CN111131352B - Theme switching method and device - Google Patents

Theme switching method and device Download PDF

Info

Publication number
CN111131352B
CN111131352B CN201811286246.4A CN201811286246A CN111131352B CN 111131352 B CN111131352 B CN 111131352B CN 201811286246 A CN201811286246 A CN 201811286246A CN 111131352 B CN111131352 B CN 111131352B
Authority
CN
China
Prior art keywords
theme
style file
target
switching
style
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811286246.4A
Other languages
Chinese (zh)
Other versions
CN111131352A (en
Inventor
罗尖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201811286246.4A priority Critical patent/CN111131352B/en
Publication of CN111131352A publication Critical patent/CN111131352A/en
Application granted granted Critical
Publication of CN111131352B publication Critical patent/CN111131352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a theme switching method and device, and belongs to the field of websites. The method comprises the following steps: receiving a theme switching request sent by a client, wherein the theme switching request comprises an identifier of a target theme; extracting an incremental style file of the target theme according to the identification of the target theme, wherein the incremental style file is a style file formed by different styles of the target theme relative to a basic theme; and sending the delta style file of the target theme to the client. When the theme switching is executed, the server only needs to transmit the incremental style file of the target theme to the client, so that the network resource required by file transmission is obviously reduced, the network transmission time is reduced, and the user waiting time is reduced.

Description

Theme switching method and device
Technical Field
The invention relates to the field of websites, in particular to a theme switching method and device.
Background
In the related art, for a multi-theme website, it is generally necessary to define a plurality of variable files during website development, and compile the variable files respectively to generate respective style files of a plurality of themes, so as to implement switching of themes according to user selection.
When the theme switching is performed according to the selection of the user, the client may request the server for the style file of the theme to be switched, and after acquiring the style file of the theme to be switched from the server, the currently loaded theme may be deleted and the style file of the theme to be switched may be loaded.
When the theme is switched every time, the server is required to send the style file of the theme, and the more complex the website is, the larger the style file of the theme is. On one hand, network resources are wasted, network transmission time is increased, user waiting time is increased, on the other hand, when the theme is switched each time, the website needs to re-analyze the style file and re-render, more time is consumed, if the user switches the theme frequently, the interface is jammed, and user experience is seriously influenced.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a method and an apparatus for switching a theme, which are used to solve or at least partially solve the above technical problems.
In order to achieve the above object, an embodiment of the present invention provides a theme switching method, where the method includes: receiving a theme switching request sent by a client, wherein the theme switching request comprises an identifier of a target theme; extracting an incremental style file of the target theme according to the identification of the target theme, wherein the incremental style file is a style file formed by styles of the target theme different from a basic theme; and sending the delta style file of the target theme to the client.
Optionally, the delta style file of the target theme is obtained in advance by the following steps: after the variable file of the target theme is compiled into the style file of the target theme, deleting the style in the style file of the target theme, which is the same as the style file of the basic theme, and taking the style file with the same style deleted as the increment style file of the target theme.
Optionally, the server stores a style file of a base theme and one or more incremental style files of non-base themes in advance.
Correspondingly, an embodiment of the present invention further provides a theme switching method, which is used for a client, and the method includes: receiving a delta style file of a target theme sent by a server based on a theme switching request, wherein the delta style file is a style file formed by styles of the target theme different from a basic theme; and loading the delta style file of the target theme based on the basic theme to obtain the target theme.
Optionally, the client is configured to load the basic theme by default, and the method further includes: after the basic theme is loaded, if the theme used by the user is detected not to be the basic theme, sending a theme switching request to a server, wherein the theme switching request comprises an identifier of the theme used by the user; and/or the method further comprises: if receiving the setting about the theme switching, sending a theme switching request to the server, wherein the theme switching request comprises the identification of the set theme.
Optionally, the loading the delta style file of the target theme based on the base theme includes: if the current running is the basic theme, directly loading the incremental style file of the target theme; and if the current running theme is not the basic theme, deleting the delta style file of the current running theme, reloading the style file of the basic theme, and loading the delta style file of the target theme.
Correspondingly, an embodiment of the present invention further provides a theme switching apparatus, which is used for a server, and the apparatus includes: the system comprises a receiving module, a switching module and a switching module, wherein the receiving module is used for receiving a theme switching request sent by a client, and the theme switching request comprises an identifier of a target theme; the extraction module is used for extracting the incremental style file of the target theme according to the identification of the target theme, wherein the incremental style file is a style file formed by different styles of the target theme relative to a basic theme; and the sending module is used for sending the increment style file of the target theme to the client.
Correspondingly, an embodiment of the present invention further provides a theme switching apparatus, configured to be used in a client, where the apparatus includes: the system comprises a receiving module, a switching module and a processing module, wherein the receiving module is used for receiving an incremental style file of a target theme sent by a server based on a theme switching request, and the incremental style file is a style file formed by styles of the target theme different from a basic theme; and the loading module is used for loading the increment style file of the target theme based on the basic theme so as to obtain the target theme.
Accordingly, an embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, the instructions being configured to cause a machine to perform: the theme switching method for the server and/or the theme switching method for the client are/is provided.
Correspondingly, an embodiment of the present invention further provides a processor, configured to execute a program, where the program is executed to: the theme switching method for the server and/or the theme switching method for the client are/is provided.
By the technical scheme, when the theme switching is executed, the server only needs to transmit the incremental style file of the target theme to the client, network resources required by file transmission are obviously reduced, network transmission time is reduced, user waiting time is reduced, the client can obtain the target theme by loading the incremental style file, time consumed by website rendering is reduced, and user experience is optimized.
Additional features and advantages of embodiments of the present invention will be described in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the embodiments of the invention without limiting the embodiments of the invention. In the drawings:
fig. 1 is a flowchart illustrating a theme switching method for a server according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a theme switching method for a client according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a theme switching apparatus for a server according to an embodiment of the present invention; and
fig. 4 is a flowchart illustrating a theme switching apparatus for a client according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The term "css" related in the embodiment of the invention refers to a cascading style sheet, which is a language used for expressing html file styles, the term "scss" is a css preprocessing language, css is expanded, characteristics such as variables, logic processing and functions are added, the cs is greatly convenient to write, and scss can also be regarded as a css preprocessor. Cannot be recognized by the browser, and needs to be compiled into css to be recognized by the browser.
Fig. 1 is a flowchart illustrating a method for switching a server theme according to an embodiment of the present invention. As shown in fig. 1, an embodiment of the present invention provides a theme switching method for a server, where the method may be applied to various types of websites or application software, and the embodiment of the present invention mainly takes a website as an example for illustration. The method may include steps S110 to S130.
Step S110, receiving a theme switching request sent by the client, where the theme switching request includes an identifier of a target theme.
When the theme needs to be switched, the client may generate a theme switching request, which may include an identification of a target theme. The identification may be any identification that can uniquely represent the target subject, for example, the identification may be a number of the target subject or a name of the target subject, etc. The client can send the generated theme switching request to the server, and the server receives the theme switching request.
And step S120, extracting the increment style file of the target theme according to the identification of the target theme.
The server can generate and store at least a target theme increment style file in advance, wherein the target theme increment style file is a style file formed by styles of different target themes relative to a basic theme. The delta style file for the target theme may be associated with an identification of the target theme such that the delta style file for the target theme may be found via the identification of the target theme. The delta style file may be any style file of a theme, for example, a background color, a text format or a picture in a theme, a picture layout, and the like.
Step S130, sending the delta style file of the target theme to the client.
After receiving the delta style file of the target theme, the client can load the delta style file to obtain the target theme.
Through the technical scheme, when the theme switching is executed, the server only needs to transmit the incremental style file of the target theme to the client, so that the network resource required by transmission is obviously reduced, the network transmission time is reduced, and the user waiting time is reduced.
In an embodiment, the delta style file for the non-base theme may be obtained by comparing the differences between the style file for the non-base theme and the style file for the base theme.
At the time of website development, a plurality of variable files can be defined by means of the css preprocessor language, and the defined variable files can comprise a variable file for a basic theme and one or more variable files for a non-basic theme. For example, three variant files may be generated, which are a theme 1 variant file, a theme 2 variant file, and a theme 3 variant file, where theme 1 is a basic theme, and theme 2 and theme 3 are non-basic themes. After the variable file is generated, the variable file for each topic may be compiled to generate a style file for each topic. For example, the generated style files may be a theme 1 style file, a theme 2 style file, a theme 3 style file, a theme 1 based style file.
After the style file is generated, a delta style file may be retrieved based on the style file. The style files of the non-basic theme can be compared with the style files of the basic theme, so that different style files between the non-basic theme and the basic theme can be obtained, and the obtained different style files are used as the incremental style files of the non-basic theme. For example, the style file of the non-basic theme may be compared with the style file of the basic theme, the style in the style file of the non-basic theme that is the same as the style file of the basic theme is deleted, and the file with the same style deleted may be used as the incremental style file of the non-basic theme. The delta style file may be any style file that is not a base theme, for example, it may be a background color, a text format or picture, a picture composition, etc. in a theme. Alternatively, it may be set such that the generated delta style file is color-based.
After the style file of the basic theme is acquired, the style file of the basic theme can be stored. After the delta style file of each non-base theme is obtained, the delta style file of each non-base theme can be stored. The stored delta style files for the non-base themes may be associated with the corresponding identifiers for the non-base themes, such that the corresponding delta style files for the non-base themes may be retrieved via the identifiers for the non-base themes.
By storing the incremental style files of the non-basic themes, the server can only provide the incremental style files of the target theme requested by the client to the client when theme switching is carried out, so that network resources can be saved, and network transmission time is reduced.
Fig. 2 is a flowchart illustrating a theme switching method for a client according to an embodiment of the present invention. As shown in fig. 2, an embodiment of the present invention further provides a theme switching method for a client, where the client may refer to any type of website or application software, and the embodiment of the present invention mainly takes a website as an example for illustration. The method may include steps S210 and S220.
Step S210, receiving the delta style file of the target theme sent by the server based on the theme switching request.
When the client determines that the theme switching is required, a theme switching request may be generated, where the theme switching request may include an identifier of a target theme. The identification may be any identification that can uniquely represent the target subject, for example, the identification may be a number of the target subject or a name of the target subject, etc. The client side can send the generated theme switching request to the server, and after receiving the theme switching request, the server can send the delta style file of the target theme to the client side.
The server can generate and store at least a target theme increment style file in advance, wherein the target theme increment style file is a style file formed by different styles of a target theme relative to a basic theme. The delta style file may be any style file of the theme, for example, may be a background color, a text format or a picture, a picture composition, etc. in the theme.
Step S220, loading the delta style file of the target theme based on the basic theme to obtain the target theme.
A record of the base theme style file may be maintained at the client at all times, and after the client receives the delta style file of the target theme, the delta style file of the target theme may be loaded based on the base theme, so as to obtain the target theme at the client. When the client loads the style file, the setting in the style file loaded later with the same attribute of the same element is defined as the standard, for example, if the color of the text set in the basic main body is red, and the color of the text set in the incremental style file of the target theme is blue, the color of the text will be set as the color of the text set in the incremental style file of the target theme, that is, blue, after the client reloads the incremental style file of the target theme on the basis of the style file of the basic theme.
By the technical scheme, when the theme is switched, the client only needs to load the incremental style file, so that the loading time required by the theme switching is obviously shortened, and the user experience is optimized.
In an alternative embodiment, the client may be set to load the base theme by default, that is, the base theme is loaded by default each time the user opens the client. It may then be detected whether the theme used by the user is the underlying theme. For example, the last setting of the theme by the user may be detected, and if the user sets that the basic theme is used at the client, it may be determined that the basic theme is used by the user, in which case, no theme switching is required.
If the user sets that the non-basic theme is used at the client, the non-basic theme used by the user can be determined, and in this case, theme switching is required. The client may perform topic switching with the topic used by the user as the target topic. In particular, the client may first generate a topic switch request, which may include an identification of the topic used by the user. Then, the client may send the theme switching request to the server, and the server may extract a delta style file of a theme used by the user based on the theme switching request and send the delta style file to the client. Because the client currently runs the basic theme, after receiving the incremental style file sent by the server, the incremental style file of the theme used by the user can be loaded aiming at the basic theme so as to obtain the theme used by the user.
Further, based on any of the above embodiments, the user may also perform setting of theme switching at the client, for example, the client may have an option of theme switching, and through this option, the user may select which theme to run at the client. After receiving the setting of the user on the theme switching, the client may perform the theme switching with the theme set by the user as a target theme.
In particular, the client may generate a topic switch request, which may include an identification of a topic set by the user. Then, the client may send the theme switching request to the server, and the server may extract a delta style file of a theme set by the user based on the theme switching request and send the delta style file to the client.
If the client currently runs the basic theme, the incremental style file of the theme set by the user can be directly loaded based on the basic theme so as to obtain the theme set by the user.
If the client currently runs the theme which is not the basic theme, the incremental style file of the currently running theme can be deleted in the record, the style file of the basic theme is reserved, then the style file of the basic theme is reloaded, and the incremental style file of the theme set by the user is further loaded based on the basic theme so as to obtain the theme set by the user. If the attributes of the same elements in the delta style file of the currently running theme and the delta style file of the theme set by the user are modified, for example, both the background color and the text color are modified, optionally, the delta style file of the currently running theme may not be deleted in the record, but the delta style file of the theme set by the user may be directly loaded, and when loading, the setting of the delta style file of the theme set by the user may cover the configuration of the delta style file of the currently running theme, so that the theme set by the user may be obtained. If the incremental style file of the currently running theme and the incremental style file of the theme set by the user modify the attributes of different elements, for example, the currently running theme is configured differently for text color and text format, and the theme set by the user is configured differently for background color and text color, in this case, the basic theme style file and the incremental style file need to be loaded after the incremental style file of the currently running theme is deleted, so as to ensure that the loaded theme is completely consistent with the configuration of the theme set by the user.
By loading the delta style file of the target theme on the basis of the basic theme at the client, the rendering time of the browser is obviously reduced, and the client interface is not jammed even if the user switches the theme frequently.
Fig. 3 is a flowchart illustrating a theme switching apparatus for a server according to an embodiment of the present invention. As shown in fig. 3, an embodiment of the present invention further provides a theme switching apparatus, which may be applied to various types of websites or application software, where the apparatus may include a receiving module 310, configured to receive a theme switching request sent by a client, where the theme switching request includes an identifier of a target theme; an extracting module 320, configured to extract, according to the identifier of the target theme, an incremental style file of the target theme, where the incremental style file is a style file formed by styles of the target theme different from a basic theme; and a sending module 330, configured to send the delta style file of the target theme to the client. The theme switching device enables the server to transmit the incremental style file of the target theme to the client only when the theme switching is executed, thereby obviously reducing network resources required by transmission, reducing network transmission time and reducing user waiting time.
The style file of the base theme and one or more delta style files of non-base themes may be pre-stored in the server. Specifically, at the time of website development, a plurality of variable files may be defined, and the defined variable files may include a variable file for a base topic and one or more variable files for non-base topics. After the variable file is generated, the variable file for each theme may be compiled to generate a style file for each theme. After the style file is generated, the style file of the non-basic theme and the style file of the basic theme can be compared, the style which is the same as the style file of the basic theme in the style file of the non-basic theme is deleted, and the file with the same style deleted can be used as the increment style file of the non-basic theme. The generated style file for the base theme and the delta style file for each non-base theme may then be stored. By storing the incremental style files of the non-basic themes, the server can only provide the incremental style files of the target theme requested by the client to the client when theme switching is carried out, so that network resources can be saved, and network transmission time is reduced.
The specific working principle and benefits of the theme switching apparatus for a server provided in the embodiment of the present invention are similar to the specific working principle and benefits of the theme switching method for a server provided in the embodiment of the present invention, and are not described again here.
The theme switching apparatus for the server may include a processor and a memory, and the receiving module 310, the extracting module 320, the sending module 330, and the like may be stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more, and the theme switching method for the server is executed by adjusting the kernel parameters. The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
Fig. 4 is a flowchart illustrating a theme switching apparatus for a client according to an embodiment of the present invention. As shown in fig. 4, an embodiment of the present invention further provides a theme switching apparatus for a client, where the client may refer to any type of website or application software, and the apparatus may include: a receiving module 410, configured to receive a delta style file of a target theme, where the delta style file is sent by a server based on a theme switching request, and the delta style file is a style file formed by styles of the target theme different from a basic theme; and a loading module 420, configured to load the delta style file of the target theme based on the base theme to obtain the target theme. When the theme is switched, the client only needs to load the incremental style file, so that the loading time required by the theme switching is obviously shortened, and the user experience is optimized.
The client may be configured to load the base theme by default, that is, each time the user opens the client, the base theme is loaded by default. It may then be detected whether the theme used by the user is the underlying theme. And if the theme used by the user is not the basic theme, sending a theme switching request to the server, wherein the theme switching request comprises the identification of the theme used by the user, so as to realize switching of the currently running theme.
The user may also perform setting of theme switching at the client, and after receiving the setting of the user about theme switching, the client may perform theme switching with the theme set by the user as a target theme. Specifically, the client may generate a theme switching request, and the theme switching request may include an identifier of a theme set by the user. Then, the client may send the theme switching request to the server, and the server may extract a delta style file of a theme set by the user based on the theme switching request and send the delta style file to the client. And if the current running is the basic theme, directly loading the delta style file of the target theme. And if the current running theme is not the basic theme, deleting the delta style file of the current running theme, reloading the style file of the basic theme, and loading the delta style file of the target theme. By loading the delta style file of the target theme on the basis of the basic theme at the client, the rendering time of the browser is obviously reduced, and the client interface is not jammed even if the user switches the theme frequently.
The specific working principle and benefits of the theme switching apparatus for a server provided in the embodiment of the present invention are similar to the specific working principle and benefits of the theme switching method for a server provided in the embodiment of the present invention, and are not described again here.
The theme switching device of the user client may include a processor and a memory, and the receiving module 410 and the loading module 420 may be stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more, and the theme switching method for the client is executed by adjusting the kernel parameters. The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), including at least one memory chip.
Embodiments of the present invention also provide a machine-readable storage medium having instructions stored thereon, where the instructions are configured to cause a machine to perform: the theme switching method for the server according to any embodiment of the invention and/or the theme switching method for the client according to any embodiment of the invention.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes the following steps when running: the theme switching method for the server according to any embodiment of the invention and/or the theme switching method for the client according to any embodiment of the invention.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for switching themes, the method comprising, for a server:
receiving a theme switching request sent by a client, wherein the theme switching request comprises an identifier of a target theme;
extracting a delta style file of the target theme relative to a basic theme according to the identification of the target theme; and
sending the delta style file of the target theme to the client;
the incremental style file is a style file formed by an incremental part on the basis of the style file of the target theme relative to the base theme.
2. The method of claim 1, wherein the delta style file for the target theme is pre-fetched by:
after the variable file of the target theme is compiled into the style file of the target theme, deleting the style in the style file of the target theme, which is the same as the style file of the basic theme, and taking the style file with the same style deleted as the increment style file of the target theme.
3. The method according to claim 1, wherein the server stores a style file of a base theme and one or more delta style files of a non-base theme in advance.
4. A method for switching themes, the method being used for a client, the method comprising:
receiving a delta style file of a target theme relative to a basic theme, which is sent by a server based on a theme switching request; and
loading a delta style file of the target theme based on the base theme to obtain the target theme;
the incremental style file is a style file formed by an incremental part on the basis of the style file of the target theme relative to the base theme.
5. The method of claim 4,
the client is set to load the base theme by default, the method further comprising: after the basic theme is loaded, if the theme used by the user is detected not to be the basic theme, sending a theme switching request to a server, wherein the theme switching request comprises an identifier of the theme used by the user; and/or
The method further comprises the following steps: if receiving the setting about the theme switching, sending a theme switching request to the server, wherein the theme switching request comprises the identification of the set theme.
6. The method of claim 4 or 5, wherein loading the delta style file for the target theme based on the base theme comprises:
if the current running is the basic theme, directly loading the incremental style file of the target theme; and
and if the current running theme is not the basic theme, deleting the delta style file of the current running theme, reloading the style file of the basic theme, and loading the delta style file of the target theme.
7. A theme switching apparatus, adapted for a server, the apparatus comprising:
the system comprises a receiving module, a switching module and a switching module, wherein the receiving module is used for receiving a theme switching request sent by a client, and the theme switching request comprises an identifier of a target theme;
the extraction module is used for extracting the increment style file of the target theme relative to the basic theme according to the identification of the target theme; and
the sending module is used for sending the increment style file of the target theme to the client;
the incremental style file is a style file formed by an incremental part on the basis of the style file of the target theme relative to the base theme.
8. A theme switching apparatus, for a client, the apparatus comprising:
the receiving module is used for receiving the increment style file of the target theme to the basic theme, which is sent by the server based on the theme switching request; and
a loading module, configured to load the delta style file of the target theme based on the base theme to obtain the target theme;
the incremental style file is a style file formed by an incremental part on the basis of the style file of the target theme relative to the base theme.
9. A machine-readable storage medium having instructions stored thereon for causing a machine to perform: the topic switching method according to any one of claims 1 to 3 and/or the topic switching method according to any one of claims 4 to 6.
10. A processor configured to execute a program, wherein the program is configured to perform: the topic switching method according to any one of claims 1 to 3 and/or the topic switching method according to any one of claims 4 to 6.
CN201811286246.4A 2018-10-31 2018-10-31 Theme switching method and device Active CN111131352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811286246.4A CN111131352B (en) 2018-10-31 2018-10-31 Theme switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811286246.4A CN111131352B (en) 2018-10-31 2018-10-31 Theme switching method and device

