CN110489679B - Browser kernel processing method and device and storage medium - Google Patents

Browser kernel processing method and device and storage medium Download PDF

Info

Publication number
CN110489679B
CN110489679B CN201810444901.8A CN201810444901A CN110489679B CN 110489679 B CN110489679 B CN 110489679B CN 201810444901 A CN201810444901 A CN 201810444901A CN 110489679 B CN110489679 B CN 110489679B
Authority
CN
China
Prior art keywords
party
kernel
browser kernel
information
loading
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
CN201810444901.8A
Other languages
Chinese (zh)
Other versions
CN110489679A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810444901.8A priority Critical patent/CN110489679B/en
Publication of CN110489679A publication Critical patent/CN110489679A/en
Application granted granted Critical
Publication of CN110489679B publication Critical patent/CN110489679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a method, a device and a storage medium for processing a browser kernel, wherein a target component is operated when a webpage request instruction is detected; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third-party interface information in the kernel loading module; according to the method, compared with the existing scheme of loading the webpage by default using the system browser kernel, the scheme has the advantages that the third-party interface information in the operating system is directly called through the target component when the webpage request instruction is detected, and the third-party browser kernel is called according to the third-party interface information to load the webpage, so that the convenience and the flexibility of the browser kernel processing are greatly improved.

Description

Browser kernel processing method and device and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a browser kernel processing method, a browser kernel processing device and a storage medium.
Background
With the continuous popularization and development of terminals, users increasingly rely on the terminals, and various applications can be installed on the terminals, wherein in order to enrich the expression forms of the applications, world Wide Web (Web) pages are built in many applications.
In the prior art, a system browser kernel is installed in an operating system of a terminal, and the system browser kernel is called to render and display a Web page when the Web page is opened.
In the research and practice process of the prior art, the inventor of the present invention finds that, in the prior art, when a Web page is opened in a certain application, a system browser kernel is defaulted to be used for rendering the Web page, and if a third-party browser kernel is required to be used for checking the Web page for rendering, the third-party browser kernel is required to be manually invoked, so that the process is complicated, and when other applications are used for opening the Web page, the system browser kernel is still defaulted to be used for rendering, so that the processing flexibility is poor.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing a browser kernel and a storage medium, and aims to improve the convenience and the flexibility of the processing of the browser kernel.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
a method for processing a browser kernel comprises the following steps:
when a webpage request instruction is detected, operating a target component;
calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel;
analyzing the kernel loading module to select third party interface information in the kernel loading module;
and calling a third-party browser kernel according to the third-party interface information, and loading a webpage through the third-party browser kernel.
A processing device of a browser core, comprising:
the running unit is used for running the target component when the webpage request instruction is detected;
the calling unit is used for calling a kernel loading module through the target component, and the kernel loading module is used for loading a browser kernel;
the first selection unit is used for analyzing the kernel loading module to select the third party interface information in the kernel loading module;
and the loading unit is used for calling a third-party browser kernel according to the third-party interface information and loading a webpage through the third-party browser kernel.
In some embodiments, the processing apparatus further comprises a mounting unit and an adding unit:
the installation unit is used for installing a third party installation package into a preset directory of the operating system, wherein the third party installation package comprises a third party browser kernel;
and the adding unit is used for adding third-party interface information in the kernel loading module and pointing the pointer information of the target component to the third-party interface information.
In some embodiments, the processing apparatus further includes a second obtaining unit, a determining unit, and a second selecting unit:
the second acquisition unit is used for detecting an application program associated with the webpage request instruction, acquiring an application identifier corresponding to the application program, and acquiring local record information, wherein the local record information comprises a first association relation between the application identifier and a system browser kernel or a third-party browser kernel;
the judging unit is used for judging whether the browser kernel corresponding to the application identifier is a third-party browser kernel or not according to the local recording information;
the first selecting unit is further configured to, when it is determined that the browser kernel corresponding to the application identifier is a third-party browser kernel, perform analysis on the kernel loading module to select third-party interface information in the kernel loading module;
and the second selection unit is used for analyzing the kernel loading module to select the system interface information in the kernel loading module, calling the system browser kernel according to the system interface information and loading a webpage through the system browser kernel when the browser kernel corresponding to the application identifier is judged not to be the third-party browser kernel.
In some embodiments, the processing apparatus further includes a receiving unit and an updating unit:
the receiving unit is used for receiving record information sent by the server, wherein the record information comprises a second incidence relation between the application identifier and a system browser kernel or a third-party browser kernel;
and the updating unit is used for updating the local recording information according to the recording information.
In some embodiments, the update unit is specifically configured to:
acquiring a second association relation between the application identifier in the record information and a system browser kernel or a third-party browser kernel;
and replacing the first association relationship between the application identifier in the local record information and the system browser kernel or the third-party browser kernel with a second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel.
A storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the processing method of the browser kernel.
The embodiment of the invention operates the target component when detecting the webpage request instruction; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select the third party interface information in the kernel loading module; according to the method, compared with the existing scheme of loading the webpage by default using the system browser kernel, the scheme has the advantages that the third-party interface information in the operating system is directly called through the target component when the webpage request instruction is detected, and the third-party browser kernel is called according to the third-party interface information to load the webpage, so that the convenience and the flexibility of the browser kernel processing are greatly improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a processing system of a browser kernel according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a processing method of a browser kernel according to an embodiment of the present invention;
fig. 3 is another schematic flowchart of a processing method of a browser kernel according to an embodiment of the present invention;
FIG. 4a is a schematic diagram of processing modules of a browser kernel provided by an embodiment of the present invention;
FIG. 4b is another schematic diagram of a processing module of a browser core according to an embodiment of the present invention;
FIG. 5a is a schematic structural diagram of a processing device of a browser core according to an embodiment of the present invention;
FIG. 5b is a schematic structural diagram of a processing apparatus of a browser core according to an embodiment of the present invention;
FIG. 5c is a schematic structural diagram of a processing device of a browser core according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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.
The embodiment of the invention provides a method and a device for processing a browser kernel and a storage medium.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a processing system of a browser kernel according to an embodiment of the present invention, including: the terminal a, the terminal B and the server (the processing system may also include other terminals besides the terminal a and the terminal B, the specific number of the terminals is not limited here), the terminal a and the server and the terminal B and the server may be connected through a communication network, which may include a wireless network and a wired network, wherein the wireless network includes one or more combinations of a wireless wide area network, a wireless local area network, a wireless metropolitan area network and a wireless personal area network. The network includes network entities such as routers, gateways, etc., which are not shown in the figure. The terminal A and the terminal B can receive a third party installation package, record information and the like sent by the server through a communication network, wherein the third party installation package comprises a third party browser kernel, and the record information comprises a second association relation between an application identifier and a system browser kernel or the third party browser kernel.
The processing system of the browser kernel may include a processing device of the browser kernel, and the processing device of the browser kernel may be specifically integrated in a terminal having a computing capability and provided with a storage unit and a microprocessor, such as a tablet computer, a mobile phone, a notebook computer, a desktop computer, and the like, in fig. 1, the terminal is a terminal a and a terminal B in fig. 1, and various applications required by a user, such as a browser application having a web page browsing function, may be installed in the terminal a and the terminal B. The terminal A and the terminal B can install the installation package in a specified directory of an operating system by receiving the installation package which is sent by the server and contains the kernel of the third-party browser, and add third-party interface information in the kernel loading module by adaptively adjusting the kernel loading module, wherein the third-party interface information is used for executing and calling the kernel of the third-party browser. After the installation package is installed in the operating system, when a webpage request instruction is detected, the terminal A and the terminal B run a target component, and a kernel loading module is called through the target component. And analyzing the kernel loading module to select the newly added third party interface information, calling a third party browser kernel according to the third party interface information, and loading a webpage through the third party browser kernel.
The processing system of the browser kernel can further comprise a server, and the server is mainly used for storing a third party installation package and record information and sending the third party installation package and the record information to the terminal, and developers can modify the third party installation package and the record information in the server.
It should be noted that the scenario diagram of the processing system of the browser kernel shown in fig. 1 is merely an example, and the processing system of the browser kernel and the scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention.
The following are detailed below. The numbers in the following examples are not intended to limit the order of preference of the examples.
The first embodiment,
In the present embodiment, the description will be made from the perspective of a processing device of a browser core, which may be integrated in a terminal having computing capability, such as a tablet computer, a mobile phone, and the like, which has a storage unit and is equipped with a microprocessor.
A method for processing a browser kernel comprises the following steps: when a webpage request instruction is detected, operating a target component; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third-party interface information in the kernel loading module; and calling a third-party browser kernel according to the third-party interface information, and loading the webpage through the third-party browser kernel.
Referring to fig. 2, fig. 2 is a flowchart illustrating a processing method of a browser kernel according to an embodiment of the present invention. The browser kernel processing method comprises the following steps:
in step 101, when a web page request instruction is detected, a target component is executed.
It should be noted that, a System browser kernel is installed in an Operating System (OS) of the terminal, for example, the System browser kernel of an apple mobile Operating System (iOS) is a Webkit kernel, and when a web page is opened, the System browser kernel in the Operating System is generally called by default, although the System browser kernel can provide basic typesetting and rendering capabilities, some performance optimization or customization requirements cannot be met, and only by introducing a third-party browser kernel component externally, and only for an application program currently introduced, all application programs in the terminal cannot be covered.
In order to enrich the expression forms and functions of the application programs, web pages such as shopping application programs are built in a plurality of application programs in the terminal, and when a user uses an application program to trigger a certain web page, a web page request instruction is generated correspondingly.
Further, the target component provides a component for opening a web page for an operating system of the terminal, and is a component used for displaying web page content in the operating system.
Accordingly, when a web page request instruction is detected, the terminal may execute a target component for displaying web page content.
In some embodiments, before the step of running the target component, the method may further include:
(1) Installing a third party installation package into a preset directory of the operating system;
(2) And adding third-party interface information in the kernel loading module, and pointing the pointer information of the target component to the third-party interface information.
The third-party installation package comprises a third-party browser kernel, the function of the third-party browser kernel is similar to that of the system browser kernel, but the rendering effect which can not be realized by some system browsers can be realized. The third party browser kernel is provided by a third party developer, such as the Presto kernel, the X5 kernel, and so on. The terminal can download the third party installation package in the server for installation, and in the installation process of the third party installation package, the third party installation files and the third party browser kernel can be installed in a preset directory of the operating system, so that the third party installation files can be conveniently and quickly found through the preset target. And adding third party Interface information to the kernel loading module, wherein the third party Interface information is an Application Programming Interface (API) for calling a third party browser kernel, and the API is a predefined function for providing the capability of an Application program and a developer to access a set of routines based on certain software or hardware without accessing source codes or understanding details of an internal working mechanism. And pointing the pointer information of the target component to the third party interface information so that the third party interface information is taken as default interface information.
In step 102, the kernel load module is invoked by the target component.
The kernel loading module is used for loading a browser kernel, in a general scene, the kernel loading module comprises interface information, namely system interface information, and the system browser kernel can be directly called through the system interface information. Due to the high-speed development of the third-party browser kernel, the loading speed, the safety and the stability of the third-party browser kernel exceed those of the system browser kernel. Therefore, a user often wants to load a webpage through a third-party browser kernel, when the user needs to load the webpage by using a third-party browser interface, the third-party browser kernel needs to be manually introduced to achieve the loading, the operation is complex, the third-party browser kernel is introduced to a certain target application program to load the webpage of the target application program, when other application programs load the webpage, the webpage is still loaded by calling a system browser interface, and the processing flexibility is poor.
In this embodiment, the third-party browser kernel is issued to a terminal manufacturer or an operating system manufacturer in an independent manner, third-party interface information is added to the kernel loading module, the interface information of the target component calling the kernel loading module is changed into the third-party interface information, the calling package name in the kernel loading module is correspondingly changed into the third-party browser kernel package name, and the interface implementation class name in the third-party interface information is also correspondingly changed into the third-party browser kernel implementation class name.
Based on the method, the kernel loading module in the operating system is called through the running target component, and the pointer of the target component directly points to the newly added third party interface information in the kernel loading module instead of the system interface information in the kernel loading module.
In step 103, the kernel loading module is analyzed to select the third party interface information in the kernel loading module.
The operating system of the terminal analyzes the kernel loading module, determines the interface information in the kernel recording module pointed by the pointer of the target component, and directly selects the third-party interface information in the kernel loading module instead of the system interface information in the common scene because the pointer of the current target component points to the newly-added third-party interface information in the kernel loading module.
In some embodiments, before the step of analyzing the kernel loading module to select the third party interface information in the kernel loading module, the method may further include:
(1) Detecting an application program associated with a webpage request instruction, acquiring an application identifier corresponding to the application program, and acquiring local record information;
(2) Judging whether the browser kernel corresponding to the application identifier is a third-party browser kernel or not according to the local recording information;
(3) Executing a step of analyzing the kernel loading module to select third party interface information in the kernel loading module;
(4) And analyzing the kernel loading module to select the system interface information in the kernel loading module, calling a system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
In some embodiments, before the step of detecting an application program associated with the web page request instruction, acquiring an application identifier corresponding to the application program, and acquiring local record information, the method may further include:
(1.1) receiving record information sent by a server, wherein the record information comprises a second association relation between an application identifier and a system browser kernel or a third-party browser kernel;
and (1.2) updating the local record information according to the record information.
The terminal can receive the recording information sent by the server in real time through the network, and update the local recording information through the received recording information, so that the cloud server can issue the use of the browser kernel in the switch control terminal.
In some embodiments, the step of updating the local recording information according to the recording information may include:
(2.1) acquiring a second association relation between the application identifier in the record information and a system browser kernel or a third-party browser kernel;
and (2.2) replacing the first incidence relation between the application identifier in the local record information and the system browser kernel or the third-party browser kernel with a second incidence relation between the application identifier in the record information and the system browser kernel or the third-party browser kernel.
After receiving the record information, the terminal acquires a second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel, and replaces the first association relationship between the application identifier in the local record information, which is the same as the record information, and the system browser kernel or the third-party browser kernel with the second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel. Therefore, the cloud server can control the use of the browser kernel in the terminal.
In step 104, a third-party browser kernel is called according to the third-party interface information, and a web page is loaded through the third-party browser kernel.
It should be noted that the browser kernel (Rendering Engine) may also be referred to as a composition Engine, an interpretation Engine, and a Rendering Engine, and as the name implies, is used for Rendering web page content and converting the code of the web page into a final viewable page. The rendering (display) effect of different kernels is also different.
The third-party interface information is called, the third-party interface information can directly execute initialization of a third-party browser kernel and call of the third-party browser kernel, syntax interpretation is conducted on codes of the webpage in the webpage request instruction through the third-party browser kernel, and the webpage after the syntax interpretation is rendered, so that the effect of loading the webpage through the rendering effect of the third-party browser kernel is achieved.
In some embodiments, the step of calling a third-party browser kernel according to the third-party interface information and loading the web page through the third-party browser kernel may include:
(1) Loading a first execution file in the third-party browser kernel according to the third-party interface information so as to read the configuration file information in the third-party browser kernel;
(2) Loading a second execution file in the third-party browser kernel according to the third-party interface information so as to load resource file information in the third-party browser kernel;
(3) And loading the webpage through the configuration file information and the resource file information.
The first execution file can be a dex file in a kernel of a third-party browser, the dex file is an executable file on an operating system platform, source codes of the kernel of the third-party browser are contained in the dex file, corresponding source codes can be obtained through a decompilation tool, the kernel of the third-party browser can be initialized by loading the first execution file, configuration file information in the kernel of the third-party browser is read, and the configuration file information is a set of settings and files required by loading a webpage environment.
Further, the second execution file may be a so file in a kernel of the third-party browser, where the so file is a binary file, and is similar to a dynamic link library file, the kernel of the third-party browser may be called by loading the second execution file, and resource file information in the kernel of the third-party browser is loaded, where the resource file includes a bitmap, a character string, and other data that may be changed without re-editing a code.
And analyzing the hypertext markup language in the webpage through the configuration file information and the resource file information, laying out and drawing the analyzed webpage, and finally carrying out composite layering to realize the display of the webpage.
In some embodiments, the step of loading the web page by the configuration file information and the resource file information may include:
(1.1) syntactically interpreting the web page through the profile information;
and (1.2) rendering the webpage after the syntax interpretation through the resource file information, and displaying the webpage.
The configuration file information may be used to perform grammatical interpretation on a hypertext Markup Language (HTML) in a web page, parse the HTML into code information that can be recognized by an operating system, and represent the parsed code information by using a Cascading Style Sheets (CSS).
Further, the webpage after the syntax interpretation is subjected to page layout, rendering and composite layer synthesis through the resource file information, and the webpage is displayed.
In some embodiments, before the step of integrating the third-party browser kernel in the third-party installation package, calling the third-party browser kernel according to the third-party interface information, and loading the web page through the third-party browser kernel, the method may further include:
(2.1) acquiring the state information of the third party installation package;
(2.2) detecting whether the state information is in an installation completion state;
(2.3) executing a step of calling a third-party browser kernel according to the third-party interface information;
and (2.4) switching the third party interface information selected in the kernel loading module into system interface information, calling a system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
The third-party browser kernel is integrated in the third-party installation package, that is, the third-party installation package is installed in the operating system, so that the third-party browser kernel can be loaded into the operating system.
In an actual using process, after the third-party browser kernel is unloaded, the third-party browser kernel is also deleted correspondingly, at this time, the operating system cannot call the third-party browser kernel through the third-party interface information, and a situation that a webpage cannot be opened occurs.
Therefore, when the third-party browser kernel is called according to the third-party interface information, state information of the third-party installation package needs to be acquired first, and the state information includes an installation completion state or an installation incompletion state. And detecting whether the state information is in an installation completion state, and executing the step (2.3) when the state information is detected to be in the installation completion state. When it is detected that the status information is not the installation completion status, step (2.4) is performed.
When the state information is detected to be the installation completion state, the third party installation package is indicated to be installed in the operating system, and the step of calling the third party browser kernel according to the third party interface information can be directly executed.
When the state information is detected not to be in the installation completion state, it is indicated that the third-party installation package is uninstalled and cannot be called to the kernel of the third-party browser through the third-party interface information, at this time, in order that the webpage can be normally displayed, the third-party interface information selected in the kernel loading module can be switched to system interface information, the kernel of the system browser is called according to the system interface information, and the webpage is loaded through the kernel of the system browser.
In some embodiments, after the step of loading the web page by using the third-party browser kernel, when it is detected that the third-party browser kernel fails to be loaded, switching the third-party interface information selected in the kernel loading module to system interface information, calling a system browser kernel according to the system interface information, and loading the web page by using the system browser kernel.
Due to some special scenes, such as file loss or environment configuration, the loading of the third-party browser kernel fails, and at this time, the webpage cannot be normally displayed.
Therefore, when the loading failure of the third-party browser kernel is detected, the third-party interface information selected in the kernel loading module is switched to the system interface information, the system browser kernel is called according to the system interface information, and the webpage is loaded through the system browser kernel.
In an embodiment, when the third-party browser kernel fails to be loaded, a piece of prompt information may be displayed, where the prompt information is used to prompt a user that the third-party browser kernel is abnormal, and the user may reload the third-party browser kernel or repair the abnormality according to the prompt information.
As can be seen from the above, the embodiment of the present invention operates the target component by detecting the web page request instruction; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third-party interface information in the kernel loading module; according to the scheme, when a webpage request instruction is detected, the third party interface information in the operating system is directly called through the target component, and the third party browser kernel is called according to the third party interface information to load the webpage, so that the convenience and the flexibility of the processing of the browser kernel are greatly improved.
Example II,
The method described in the first embodiment is further illustrated by way of example.
In this embodiment, a description will be given taking an example in which the processing device of the browser core is specifically integrated in a terminal.
Referring to fig. 3, fig. 3 is another flow chart illustrating a processing method of a browser kernel according to an embodiment of the present invention. The method flow can comprise the following steps:
in step 201, the terminal installs the third party installation package into a preset directory of the operating system.
It should be noted that, as shown in fig. 4a, a system browser kernel is installed in an operating system of a terminal, the system browser kernel is integrated in a system installation package (Google WebView. Apk), when a user opens a web page therein by using an application (App), a target component (WebView component) is run, and a kernel loading module (WebCore Loader) is called by the WebView component, the kernel loading module (WebCore Loader) includes system interface information (system kernel interface layer), when the WebView component calls the kernel loading module (WebCore Loader), the system interface information in the kernel loading module (WebCore Loader) is pointed, so that the system browser kernel in the system installation package (Google view. Apk) can be called according to the system interface information, and the system browser kernel is loaded by the system browser kernel.
Although basic typesetting and rendering capabilities of a webpage can be provided through a system browser kernel, some performance optimization or customization requirements cannot be realized, the webpage can be loaded only by externally introducing a third-party browser kernel component, and only aiming at the currently introduced application program, when the webpage is opened by other application programs, the webpage is still automatically loaded by the system browser kernel, so that the flexibility is poor.
The third-party installation package comprises a third-party browser kernel, and the third-party browser kernel can achieve rendering and typesetting effects which cannot be achieved by the system browser kernel. The third party installation package is provided by a third party developer. The terminal can download the third party installation package from the cloud server, and install the third party installation package into a preset directory folder of the operating system, so that the operating system can directly find the third party installation package and the third party installation files through the preset directory folder conveniently.
In step 202, the terminal adds third-party interface information to the kernel loading module, and points the pointer information of the target component to the third-party interface information.
The method comprises the steps that a kernel loading module is adjusted in the process of installing the third-party installation package, specifically, third-party interface information (a third-party kernel interface layer) is added on the basis of keeping system interface information, a pointer of a target component points to the newly-added third-party interface information, the name of a called installation package is modified to be the name of the third-party installation package, and the name of an implementation class in the third-party interface information is modified to be the name of the implementation class of a third-party browser kernel, so that the third-party browser kernel is automatically used as a priority loading kernel instead of the system browser kernel.
For example, as shown in fig. 4b, after the third-party browser kernel (X5 kernel) is installed in the operating system in the form of a third-party installation package (X5 installation package), the system browser kernel is integrated in the system installation package (Google webview.apk), and the X5 kernel (third-party browser kernel) is integrated in the X5 installation package (x5webview.apk), that is, the operating system currently possesses two browser kernels, namely, the system browser kernel and the X5 kernel. The method is characterized in that a kernel loading module (WebCore Loader) is correspondingly changed into an X5 kernel loading module (X5 WebCore Loader), the difference is that third party interface information (a third party kernel interface layer, namely an X5 kernel interface layer) is added in the X5WebCore Loader, a system kernel interface layer of an original WebView component calling kernel loading module is replaced by the X5 kernel interface layer (namely pointer information of a target component points to the third party interface information), and the X5 kernel interface layer supplements an X5 specific interface layer on the basis of reserving functions of the system kernel interface layer.
Further, modifying the logic for obtaining the kernel interface layer to obtain the X5 kernel interface layer, including modifying the called package name to the X5 kernel package name, modifying the package signature to the X5 kernel package signature, and modifying the interface implementation class name to the X5 kernel implementation class name. Therefore, the X5 kernel in the X5 installation package (X5WebView. Apk) can be called preferentially according to the X5 kernel interface layer, and the function of calling the system browser kernel in the system installation package (Google WebView. Apk) according to the system interface information is also reserved.
In step 203, when the terminal detects a web page request instruction, the target component is executed.
When the terminal detects that a user opens a certain webpage through an application program, a webpage request instruction is generated, and the target component is operated.
In step 204, the terminal calls the kernel loading module through the target component.
The terminal calls a kernel loading module by operating the WebView component, the kernel loading module is used for loading a browser kernel, the kernel loading module comprises system interface information and third party interface information, and as the pointer information of the target component points to the third party interface information in the kernel loading module, the kernel loading module defaults to use an interface as the third party interface information.
In step 205, the terminal receives the record information sent by the server, and obtains a second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel.
The server may issue record information to the terminal according to a usage habit to control a usage switching relationship between an application program in the terminal and a browser kernel, where the record information includes a second association relationship between each application identifier and a system browser kernel or a third-party browser kernel, and after receiving the record information sent by the server, the terminal may parse the record information to obtain the second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel, where the second association relationship may be represented by a table, as shown in table 1:
TABLE 1
Application identification Browser kernel
Applications 1 Third party browser kernel
Application 2 Third party browser kernel
Application 3 System browser kernel
Application 4 Third party browser kernel
From table 1, it can be seen that, in the record information, the browser kernel corresponding to "application 1" is a third-party browser kernel, the browser kernel corresponding to "application 2" is a third-party browser kernel, the browser kernel corresponding to "application 3" is a system browser kernel, and the browser kernel corresponding to "application 4" is a third-party browser kernel.
In step 206, the terminal replaces the first association relationship between the application identifier in the local record information and the system browser kernel or the third-party browser kernel with the second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel.
The local record information is stored in a specified file directory of the terminal, and the local record information contains a first association relation between the application identifier and a system browser kernel or a third-party browser kernel. The first association relationship in the local record information directly represents that when an application program corresponding to a certain application identifier is used for opening a webpage, the browser kernel indicated by the first association relationship is used for rendering, so that a user can flexibly use the required browser kernel to open a specified application program by adjusting the local record information. The first association relationship may be represented by a table, as shown in table 2:
TABLE 2
Application identification Browser kernel
Applications 1 System browser kernel
Application 2 Third party browser kernel
Application 3 Third party browser kernel
Application 4 Third party browser kernel
Applications 5 System browser kernel
From table 2, it can be seen that, in the local record information, the browser kernel corresponding to "application 1" is a system browser kernel, the browser kernel corresponding to "application 2" is a third-party browser kernel, the browser kernel corresponding to "application 3" is a third-party browser kernel, the browser kernel corresponding to "application 4" is a third-party browser kernel, and the browser kernel corresponding to "application 5" is a system browser kernel.
Further, the first association relationship between the application identifier in the local record information and the system browser kernel or the third-party browser kernel, which is the same as that in the record information, is replaced by the second association relationship between the application identifier in the record information and the system browser kernel or the third-party browser kernel. Namely, the first incidence relation that the application 1 in the local record information corresponds to the system browser kernel is replaced by the second incidence relation that the application 1 in the record information corresponds to the third-party browser kernel. And replacing the first incidence relation of the 'application 3' in the local record information corresponding to the third-party browser kernel with the second incidence relation of the 'application 3' in the record information corresponding to the system browser kernel. The rest of the association relations are the same and are not changed. Then the first association after replacement can be as shown in table 3:
TABLE 3
Application identification Browser kernel
Applications 1 Third party browser kernel
Application 2 Third party browser kernel
Application 3 System browser kernel
Application 4 Third party browser kernel
Applications 5 System browser kernel
In step 207, the terminal detects an application program associated with the web page request instruction, obtains an application identifier corresponding to the application program, and obtains local record information.
The terminal detects through which application program the web page request instruction is generated, for example, the web page request instruction is "XX shopping application", acquires an application identifier "application 1" corresponding to the "XX shopping application", and acquires a first association relation in the local record information, that is, table 3.
In step 208, the terminal determines whether the browser kernel corresponding to the application identifier is a third-party browser kernel according to the local record information.
If the acquired application identifier is "application 1", and the first association relation (i.e., table 3) indicates that the browser kernel corresponding to "application 1" is the third-party browser kernel, it is determined that the browser kernel corresponding to the application identifier is the third-party browser kernel, and step 209 is executed. If the obtained application identifier is "application 5", and the first association relationship (i.e., table 3) indicates that the browser kernel corresponding to "application 5" is the system browser kernel, it is determined that the browser kernel corresponding to the application identifier is not the third-party browser kernel, and step 210 is performed.
In step 209, the terminal analyzes the kernel loader module to select the third party interface information in the kernel loader module.
When the browser kernel corresponding to the application identifier is judged to be the third-party browser kernel, it is indicated that the application program corresponding to the application identifier needs to load the webpage through the third-party browser kernel, and since the target component pointer information points to the third-party interface information in the kernel loading module, the steps of analyzing the kernel loading module, and selecting and determining the third-party interface information in the kernel module are directly executed.
In step 210, the terminal analyzes the kernel loading module to select the system interface information in the kernel loading module, calls the kernel of the system browser according to the system interface information, and loads the web page through the kernel of the system browser.
When the browser kernel corresponding to the application identifier is judged not to be the third-party browser kernel, the application program corresponding to the application identifier needs to load the webpage through the system browser kernel, the terminal can analyze the kernel loading module, change the third-party interface information newly added in the kernel loading module pointed by the pointer of the target component into the system interface information pointed in the kernel loading module, analyze the kernel loading module to select and determine the system interface information in the kernel loading module, call the system browser kernel according to the system interface information, and load the webpage through the system browser kernel.
In step 211, the terminal obtains the status information of the third party installation package.
The third-party browser kernel is integrated in the third-party installation package, and when the third-party installation package is installed, the third-party browser kernel is loaded into an operating system of the terminal, so that when the terminal calls the third-party browser kernel, state information of the third-party installation package needs to be acquired, and the state information comprises an installation completion state and an installation incompletion state.
In step 212, the terminal detects whether the status information is an installation completed status.
Wherein, when the terminal detects that the status information is the installation completed status, step 213 is executed. When the terminal detects that the status information is not in the installation complete status, step 214 is executed.
In step 213, the terminal loads the first execution file in the third-party browser kernel according to the third-party interface information, so as to read the configuration file information in the third-party browser kernel.
When the terminal detects that the state new information is in the installation completion state, it indicates that the kernel of the third-party browser is already loaded into the operating system of the terminal, and correspondingly, the terminal loads the dex file in the kernel of the third-party browser according to the third-party interface information, so as to initialize the kernel of the third-party browser and read the configuration file information in the kernel of the third-party browser.
In step 214, the terminal switches the third-party interface information selected in the kernel loading module to system interface information, calls a kernel of a system browser according to the system interface information, and loads a web page through the kernel of the system browser.
When the state information is detected not to be in the installation completion state, it is indicated that the third-party installation package is uninstalled and cannot be called to a third-party browser kernel through third-party interface information, at this time, in order that the webpage can be displayed normally, the third-party interface information selected in the kernel loading module can be switched to system interface information, a system browser kernel is called according to the system interface information, and the webpage is loaded through the system browser kernel.
In step 215, the terminal loads a second executable file in the third-party browser kernel according to the third-party interface information, so as to load resource file information in the third-party browser kernel.
After loading the dex file in the third-party browser kernel and reading the configuration file information in the third-party browser kernel, the terminal also loads the so file in the third-party browser kernel according to the third-party interface information so as to call the function of the third-party browser kernel and load the resource file information in the third-party browser kernel.
In step 216, the terminal performs syntax interpretation on the web page through the configuration file information, renders the syntax-interpreted web page through the resource file information, and displays the web page.
The terminal analyzes HTML of the webpage through the configuration file information and the initialized third-party browser kernel, analyzes the HTML into code information which can be identified by an operating system, and expresses the analyzed code information by using a cascading style sheet.
And further, performing page layout, rendering and composite layer synthesis on the expressed webpage through the resource file information and the webpage after checking in the third-party browser to finish the display of the webpage.
In step 217, when the terminal detects that the third-party browser kernel fails to be loaded, the third-party interface information selected in the kernel loading module is switched to system interface information, the system browser kernel is called according to the system interface information, and a webpage is loaded through the system browser kernel.
The third-party browser kernel can fail to be loaded due to some special conditions, such as the loss of a file of the third-party browser kernel, or the mismatch of operating environments and the like, and when the third-party browser kernel fails to be loaded, the webpage cannot be normally displayed due to the fact that the pointer information of the target component points to the third-party interface information.
Therefore, when the loading failure of the third-party browser kernel is detected, the selected third-party interface information in the kernel loading module is switched into the system interface information, the system browser kernel is called according to the system interface information, and the webpage is loaded through the system browser kernel. Simultaneously displaying a prompt message, wherein the prompt message can be' loading failure of the third-party browser kernel, please note! ".
According to the scheme, compared with the scheme that the kernel of the third-party browser is used for loading the webpage by default, the scheme can be used for conveniently processing the kernel of the webpage according to actual needs, the scheme can be used for loading the application program needing to be loaded by using the kernel of the third-party browser, and the flexibility of the kernel of the webpage loaded by using the corresponding kernel of the third-party browser in the system browser is improved.
Example III,
In order to better implement the method for processing the browser kernel provided by the embodiment of the present invention, an embodiment of the present invention further provides a device based on the method for processing the browser kernel. The terms are the same as those in the above-mentioned processing method of the browser kernel, and specific implementation details can refer to the description in the method embodiment.
Referring to fig. 5a, fig. 5a is a schematic structural diagram of a processing device of a browser kernel according to an embodiment of the present invention, where the processing device of the browser kernel may include an execution unit 301, a call unit 302, a first selection unit 303, a loading unit 304, and the like.
The execution unit 301 is configured to execute the target component when the web page request instruction is detected.
In order to enrich the expression forms and functions of the application programs, web pages such as shopping application programs are built in a plurality of application programs in the terminal, and when a user uses an application program to trigger a certain web page, a web page request instruction is generated correspondingly.
Further, the target component provides a component for opening a web page for an operating system of the terminal, and is a component used for displaying web page content in the operating system.
Accordingly, when the execution unit 301 detects a web page request instruction, a target component for displaying web page content may be executed.
A calling unit 302, configured to call a kernel loading module through the target component, where the kernel loading module is used to load a browser kernel.
The kernel loading module is used for loading a browser kernel, in a general scene, the kernel loading module comprises interface information, namely system interface information, and the system browser kernel can be directly called through the system interface information. Due to the high-speed development of the third-party browser kernel, the loading speed, the safety and the stability of the third-party browser kernel exceed those of a system browser. Therefore, a user often wants to load a webpage through a third-party browser kernel, when the user needs to load the webpage by using a third-party browser interface, the third-party browser kernel needs to be manually introduced to achieve the loading, the operation is complex, the third-party browser kernel is introduced to a certain target application program to load the webpage of the target application program, when other application programs load the webpage, the webpage is still loaded by calling a system browser interface, and the processing flexibility is poor.
In this embodiment, the third-party browser kernel may be issued to a terminal manufacturer or an operating system manufacturer in an individual form, third-party interface information is added to the kernel loading module, interface information of the target component calling the kernel loading module is changed into the third-party interface information, a calling package name in the kernel loading module is correspondingly changed into a third-party browser kernel package name, and an interface implementation class name in the third-party interface information is also correspondingly changed into a third-party browser kernel implementation class name.
Based on this, the calling unit 302 calls the kernel loading module in the operating system through the running target component, and the pointer of the target component directly points to the newly added third party interface information in the kernel loading module, but not to the system interface information in the kernel loading module.
The first selecting unit 303 is configured to analyze the kernel loading module to select third party interface information in the kernel loading module.
The first selecting unit 303 analyzes the kernel loading module, and determines the interface information in the kernel description module to which the pointer of the target component points, and since the pointer of the current target component points to the newly-added third-party interface information in the kernel loading module, the first selecting unit 303 may directly select the third-party interface information in the kernel loading module, instead of the system interface information in the normal scenario.
And the loading unit 304 is configured to call a third-party browser kernel according to the third-party interface information, and load a web page through the third-party browser kernel.
The loading unit 304 initializes the third-party browser kernel and calls the third-party browser kernel by calling third-party interface information, performs syntax interpretation on a code of a webpage in the webpage request instruction by using the third-party browser kernel, and renders the webpage after the syntax interpretation so as to achieve a loading effect on the webpage by using a rendering effect of the third-party browser kernel.
In some embodiments, as shown in fig. 5b, the loading unit 304 may include a reading subunit 3041, a first loading subunit 3042, and a second loading subunit 3043, as follows:
a reading subunit 3041, configured to load a first execution file in the third-party browser kernel according to the third-party interface information, so as to read configuration file information in the third-party browser kernel;
a first loading subunit 3042, configured to load a second execution file in the third-party browser kernel according to the third-party interface information, so as to load resource file information in the third-party browser kernel;
a second loading subunit 3043, configured to load a web page according to the configuration file information and the resource file information.
The first execution file may be a dex file in a kernel of a third-party browser, where the dex file is an executable file on an operating system platform, the dex file includes a source code of the kernel of the third-party browser, and a corresponding source code may be acquired by a decompilation tool, and the reading subunit 3041 may initialize the kernel of the third-party browser by loading the first execution file, and reads configuration file information in the kernel of the third-party browser, where the configuration file information is a set of settings and files required for loading a web environment.
Further, the second execution file may be a so file in the kernel of the third-party browser, where the so file is a binary file, and similar to the dynamic link library file, the first loading subunit 3042 may call the kernel of the third-party browser by loading the second execution file, and load the resource file information in the kernel of the third-party browser, where the resource file includes a bitmap, a character string, and other data that can be changed without re-editing a code.
The second loading subunit 3043 parses the html in the web page according to the configuration file information and the resource file information, lays out and draws the parsed web page, and finally performs composite layering to display the web page.
In some embodiments, the second loading subunit 3043 may be specifically configured to perform syntax interpretation on the web page through the configuration file information, render the syntax-interpreted web page through the resource file information, and display the web page.
The second loading subunit 3043 may perform syntax interpretation on the hypertext markup language in the web page through the configuration file information, parse the hypertext markup language into code information that can be recognized by the operating system, and express the parsed code information by using a cascading style sheet.
Further, the webpage after the syntax interpretation is subjected to page layout, rendering and composite layer synthesis through the resource file information, and the webpage is displayed.
In some embodiments, as shown in fig. 5c, the processing device of the browser core may further include an installation unit 305, an addition unit 306, a reception unit 307, an update unit 308, a second acquisition unit 309, a determination unit 310, a second selection unit 311, a first acquisition unit 312, a detection unit 313, a first switching unit 314, and a second switching unit 315.
The installing unit 305 is configured to install a third-party installation package into the preset directory of the operating system, where the third-party installation package includes a third-party browser kernel.
The adding unit 306 is configured to add third-party interface information in the kernel loading module, and point the pointer information of the target component to the third-party interface information.
The third-party installation package comprises a third-party browser kernel, the function of the third-party browser kernel is similar to that of the system browser kernel, but the rendering effect which can not be realized by some system browsers can be realized. The third party browser kernel is provided by a third party developer, such as the Presto kernel, the X5 kernel, and so on. The installation unit 305 may download the third party installation package in the server for installation, and in the installation process of the third party installation package, install the third party installation file and the third party browser kernel in the preset directory of the operating system, so as to conveniently and quickly find the third party installation file directly through the preset target. And the adding unit 306 adds third-party interface information to the kernel loading module, where the third-party interface information is an application programming interface for calling a third-party browser kernel, and points the pointer information of the target component to the third-party interface information, so that the third-party interface information is used as default interface information.
The receiving unit 307 is configured to receive record information sent by the server, where the record information includes a second association relationship between the application identifier and the system browser kernel or the third-party browser kernel.
An updating unit 308, configured to update the local recording information according to the recording information.
The receiving unit 307 may receive the record information sent by the server in real time through the network, and the updating unit 308 performs an updating operation on the local record information through the received record information, so that the cloud server may issue the use of the browser kernel in the switch control terminal.
In some embodiments, the updating unit 308 may be specifically configured to acquire a second association relationship between the application identifier in the recorded information and the system browser kernel or the third-party browser kernel, and replace the first association relationship between the application identifier in the local recorded information and the system browser kernel or the third-party browser kernel with the second association relationship between the application identifier in the recorded information and the system browser kernel or the third-party browser kernel.
After the receiving unit 307 receives the record information, the updating unit 308 obtains a second association relationship between the application identifier in the record information and the kernel of the system browser or the kernel of the third-party browser, and replaces the first association relationship between the application identifier in the local record information, which is the same as the record information, and the kernel of the system browser or the kernel of the third-party browser with the second association relationship between the application identifier in the record information and the kernel of the system browser or the kernel of the third-party browser. Therefore, the cloud server can control the use of the browser kernel in the terminal.
The second obtaining unit 309 is configured to detect an application program associated with the web page request instruction, obtain an application identifier corresponding to the application program, and obtain local record information, where the local record information includes a first association relationship between the application identifier and a system browser kernel or a third-party browser kernel.
A determining unit 310, configured to determine, according to the local record information, whether the browser kernel corresponding to the application identifier is a third-party browser kernel.
The first selecting unit 303 is further specifically configured to, when it is determined that the browser kernel corresponding to the application identifier is a third-party browser kernel, perform a step of analyzing the kernel loading module to select third-party interface information in the kernel loading module
A second selecting unit 311, configured to, when it is determined that the browser kernel corresponding to the application identifier is not the third-party browser kernel, analyze the kernel loading module to select system interface information in the kernel loading module, call a system browser kernel according to the system interface information, and load a web page through the system browser kernel.
The second obtaining unit 309 detects through which application the web page request instruction is generated, obtains an application identifier corresponding to the application, where the application identifier may be a name of the application or a version number of the application, and obtains the local recording information stored in the storage space of the terminal.
The local record information can be stored in an appointed file directory of the storage space, so that a user can directly call the local record information through the appointed file directory conveniently, the local record information comprises a first incidence relation between the application identifier and a system browser kernel or a third-party browser kernel, namely the local record information indicates the browser kernel information appointed by an application program corresponding to the application identifier when a webpage is opened, and the browser kernel information can be selected as the third-party browser kernel or the system browser kernel according to the self requirement of the user.
Further, the determining unit 310 determines, according to the first association relationship between the application identifier indicated in the local record information and the browser kernel, whether the browser kernel corresponding to the application identifier is a third-party browser kernel.
When the first selecting unit 303 determines that the browser kernel corresponding to the application identifier is the third-party browser kernel, it indicates that the web page in the application program corresponding to the application identifier needs to be loaded through the third-party browser kernel, so that the kernel loading module is executed and analyzed, and the third-party interface information in the kernel module is selected and determined.
When the second selecting unit 311 determines that the browser kernel corresponding to the application identifier is not the third-party browser kernel, it indicates that the web page in the application program corresponding to the application identifier needs to be loaded through the system browser kernel, so the kernel loading module is analyzed, the third-party interface information newly added in the kernel loading module pointed by the pointer of the target component is changed to the system interface information pointed by the kernel loading module, the kernel loading module is analyzed to select and determine the system interface information in the kernel loading module, the system browser kernel is called according to the system interface information, and the web page is loaded through the system browser kernel. Therefore, the purpose that all application programs are allowed to use the third-party browser kernel and part of the application programs use the third-party browser kernel under the control of the terminal can be achieved by setting the first association relation between the application identification in the local record information and the browser kernel.
The first obtaining unit 312 is configured to obtain status information of the third party installation package.
A detecting unit 313 for detecting whether the status information is an installation completed status.
The loading unit 304 is further configured to, when it is detected that the state information is an installation completion state, execute calling a third-party browser kernel according to the third-party interface information, and load a web page through the third-party browser kernel.
The first switching unit 314 is configured to switch the third-party interface information selected in the kernel loading module to system interface information when it is detected that the state information is not the installation completion state, call a kernel of a system browser according to the system interface information, and load a web page through the kernel of the system browser.
The third-party browser kernel is integrated in the third-party installation package, that is, the third-party installation package is installed in the operating system, so that the third-party browser kernel can be loaded into the operating system.
In an actual using process, after the third-party browser kernel is unloaded, the third-party browser kernel is correspondingly deleted, at this time, the operating system cannot call the third-party browser kernel through the third-party interface information, and a situation that a webpage cannot be opened occurs.
Therefore, when the third-party browser kernel is called according to the third-party interface information, the first obtaining unit 312 needs to first obtain the status information of the third-party installation package, where the status information includes an installation completion status or an installation incompletion status. The detection unit 313 detects whether the status information is the installation completion status.
When the loading unit 304 detects that the state information is the installation completion state, it indicates that the third party installation package is already installed in the operating system, and may directly execute calling the third party browser kernel according to the third party interface information, and load the web page through the third party browser kernel.
When the first switching unit 314 detects that the state information is not in the installation completion state, it indicates that the third party installation package has been unloaded and cannot be called to the third party browser kernel through the third party interface information, and at this time, in order to normally display the web page, the third party interface information selected in the kernel loading module may be switched to system interface information, the system browser kernel is called according to the system interface information, and the web page is loaded through the system browser kernel.
The second switching unit 315 is configured to switch the third-party interface information selected in the kernel loading module to system interface information when it is detected that the third-party browser kernel fails to be loaded, call a system browser kernel according to the system interface information, and load a web page through the system browser kernel.
Due to some special scenes, such as file loss or environment configuration and the like, the loading of the third-party browser kernel fails, and at this time, the webpage cannot be normally displayed.
Therefore, when the second switching unit 315 detects that the third-party browser kernel fails to be loaded, the third-party interface information selected in the kernel loading module is switched to system interface information, the system browser kernel is called according to the system interface information, and a web page is loaded through the system browser kernel.
In an embodiment, when the third-party browser kernel fails to be loaded, the second switching unit 315 may display a piece of prompting information, where the prompting information is used to prompt the user that the third-party browser kernel is abnormal, and the user may reload the third-party browser kernel or repair the abnormality according to the prompting information.
The specific implementation of each unit can refer to the previous embodiment, and is not described herein again.
As can be seen from the above, in the embodiment of the present invention, when the execution unit 301 detects a web page request instruction, the target component is executed; the calling unit 302 calls a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; the first selecting unit 303 analyzes the kernel loading module to select the third party interface information in the kernel loading module; the loading unit 304 calls a third-party browser kernel according to the third-party interface information, and loads a webpage through the third-party browser kernel, so that compared with the existing default scheme of loading the webpage by using the system browser kernel, the scheme directly calls the third-party interface information in the operating system through the target component when detecting a webpage request instruction, and calls the third-party browser kernel to load the webpage according to the third-party interface information, thereby greatly improving the convenience of processing the browser kernel and the flexibility of processing.
Examples IV,
An embodiment of the present invention further provides a terminal, as shown in fig. 6, the terminal may include a Radio Frequency (RF) circuit 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a Wireless Fidelity (WiFi) module 407, a processor 408 including one or more processing cores, a power supply 409, and other components. Those skilled in the art will appreciate that the terminal structure shown in fig. 6 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 401 may be used for receiving and transmitting signals during a message transmission or communication process, and in particular, for receiving downlink information of a base station and then sending the received downlink information to the one or more processors 408 for processing; in addition, data relating to uplink is transmitted to the base station. In general, RF circuitry 401 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 401 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), long Term Evolution (LTE), email, short Messaging Service (SMS), etc.
The memory 402 may be used to store software programs and modules, and the processor 408 may execute various functional applications and processes of the browser core by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal, etc. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 408 and the input unit 403 with access to the memory 402.
The input unit 403 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in a particular embodiment, the input unit 403 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts it to touch point coordinates, and sends the touch point coordinates to the processor 408, and can receive and execute commands sent from the processor 408. In addition, the touch sensitive surface can be implemented in various types, such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 403 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 404 may be used to display information input by or provided to the user and various graphical user interfaces of the terminal, which may be made up of graphics, text, icons, video, and any combination thereof. The Display unit 404 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation may be transmitted to the processor 408 to determine the type of touch event, and the processor 408 may then provide a corresponding visual output on the display panel based on the type of touch event. Although in FIG. 6 the touch-sensitive surface and the display panel are two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 405, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or the backlight when the terminal moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of identifying the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration identification related functions (such as pedometer and tapping), and the like; other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor and the like which can be configured at the terminal are not described in detail herein.
Audio circuitry 406, a speaker, and a microphone may provide an audio interface between the user and the terminal. The audio circuit 406 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electric signal, which is received by the audio circuit 406 and converted into audio data, which is then processed by the audio data output processor 408, and then transmitted to, for example, another terminal via the RF circuit 401, or the audio data is output to the memory 402 for further processing. The audio circuitry 406 may also include an earbud jack to provide peripheral headset communication with the terminal.
WiFi belongs to short distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web page and access streaming media etc. through WiFi module 407, it provides wireless broadband internet access for the user. Although fig. 6 shows the WiFi module 407, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 408 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the terminal and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby integrally monitoring the handset. Optionally, processor 408 may include one or more processing cores; preferably, the processor 408 may integrate an application processor, which handles primarily the operating system, user interface, applications, etc., and a modem processor, which handles primarily the wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 408.
The terminal also includes a power source 409 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 408 via a power management system to manage charging, discharging, and power consumption via the power management system. The power supply 409 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown, the terminal may further include a camera, a bluetooth module, etc., which will not be described herein. Specifically, in this embodiment, the processor 408 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 408 runs the application programs stored in the memory 402, thereby implementing various functions:
when a webpage request instruction is detected, operating a target component; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third party interface information in the kernel loading module; and calling a third-party browser kernel according to the third-party interface information, and loading a webpage through the third-party browser kernel.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the processing method for the browser kernel, and are not described herein again.
As can be seen from the above, the terminal according to the embodiment of the present invention may operate the target component by detecting the web page request instruction; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third-party interface information in the kernel loading module; according to the method, compared with the existing scheme of loading the webpage by default using the system browser kernel, the scheme has the advantages that the third-party interface information in the operating system is directly called through the target component when the webpage request instruction is detected, and the third-party browser kernel is called according to the third-party interface information to load the webpage, so that the convenience and the flexibility of the browser kernel processing are greatly improved.
Example V,
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present invention provides a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any one of the processing methods of the browser core provided in the embodiments of the present invention. For example, the instructions may perform the steps of:
when a webpage request instruction is detected, operating a target component; calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel; analyzing the kernel loading module to select third party interface information in the kernel loading module; and calling a third-party browser kernel according to the third-party interface information, and loading a webpage through the third-party browser kernel.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium may execute the steps in any browser kernel processing method provided in the embodiment of the present invention, beneficial effects that can be achieved by any browser kernel processing method provided in the embodiment of the present invention may be achieved, for details, see the foregoing embodiment, and are not described herein again.
The foregoing describes in detail a method, an apparatus, and a storage medium for processing a browser kernel according to an embodiment of the present invention, and a specific example is applied in the present disclosure to explain principles and embodiments of the present invention, and the description of the foregoing embodiments is only used to help understanding a method and a core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as limiting the present invention.

Claims (14)

1. A method for processing a browser kernel, comprising:
when a webpage request instruction is detected, operating a target component;
calling a kernel loading module through the target component, wherein the kernel loading module is used for loading a browser kernel;
analyzing the kernel loading module, and if the pointer of the target component points to the third party interface information in the kernel loading module, selecting the third party interface information in the kernel loading module;
calling a third-party browser kernel according to the third-party interface information, and loading a webpage through the third-party browser kernel;
before the step of operating the target component, the method further comprises:
installing a third-party installation package into a preset directory of an operating system, wherein the third-party installation package comprises a third-party browser kernel;
adding third party interface information in a kernel loading module, and pointing the pointer information of a target component to the third party interface information, wherein the third party interface information is an application programming interface for calling a kernel of the third party browser.
2. The processing method according to claim 1, wherein the step of calling a third-party browser kernel according to the third-party interface information and loading a web page through the third-party browser kernel comprises:
loading a first execution file in the third-party browser kernel according to the third-party interface information so as to read the configuration file information in the third-party browser kernel;
loading a second execution file in the third-party browser kernel according to the third-party interface information so as to load resource file information in the third-party browser kernel;
and loading the webpage through the configuration file information and the resource file information.
3. The processing method according to claim 2, wherein the step of loading the web page with the configuration file information and the resource file information comprises:
performing grammatical interpretation on the webpage through the configuration file information;
and rendering the webpage after the syntax interpretation through the resource file information, and displaying the webpage.
4. The processing method according to claim 1, wherein the third-party browser kernel is integrated in a third-party installation package, and before the step of calling the third-party browser kernel according to the third-party interface information, the method further comprises:
acquiring state information of a third party installation package;
detecting whether the state information is in an installation completion state;
when the state information is detected to be in an installation completion state, executing a step of calling a third-party browser kernel according to the third-party interface information;
and when the state information is detected not to be in the installation completion state, switching the third party interface information selected in the kernel loading module into system interface information, calling a system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
5. The processing method according to any one of claims 1 to 4, wherein after the step of loading the web page by the third-party browser kernel, the method further comprises:
when detecting that the loading of the kernel of the third-party browser fails, switching the third-party interface information selected in the kernel loading module into system interface information;
and calling a system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
6. The processing method according to claim 1, wherein said step of analyzing said kernel loader module to select third party interface information in said kernel loader module is preceded by the step of:
detecting an application program associated with a webpage request instruction, acquiring an application identifier corresponding to the application program, and acquiring local record information, wherein the local record information comprises a first association relation between the application identifier and a system browser kernel or a third-party browser kernel;
judging whether the browser kernel corresponding to the application identifier is a third-party browser kernel or not according to the local recording information;
when the browser kernel corresponding to the application identifier is judged to be a third-party browser kernel, executing a step of analyzing the kernel loading module to select third-party interface information in the kernel loading module;
and when the browser kernel corresponding to the application identifier is judged not to be the third-party browser kernel, analyzing the kernel loading module to select system interface information in the kernel loading module, calling the system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
7. The processing method according to claim 6, wherein before the step of detecting the application program associated with the web page request instruction, acquiring the application identifier corresponding to the application program, and acquiring the local record information, the method further comprises:
receiving record information sent by a server, wherein the record information comprises a second association relation between an application identifier and a system browser kernel or a third-party browser kernel;
and updating the local recording information according to the recording information.
8. The processing method according to claim 7, wherein the step of updating the local recording information according to the recording information comprises:
acquiring a second association relation between the application identifier in the record information and a system browser kernel or a third-party browser kernel;
and replacing the first incidence relation between the application identifier in the local record information and the system browser kernel or the third-party browser kernel with the second incidence relation between the application identifier in the record information and the system browser kernel or the third-party browser kernel.
9. A device for processing a browser kernel, comprising:
the operation unit is used for operating the target component when the webpage request instruction is detected;
the calling unit is used for calling a kernel loading module through the target component, and the kernel loading module is used for loading a browser kernel;
the first selection unit is used for analyzing the kernel loading module and selecting the third party interface information in the kernel loading module if the pointer of the target component points to the third party interface information in the kernel loading module;
the loading unit is used for calling a third-party browser kernel according to the third-party interface information and loading a webpage through the third-party browser kernel;
the installation unit is used for installing a third-party installation package into a preset directory of the operating system, wherein the third-party installation package comprises a third-party browser kernel;
and the adding unit is used for adding third-party interface information into the kernel loading module and pointing the pointer information of the target component to the third-party interface information, wherein the third-party interface information is an application programming interface for calling the kernel of the third-party browser.
10. The processing apparatus according to claim 9, wherein the loading unit comprises:
the reading subunit is used for loading a first execution file in the third-party browser kernel according to the third-party interface information so as to read the configuration file information in the third-party browser kernel;
the first loading subunit is used for loading a second execution file in the third-party browser kernel according to the third-party interface information so as to load resource file information in the third-party browser kernel;
and the second loading subunit is used for loading the webpage through the configuration file information and the resource file information.
11. The processing apparatus according to claim 10, wherein the second loading subunit is specifically configured to:
performing syntax interpretation on the webpage through the configuration file information;
and rendering the webpage after the syntax interpretation through the resource file information, and displaying the webpage.
12. The processing apparatus according to claim 9, wherein the third-party browser kernel is integrated in a third-party installation package, and the processing apparatus further comprises a first obtaining unit, a detecting unit, and a first switching unit:
the first acquisition unit is used for acquiring the state information of the third-party installation package;
the detection unit is used for detecting whether the state information is in an installation completion state;
the loading unit is further used for calling a third-party browser kernel according to the third-party interface information and loading a webpage through the third-party browser kernel when the state information is detected to be in an installation completion state;
and the first switching unit is used for switching the third-party interface information selected in the kernel loading module into system interface information when the state information is not detected to be in the installation completion state, calling a system browser kernel according to the system interface information, and loading a webpage through the system browser kernel.
13. The processing apparatus according to any one of claims 9 to 12, characterized in that the processing apparatus further comprises:
and the second switching unit is used for switching the third-party interface information selected in the kernel loading module into system interface information when detecting that the loading of the kernel of the third-party browser fails, calling the kernel of the system browser according to the system interface information, and loading a webpage through the kernel of the system browser.
14. A storage medium storing a plurality of instructions, the instructions being adapted to be loaded by a processor to perform the steps of the processing method of the browser core according to any one of claims 1 to 8.
CN201810444901.8A 2018-05-10 2018-05-10 Browser kernel processing method and device and storage medium Active CN110489679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810444901.8A CN110489679B (en) 2018-05-10 2018-05-10 Browser kernel processing method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810444901.8A CN110489679B (en) 2018-05-10 2018-05-10 Browser kernel processing method and device and storage medium

