Summary of the invention
Based on this, present description provides web page element processing and Redundant Web Pages pattern lookup methods and device.
According to this specification embodiment in a first aspect, providing a kind of web page element processing method, which comprises obtain
Take the target webpage element with first identifier information;Address properties are inserted into the target webpage attribute of an element;It is described
Address properties are used to the first identifier information being sent to log server, so that the log server is according to webpage pattern
Second identifier information and the first identifier information in table search Redundant Web Pages pattern from the webpage style sheet;Wherein,
The second identifier information is for identifying the corresponding web page element of webpage pattern in the webpage style sheet.
Optionally, the step of address properties are inserted into the target webpage attribute of an element includes: in the target network
Background is inserted into page attribute of an element, the log server is directed toward in the address of the Background.
Optionally, the transparency of the Background is less than default transparency threshold;And/or the pixel size of the Background
Less than preset pixel threshold.
Optionally, the Background is inserted into the target webpage attribute of an element by ID selector.
Optionally, the method also includes: delete the Redundant Web Pages pattern.
Optionally, the target webpage element includes top margin element, page footing element, navigation bar element and/or content regions member
Element.
Optionally, the first identifier information includes the identification name and webpage pattern of the target webpage element.
According to the second aspect of this specification embodiment, a kind of Redundant Web Pages pattern lookup method, the method packet are provided
It includes: receiving the webpage style sheet that client is sent, include using webpage sample in the webpage style sheet in the webpage style sheet
The second identifier information of the web page element of formula;Obtain the first identifier information of target webpage element;Wherein, the target webpage member
Element is handled using web page element processing method described in any embodiment;According to the first identifier information and second identifier
Information searches Redundant Web Pages pattern from the webpage style sheet.
Optionally, the Redundant Web Pages pattern be first identifier information in do not include second identifier information webpage pattern.
According to the third aspect of this specification embodiment, a kind of web page element processing unit is provided, described device includes:
One obtains module, for obtaining the target webpage element with first identifier information;It is inserted into module, in the target webpage
Address properties are inserted into attribute of an element;Wherein, the address properties are used to for the first identifier information to be sent to log clothes
It is engaged in device, so that the log server is according to second identifier information and the first identifier information in webpage style sheet from described
Redundant Web Pages pattern is searched in webpage style sheet;Wherein, the second identifier information is for identifying net in the webpage style sheet
The corresponding web page element of page pattern.
According to the fourth aspect of this specification embodiment, a kind of Redundant Web Pages pattern lookup device, described device packet are provided
Include: receiving module includes using the webpage sample in the webpage style sheet for receiving the webpage style sheet of client transmission
The second identifier information of the web page element of webpage pattern in formula table;Second obtains module, for obtaining the of target webpage element
One identification information;Wherein, the target webpage element is handled using web page element processing method described in any embodiment;
Searching module, for searching Redundant Web Pages from the webpage style sheet according to the first identifier information and second identifier information
Pattern.
According to the 5th of this specification embodiment the aspect, a kind of computer readable storage medium is provided, meter is stored thereon with
Calculation machine program realizes method described in any embodiment when the program is executed by processor.
According to the 6th of this specification embodiment aspect, a kind of computer equipment is provided, including memory, processor and deposit
The computer program that can be run on a memory and on a processor is stored up, the processor realizes any reality when executing described program
Apply method described in example.
Using this specification example scheme, address properties are inserted into for the target webpage element with first identifier information,
Log server is enabled to get the first identifier information of target webpage element, then by log server according to first identifier
Second identifier information searching Redundant Web Pages pattern in information and webpage style sheet, can effectively find out Redundant Web Pages pattern.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
This specification can be limited.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to
When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent device and method of some aspects be described in detail in attached claims, this specification.
It is only to be not intended to be limiting this explanation merely for for the purpose of describing particular embodiments in the term that this specification uses
Book.The "an" of used singular, " described " and "the" are also intended to packet in this specification and in the appended claims
Most forms are included, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein is
Refer to and includes that one or more associated any or all of project listed may combine.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not taking off
In the case where this specification range, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
As shown in Figure 1, being the web page element processing method flow chart of this specification one embodiment.The method may include
Following steps:
Step 102: obtaining the target webpage element with first identifier information;
Step 104: being inserted into address properties in the target webpage attribute of an element;
Wherein, the address properties are used to the first identifier information being sent to log server, so that the log
Server is searched from the webpage style sheet according to the second identifier information in webpage style sheet with the first identifier information
Redundant Web Pages pattern;Wherein, the second identifier information is for identifying the corresponding webpage of webpage pattern in the webpage style sheet
Element.
In the present embodiment, first identifier information can be set for the target webpage element on webpage in advance.First mark
The identification name for knowing information can be named using the combination of pound sign (#) padding string, and naming rule can be set according to actual needs
It is fixed, for example, can be named according to function of the target webpage element in webpage and/or position etc..For example, top margin element can be with
It is named as #header.Target webpage element can be element important in webpage, for example, top margin element, page footing element,
Navigation bar element and/or content p-block element p etc..
Be inserted into address properties in target webpage attribute of an element, can make the target webpage element in a browser by with
Family can request the address of log server when accessing.It in one embodiment, can be by the target webpage element
Attribute in be inserted into the mode of Background and be inserted into address properties in target webpage attribute of an element, wherein the Background
Address be directed toward the log server.Further, the transparency of the Background of insertion can be less than preset transparency threshold
Value, for example, it may be all-transparent, this way it is possible to avoid influencing observation of the user to target webpage element.The Background of insertion
Pixel size be also less than preset pixel threshold, for example, the size of Background can be 1 pixel × 1 pixel size,
In this way, it is possible to reduce the time needed for load Background improves user experience to reduce web page loading time.Certainly, background
Figure can also meet two above condition simultaneously.
Background can be inserted into the target webpage attribute of an element by ID selector.It is selected by using ID
Device can add Background each to set the target webpage element of ID (that is, first identifier information), so that this target network
The address of meeting Request Log server when page element is accessed by the user in a browser, to send the first identifier information
To log server.A definition can be increased in target webpage attribute of an element by ID selector, it is a form of fixed
It is adopted as follows:
#header{background-image:url('https://logServer/id/header.gif')};
This definition indicates to be inserted into URL in the target webpage attribute of an element that first identifier information is #header
(Uniform Resource Locator, uniform resource locator) ishttps://logServer/id/header.gif's
Address properties.According to the address properties, first identifier information can be sent to log server, it specifically, can be according to
Log is sent to log server after the generation log of one identification information.
When user opens webpage in a browser, webpage style sheet can be sent to log server.Webpage style sheet
In may include webpage pattern used in history and using the webpage pattern web page element second identifier information.Log clothes
Be engaged in the available first identifier information of device and second identifier information, and according to second identifier information and the first identifier information from
Redundant Web Pages pattern is searched in the webpage style sheet.Due to web page element modification or the change of webpage design etc., net
Part webpage pattern in page style sheet may be Redundant Web Pages pattern, that is, there is no use these webpage patterns in webpage
Web page element, therefore, this corresponding second identifier information of partial redundance webpage pattern is not include in first identifier information.
As long as can be found out in webpage style sheet to which log server compares first identifier information and second identifier information
Redundant Web Pages pattern.
In one embodiment, after finding Redundant Web Pages pattern, the redundant network can also be deleted from webpage style sheet
Page pattern.In practical applications, a process cycle (for example, one month) can also be set for log server, takes log
The each process cycle of device of being engaged in executes the primary operation for searching Redundant Web Pages element.
In one embodiment, first identifier information not only may include the identification name of target webpage element, may also include mesh
The webpage pattern for marking web page element, for example, color, font, font size, picture format, resolution ratio etc..By taking color as an example, including face
The first identifier information of tinctorial pattern formula can be denoted as following form:
#header{color:red;};
The scheme of this specification embodiment is inserted into address properties for the target webpage element with first identifier information, is made
The first identifier information of target webpage element can be got by obtaining log server, then be believed by log server according to first identifier
Second identifier information searching Redundant Web Pages pattern in breath and webpage style sheet, can effectively find out Redundant Web Pages pattern.
As shown in Fig. 2, being the structural representation of the system of the execution web page element processing method of this specification one embodiment
Figure, the working principle of the system are as shown in Figure 3.The system can include:
Web page element processing server 202, log server 204 and web page server 206.Wherein, at web page element
Reason server 202 can be used for obtaining the target webpage element with first identifier information, in the target webpage attribute of an element
Middle insertion address properties, and the first identifier information is sent to log server 204 according to the address properties.Webpage sample
The corresponding source file of formula table can be stored in advance after being converted into dist file into web page server 206, and user is passing through visitor
When browser on the end of family starts webpage, can by CDN (Content Delivery Network, content distributing network) from
The source file is obtained in web page server 206, to show corresponding webpage pattern in a browser.Web page server 206 is also
Webpage style sheet can be sent to log server 204.Log server 204 can be marked according to second in webpage style sheet
Know information and the first identifier information searches Redundant Web Pages pattern from the webpage style sheet.
As shown in figure 4, this specification embodiment also provides a kind of Redundant Web Pages pattern lookup method, the method can be wrapped
It includes:
Step 402: receiving the webpage style sheet that client is sent, include using the webpage sample in the webpage style sheet
The second identifier information of the web page element of webpage pattern in formula table;
Step 404: obtaining the first identifier information of target webpage element;Wherein, the target webpage element is using any
Web page element processing method described in embodiment is handled;
Step 406: redundancy is searched from the webpage style sheet according to the first identifier information and second identifier information
Webpage pattern.
Wherein, the Redundant Web Pages pattern be first identifier information in do not include second identifier information webpage pattern.
Various technical characteristics in above embodiments can be arbitrarily combined, as long as there is no punchings for the combination between feature
Prominent or contradiction, but as space is limited, is not described one by one, thus the various technical characteristics in above embodiment it is any into
Row combination also belongs to the range of this disclosure.
As shown in figure 5, this specification embodiment also provides a kind of web page element processing unit, described device can include:
First obtains module 502, for obtaining the target webpage element with first identifier information;
It is inserted into module 504, for being inserted into address properties in the target webpage attribute of an element;
Wherein, the address properties are used to the first identifier information being sent to log server, so that the log
Server is searched from the webpage style sheet according to the second identifier information in webpage style sheet with the first identifier information
Redundant Web Pages pattern;Wherein, the second identifier information is for identifying the corresponding webpage of webpage pattern in the webpage style sheet
Element.
As shown in fig. 6, this specification embodiment also provides a kind of Redundant Web Pages pattern lookup device, described device can be wrapped
It includes:
Receiving module 602 includes using institute in the webpage style sheet for receiving the webpage style sheet of client transmission
State the second identifier information of the web page element of webpage pattern in webpage style sheet;
Second obtains module 604, for obtaining the first identifier information of target webpage element;Wherein, the target webpage
Element is handled using web page element processing method described in any embodiment;
Searching module 606 is used for according to the first identifier information and second identifier information from the webpage style sheet
Search Redundant Web Pages pattern.
The specific details of the realization process of the function of modules and effect, which are shown in, in above-mentioned apparatus corresponds to step in the above method
Realization process, details are not described herein.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality
Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit
The module of explanation may or may not be physically separated, and the component shown as module can be or can also be with
It is not physical module, it can it is in one place, or may be distributed on multiple network modules.It can be according to actual
The purpose for needing to select some or all of the modules therein to realize this specification scheme.Those of ordinary skill in the art are not
In the case where making the creative labor, it can understand and implement.
The embodiment of this specification device can be applied on a computing device, such as server or terminal device.Device
Embodiment can also be realized by software realization by way of hardware or software and hardware combining.Taking software implementation as an example,
As the device on a logical meaning, being will be corresponding in nonvolatile memory by the processor of file process where it
Computer program instructions are read into memory what operation was formed.For hardware view, as shown in fig. 7, being this specification device
A kind of hardware structure diagram of place computer equipment, in addition to processor 702 shown in Fig. 7, memory 704, network interface 706, with
And except nonvolatile memory 708, server or electronic equipment in embodiment where device are set generally according to the computer
Standby actual functional capability can also include other hardware, repeat no more to this.
Correspondingly, this specification embodiment also provides a kind of computer storage medium, is stored with journey in the storage medium
Sequence realizes the method in any of the above-described embodiment when described program is executed by processor.
Correspondingly, this specification embodiment also provides a kind of computer equipment, including memory, processor and is stored in
On reservoir and the computer program that can run on a processor, the processor realize any of the above-described implementation when executing described program
Method in example.
This specification embodiment can be used one or more wherein include the storage medium of program code (including but not
Be limited to magnetic disk storage, CD-ROM, optical memory etc.) on the form of computer program product implemented.Computer is available to be deposited
Storage media includes permanent and non-permanent, removable and non-removable media, can be accomplished by any method or technique letter
Breath storage.Information can be computer readable instructions, data structure, the module of program or other data.The storage of computer is situated between
The example of matter includes but is not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory
Device (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), the read-only storage of electrically erasable
Device (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), digital versatile disc
(DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices or any other non-biography
Defeated medium, can be used for storage can be accessed by a computing device information.
Those skilled in the art will readily occur to the disclosure after considering specification and practicing specification disclosed herein
Other embodiments.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes
Or adaptive change follow the general principles of this disclosure and including the disclosure it is undocumented in the art known in often
Knowledge or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following
Claim point out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
The foregoing is merely the preferred embodiments of the disclosure, not to limit the disclosure, all essences in the disclosure
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of disclosure protection.