CN109960531B - Page display method and device - Google Patents

Page display method and device Download PDF

Info

Publication number
CN109960531B
CN109960531B CN201711433243.4A CN201711433243A CN109960531B CN 109960531 B CN109960531 B CN 109960531B CN 201711433243 A CN201711433243 A CN 201711433243A CN 109960531 B CN109960531 B CN 109960531B
Authority
CN
China
Prior art keywords
kernel
page
browser
displayed
key field
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
CN201711433243.4A
Other languages
Chinese (zh)
Other versions
CN109960531A (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.)
China Mobile Zhejiang Innovation Research Institute Co ltd
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Zhejiang 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 China Mobile Communications Group Co Ltd, China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711433243.4A priority Critical patent/CN109960531B/en
Publication of CN109960531A publication Critical patent/CN109960531A/en
Application granted granted Critical
Publication of CN109960531B publication Critical patent/CN109960531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Abstract

The embodiment of the invention provides a page display method and device. The method comprises the following steps: extracting page attributes from a page to be displayed; according to the extracted page attribute and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and taking the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel. The device is used for executing the method. The page display method and the page display device provided by the embodiment of the invention can solve the compatibility problem when the user accesses different service systems, and simultaneously reduce the development cost and improve the user experience.

Description

Page display method and device
Technical Field
The embodiment of the invention relates to the technical field of browsers, in particular to a page display method and device.
Background
The browser kernel is a core part of the browser and is responsible for explaining the webpage syntax, and determines how the browser displays the content of the webpage, the format information of the webpage and the like. The types of the browser kernels are many, and at present, the common browser kernels mainly include three types: the first type: the Webkit kernel is mainly applied to browsers such as Safari, Chrome, Opera and the like; the second type: the Trident kernel is mainly applied to IE series browsers; in the third category: and the Gecko kernel is mainly applied to a Firefox browser.
Because the different browser kernels interpret the web page writing methods differently, the rendering effect of the same web page in different browsers of the same kernel is different.
At present, service systems inside enterprises are more and more, the association among the service systems is more and more compact, and there is often a case that after one service system is opened by one browser, other service systems need to be visited mutually. When each service system is developed, the supported browser kernels are inconsistent, so that compatibility problems often occur, such as js error, unavailability of a certain function, poor webpage rendering effect and the like. For example, when the service system a accesses the service system B through single sign-on, the service system a is only compatible with the IE11 browser of the Trident kernel, and the service system B is only compatible with the chrome browser of the Webkit kernel, so that the compatibility problem occurs, which causes some functions of the service system to be abnormal, and the user experience to be poor.
At present, there are two main methods for solving the compatibility problem: the first solution is for the user to install enough browsers on the local client and remember the best browser for each service system. And the other is that the development team debugs the compatibility among the browsers and the kernels thereof one by one according to different browsers.
However, in the first solution, because the sessions of different browsers are different, the user needs to log in and access different browsers for multiple times, which greatly affects the convenience of the user for accessing the service system, and the user experience is poor. In the second solution, there is a problem that development and maintenance costs are high.
Therefore, a solution is needed to provide a solution that can improve the user experience and reduce the development cost while solving the compatibility problem when the user accesses different service systems of the enterprise.
Disclosure of Invention
Aiming at the defects in the prior art, the embodiments of the present invention provide a page display method and apparatus, which can reduce development cost and improve user experience while solving the compatibility problem when a user accesses different service systems.
In one aspect, an embodiment of the present invention provides a page display method, including:
extracting page attributes from a page to be displayed;
according to the extracted page attribute and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and taking the browser kernel as a target rendering kernel corresponding to the page to be displayed;
and rendering and displaying the page to be displayed through the target rendering kernel.
In another aspect, an embodiment of the present invention provides a page display apparatus, including:
extracting page attributes from a page to be displayed;
according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed;
and rendering and displaying the page to be displayed through the target rendering kernel.
In another aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a bus, where:
the processor and the memory complete mutual communication through a bus;
the processor may invoke a computer program in memory to perform the steps of the above-described method.
In yet another aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the above-mentioned method.
According to the page display method and device provided by the embodiment of the invention, the page attribute is extracted from the page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel. Therefore, the corresponding target rendering kernel can be found for the pages to be displayed from different service systems, the compatibility problem existing when a user accesses different service systems is solved, the user experience is improved, and the development cost is low.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 illustrates an exemplary flow diagram of a page display method according to one embodiment of the invention;
FIG. 2 is a schematic structural diagram of a page display apparatus according to an embodiment of the present invention;
fig. 3 shows a physical structure diagram of an electronic device according to an embodiment of the invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it is obvious that the described embodiments are only some embodiments of the present invention, 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 invention.
As used herein, the terms "module," "device," and the like are intended to encompass a computer-related entity, such as but not limited to hardware, firmware, a combination of hardware and software, or software in execution. For example, a module may be, but is not limited to: a process running on a processor, an object, an executable, a thread of execution, a program, and/or a computer. For example, an application running on a computing device and the computing device may both be a module. One or more modules may reside within a process and/or thread of execution and a module may be localized on one computer and/or distributed between two or more computers.
The technical scheme of the invention is explained in detail in the following with the accompanying drawings.
Referring to FIG. 1, an exemplary flow diagram of a page display method according to one embodiment of the invention is shown.
As shown in fig. 1, the page display method provided in the embodiment of the present invention may include the following steps:
s110: and extracting page attributes from the page to be displayed.
The page display method provided by the embodiment of the invention is suitable for a scene that a user sends a webpage request through the browser, and the browser displays the page to be displayed after receiving the page to be displayed returned by the target service system.
The execution main body of the page display method provided by the embodiment of the invention can be specifically a browser with a kernel adaptation function; or a device connected to a browser.
In practical applications, the web page request sent by the browser may specifically be an http (hyper text transfer protocol) message request; correspondingly, the page to be displayed returned by the target service system may specifically be an http page. The target service system refers to a service system which is pre-accessed by a user; the user can directly access the target service system or jump to the target service system through the currently accessed service system.
In the embodiment of the present invention, the page attribute extracted from the page to be displayed may include at least one of the following: js (javascript ), css (cascading style sheet), and meta (meta) attributes.
In the embodiment of the present invention, the extraction of js, the extraction of css, and the extraction of meta attribute may adopt technical means commonly used by those skilled in the art, and are not described in detail herein.
S120: and searching out the browser kernel with the highest matching degree with the page to be displayed according to the extracted page attribute and a preset kernel selection model, and taking the browser kernel as a target rendering kernel corresponding to the page to be displayed.
Specifically, the extracted page attribute may be subjected to keyword extraction, and a keyword set corresponding to the page to be displayed is generated according to the extracted keyword.
Then, for each browser kernel, according to a Bayesian algorithm preset in the kernel selection model and a kernel selection model parameter corresponding to the browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears, and taking the probability as the matching degree between the browser kernel and the page to be displayed. The kernel selection model parameter corresponding to the browser kernel is specifically the occurrence probability of each keyword when the browser kernel is taken as a target to render the kernel.
The rendering display effect of the browser kernel on the page to be displayed is best when the probability that the browser kernel is taken as a target rendering kernel is larger when the keyword set corresponding to the page to be displayed appears is considered.
Therefore, according to the matching degree between each browser kernel and the page to be displayed, the browser kernel with the highest matching degree with the page to be displayed can be found, and the found browser kernel is used as the target rendering kernel corresponding to the page to be displayed.
In the embodiment of the invention, the pages of the webpages of different service systems can be collected in advance; and extracting page attributes aiming at all collected pages, performing word segmentation and keyword identification on all extracted js, css and meta attributes, extracting all keywords, and setting corresponding key fields aiming at each keyword.
In this way, after the page attribute of the page to be displayed is extracted in step S110, the keyword corresponding to the key field may be extracted from the extracted page attribute for each preset key field, and if the keyword corresponding to the key field is extracted, the value of the page to be displayed on the key field is the keyword corresponding to the key field; if the keyword corresponding to the key field is not extracted, the value of the page to be displayed on the key field is represented by a specified identifier, such as "0", "none", and the like.
And forming a keyword set corresponding to the page to be displayed based on the value of the page to be displayed on each key field.
In the embodiment of the invention, the kernel selection model can comprise a preset Bayesian algorithm and pre-trained kernel selection model parameters corresponding to each browser kernel.
After generating the keyword set corresponding to the page to be displayed, selecting model parameters according to a bayesian algorithm and a kernel corresponding to the browser kernel for each browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears, and taking the probability as the matching degree between the browser kernel and the page to be displayed.
In practical application, the kernel selection model parameter corresponding to the browser kernel refers to the occurrence probability of a keyword corresponding to each key field when the browser kernel is used as a target for rendering the kernel. Can pass through P (w)i|Kj) To indicate with the jth browser kernel KjKeyword w corresponding to ith key field in key set when rendering kernel for targetiThe probability of occurrence of.
Wherein i is an integer from 1 to n, j is an integer from 1 to m, m is the total number of the browser kernels, and n is the total number of the preset key fields.
The bayesian algorithm specifically includes the following equations (1), (2) and (3).
Figure BDA0001525341370000061
Figure BDA0001525341370000062
Figure BDA0001525341370000063
Wherein, P (K)j|Wn) Representing a set of keywords WnBrowser kernel K when presentjA probability of rendering a kernel for the target; p (K)j) Represents the jth browser kernel KjThe value of the occurrence probability of (2) is 1/m.
According to formula (1), formula (2), formula (3) and browser kernel KjThe corresponding kernel selection model parameter P (w)i|Kj) The keyword set W can be calculatednBrowser kernel K when presentjProbability P (K) of rendering kernel for targetj/Wn)。
In the embodiment of the invention, based on the kernel selection model parameters corresponding to each pre-trained browser kernel, namely the occurrence probability of each keyword when each browser kernel is taken as a target rendering kernel, the occurrence probability of a keyword set when different browser kernels are taken as target rendering kernels can be respectively calculated according to the formula (3). And calculating the occurrence probability of a keyword set according to the formula (2) and the occurrence probability of each browser kernel.
Then, according to the formula (1), the occurrence probability of each browser core, the occurrence probability of the keyword set when rendering the core by taking each browser core as a target and the occurrence probability of the keyword set, the probability of rendering the core by taking different browser cores as the target when the keyword set occurs is respectively calculated.
In this way, for each browser kernel, the probability of rendering the kernel with the browser kernel as a target when the keyword set appears can be used as the matching degree between the browser kernel and the page to be displayed. And finally, selecting the browser kernel with the highest matching degree as a target rendering kernel corresponding to the page to be displayed.
S130: and rendering and displaying the page to be displayed through the target rendering kernel.
In the embodiment of the present invention, after the target rendering kernel corresponding to the page to be displayed is found in step S120, the identifier of the target rendering kernel may be obtained, the browser kernel corresponding to the identifier is found from the local or cloud kernel pool according to the identifier of the target rendering kernel, and is loaded, and the page to be displayed is rendered and displayed through the loaded browser kernel.
In the embodiment of the invention, the kernel pool of the cloud and the local kernel pool are kept synchronous. For example, when the kernel pool of the cloud is changed, for example, a newly added browser kernel or a browser kernel is updated, the newly added browser kernel and/or the updated browser in the kernel pool of the cloud are synchronized to the local kernel pool.
In the embodiment of the invention, if the browser kernel corresponding to the identifier is not found from the local kernel pool, the browser kernel in the kernel pool of the cloud can be synchronized to the local kernel pool, so that the target rendering kernel can be loaded from the local kernel pool.
According to the page display method provided by the embodiment of the invention, the page attribute is extracted from the page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and taking the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel. Therefore, the corresponding target rendering kernel can be found for the pages to be displayed from different service systems, the compatibility problem existing when a user accesses different service systems is solved, the user experience is improved, and the development cost is low.
On the basis of the above embodiment, in a page display method provided by another embodiment of the present invention, the method further includes: pre-training the kernel selection model parameter P (w) corresponding to the browser kernel according to the following modei|Kj):
From the browser kernel KjExtracting at least one page attribute from the corresponding sample page as a browser kernel KjA corresponding sample page attribute set; wherein the sample page is displayed with the browser kernel KjThe kernel is rendered for the target.
For each preset key field, extracting the key words corresponding to the key field from the sample page attribute set; if the key field is extracted, the value of the sample page on the key field is the key word corresponding to the key field; and if not, representing the value of the sample page on the key field by using a specified identifier.
For the ith key field, if the value of the sample page on the ith key field is the specified identifier, the kernel selects a model parameter P (w)i|Kj) Is 0.
If the value of the sample page on the ith key field is the key word w corresponding to the ith key fieldiThen the kernel selects the model parameter P (w)i|Kj) Comprises the following steps: the keyword w corresponding to the ith key field in the sample page attribute setiAnd the ratio of the number of occurrences of the sample page attribute set to the sum of the number of occurrences of the keywords corresponding to each key field in the sample page attribute set.
Other steps of the embodiment of the present invention are similar to those of the previous embodiment, and are not described again in the embodiment of the present invention.
According to the page display method provided by the embodiment of the invention, the kernel selection model parameters corresponding to the browser kernel are calculated based on the sample page with the browser kernel as the target rendering kernel, so that the accuracy of the adapted browser kernel can be improved, and the user experience is improved.
On the basis of the above embodiment, in a page display method provided by another embodiment of the present invention, the method further includes: and if the browser kernel is updated, according to a sample page of the kernel rendered by taking the updated browser kernel as a target, retraining the kernel selection model parameters corresponding to the browser kernel.
Considering that when the browser kernel is updated, the rendering and displaying effects of the updated browser kernel on the sample page selected when the model parameters are selected by the training kernel may also be changed.
Therefore, in order to improve the accuracy of the kernel selection model, in the embodiment of the present invention, the sample page of the rendering kernel with the updated browser kernel as the target may be reselected. And then, according to a sample page of the kernel rendered by taking the updated browser kernel as a target, retraining the kernel selection model parameters corresponding to the browser kernel.
The method for retraining the kernel selection model parameter corresponding to the browser kernel according to the sample page of the kernel rendered with the updated browser kernel as the target may adopt the training mode of the kernel selection model parameter in the above embodiment.
Other steps of the embodiment of the present invention are similar to those of the previous embodiment, and are not described again in the embodiment of the present invention.
According to the page display method provided by the embodiment of the invention, the kernel selection model parameters are updated in time, so that the effectiveness of the kernel selection model can be ensured, and the accuracy of the finally selected target rendering kernel is improved.
On the basis of the above embodiments, another embodiment of the present invention provides a page display apparatus.
Referring to fig. 2, a schematic structural diagram of a page display apparatus according to an embodiment of the present invention is shown.
As shown in fig. 2, a page display apparatus 200 according to an embodiment of the present invention may include: an attribute extraction unit 201, a kernel adaptation unit 202 and a page display unit 203.
The attribute extraction unit 201 is configured to extract a page attribute from a page to be displayed.
The kernel adaptation unit 202 is configured to find a browser kernel with a highest matching degree with the page to be displayed according to the extracted page attribute and a preset kernel selection model, and use the browser kernel as a target rendering kernel corresponding to the page to be displayed.
The page display unit 203 is configured to render and display the page to be displayed through the target rendering kernel.
In practical applications, the page display apparatus 200 provided in the embodiment of the present invention may be disposed in a browser; or the page display device 200 and the browser are independently arranged, and the page to be displayed is displayed together through the interaction between the page display device 200 and the browser. Alternatively, the units in the page display apparatus 200 may be disposed in different devices, and the display of the page to be displayed is realized through interaction between the different devices and the browser.
Optionally, the page attribute includes at least one of: java script js, cascading style sheet css, and meta attributes.
Optionally, the kernel adaptation unit 202 is specifically configured to perform keyword extraction on the extracted page attribute, and generate a keyword set corresponding to the page to be displayed according to the extracted keyword; aiming at each browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to a Bayesian algorithm preset in the kernel selection model and a kernel selection model parameter corresponding to the browser kernel, and taking the probability as the matching degree between the browser kernel and the page to be displayed; the kernel selection model parameters corresponding to the browser kernel are specifically the occurrence probability of each keyword when the browser kernel is taken as a target to render the kernel; and searching the browser kernel with the highest matching degree with the page to be displayed according to the matching degree between each browser kernel and the page to be displayed.
Optionally, the kernel adaptation unit 202 may extract, for each preset key field, a keyword corresponding to the key field from the extracted page attribute; if the key word is extracted, the value of the page to be displayed on the key field is the key word corresponding to the key field; if not, the value of the page to be displayed on the key field is represented by a designated identifier; and forming a keyword set corresponding to the page to be displayed based on the value of the page to be displayed on each key field.
Alternatively, the kernel adaptation unit 202 may be according to the following formula (1), formula (2), formula (3) and browser kernel KjThe corresponding kernel selection model parameter P (w)i|Kj) Calculate a set of keywords WnBrowser kernel K when presentjProbability P (K) of rendering kernel for targetj/Wn):
Figure BDA0001525341370000101
Figure BDA0001525341370000102
Figure BDA0001525341370000103
Wherein m is the total number of the browser kernels, and n is the total number of the key fields; p (K)j) Denotes the jth browser kernel KjThe occurrence probability of (1/m) is taken as a value; p (w)i|Kj) Denoted as the jth browser kernel KjRendering a kernel for a target, wherein the keyword w corresponding to the ith key field in the key setiI is an integer from 1 to n, and j is an integer from 1 to m.
Optionally, the page display apparatus 200 provided in the embodiment of the present invention may further include: and a parameter training unit.
And the parameter training unit is used for training the kernel selection model parameters corresponding to each browser kernel.
Specifically, the parameter training unit may pre-train the kernel selection model parameter P (w) corresponding to the browser kernel according to the following manneri|Kj):
From the browser kernel KjExtracting at least one page attribute from the corresponding sample page as a browser kernel KjA corresponding sample page attribute set; wherein the sample page is displayed with the browser kernel KjRendering a kernel for the target; for each preset key field, extracting the key words corresponding to the key field from the sample page attribute set; if the key field is extracted, the value of the sample page on the key field is the key word corresponding to the key field; if not, the value of the sample page on the key field is represented by a specified identifier; for the firsti key fields, if the value of the sample page on the ith key field is the designated identification, the kernel selects a model parameter P (w)i|Kj) Is 0; if the value of the sample page on the ith key field is the key word w corresponding to the ith key fieldiThen the kernel selects the model parameter P (w)i|Kj) Comprises the following steps: the keyword w corresponding to the ith key field in the sample page attribute setiAnd the ratio of the number of occurrences of the sample page attribute set to the sum of the number of occurrences of the keywords corresponding to each key field in the sample page attribute set.
Optionally, in the embodiment of the present invention, the parameter training unit is further configured to, if the browser kernel is updated, re-train the kernel selection model parameter corresponding to the browser kernel according to a sample page of a rendering kernel that takes the updated browser kernel as a target.
The page display device 200 provided by the embodiment of the invention extracts the page attribute from the page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel. Therefore, the corresponding target rendering kernel can be found for the pages to be displayed from different service systems, the compatibility problem existing when a user accesses different service systems is solved, the user experience is improved, and the development cost is low.
The embodiment of the page display device provided by the present invention can be specifically used for executing the processing flow of each method embodiment, and the functions thereof are not described herein again, and reference may be made to the detailed description of the method embodiments.
Referring to fig. 3, a physical structure diagram of an electronic device according to an embodiment of the present invention is shown. As shown in fig. 3, the electronic device 300 may include: a processor (processor)301, a memory (memory)302 and a bus 303, wherein the processor 301 and the memory 302 communicate with each other via the bus 303. The processor 301 may call the computer program in the memory 302 to perform the methods provided by the method embodiments described above, including for example:
extracting page attributes from a page to be displayed; according to the extracted page attribute and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and taking the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel.
In another embodiment, the page attribute includes at least one of:
java script js, cascading style sheet css, and meta attributes.
In another embodiment, the processor 301, when executing the computer program, implements the following method:
the method for searching the browser kernel with the highest matching degree with the page to be displayed according to the extracted page attribute and a preset kernel selection model comprises the following steps:
extracting keywords from the extracted page attributes, and generating a keyword set corresponding to the page to be displayed according to the extracted keywords;
aiming at each browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to a Bayesian algorithm preset in the kernel selection model and a kernel selection model parameter corresponding to the browser kernel, and taking the probability as the matching degree between the browser kernel and the page to be displayed; the kernel selection model parameters corresponding to the browser kernel are specifically the occurrence probability of each keyword when the browser kernel is taken as a target to render the kernel;
and searching the browser kernel with the highest matching degree with the page to be displayed according to the matching degree between each browser kernel and the page to be displayed.
In another embodiment, the processor 301, when executing the computer program, implements the following method:
the extracting keywords from the extracted page attributes, and generating a keyword set corresponding to the page to be displayed according to the extracted keywords include:
aiming at each preset key field, extracting the key words corresponding to the key field from the extracted page attribute; if the key field is extracted, the value of the page to be displayed on the key field is the key word corresponding to the key field; if not, the value of the page to be displayed on the key field is represented by a designated identifier;
and forming a keyword set corresponding to the page to be displayed based on the value of the page to be displayed on each key field.
In another embodiment, the processor 301, when executing the computer program, implements the following method:
the calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to the Bayesian algorithm preset in the kernel selection model and the kernel selection model parameters corresponding to the browser kernels respectively comprises the following steps:
selecting model parameters P (w) according to the following formula (1), formula (2), formula (3) and corresponding kernels of the browser kernelsi|Kj) Calculate a set of keywords WnBrowser kernel K when presentjProbability P (K) of rendering kernel for targetj/Wn):
Figure BDA0001525341370000131
Figure BDA0001525341370000132
Figure BDA0001525341370000133
Wherein m is the total number of the browser kernels, and n is the total number of the key fields; p (K)j) Denotes the jth browser kernel KjThe occurrence probability of (1/m) is taken as a value; p (w)i|Kj) Denoted as the jth browser kernel KjRendering a kernel for a target, wherein the keyword w corresponding to the ith key field in the key setiI is an integer from 1 to n, and j is an integer from 1 to m.
In another embodiment, the processor 301, when executing the computer program, implements the following method:
the method further comprises the following steps:
pre-training the kernel selection model parameter P (w) corresponding to the browser kernel according to the following modei|Kj):
From the browser kernel KjExtracting at least one page attribute from the corresponding sample page as a browser kernel KjA corresponding sample page attribute set; wherein the sample page is displayed with the browser kernel KjRendering the kernel for the target;
for each preset key field, extracting the key words corresponding to the key field from the sample page attribute set; if the key field is extracted, the value of the sample page on the key field is the key word corresponding to the key field; if not, the value of the sample page on the key field is represented by a specified identifier;
for the ith key field, if the value of the sample page on the ith key field is the designated identifier, the kernel selects a model parameter P (w)i|Kj) Is 0;
if the value of the sample page on the ith key field is the key word w corresponding to the ith key fieldiThen the kernel selects the model parameter P (w)i|Kj) Comprises the following steps: the keyword w corresponding to the ith key field in the sample page attribute setiAnd the ratio of the number of occurrences of the sample page attribute set to the sum of the number of occurrences of the keywords corresponding to each key field in the sample page attribute set.
In another embodiment, the processor 301, when executing the computer program, implements the following method:
the method further comprises the following steps:
and if the browser kernel is updated, according to a sample page of the kernel rendered by taking the updated browser kernel as a target, retraining the kernel selection model parameters corresponding to the browser kernel.
The electronic equipment provided by the embodiment of the invention at least has the following technical effects: extracting page attributes from a page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed; and displaying the page to be displayed through the target rendering kernel. Therefore, for the pages to be displayed and rendered from different service systems, the corresponding target rendering kernel can be found, the compatibility problem existing when a user accesses different service systems is solved, the user experience is improved, and the development cost is low.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes:
extracting page attributes from a page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel.
An embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores a computer program, where the computer program causes the computer to execute the method provided by the foregoing method embodiments, for example, the method includes:
extracting page attributes from a page to be displayed; according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed; and rendering and displaying the page to be displayed through the target rendering kernel.
In addition, the logic instructions in the memory may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A page display method, comprising:
extracting page attributes from a page to be displayed;
according to the extracted page attributes and a preset kernel selection model, finding out a browser kernel with the highest matching degree with the page to be displayed, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed;
rendering and displaying the page to be displayed through the target rendering kernel;
the method for searching the browser kernel with the highest matching degree with the page to be displayed according to the extracted page attribute and a preset kernel selection model comprises the following steps:
extracting keywords from the extracted page attributes, and generating a keyword set corresponding to the page to be displayed according to the extracted keywords;
aiming at each browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to a Bayesian algorithm preset in the kernel selection model and a kernel selection model parameter corresponding to the browser kernel, and taking the probability as the matching degree between the browser kernel and the page to be displayed; the kernel selection model parameters corresponding to the browser kernel are specifically the occurrence probability of each keyword when the browser kernel is taken as a target to render the kernel;
according to the matching degree between each browser kernel and the page to be displayed, searching out the browser kernel with the highest matching degree with the page to be displayed;
the calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to the Bayesian algorithm preset in the kernel selection model and the kernel selection model parameters corresponding to the browser kernels respectively comprises the following steps:
selecting model parameters P (w) according to the following formula (1), formula (2), formula (3) and corresponding kernels of the browser kernelsi|Kj) Calculate a set of keywords WnBrowser kernel when present KjProbability P (K) of rendering kernel for targetj/Wn):
Figure FDA0003560612890000011
Figure FDA0003560612890000012
Figure FDA0003560612890000013
Wherein m is the total number of the browser kernels, and n is the total number of the key fields; p (K)j) Denotes the jth browser kernel KjThe occurrence probability of (1/m) is taken as a value; p (w)i|Kj) Denoted as the jth browser kernel KjRendering a kernel for a target, wherein the keyword w corresponding to the ith key field in the key setiI is an integer from 1 to n, and j is an integer from 1 to m;
the method further comprises the following steps:
pre-training the kernel selection model parameter P (w) corresponding to the browser kernel according to the following modei|Kj):
From the browser kernel KjAt least one page attribute is extracted from the corresponding sample page,as a browser kernel KjA corresponding sample page attribute set; wherein the sample page is displayed with the browser kernel KjRendering the kernel for the target;
for each preset key field, extracting the key words corresponding to the key field from the sample page attribute set; if the key field is extracted, the value of the sample page on the key field is the key word corresponding to the key field; if not, the value of the sample page on the key field is represented by a specified identifier;
for the ith key field, if the value of the sample page on the ith key field is the designated identifier, the kernel selects a model parameter P (w)i|Kj) Is 0;
if the value of the sample page on the ith key field is the key word w corresponding to the ith key fieldiThen the kernel selects the model parameter P (w)i|Kj) Comprises the following steps: the keyword w corresponding to the ith key field in the sample page attribute setiAnd the ratio of the number of occurrences of the sample page attribute set to the sum of the number of occurrences of the keywords corresponding to each key field in the sample page attribute set.
2. The method of claim 1, wherein the page attributes comprise at least one of:
java script js, cascading style sheet css, and meta attributes.
3. The method according to claim 1, wherein the extracting keywords from the extracted page attributes, and generating a keyword set corresponding to the page to be displayed according to the extracted keywords comprises:
aiming at each preset key field, extracting the key words corresponding to the key field from the extracted page attribute; if the key field is extracted, the value of the page to be displayed on the key field is the key word corresponding to the key field; if not, the value of the page to be displayed on the key field is represented by a designated identifier;
and forming a keyword set corresponding to the page to be displayed based on the value of the page to be displayed on each key field.
4. The method of claim 1, further comprising:
and if the browser kernel is updated, according to a sample page of the kernel rendered by taking the updated browser kernel as a target, retraining the kernel selection model parameters corresponding to the browser kernel.
5. A page display apparatus, comprising:
the attribute extraction unit is used for extracting page attributes from the page to be displayed;
the kernel adaptation unit is used for searching out a browser kernel with the highest matching degree with the page to be displayed according to the extracted page attribute and a preset kernel selection model, and using the browser kernel as a target rendering kernel corresponding to the page to be displayed;
the page display unit is used for rendering and displaying the page to be displayed through the target rendering kernel;
the kernel adaptation unit is specifically configured to:
extracting keywords from the extracted page attributes, and generating a keyword set corresponding to the page to be displayed according to the extracted keywords;
aiming at each browser kernel, calculating the probability of rendering the kernel by taking the browser kernel as a target when the keyword set appears according to a Bayesian algorithm preset in the kernel selection model and a kernel selection model parameter corresponding to the browser kernel, and taking the probability as the matching degree between the browser kernel and the page to be displayed; the kernel selection model parameters corresponding to the browser kernel specifically refer to the occurrence probability of each keyword when the browser kernel is used as a target to render the kernel;
according to the matching degree between each browser kernel and the page to be displayed, searching the browser kernel with the highest matching degree between the browser kernel and the page to be displayed;
selecting model parameters P (w) according to the following formula (1), formula (2), formula (3) and corresponding kernels of the browser kernelsi|Kj) Calculate a set of keywords WnBrowser kernel K when presentjProbability P (K) of rendering kernel for targetj/Wn):
Figure FDA0003560612890000031
Figure FDA0003560612890000041
Figure FDA0003560612890000042
Wherein m is the total number of the browser kernels, and n is the total number of the key fields; p (K)j) Denotes the jth browser kernel KjThe occurrence probability of (1/m) is taken as a value; p (w)i|Kj) Denoted as the jth browser kernel KjRendering a kernel for a target, wherein the keyword w corresponding to the ith key field in the key setiI is an integer from 1 to n, and j is an integer from 1 to m;
the page display device further comprises a parameter training unit for:
pre-training the kernel selection model parameter P (w) corresponding to the browser kernel according to the following modei|Kj):
From the browser Kernel KjExtracting at least one page attribute from the corresponding sample page as a browser kernel KjA corresponding sample page attribute set; wherein the sample page is displayed with the browser kernel KjRendering the kernel for the target;
for each preset key field, extracting the key words corresponding to the key field from the sample page attribute set; if the key field is extracted, the value of the sample page on the key field is the key word corresponding to the key field; if not, the value of the sample page on the key field is represented by a specified identifier;
for the ith key field, if the value of the sample page on the ith key field is the designated identifier, the kernel selects a model parameter P (w)i|Kj) Is 0;
if the value of the sample page on the ith key field is the key word w corresponding to the ith key fieldiThen the kernel selects the model parameter P (w)i|Kj) Comprises the following steps: the keyword w corresponding to the ith key field in the sample page attribute setiAnd the ratio of the number of occurrences of the sample page attribute set to the sum of the number of occurrences of the keywords corresponding to each key field in the sample page attribute set.
6. An electronic device comprising a processor, a memory, and a bus, wherein:
the processor and the memory complete mutual communication through a bus;
the processor may invoke a computer program in memory to perform the steps of the method of any of claims 1-4.
7. 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 according to any one of claims 1 to 4.
CN201711433243.4A 2017-12-26 2017-12-26 Page display method and device Active CN109960531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711433243.4A CN109960531B (en) 2017-12-26 2017-12-26 Page display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711433243.4A CN109960531B (en) 2017-12-26 2017-12-26 Page display method and device