Publications (2)

Publication Number Publication Date
CN110489679A CN110489679A (en) 2019-11-22
CN110489679B true CN110489679B (en) 2023-04-07

Family

ID=68543221

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810444901.8A Active CN110489679B (en) 2018-05-10 2018-05-10 Browser kernel processing method and device and storage medium

Country Status (1)

Country Link
CN (1) CN110489679B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416496A (en) * 2020-11-24 2021-02-26 平安普惠企业管理有限公司 Page display method and device and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8887039B2 (en) * 2008-01-02 2014-11-11 Microsoft Corporation Web page based program versioning
CN101655863A (en) * 2009-04-24 2010-02-24 北京搜狗科技发展有限公司 Method for loading web pages in browser and browser
CN103500194A (en) * 2013-09-17 2014-01-08 北京奇虎科技有限公司 Method, device and browser for loading webpage
CN103645946A (en) * 2013-11-19 2014-03-19 北京奇虎科技有限公司 Method and device for processing browser kernel information
CN104951326B (en) * 2014-03-31 2020-06-30 腾讯科技(深圳)有限公司 Webpage access method and device
CN106354484A (en) * 2015-07-16 2017-01-25 中兴通讯股份有限公司 Browser compatibility method and browser
CN105607928B (en) * 2015-12-18 2019-03-01 北京奇虎科技有限公司 For the support method of browser kernel and the display methods and device of webpage