Publications (2)

Publication Number Publication Date
CN111131352A CN111131352A (en) 2020-05-08
CN111131352B true CN111131352B (en) 2023-01-13

Family

ID=70485374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811286246.4A Active CN111131352B (en) 2018-10-31 2018-10-31 Theme switching method and device

Country Status (1)

Country Link
CN (1) CN111131352B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368424B (en) 2020-03-03 2023-09-01 阿波罗智能技术(北京)有限公司 Vehicle simulation method, device, equipment and medium
CN111767103A (en) * 2020-04-23 2020-10-13 北京沃东天骏信息技术有限公司 Method and device for changing page theme
CN112540757A (en) * 2020-12-09 2021-03-23 北京同有飞骥科技股份有限公司 User graphical interface skin changing method, device and equipment based on pre-compiling pattern
CN112579958B (en) * 2020-12-23 2024-05-10 平安银行股份有限公司 Webpage conversion method, webpage conversion device, computer equipment and readable storage medium
CN112965779A (en) * 2021-03-26 2021-06-15 网易(杭州)网络有限公司 Page mode switching method, device and equipment
CN113076150A (en) * 2021-04-13 2021-07-06 北京同邦卓益科技有限公司 Interface theme switching method, device, equipment, storage medium and program product
CN113157374A (en) * 2021-04-27 2021-07-23 北京有竹居网络技术有限公司 Page mode switching method, device, equipment and storage medium
CN115344315B (en) * 2021-04-27 2024-02-02 阿波罗智联(北京)科技有限公司 Skin switching method and device of applet page and electronic equipment
CN113569171A (en) * 2021-09-26 2021-10-29 上海观安信息技术股份有限公司 Webpage theme changing method and device, storage medium and computer equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915257A (en) * 2015-06-08 2015-09-16 青岛海信移动通信技术股份有限公司 Method and device for replacing theme based on Android system application
CN106126733A (en) * 2016-07-04 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method and system changing CSS style
CN106227512A (en) * 2016-07-07 2016-12-14 网易(杭州)网络有限公司 The replacing skins method and device of application software display interface
CN106354394A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Browser subject switching handling method and device
CN106657611A (en) * 2016-11-15 2017-05-10 努比亚技术有限公司 Device and method for changing application theme
CN106802794A (en) * 2016-12-20 2017-06-06 智车优行科技(北京)有限公司 Method for switching theme, device, vehicle and system
CN107329747A (en) * 2017-06-20 2017-11-07 福建中金在线信息科技有限公司 A kind of method and device for generating multi-threaded pattern
CN107368231A (en) * 2017-06-07 2017-11-21 深圳市金立通信设备有限公司 A kind of theme processing method and Related product
CN107818143A (en) * 2017-10-16 2018-03-20 中国银联股份有限公司 A kind of page configuration, generation method and device
CN108228677A (en) * 2016-12-22 2018-06-29 北京国双科技有限公司 Switch the method and apparatus of subject of Web site style
WO2018176207A1 (en) * 2017-03-28 2018-10-04 深圳中兴力维技术有限公司 Web theme switching method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150220496A1 (en) * 2014-02-06 2015-08-06 Sugarcrm Inc. Dynamic sprite based theme switching

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915257A (en) * 2015-06-08 2015-09-16 青岛海信移动通信技术股份有限公司 Method and device for replacing theme based on Android system application
CN106126733A (en) * 2016-07-04 2016-11-16 浪潮(北京)电子信息产业有限公司 A kind of method and system changing CSS style
CN106227512A (en) * 2016-07-07 2016-12-14 网易(杭州)网络有限公司 The replacing skins method and device of application software display interface
CN106354394A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Browser subject switching handling method and device
CN106657611A (en) * 2016-11-15 2017-05-10 努比亚技术有限公司 Device and method for changing application theme
CN106802794A (en) * 2016-12-20 2017-06-06 智车优行科技(北京)有限公司 Method for switching theme, device, vehicle and system
CN108228677A (en) * 2016-12-22 2018-06-29 北京国双科技有限公司 Switch the method and apparatus of subject of Web site style
WO2018176207A1 (en) * 2017-03-28 2018-10-04 深圳中兴力维技术有限公司 Web theme switching method and system
CN107368231A (en) * 2017-06-07 2017-11-21 深圳市金立通信设备有限公司 A kind of theme processing method and Related product
CN107329747A (en) * 2017-06-20 2017-11-07 福建中金在线信息科技有限公司 A kind of method and device for generating multi-threaded pattern
CN107818143A (en) * 2017-10-16 2018-03-20 中国银联股份有限公司 A kind of page configuration, generation method and device