Publications (2)

Publication Number Publication Date
CN109960531A CN109960531A (en) 2019-07-02
CN109960531B true CN109960531B (en) 2022-06-14

Family

ID=67022200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711433243.4A Active CN109960531B (en) 2017-12-26 2017-12-26 Page display method and device

Country Status (1)

Country Link
CN (1) CN109960531B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559097A (en) * 2013-10-18 2014-02-05 北京奇虎科技有限公司 Inter-process communication method and device in browser and browser
CN105677844A (en) * 2016-01-06 2016-06-15 北京摩比万思科技有限公司 Mobile advertisement big data directional pushing and user cross-screen recognition method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248514A1 (en) * 2008-04-01 2009-10-01 Yahoo! Inc. System and method for detecting the sensitivity of web page content for serving advertisements in online advertising
CN102385594B (en) * 2010-08-31 2015-09-30 腾讯科技(深圳)有限公司 The kernel control method of multi-core browser and device
CN103164423B (en) * 2011-12-09 2017-11-03 百度在线网络技术(北京)有限公司 A kind of method and apparatus for being used to determine to render the browser kernel type of webpage
US20140109072A1 (en) * 2012-10-16 2014-04-17 Citrix Systems, Inc. Application wrapping for application management framework
CN104462571A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Webpage loading method and device and browser client-side
CN106354484A (en) * 2015-07-16 2017-01-25 中兴通讯股份有限公司 Browser compatibility method and browser

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559097A (en) * 2013-10-18 2014-02-05 北京奇虎科技有限公司 Inter-process communication method and device in browser and browser
CN105677844A (en) * 2016-01-06 2016-06-15 北京摩比万思科技有限公司 Mobile advertisement big data directional pushing and user cross-screen recognition method