Also Published As

Publication number Publication date
CN110489679A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
US20210191996A1 (en) Method for displaying application page, non-transitory storage medium and electronic device
US10186244B2 (en) Sound effect processing method and device, plug-in unit manager and sound effect plug-in unit
US9800609B2 (en) Method, device and system for detecting malware in a mobile terminal
CN108287918B (en) Music playing method and device based on application page, storage medium and electronic equipment
CN108363528B (en) Application page starting method and device, storage medium and electronic equipment
CN107741844B (en) Method and device for generating application installation package
CN106502703B (en) Function calling method and device
CN108549568B (en) Application entry processing method and device, storage medium and electronic equipment
CN106775828B (en) Application program installation method and device and computer equipment
CN108595218B (en) Method and device for loading dynamic library of system
CN107247691B (en) Text information display method and device, mobile terminal and storage medium
CN110020293B (en) Multimedia data display method, device and storage medium
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
CN109800030B (en) Application program running method and device and terminal
US20190213241A1 (en) Web page display method and apparatus, mobile terminal, and storage medium
US20150007067A1 (en) Method and system for generating a user interface
CN108182090B (en) Flash plug-in loading method and device based on blink kernel
CN106095423B (en) Method, terminal and server for providing browsing service
CN108563476B (en) Application program running method and device, storage medium and electronic equipment
CN110489679B (en) Browser kernel processing method and device and storage medium
CN109145598B (en) Virus detection method and device for script file, terminal and storage medium
CN116594616A (en) Component configuration method and device and computer readable storage medium
CN106933626B (en) Application association method and device
CN113742716B (en) Code running method, device, electronic equipment, storage medium and program product
CN110287443B (en) Page data display method and related 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