Also Published As

Publication number Publication date
CN111131352A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111131352B (en) Theme switching method and device
CN109669709B (en) Data migration method and data migration system for block chain upgrading
US11086638B2 (en) Method and apparatus for loading application
CN109195157B (en) Application management method and device and terminal
CN112306411A (en) Data storage method and device, nonvolatile storage medium and processor
CN111240892A (en) Data backup method and device
CN108874379B (en) Page processing method and device
US10922682B2 (en) Java card application memory footprint optimization
CN108881367B (en) Service request processing method, device and equipment
CN111367577A (en) Method, device and terminal for loading plug-in of application
CN113127852B (en) SE application management method and device based on chip card and storage medium
CN110874214B (en) Function calling method and device, electronic equipment and storage medium
CN107368486B (en) Service migration method and device
CN107291439B (en) Target incremental data construction method and device
CN110969461B (en) Method and device for processing public number information, storage medium and processor
CN115878916A (en) Time-consuming optimization method and device for page refreshing and terminal equipment
CN109165023B (en) Method, device and equipment for modifying ISO (International organization for standardization) mirror image file
CN107180107B (en) Method and system for uploading selected files by mobile phone attachment under Ionic framework
CN113741946B (en) Clipping method, device and equipment of public interface function library and readable storage medium
CN112527792A (en) Data storage method, device, equipment and storage medium
CN114924674B (en) Multi-region column navigation interaction method, device and medium
CN110968599B (en) Inquiry method and device based on Impala
CN104462137A (en) Interactive object creating method and device
CN115951893B (en) Method, system, equipment and storage medium for acquiring semiconductor processing script
CN109495288B (en) Service deployment method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant