Theme switching method and device, equipment, medium and product

By obtaining the preset theme configuration file and the target theme file name, setting system parameter values, and reading and loading theme resource files, the problem of insufficient flexibility in switching between multiple resource sets in the existing technology is solved, and theme switching for individual applications is realized, thus improving flexibility.

CN119003460APending Publication Date: 2024-11-22HUNAN KAIHONG ZHIGU DIGITAL IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410956373.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the existing technology, the open-source code framework of OpenHarmony-4.0-Release only supports one SystemResourcesOverlay.hap file, which cannot meet the needs of multiple sets of resources. Moreover, any modification to the full set of system resources will affect all applications, and cannot meet the theme resource switching requirements of custom scenes.

Method used

By obtaining a preset theme configuration file, configuring the sandbox of the application to be replaced, obtaining the target theme file name, setting system parameter values, and starting the application, the system can read and load theme resource files, thereby enabling the configuration and switching of multiple theme resource files.

Benefits of technology

It enables the configuration of multiple sets of theme resource files, improves the flexibility of theme switching, supports theme switching for individual applications, and avoids the impact of modifying the entire system's resources on other applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003460A_ABST
    Figure CN119003460A_ABST
Patent Text Reader

Abstract

The invention discloses a theme switching method, device and equipment, a medium and a product. The method comprises the following steps: acquiring a preset theme configuration file, wherein the preset configuration file comprises a theme resource directory; according to a preset theme configuration file, the sandbox of the to-be-replaced application is configured, and a configured target sandbox is obtained; obtaining a target theme file name of the to-be-replaced application; according to the target theme file name, setting a system parameter value of a to-be-replaced application system parameter, and starting the to-be-replaced application; and reading a theme resource file corresponding to the system parameter value through the to-be-replaced application according to the theme resource directory in the target sandbox, and loading the theme resource file. A plurality of sets of custom theme files are set through the theme resource catalog and mounted to the target sandbox, and the aim of theme switching is achieved by replacing the name of the target theme file. Configuration of multiple sets of theme resource files is achieved, theme switching for independent application is achieved, and flexibility of theme switching is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a theme switching method, device, equipment, medium and product. Background Art

[0002] Based on the personalized demand for application themes, the application needs to display different themes according to different products or customers, which requires a theme switching solution to meet this demand.

[0003] In the open source code framework of the open source operating system (such as OpenHarmony-4.0-Release), a system resource definition and coverage solution has been implemented: a SystemResourcesOverlay.hap file related to system resource coverage is preset to achieve the purpose of covering system resources and realize the switching of theme resources.

[0004] However, the system only supports one SystemResourcesOverlay.hap file, and the resources are automatically the full system resources. This file cannot solve the problem of multiple sets of resources, and the number of full system resources is too large, and the modification affects all applications, and cannot fully meet the custom scenarios of the application. Summary of the invention

[0005] The present invention provides a theme switching method, device, equipment, medium and product to realize the configuration and switching of multiple themes.

[0006] According to a first aspect of the present invention, there is provided a theme switching method, comprising:

[0007] Obtain a preset theme configuration file, wherein the preset configuration file includes a theme resource directory;

[0008] According to the preset theme configuration file, the sandbox of the application to be replaced is configured to obtain a configured target sandbox;

[0009] Get the target theme file name of the application to be replaced;

[0010] According to the target theme file name, set the system parameter value of the system parameter of the application to be replaced, and start the application to be replaced;

[0011] The application to be replaced reads a theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox, and loads the theme resource file.

[0012] According to a second aspect of the present invention, there is provided a theme switching device, comprising:

[0013] A file acquisition module, used to acquire a preset theme configuration file, wherein the preset configuration file includes a theme resource directory;

[0014] A sandbox configuration module, used to configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain a configured target sandbox;

[0015] A name acquisition module, used to acquire the target theme file name of the application to be replaced;

[0016] A parameter setting module, used to set the system parameter value of the system parameter of the application to be replaced according to the target theme file name, and start the application to be replaced;

[0017] The file loading module is used to read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file.

[0018] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0019] at least one processor; and

[0020] a memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the theme switching method described in any embodiment of the present invention.

[0022] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the theme switching method described in any embodiment of the present invention when executed.

[0023] According to a fifth aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the subject switching method of any embodiment of the present invention is implemented.

