CN112394932A - Automatic browser webpage skin changing method and device - Google Patents

Automatic browser webpage skin changing method and device Download PDF

Info

Publication number
CN112394932A
CN112394932A CN202011299432.9A CN202011299432A CN112394932A CN 112394932 A CN112394932 A CN 112394932A CN 202011299432 A CN202011299432 A CN 202011299432A CN 112394932 A CN112394932 A CN 112394932A
Authority
CN
China
Prior art keywords
skin
webpage
style
loading
browser
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.)
Pending
Application number
CN202011299432.9A
Other languages
Chinese (zh)
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202011299432.9A priority Critical patent/CN112394932A/en
Publication of CN112394932A publication Critical patent/CN112394932A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a method and a device for automatically changing the skin of a browser webpage, wherein the method comprises the following steps: receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information; determining a webpage skin style corresponding to the webpage skin characteristic information in a local skin style library; displaying a webpage corresponding to the webpage skin style; the method and the device can automatically, flexibly and accurately realize the skin changing of the browser webpage.

Description

Automatic browser webpage skin changing method and device
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for automatically changing skins of a browser webpage.
Background
The web page changes the skin, and the name is just the switching of the web page theme. The web server prepares a plurality of sets of different style themes, and the browser loads different styles according to related information (such as user authority, important festivals and the like) so as to show different effects.
The inventor finds that the web page skin changing scheme in the prior art is that the server directly returns the corresponding page (including styles), for example, when national celebration and spring festival come, the website releases a new version, and the relevant theme styles are embedded into the web page codes in the new version. For different users to display different style pages, the traditional method is to judge the roles of the users through programs, and then return different pages (including style codes) according to the roles of the users, so that the business logic of the programs which need to be released or modified in the traditional scheme can reach the effect of changing the skin of the webpage, once the programs are released or modified, the related work of development, test and deployment can be involved, the workload of developers is increased, the process is more complex, and corresponding risks exist when the programs are online.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a method and a device for automatically changing the skin of a browser webpage, which can automatically, flexibly and accurately realize the skin change of the browser webpage.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides an automatic browser webpage skinning method, including:
receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information;
determining a webpage skin style corresponding to the webpage skin characteristic information in a local skin style library;
and displaying the webpage corresponding to the webpage skin style.
Further, the determining web page skin characteristic information according to the web page skin resource information includes:
judging whether the webpage skin resource information contains webpage skin characteristic information or not according to a preset skin identifier, if so, determining the webpage skin characteristic information in the webpage skin resource information according to the preset characteristic identifier, and otherwise, setting default skin characteristic information in a local skin style library as the webpage skin characteristic information.
Further, the determining the web page skin style corresponding to the web page skin feature information in the local skin style library includes:
judging whether the local skin style library contains a webpage skin style corresponding to the webpage skin characteristic information, if so, loading the webpage skin style according to a style loading model corresponding to the webpage skin characteristic information, and otherwise, executing style loading exception processing.
Further, the performing pattern load exception handling comprises:
sending a skin style update request to the server;
and updating the local skin style library according to the skin style data returned by the server, and loading the corresponding webpage skin style according to the style loading model corresponding to the webpage skin characteristic information after the local skin style library is updated.
Further, the performing pattern load exception handling comprises:
and loading the default webpage skin style in the local skin style library.
In a second aspect, the present application provides an automatic skin changing device for a browser webpage, including:
the webpage skin characteristic information determining module is used for receiving webpage skin resource information sent by a server and determining the webpage skin characteristic information according to the webpage skin resource information;
the webpage skin style determining module is used for determining a webpage skin style corresponding to the webpage skin characteristic information in a local skin style library;
and the webpage loading and displaying module is used for displaying the webpage corresponding to the webpage skin style.
Further, the webpage skin characteristic information determining module comprises:
the webpage skin resource information screening unit is used for judging whether webpage skin feature information is contained in the webpage skin resource information according to a preset skin identifier, if so, determining the webpage skin feature information in the webpage skin resource information according to the preset feature identifier, and otherwise, setting default skin feature information in a local skin style library as the webpage skin feature information.
Further, the webpage skin style determination module comprises:
and the webpage skin style loading unit is used for judging whether the local skin style library contains the webpage skin style corresponding to the webpage skin characteristic information, if so, loading the webpage skin style according to the style loading model corresponding to the webpage skin characteristic information, and otherwise, executing style loading exception processing.
Further, the web page skin style loading unit comprises:
a skin style update request subunit, configured to send a skin style update request to the server;
and the local skin style library updating subunit is used for updating the local skin style library according to the skin style data returned by the server, and loading the corresponding webpage skin style according to the style loading model corresponding to the webpage skin characteristic information after the local skin style library is updated.
Further, the web page skin style loading unit comprises:
and the default webpage skin style loading subunit is used for loading the default webpage skin style in the local skin style library.
In a third aspect, the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for automatically skinning a browser webpage when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the browser web page automatic skinning method.
According to the technical scheme, the method and the device for automatically changing the skin of the browser webpage are characterized in that the webpage skin style corresponding to the webpage skin characteristic information in the local skin style library is determined through the screening rule (namely the extraction rule of the webpage skin characteristic information) which is built in the client browser and aims at the webpage skin resource information, the webpage skin style is automatically loaded, and the server does not need to transmit the information related to the webpage skin style, so that the skin changing work of the browser webpage is automatically, flexibly and accurately realized.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating an automatic skin changing method for a browser webpage according to an embodiment of the present application;
FIG. 2 is a second schematic flowchart illustrating an automatic skin-changing method for a browser webpage according to an embodiment of the present application;
FIG. 3 is a diagram illustrating an exemplary configuration of an automatic skin-changing device for a browser webpage according to an embodiment of the present disclosure;
FIG. 4 is a second block diagram of an automatic skin-changing device for a browser webpage according to an embodiment of the present application;
FIG. 5 is a third block diagram of an automatic browser page skin changing device according to an embodiment of the present application;
FIG. 6 is a fourth block diagram of an automatic skin-changing device for browser pages in an embodiment of the present application;
FIG. 7 is a fifth diagram illustrating the structure of an automatic skin-changing device for a browser webpage according to an embodiment of the present application;
FIG. 8 is a block diagram of an automatic skin changing system for a browser webpage according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Considering that in the prior art, the service logic of a publishing or modifying program has achieved the effect of changing the skin of a webpage, once the publishing or modifying program is involved, the related work of development, testing and deployment is involved, the workload of developers is increased, the process is complex, and meanwhile, the problem of corresponding risks exists when the webpage is online is solved.
In order to automatically, flexibly and accurately implement browser webpage skin changing, the application provides an embodiment of a browser webpage skin changing method, and referring to fig. 1, the browser webpage skin changing method specifically includes the following contents:
step S101: receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information.
Optionally, in the application, the client browser receives web page skin Resource information sent by the corresponding server, where the web page skin Resource information may be a URL (Uniform Resource Locator) containing information related to a web page skin, and the web page skin feature information is information contained in the URL and used for representing a web page skin to be loaded, for example, a color, and a specific coding form, for example, { the me: "green" }.
Step S102: and determining the webpage skin style corresponding to the webpage skin characteristic information in the local skin style library.
Optionally, the client browser is locally configured with a local skin style library, where a plurality of web page skin styles acquired from a server or other third-party systems are pre-stored in the local skin style library, and the web page skin styles can be used for a web page to be displayed after being loaded and rendered.
Optionally, in a specific embodiment of the present application, the present application may obtain web page skin feature information according to a web page website URL sent by a server and determine a corresponding web page skin style, where a search attribute in the URL is a search string, also called a query string, that is, a question mark (? The parameter is a part behind the question mark, for example, the parameter is name & age & 10, which is a total of 2 parameters, and each parameter is (1) a name parameter whose value is test, (2) an age parameter whose value is 10.
The specific process is as follows:
(1) the getRequest function is encapsulated, and the parameter of getRequest is the web page URL.
(2) Using api split by string intercept method and string, traversing the parameter value in URL, and saving the parameter value into an object variable, such as { the me: "green" }.
(3) And traversing the variables to obtain webpage skin characteristic information, storing the webpage skin characteristic information in the name attribute of the object, returning the value if the value of the name attribute is obtained, and otherwise, returning the empty character string.
Then, after determining a webpage skin style corresponding to the webpage skin feature information in the local skin style library, implementing a specific webpage skin style loading work through a preset loading style function, specifically:
(1) a link node is created.
(2) The ref attribute of the link node is configured as 'stylesheet', i.e., a style sheet.
(3) The href attribute of the link node is configured to be the address (which can be a network address or a local address) of the style sheet.
(4) The link node is inserted into the page head tag.
In another possible embodiment of the application, considering 2 scenarios, one is that the network is not smooth, and two is that the server or the local skin style library file is lost, and these 2 scenarios all result in unsuccessful style loading, so an internal variable loadNo may be set and initialized to 0 by using a JavaScript closure technique, when the style sheet loading is unsuccessful, the value of the loadNo variable is increased by 1, and a style sheet is continuously attempted to be loaded once, if the variable value is continuously unsuccessful, the value of the loadNo is continuously increased by 1, this process is consistent and continuous, when the value of the loadNo is 9, a style sheet is continuously loaded 10 times, at this time, the style sheet is not continuously loaded, and a default style sheet (the default style sheet is in the network server or the local skin style library) is loaded instead, and a default style is rendered for the web page.
Step S103: and displaying the webpage corresponding to the webpage skin style.
As can be seen from the above description, the automatic skin changing method for a browser webpage provided in the embodiment of the present application can determine a webpage skin style corresponding to webpage skin feature information in a local skin style library through a filtering rule (i.e., an extraction rule of the webpage skin feature information) for the webpage skin resource information built in a client browser, and automatically load the webpage skin style without transmitting information related to the webpage skin style by a server, so as to automatically, flexibly and accurately implement the skin changing work of the browser webpage.
In order to determine the web page skin feature information from the web page skin resource information sent by the server according to the specific filtering rule, in an embodiment of the method for automatically skin-changing a browser web page of the present application, the step S101 may further specifically include the following steps:
judging whether the webpage skin resource information contains webpage skin characteristic information or not according to a preset skin identifier, if so, determining the webpage skin characteristic information in the webpage skin resource information according to the preset characteristic identifier, and otherwise, setting default skin characteristic information in a local skin style library as the webpage skin characteristic information.
Optionally, in the application, the client browser receives web page skin Resource information sent by the corresponding server, where the web page skin Resource information may be a URL (Uniform Resource Locator) containing information related to a web page skin, and the web page skin feature information is information contained in the URL and used for representing a web page skin to be loaded, for example, a color, and a specific coding form, for example, { the me: "green" }.
Optionally, the method and the device can obtain webpage skin feature information according to a webpage website URL sent by a server and determine a corresponding webpage skin style, where a search attribute in the URL is a search string, also called a query string, that is, a question mark (? The parameter is a part behind the question mark, for example, the parameter is name & age & 10, which is a total of 2 parameters, and each parameter is (1) a name parameter whose value is test, (2) an age parameter whose value is 10.
Optionally, if it is determined that the web page skin resource information does not include the web page skin feature information, default skin feature information in a local skin style library may be set as the web page skin feature information.
In order to determine the corresponding web page skin style from the local skin style library of the browser, in an embodiment of the method for automatically skin-changing a browser web page of the present application, the step S102 may further specifically include the following steps:
judging whether the local skin style library contains a webpage skin style corresponding to the webpage skin characteristic information, if so, loading the webpage skin style according to a style loading model corresponding to the webpage skin characteristic information, and otherwise, executing style loading exception processing.
Optionally, the specific process is as follows:
(1) the getRequest function is encapsulated, and the parameter of getRequest is the web page URL.
(2) Using api split by string intercept method and string, traversing the parameter value in URL, and saving the parameter value into an object variable, such as { the me: "green" }.
(3) And traversing the variables to obtain webpage skin characteristic information, storing the webpage skin characteristic information in the name attribute of the object, returning the value if the value of the name attribute is obtained, and otherwise, returning the empty character string.
In order to load and display a web page when the local skin style library of the browser does not contain a corresponding web page skin style, in an embodiment of the method for automatically changing skin of a browser web page of the present application, referring to fig. 2, the following may be specifically included:
step S201: sending a skin style update request to the server.
Step S202: and updating the local skin style library according to the skin style data returned by the server, and loading the corresponding webpage skin style according to the style loading model corresponding to the webpage skin characteristic information after the local skin style library is updated.
In order to load and display a web page when the local skin style library of the browser does not contain a corresponding web page skin style, in an embodiment of the automatic skin changing method for a browser web page of the present application, the following contents may be further specifically included:
and loading the default webpage skin style in the local skin style library.
Optionally, in another possible embodiment of the present application, in consideration of 2 scenarios, one is that a network is not smooth, and another is that a server or a local skin style library file is lost, and these 2 scenarios all result in unsuccessful style loading, so that an internal variable loadNo may be set and initialized to 0 by using a JavaScript closure technique, when the style sheet loading is unsuccessful, the loadNo variable value is increased by 1, and a style sheet is continuously attempted to be loaded once, if the loading is continuously unsuccessful, the loadNo variable value is continuously increased by 1, this process is consistent and continuous, when the value of loadNo is 9, a style sheet is continuously loaded 10 times, at this time, the style sheet is not continuously loaded, a default style sheet (the default style sheet is in the web server or the local skin style library) is loaded, and a webpage rendering style is default.
In order to automatically, flexibly and accurately implement browser webpage skin changing, the present application provides an embodiment of a browser webpage automatic skin changing apparatus for implementing all or part of contents of the browser webpage automatic skin changing method, and referring to fig. 3, the browser webpage automatic skin changing apparatus specifically includes the following contents:
the web page skin characteristic information determining module 10 is configured to receive web page skin resource information sent by a server, and determine web page skin characteristic information according to the web page skin resource information.
And the web page skin style determining module 20 is configured to determine a web page skin style corresponding to the web page skin feature information in the local skin style library.
And the webpage loading and displaying module 30 is configured to display a webpage corresponding to the webpage skin style.
As can be seen from the above description, the automatic skin changing device for a browser webpage provided in the embodiment of the present application can determine a webpage skin style corresponding to webpage skin feature information in a local skin style library through a filtering rule (i.e., an extraction rule of the webpage skin feature information) for the webpage skin resource information built in a client browser, and automatically load the webpage skin style without transmitting information related to the webpage skin style by a server, so as to automatically, flexibly and accurately implement the skin changing work of the browser webpage.
In order to determine the web page skin characteristic information from the web page skin resource information sent by the server according to a specific filtering rule, in an embodiment of the automatic browser web page skin changing device of the present application, referring to fig. 4, the web page skin characteristic information determining module 10 includes:
the web page skin resource information screening unit 11 is configured to determine whether the web page skin resource information includes web page skin feature information according to a preset skin identifier, if so, determine the web page skin feature information in the web page skin resource information according to the preset feature identifier, and otherwise, set default skin feature information in a local skin style library as the web page skin feature information.
In order to determine the corresponding web page skin style from the local skin style library of the browser, in an embodiment of the automatic skin changing device for a browser web page of the present application, referring to fig. 5, the web page skin style determining module 20 includes:
the web page skin style loading unit 21 is configured to determine whether the local skin style library includes a web page skin style corresponding to the web page skin feature information, if so, load the web page skin style according to a style loading model corresponding to the web page skin feature information, and otherwise, execute a style loading exception process.
In order to load and display a web page when the local skin style library of the browser does not contain a corresponding web page skin style, in an embodiment of the automatic skin changing device for a browser web page of the present application, referring to fig. 6, the web page skin style loading unit 21 includes:
a skin style update request subunit 211, configured to send a skin style update request to the server.
And a local skin style library updating subunit 212, configured to update the local skin style library according to the skin style data returned by the server, and load a corresponding web page skin style according to a style loading model corresponding to the web page skin feature information after the local skin style library is updated.
In order to load and display a web page when the local skin style library of the browser does not contain a corresponding web page skin style, in an embodiment of the automatic skin changing device for a browser web page of the present application, referring to fig. 7, the web page skin style loading unit 21 includes:
and a default webpage skin style loading subunit 213, configured to load a default webpage skin style in the local skin style library.
To further illustrate the present invention, the present application further provides a specific application example of implementing an automatic skin changing method for a browser webpage by using the above automatic skin changing device for a browser webpage, and with reference to fig. 8, the method specifically includes: the system comprises a browser, a server and a background management system.
The browser, namely the client, is mainly used for realizing:
1. obtaining style information in a URL
The skin style information is obtained according to a web site URL sent by a server, wherein a search attribute in the URL is a search string, which is also called a query string, i.e. a question mark (. Request parameters & connect, like web site? The parameter is a part behind the question mark, for example, the parameter is name & age & 10, which is a total of 2 parameters, and each parameter is (1) a name parameter whose value is test, (2) an age parameter whose value is 10.
Specifically, the process of acquiring the style information is as follows:
(1) the getRequest function is encapsulated, and the parameter of getRequest is the web page URL.
(2) Using api split by string intercept method and string, traversing the parameter value in URL, and saving the parameter value into an object variable, such as { the me: "green" }.
(3) Traversing the variables, acquiring skin related information, storing the skin information in the name attribute of the object, returning the value if the value of the name attribute is acquired, and otherwise, returning a null character string.
2. Load style function implementation
Specifically, the specific process of the style loading function is as follows:
(1) a link node is created.
(2) The ref attribute of the link node is configured as 'stylesheet', i.e., a style sheet.
(3) The href attribute of the link node is configured to be the address (which can be a network address or a local address) of the style sheet.
(4) The link node is inserted into the page head tag.
In addition, considering 2 scenarios, one is that the network is not smooth, and the other is that the server or the local style file is lost, the 2 scenarios all result in unsuccessful style loading. The embodiment also sets an internal variable loadNo by using a closure technique of JavaScript, and initializes it to 0. When the style sheet loading is unsuccessful, the value of the loadNo variable is added with 1, the loading of the style sheet is continuously tried, and if the loading is not successful, the value of the loadNo variable is continuously added with 1. This process continues consistently, and when the value of loadNo is 9, i.e. 10 times of style sheets are loaded continuously, the style sheet is not loaded continuously, and instead, the default style sheet (which must exist on the web server or locally) is loaded, and the web page renders the default style.
3. Webpage skin changing function implementation
Specifically, the webpage skin-changing function comprises the following specific steps:
(1) and calling the getRequest function to acquire the style information in the URL.
(2) And calling the loading style function.
4. Webpage skin changing modularization implementation
According to the embodiment, the webpage code change can be encapsulated into a JavaScript class, so that modular development is realized, and low cohesion and high coupling of the code are guaranteed.
Specifically, the JavaScript class includes:
(1) and acquiring a style information function in the URL.
(2) A style function is loaded.
(3) And web page skin changing function.
(4) And constructing the function.
The default parameters of the constructor are as follows: cssBaseUrl (i.e. other information besides the file name of the sample table) as a basic path of the style sheet, default file name of the webpage style sheet. The true path of the default style sheet is cssBaseUrl/default. The path for other style sheets, such as green.
And calling a webpage skin changing function in the construction function to realize webpage skin changing.
In addition, the server in this embodiment is implemented by nginx, and other types of web servers such as Apache may also be used.
In this embodiment, md5 generates a file hash value for a file by an irreversible string transformation calculation. Any two files will not have the same hash value (unless the file contents are identical). md5 is often used to verify files, ensuring file uniqueness. Because if the values of the files md5 are different, the contents of the files are also different. The file md5 may be generated using md5 generation tools (many tools on the network).
In this embodiment, the style sheet name consists of a style name and an md5 name, for example, a style sheet name is green, the md5 value 573a628ad29c6bc900ea5844c3ca0be7 of this skin style sheet file, and the final style sheet file name is green.573a628ad 29c6bc900ae5844c3ca 0 bes.
The purpose of processing the style sheet names is to add version numbers to the style sheets, the main content of one style sheet is green, but as long as the content is changed, the md5 value of the file is different, and the consistency between the file content and the file version is ensured.
Meanwhile, because the file names have md5 values, other style files cannot be covered when the skin style sheet file is uploaded to the static file server, and the previous file is kept on the static resource server, so that the application is more quickly returned when problems occur.
In this embodiment, taking the nginx web server as an example, the storage location of the static resource is configured by configuring a port number, an iP address and a location, and the nginx service is restarted to access the static resource. After the stylesheet files are named according to the above, the stylesheet files are uploaded to the static resource directory through an ftp tool.
In this embodiment, each style file has a unique md5 code, and as long as the file content changes, the md5 of the style file changes, so the file name of the style sheet changes, so that different style files can be loaded by the file name without checking whether the file content changes. Therefore, the embodiment does not need to negotiate a Cache (negotiate the Cache to determine whether the file changes), and the embodiment directly uses the Cache-Control strong Cache and sets the validity max-age to a larger value (for example, 30 days). The nginx server sets the strong cache as follows:
location~.*\.(css)${
add_header Cache-Control max-age=2592000;
add_header Pragma no-cache;
}
the Max-age value is 2592000 in seconds, i.e., a 30 day useful life.
In this embodiment, when the client requests the style sheet for the first time, the client does not have a style locally, so that a request needs to be sent to the server, the server returns the style file, and a cache-control is set in a response header of the request to describe the validity period of the file. When the client requests the style sheet file for the second time, whether the style sheet file is overdue can be judged according to the cache-retry of the last request.
As can be seen from the above, the present application can achieve at least the following technical effects:
(1) the web page changing is realized through a client (browser), a static resource server and a background management system.
(2) According to the method and the device, dynamic skin changing can be achieved only by configuring the skin parameters in the URL and uploading the style files to the static file server, server codes do not need to be modified, operation is simple, and operation and maintenance are convenient.
(3) The web page performance is good. By using the strong cache, network requests are reduced, the speed of loading the style sheet of the webpage is improved, the webpage can be rendered more quickly, and the user experience is improved.
(4) Modular concept in software design. The code has high cohesion, low coupling and strong maintainability.
In terms of hardware, in order to automatically, flexibly and accurately implement browser webpage skinning, the present application provides an embodiment of an electronic device for implementing all or part of contents in the browser webpage skinning method, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the browser webpage automatic skin changing device and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the automatic skin changing method for a browser webpage and the embodiment of the automatic skin changing device for a browser webpage in the embodiments, and the contents thereof are incorporated herein, and repeated details are not repeated.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the browser webpage automatic skin changing method may be executed on the electronic device side as described in the above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be communicatively connected to a remote server to implement data transmission with the server. The server may include a server on the task scheduling center side, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 9 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 9, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 9 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the browser web page auto skinning method function can be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
step S101: receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information.
Step S102: and determining the webpage skin style corresponding to the webpage skin characteristic information in the local skin style library.
Step S103: and displaying the webpage corresponding to the webpage skin style.
As can be seen from the above description, in the electronic device provided in the embodiment of the present application, the webpage skin style corresponding to the webpage skin feature information in the local skin style library is determined through the filtering rule (i.e., the extraction rule of the webpage skin feature information) for the webpage skin resource information built in the client browser, and the webpage skin style is automatically loaded without transmitting information related to the webpage skin style by the server, so that the skin change work of the browser webpage is automatically, flexibly, and accurately achieved.
In another embodiment, the automatic browser webpage skin changing device may be configured separately from the central processing unit 9100, for example, the automatic browser webpage skin changing device may be configured as a chip connected to the central processing unit 9100, and the automatic browser webpage skin changing method function is realized by the control of the central processing unit.
As shown in fig. 9, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 9; in addition, the electronic device 9600 may further include components not shown in fig. 9, which may be referred to in the prior art.
As shown in fig. 9, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all steps in the browser webpage automatic skin changing method in which the execution subject is the server or the client in the foregoing embodiment, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the browser webpage automatic skin changing method in which the execution subject is the server or the client in the foregoing embodiment, for example, when the processor executes the computer program, the processor implements the following steps:
step S101: receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information.
Step S102: and determining the webpage skin style corresponding to the webpage skin characteristic information in the local skin style library.
Step S103: and displaying the webpage corresponding to the webpage skin style.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present application determines, through a filtering rule (i.e., an extraction rule of web page skin feature information) for web page skin resource information that is built in a client browser, a web page skin style corresponding to the web page skin feature information in a local skin style library, and automatically loads the web page skin style, without transmitting information related to the web page skin style by a server, so as to automatically, flexibly, and accurately implement a skin change operation of a browser web page.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. An automatic browser webpage skin changing method is characterized by comprising the following steps:
receiving webpage skin resource information sent by a server, and determining webpage skin characteristic information according to the webpage skin resource information;
determining a webpage skin style corresponding to the webpage skin characteristic information in a local skin style library;
and displaying the webpage corresponding to the webpage skin style.
2. The method for automatically skinning a browser webpage according to claim 1, wherein the determining webpage skin feature information according to the webpage skin resource information comprises:
judging whether the webpage skin resource information contains webpage skin characteristic information or not according to a preset skin identifier, if so, determining the webpage skin characteristic information in the webpage skin resource information according to the preset characteristic identifier, and otherwise, setting default skin characteristic information in a local skin style library as the webpage skin characteristic information.
3. The method for automatically skinning a browser webpage according to claim 1, wherein the determining a webpage skin style corresponding to the webpage skin feature information in the local skin style library comprises:
judging whether the local skin style library contains a webpage skin style corresponding to the webpage skin characteristic information, if so, loading the webpage skin style according to a style loading model corresponding to the webpage skin characteristic information, and otherwise, executing style loading exception processing.
4. The method of claim 3, wherein the performing style loading exception handling comprises:
sending a skin style update request to the server;
and updating the local skin style library according to the skin style data returned by the server, and loading the corresponding webpage skin style according to the style loading model corresponding to the webpage skin characteristic information after the local skin style library is updated.
5. The method of claim 3, wherein the performing style loading exception handling comprises:
and loading the default webpage skin style in the local skin style library.
6. An automatic skin changing device for a browser webpage is characterized by comprising:
the webpage skin characteristic information determining module is used for receiving webpage skin resource information sent by a server and determining the webpage skin characteristic information according to the webpage skin resource information;
the webpage skin style determining module is used for determining a webpage skin style corresponding to the webpage skin characteristic information in a local skin style library;
and the webpage loading and displaying module is used for displaying the webpage corresponding to the webpage skin style.
7. The automatic skin changing device for the browser webpage according to claim 6, wherein the webpage skin characteristic information determining module comprises:
the webpage skin resource information screening unit is used for judging whether webpage skin feature information is contained in the webpage skin resource information according to a preset skin identifier, if so, determining the webpage skin feature information in the webpage skin resource information according to the preset feature identifier, and otherwise, setting default skin feature information in a local skin style library as the webpage skin feature information.
8. The automatic skin changing device for the browser webpage according to claim 6, wherein the webpage skin style determining module comprises:
and the webpage skin style loading unit is used for judging whether the local skin style library contains the webpage skin style corresponding to the webpage skin characteristic information, if so, loading the webpage skin style according to the style loading model corresponding to the webpage skin characteristic information, and otherwise, executing style loading exception processing.
9. The automatic skin changing device for the browser webpage according to claim 8, wherein the webpage skin style loading unit comprises:
a skin style update request subunit, configured to send a skin style update request to the server;
and the local skin style library updating subunit is used for updating the local skin style library according to the skin style data returned by the server, and loading the corresponding webpage skin style according to the style loading model corresponding to the webpage skin characteristic information after the local skin style library is updated.
10. The automatic skin changing device for the browser webpage according to claim 8, wherein the webpage skin style loading unit comprises:
and the default webpage skin style loading subunit is used for loading the default webpage skin style in the local skin style library.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the method for automatically skinning a browser webpage according to any one of claims 1 to 5 are implemented when the program is executed by the processor.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for automatically skinning a browser webpage according to any one of claims 1 to 5.
CN202011299432.9A 2020-11-19 2020-11-19 Automatic browser webpage skin changing method and device Pending CN112394932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011299432.9A CN112394932A (en) 2020-11-19 2020-11-19 Automatic browser webpage skin changing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011299432.9A CN112394932A (en) 2020-11-19 2020-11-19 Automatic browser webpage skin changing method and device

Publications (1)

Publication Number Publication Date
CN112394932A true CN112394932A (en) 2021-02-23

Family

ID=74607472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011299432.9A Pending CN112394932A (en) 2020-11-19 2020-11-19 Automatic browser webpage skin changing method and device

Country Status (1)

Country Link
CN (1) CN112394932A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076150A (en) * 2021-04-13 2021-07-06 北京同邦卓益科技有限公司 Interface theme switching method, device, equipment, storage medium and program product
CN114422858A (en) * 2022-03-25 2022-04-29 北京智象信息技术有限公司 Linux smart television skin rapid generation method, system, device and medium
US20220245208A1 (en) * 2021-04-27 2022-08-04 Apollo Intelligent Connectivity (Beijing) Technology Co., Ltd. Method for switching skin of mini-program page, and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662672A (en) * 2012-04-05 2012-09-12 广州市动景计算机科技有限公司 Method and device for conducting skin changing process to webpages as well as mobile terminal
CN106227512A (en) * 2016-07-07 2016-12-14 网易(杭州)网络有限公司 The replacing skins method and device of application software display interface
CN107665259A (en) * 2017-10-23 2018-02-06 四川虹慧云商科技有限公司 A kind of automatic skin change method in interface and system
CN111638927A (en) * 2020-05-06 2020-09-08 北京达佳互联信息技术有限公司 Skin switching method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662672A (en) * 2012-04-05 2012-09-12 广州市动景计算机科技有限公司 Method and device for conducting skin changing process to webpages as well as mobile terminal
US9323724B2 (en) * 2012-04-05 2016-04-26 Guangzhou Ucweb Computer Technology Co., Ltd Webpage skin replacement method, apparatus, and mobile terminal
CN106227512A (en) * 2016-07-07 2016-12-14 网易(杭州)网络有限公司 The replacing skins method and device of application software display interface
CN107665259A (en) * 2017-10-23 2018-02-06 四川虹慧云商科技有限公司 A kind of automatic skin change method in interface and system
CN111638927A (en) * 2020-05-06 2020-09-08 北京达佳互联信息技术有限公司 Skin switching method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄中杰等: "《XML新网页语言开发手册》", 北京:清华大学出版社 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076150A (en) * 2021-04-13 2021-07-06 北京同邦卓益科技有限公司 Interface theme switching method, device, equipment, storage medium and program product
US20220245208A1 (en) * 2021-04-27 2022-08-04 Apollo Intelligent Connectivity (Beijing) Technology Co., Ltd. Method for switching skin of mini-program page, and electronic device
CN115344315A (en) * 2021-04-27 2022-11-15 阿波罗智联(北京)科技有限公司 Skin switching method and device of applet page and electronic equipment
CN115344315B (en) * 2021-04-27 2024-02-02 阿波罗智联(北京)科技有限公司 Skin switching method and device of applet page and electronic equipment
CN114422858A (en) * 2022-03-25 2022-04-29 北京智象信息技术有限公司 Linux smart television skin rapid generation method, system, device and medium
CN114422858B (en) * 2022-03-25 2022-11-18 北京智象信息技术有限公司 Linux smart television skin rapid generation method, system, device and medium

Similar Documents

Publication Publication Date Title
CN112394932A (en) Automatic browser webpage skin changing method and device
CN111459539A (en) Continuous integration pipeline operation method and device based on mirror layering
CN112256772A (en) Data service method, device and readable storage medium
CN113157345A (en) Automatic starting method and device for front-end engineering
CN112463634A (en) Software testing method and device under micro-service architecture
CN111679790A (en) Remote software development storage space distribution method and device
CN114138372A (en) Front-end component loading method and device
CN112784112A (en) Message checking method and device
AU2016101498B4 (en) Data Interchange System
CN113342330A (en) Front-end engineering generation method and device
CN111367561B (en) Remote development method and device for software program
CN114153856A (en) Host data double-writing method and device
CN113095053A (en) Webpage table customizing method and device
CN103488508A (en) Browser working method, browser and terminal equipment
CN104506616A (en) Method, device and system for sending information by browser client side
CN112068879A (en) Method and device for constructing client application development framework based on configuration
CN113791984B (en) Automatic interface testing method and device
CN105808628B (en) Webpage code-transferring method, apparatus and system
CN113110829B (en) Multi-UI component library data processing method and device
CN114637531A (en) Method and device for dynamically generating application program interface
CN114968917A (en) Method and device for rapidly importing file data
CN115495519A (en) Report data processing method and device
CN112100553B (en) Webpage configuration method and device, electronic equipment and storage medium
CN114968400A (en) Webpage synchronization method and device, storage medium and electronic equipment
CN113050936A (en) Front-end data processing method and device based on integrated development environment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210223

RJ01 Rejection of invention patent application after publication