Also Published As

Publication number Publication date
CN109960531A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
US11449570B2 (en) Data caching method and apparatus
US10146750B2 (en) Method, apparatus, terminal, and storage medium for image processing
WO2015062527A1 (en) Webpage advertisement interception method, device, and browser
KR20190039230A (en) Method and system for server-side rendering of native content for presentations
CN108090351B (en) Method and apparatus for processing request message
US20130097522A1 (en) Method and system of generating composite web page elements with an annotating proxy server
CN105205080B (en) Redundant file method for cleaning, device and system
WO2019212728A1 (en) Displaying a subset of menu items based on a prediction of the next user-actions
CN105550206B (en) The edition control method and device of structured query sentence
CN106897251A (en) Rich text methods of exhibiting and device
TWI584149B (en) Web page access request response method and device
US9449114B2 (en) Removing non-substantive content from a web page by removing its text-sparse nodes and removing high-frequency sentences of its text-dense nodes using sentence hash value frequency across a web page collection
US9892100B2 (en) Verifying content of resources in markup language documents
CN103399693A (en) Method and system for relocating menus after overall refreshment of single page
US20180225378A1 (en) Boosting ranking of content within a topic of interest
CN110659301B (en) Method and system for native application content verification
US10621261B2 (en) Matching a comment to a section of a content item based upon a score for the section
US10810273B2 (en) Auto identification and mapping of functional attributes from visual representation
US20130073944A1 (en) Method and system for dynamically providing contextually relevant posts on an article
CN109960531B (en) Page display method and device
CN107784054B (en) Page publishing method and device
US20160321259A1 (en) Network insights
JP2024507029A (en) Web page identification methods, devices, electronic devices, media and computer programs
AU2015289886B2 (en) Entity recognition for enhanced document productivity
CN106033405B (en) Network book catalog integrity detection 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
CP01 Change in the name or title of a patent holder

Address after: No. 19, Jiefang East Road, Hangzhou, Zhejiang Province, 310016

Patentee after: CHINA MOBILE GROUP ZHEJIANG Co.,Ltd.

Patentee after: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

Address before: No. 19, Jiefang East Road, Hangzhou, Zhejiang Province, 310016

Patentee before: CHINA MOBILE GROUP ZHEJIANG Co.,Ltd.

Patentee before: CHINA MOBILE COMMUNICATIONS Corp.

CP01 Change in the name or title of a patent holder
TR01 Transfer of patent right

Effective date of registration: 20231226

Address after: No. 19, Jiefang East Road, Hangzhou, Zhejiang Province, 310016

Patentee after: CHINA MOBILE GROUP ZHEJIANG Co.,Ltd.

Patentee after: China Mobile (Zhejiang) Innovation Research Institute Co.,Ltd.

Patentee after: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

Address before: No. 19, Jiefang East Road, Hangzhou, Zhejiang Province, 310016

Patentee before: CHINA MOBILE GROUP ZHEJIANG Co.,Ltd.

Patentee before: CHINA MOBILE COMMUNICATIONS GROUP Co.,Ltd.

TR01 Transfer of patent right