[0024] The technical solution of the embodiment of the present invention is to obtain a preset theme configuration file, which includes a theme resource directory; configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain the configured target sandbox; obtain the target theme file name of the application to be replaced; set the system parameter values ​​of the system parameters of the application to be replaced according to the target theme file name, and start the application to be replaced; read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file. Multiple sets of custom theme files are set through the theme resource directory and mounted to the target sandbox, and the purpose of theme switching is achieved by changing the target theme file name. The configuration of multiple sets of theme resource files is realized, the theme switching for a single application is realized, and the flexibility of theme switching is improved.

[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 is a flowchart of a theme switching method provided according to Embodiment 1 of the present invention;

[0028] Figure 2 is a flowchart of a theme switching method provided according to Embodiment 2 of the present invention;

[0029] Figure 3 is a structural schematic diagram of a theme switching device provided according to Embodiment 3 of the present invention;

[0030] Figure 4 It is a schematic diagram of the structure of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] Embodiment 1

[0034] Figure 1 A flowchart of a method for switching a theme is provided for the first embodiment of the present invention. This embodiment is applicable to the case of switching a single application theme. The method can be executed by a theme switching device. The theme switching device can be implemented in the form of hardware and / or software. The theme switching device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0035] S110: Obtain a preset theme configuration file, where the preset configuration file includes a theme resource directory.

[0036] In this embodiment, the preset theme configuration file can be understood as a configuration file containing theme resources, which is used to define access control of theme resources, allowing applications to change interface themes according to user settings without affecting the theme settings of the system or other applications, such as a theme-sandbox.json file. The theme resource directory can be understood as a directory for storing theme resource files.

[0037] Specifically, the third party of the application or other relevant personnel may store multiple theme resource files in the theme resource directory in advance, form a preset theme configuration file according to a set format, and the processor may obtain the preset theme configuration file.

[0038] S120: According to a preset theme configuration file, the sandbox of the application to be replaced is configured to obtain a configured target sandbox.

[0039] In this embodiment, the application to be replaced can be understood as the application whose displayed theme needs to be replaced. The sandbox can be understood as providing an isolated environment for the running application, which strictly controls the access rights to system resources. The target sandbox can be understood as the sandbox after adding the preset configuration file.

[0040] Specifically, before the processor starts the application to be replaced, the processor may mount the preset theme configuration file to the sandbox of the application to be replaced, and modify the access rights in the preset theme configuration file to obtain the configured target sandbox.

[0041] S130: Obtain the target theme file name of the application to be replaced.

[0042] In this embodiment, the target theme file name can be understood as the name of the theme file recorded in the theme resource directory to be switched.

[0043] Specifically, the processor may obtain the target theme file name of the application to be replaced through instructions or other programs.

[0044] S140. According to the target theme file name, set the system parameter value of the application system parameter to be replaced, and start the application to be replaced.

[0045] In this embodiment, the system parameter can be understood as a parameter used to define or set the theme of the application. The system parameter value can be understood as a value used to determine the theme of the application.

[0046] Specifically, the processor may set the system parameter value of the system parameter defining the theme of the application to be replaced according to the target theme name, for example, the target theme name app1 may be set as the system parameter value to obtain persist.product.theme.app1. The processor starts the application to be replaced.

[0047] S150 . The application to be replaced reads a theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox, and loads the theme resource file.

[0048] In this embodiment, the theme resource file can be understood as a file of the theme resource to be replaced, such as a .hap file or a customized UI resource file.

[0049] Specifically, after starting the application to be replaced, the target sandbox is run so that the theme resource directory can be mounted to the target sandbox of the application to be replaced. The application to be replaced can search the theme resource directory under the access rights configured by the target sandbox according to the system parameter value used to set the application theme, access and read the theme resource file corresponding to the target theme name corresponding to the system parameter value, and the application to be replaced can load the theme resource file and perform resource overwriting through the resource manager (i.e., resourcemanager) to achieve the purpose of theme switching.

[0050] The technical solution of the embodiment of the present invention is to obtain a preset theme configuration file, which includes a theme resource directory; configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain the configured target sandbox; obtain the target theme file name of the application to be replaced; set the system parameter values ​​of the system parameters of the application to be replaced according to the target theme file name, and start the application to be replaced; read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file. Multiple sets of custom theme files are set through the theme resource directory and mounted to the target sandbox, and the purpose of theme switching is achieved by changing the target theme file name. The configuration of multiple sets of theme resource files is realized, the theme switching for a single application is realized, and the flexibility of theme switching is improved.

[0051] Embodiment 2

[0052] Figure 2 This is a flow chart of a method for switching themes provided in Embodiment 2 of the present invention. This embodiment is a further refinement of the above embodiment. Figure 2 As shown, the method includes:

[0053] S210: Obtain a preset theme configuration file.

[0054] S220: Merge the original access permission file in the sandbox of the application to be replaced with the preset theme configuration file to obtain the permission file to be configured.

[0055] In this embodiment, the original access permission file can be understood as the permission and access rule file that has been configured in the sandbox, such as appdata-sandbox.json and appdata-sandbox64.json, which correspond to the permissions and access rules for defining 32-bit and 64-bit sandboxes respectively. The permission file to be configured can be understood as a file that has not been configured with the access permission of the preset theme configuration file.

[0056] Specifically, the processor may merge the original access permission file in the sandbox of the application to be replaced with the preset theme configuration file through the source code to obtain the permission file to be configured.

[0057] S230: Configure access permissions for the permission file to be configured to obtain a target configuration file.

[0058] In this embodiment, the target configuration file can be understood as a configuration file after setting all resource access permissions.

[0059] Specifically, the processor may configure access rights for a portion of the permission file to be configured that is not configured with resource access rights, so as to determine the access rights of the application to be replaced and obtain a target configuration file.

[0060] Further, based on the above embodiment, the steps of configuring access rights for the permission file to be configured and obtaining the target configuration file can be concretized as follows:

[0061] Determine the newly added directory files in the permission file to be configured; add a preset security system tag to the newly added directory files; configure the operation permissions for the file type objects of the newly added directory files by setting the first statement; configure the search permissions for the directory type objects of the newly added directory files by setting the second statement.

[0062] In this embodiment, the security system label can be understood as a method for limiting the access rights of applications to resources through different labels. Setting the first statement can be understood as a statement for configuring the access rights allowed for file type objects. Setting the second statement can be understood as a statement for configuring the access rights for directory type objects. A newly added directory file can be understood as a directory file that has not been configured. A file type object can be understood as an access object of type file. A directory type object can be understood as an access object of type directory.

[0063] Specifically, the processor can determine the newly added directory files that do not have access rights set in the permission file to be configured, for example, by whether there is a security system tag. The processor can add a preset security system tag to the newly added directory files through corresponding statements. The processor can configure the operation permissions for the file type object of the newly added directory file by setting the first statement; and configure the search permissions for the directory type object of the newly added directory file by setting the second statement.

[0064] Exemplarily, SeLinux can be used to provide a mandatory access control mechanism based on security policies. First, the minimum resource access permissions can be configured for the newly added directory files in the form of preset security system tags. The theme resource directory corresponds to the newly added directory file, which includes two directory files, system / theme / res and vendor / theme / res. The system / theme / res directory stores system-level theme resources. These resources are built-in to the operating system and are used to provide a consistent user interface style and experience. The vendor / theme / res directory is mainly used to store manufacturer-defined theme resources. Equipment manufacturers can customize these theme resources according to their own brand style and user needs, and place the theme resource files in this directory.

[0065] Exemplarily, the processor may first set the Selinux label of the system / theme / res directory through the statement / system / theme / res( / .*)?u:object_r:system_theme_file:s0, and set the Selinux label of the vendor / theme / res directory through the statement / vendor / theme / res( / .*)?u:object_r:vendor_theme_file:s0. By setting the first statement allow system_basic_hap_attr system_theme_file:file{getattr open read} and allow system_basic_hap_attr vendor_theme_file:file{getattr open read}, the getattr, open and read operation permissions are configured for the file type objects file of / system / theme / res and / vendor / theme / res. By setting the second statement allow system_basic_hap_attrsystem_theme_file:dir{search} and allow system_basic_hap_attr vendor_theme_file:dir{search}, the search permission is configured for the directory type objects dir of / vendor / theme / res and / vendor / theme / res.

[0066] S240: Configure the sandbox based on the target configuration file to obtain a configured target sandbox.

[0067] Specifically, the processor may configure the sandbox based on the target configuration file to obtain a configured target sandbox.

[0068] S250: Obtain the target theme file name of the application to be replaced.

[0069] S260. According to the target theme file name, set the system parameter value of the application system parameter to be replaced, and start the application to be replaced.

[0070] S270: Mount the theme resource directory to the target sandbox through the application to be replaced.

[0071] Specifically, after the application to be replaced is started, the target sandbox will be automatically loaded according to the target configuration file, and the theme resource directory will be mounted to the target sandbox through the application to be replaced, so as to access the theme resource directory through the access rights configured by the target sandbox.

[0072] S280, read system parameter values.

[0073] Specifically, the application to be replaced may read a system parameter value used to define an application theme.

[0074] S290. Based on the access rights configured for the target sandbox, search for a theme resource file corresponding to the system parameter value in the theme resource directory, and load the theme resource file.

[0075] The theme resource directory includes the system theme resource directory and the custom theme resource directory. The system theme resource directory can be understood as storing system-level theme resources, which are built-in to the operating system, i.e. the / system / theme / res directory mentioned in the above example. The custom theme resource directory can be understood as storing third-party custom theme resources, i.e. the / vendor / theme / res directory mentioned in the above example.

[0076] Specifically, the application to be replaced can search for a file with the same name as the target theme file in the system parameter value in the theme resource directory based on the access permissions configured for the target sandbox, and use it as the theme resource file of the theme to be replaced. The theme resource file can then be loaded and the resource overwritten through the resource manager (i.e., resourcemanager) to achieve the purpose of theme switching.

[0077] Further, based on the above embodiment, the step of searching for a theme resource file corresponding to the system parameter value in the theme resource directory can be refined as follows:

[0078] Search for the theme resource file corresponding to the system parameter value in the custom theme resource directory; if not found, search in the system theme resource directory.

[0079] Specifically, when the application to be replaced obtains the theme resource file, it first searches for the theme resource file corresponding to the name in the system parameter value in the custom theme resource directory. If not found, it searches in the resource directory in the system theme to obtain the theme resource file.

[0080] The technical solution of the embodiment of the present invention forms a target sandbox by setting multiple sets of customized theme resources in the theme resource directory of the preset theme configuration file, and combining the preset theme configuration file to form the permission file to be configured of the sandbox, and configuring the access rights of the newly added directory files. When the application to be replaced is started, the target sandbox is started at the same time to provide a sandbox environment, which ensures the isolation between applications, ensures the security of access, and provides environmental support for the subsequent theme replacement of the application to be replaced. By adding the target theme file name of the theme to be replaced to the system parameters of the application to be replaced, the theme resource directory mounted to the target sandbox is read by the application to be replaced, and the theme resource file corresponding to the theme name in the system parameters is searched based on the configured access rights, and loaded. The configuration of multiple sets of theme resource files is realized, the theme switching for a single application is realized, and the flexibility of theme switching is improved.

[0081] Embodiment 3

[0082] Figure 3 This is a schematic diagram of the structure of a theme switching device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a file acquisition module 31, a sandbox configuration module 32, a name acquisition module 33, a parameter setting module 34 and a file loading module 35.

[0083] A file acquisition module 31, used to acquire a preset theme configuration file, wherein the preset configuration file includes a theme resource directory;

[0084] A sandbox configuration module 32, configured to configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain a configured target sandbox;

[0085] A name acquisition module 33 is used to acquire the target theme file name of the application to be replaced;

[0086] The parameter setting module 34 is used to set the system parameter value of the system parameter of the application to be replaced according to the target theme file name, and start the application to be replaced;

[0087] The file loading module 35 is used to read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file.

[0088] The technical solution of the embodiment of the present invention is to obtain a preset theme configuration file, which includes a theme resource directory; configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain the configured target sandbox; obtain the target theme file name of the application to be replaced; set the system parameter values ​​of the system parameters of the application to be replaced according to the target theme file name, and start the application to be replaced; read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file. Multiple sets of custom theme files are set through the theme resource directory and mounted to the target sandbox, and the purpose of theme switching is achieved by changing the target theme file name. The configuration of multiple sets of theme resource files is realized, the theme switching for a single application is realized, and the flexibility of theme switching is improved.

[0089] Furthermore, the sandbox configuration module 32 includes:

[0090] A first determining unit is used to merge the original access permission file in the sandbox of the application to be replaced with the preset theme configuration file to obtain the permission file to be configured;

[0091] A second determining unit is used to configure access rights for the permission file to be configured to obtain a target configuration file;

[0092] The third determining unit is used to configure the sandbox based on the target configuration file to obtain a configured target sandbox.

[0093] Wherein, the second determining unit is specifically used for:

[0094] Determine a newly added directory file in the permission file to be configured;

[0095] Adding a preset security system tag to the newly added directory file;

[0096] By setting a first statement, the operation permission is configured for the file type object of the newly added directory file;

[0097] The search permission is configured for the directory type object of the newly added directory file by setting the second statement.

[0098] Furthermore, the theme resource directory includes a system theme resource directory and a custom theme resource directory.

[0099] Furthermore, the file loading module 35 includes:

[0100] A directory mounting unit, used for mounting the subject resource directory to the target sandbox;

[0101] A parameter reading unit, used for reading the system parameter value;

[0102] The file searching unit is used to search for a theme resource file corresponding to the system parameter value in the theme resource directory based on the access permission configured by the target sandbox.

[0103] Wherein, the file search unit is specifically used for:

[0104] Search the custom theme resource directory for a theme resource file corresponding to the system parameter value; if not found, search the system theme resource directory.

[0105] The theme switching device provided in the embodiment of the present invention can execute the theme switching method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0106] Embodiment 4

[0107] Figure 4 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0108] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0109] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0110] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as a theme switching method.

[0111] In some embodiments, the theme switching method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the theme switching method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform the theme switching method in any other appropriate manner (e.g., by means of firmware).

[0112] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0113] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0114] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0115] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0116] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0117] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0118] In one embodiment, the present invention further includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the X theme switching method of any embodiment of the present invention is implemented.

[0119] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0120] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0121] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for switching a theme, characterized in that: include: Obtain a preset theme configuration file, wherein the preset configuration file includes a theme resource directory; According to the preset theme configuration file, the sandbox of the application to be replaced is configured to obtain a configured target sandbox; Get the target theme file name of the application to be replaced; According to the target theme file name, set the system parameter value of the system parameter of the application to be replaced, and start the application to be replaced; The application to be replaced reads a theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox, and loads the theme resource file.

2. The method according to claim 1, characterized in that The step of configuring the sandbox of the application to be replaced according to the preset theme configuration file to obtain the configured target sandbox includes: Merge the original access permission file in the sandbox of the application to be replaced with the preset theme configuration file to obtain the permission file to be configured; Configure access rights for the permission file to be configured to obtain a target configuration file; The sandbox is configured based on the target configuration file to obtain a configured target sandbox.

3. The method according to claim 2, characterized in that The step of configuring the access rights of the permission file to be configured to obtain a target configuration file includes: Determine a newly added directory file in the permission file to be configured; Adding a preset security system tag to the newly added directory file; By setting a first statement, the operation permission is configured for the file type object of the newly added directory file; The search permission is configured for the directory type object of the newly added directory file by setting the second statement.

4. The method according to claim 1, characterized in that: The step of reading a theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox includes: Mount the theme resource directory to the target sandbox; Reading the system parameter value; Based on the access permission configured for the target sandbox, a theme resource file corresponding to the system parameter value is searched in the theme resource directory.

5. The method according to claim 4, characterized in that The theme resource directory includes a system theme resource directory and a custom theme resource directory.

6. The method according to claim 5, characterized in that The searching for the theme resource file corresponding to the system parameter value in the theme resource directory includes: Searching for a theme resource file corresponding to the system parameter value in the custom theme resource directory; If not found, search in the system theme resource directory.

7. A theme switching device, characterized in that: include: A file acquisition module, used to acquire a preset theme configuration file, wherein the preset configuration file includes a theme resource directory; A sandbox configuration module, used to configure the sandbox of the application to be replaced according to the preset theme configuration file to obtain a configured target sandbox; A name acquisition module, used to acquire the target theme file name of the application to be replaced; A parameter setting module, used to set the system parameter value of the system parameter of the application to be replaced according to the target theme file name, and start the application to be replaced; The file loading module is used to read the theme resource file corresponding to the system parameter value according to the theme resource directory in the target sandbox through the application to be replaced, and load the theme resource file.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the theme switching method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the subject switching method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the theme switching method according to any one of claims 1 to 6.