CN109634753B - Data processing method, device, terminal and storage medium for switching browser kernels - Google Patents

Data processing method, device, terminal and storage medium for switching browser kernels Download PDF

Info

Publication number
CN109634753B
CN109634753B CN201811302043.XA CN201811302043A CN109634753B CN 109634753 B CN109634753 B CN 109634753B CN 201811302043 A CN201811302043 A CN 201811302043A CN 109634753 B CN109634753 B CN 109634753B
Authority
CN
China
Prior art keywords
cache
data
cache data
browser
domain name
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
CN201811302043.XA
Other languages
Chinese (zh)
Other versions
CN109634753A (en
Inventor
温作奖
安晓江
蒋红宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Haitai Fangyuan High Technology Co Ltd
Original Assignee
Beijing Haitai Fangyuan High Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Haitai Fangyuan High Technology Co Ltd filed Critical Beijing Haitai Fangyuan High Technology Co Ltd
Priority to CN201811302043.XA priority Critical patent/CN109634753B/en
Publication of CN109634753A publication Critical patent/CN109634753A/en
Application granted granted Critical
Publication of CN109634753B publication Critical patent/CN109634753B/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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

The invention provides a data processing method, a device, a terminal and a storage medium for switching browser kernels, wherein the method comprises the following steps: when a first webpage of a first browser kernel requests to access a target server with a domain name as a target domain name, storing cache data corresponding to the target domain name into a uniform cache of a browser; when the first browser kernel is switched to a second browser kernel, the cache data are obtained in the unified cache according to a second webpage request of the second browser kernel; and assembling the obtained cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request with the cache data to the target server. The invention realizes that each browser core shares the cache data, does not need to independently cache the same cache data in each browser core, saves the storage space, does not need to transmit data information through the cores, does not need to convert data, and improves the page loading rate.

Description

Data processing method, device, terminal and storage medium for switching browser kernels
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a data processing method, an apparatus, a terminal, and a storage medium for switching browser kernels.
Background
The browser kernel is a rendering engine used by the browser, and the rendering engine determines how the browser displays the content of the web page and the format information of the web page. Different browser kernels also have different interpretations of web page writing languages, so that rendering effects of the same web page in browsers with different kernels can also be different.
When the browser includes a plurality of browser cores, switching of the browser cores may be required. In the prior art, there are two switching implementation schemes for browser kernels: one is that when the browser detects that the kernel needs to be switched and loads the page of the kernel needing to be switched, the post data in the previous kernel is transmitted to the switched kernel; the other is that when a browsing event occurs in the current kernel, protocol request information triggered by the browsing event is stored, when the browser switches the kernels, the stored protocol request information is synchronized to the switched kernels, the switched kernels regenerate the protocol requests by using the synchronized protocol request information, and the regenerated protocol requests are initiated to the server corresponding to the webpage address accessed before switching.
Although the switching of the kernels is realized by the two schemes, the kernels of the dual-core or multi-core browsers are independent from each other, the kernels of the browsers need to respectively store data information such as cookies and the like, a large amount of storage space of a web browsing device is occupied, and due to the fact that the kernels adopt different data storage structures, data information transmitted between the kernels needs to be converted in the process of switching the kernels, the switching efficiency of the kernels is inevitably reduced, and the loading speed of a web page is influenced.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a data processing method, apparatus, terminal and storage medium for switching a browser core that overcome or at least partially solve the above problems.
According to a first aspect of the present invention, there is provided a data processing method for switching browser cores, including:
when a first webpage of a first browser kernel requests to access a target server with a domain name as a target domain name, storing cache data corresponding to the target domain name into a uniform cache of a browser;
when the first browser kernel is switched to a second browser kernel, the cache data are obtained in the unified cache according to a second webpage request of the second browser kernel;
and assembling the obtained cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request with the cache data to the target server.
Optionally, when the first web page request of the first browser kernel accesses the target server whose domain name is the target domain name, storing the cache data corresponding to the target domain name into the unified cache of the browser includes:
when a first webpage request of a first browser kernel is received, determining a target domain name and a corresponding target server according to the first webpage request;
sending the first webpage request to the target server;
receiving webpage data returned by the target server, determining a target kernel as the first browser kernel, and screening cache data in the webpage data;
and correspondingly storing the screened cache data and the target domain name into the unified cache.
Optionally, before sending the first web page request to the target server, the method further includes:
according to the target domain name, inquiring corresponding cache data in the unified cache;
the sending the first web page request to the target server includes:
and when the uniform cache does not have cache data corresponding to the target domain name, sending the first webpage request to the target server, otherwise, assembling the inquired cache data and the first webpage request into a first webpage request with cache data and sending the first webpage request to the target server.
Optionally, the storing the filtered cache data and the target domain name into the unified cache correspondingly includes:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
Optionally, after determining that the target kernel is the first browser kernel, the method further includes:
and sending the webpage data to the first browser inner core, and analyzing and rendering the webpage data by the first browser inner core.
Optionally, the method further includes:
and receiving updated cache data sent by the first browser kernel, and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
Optionally, the method further includes:
and when receiving the updating data of the cache data sent by the target server, updating the corresponding cache data in the unified cache.
Optionally, the cache data includes Cookie data.
According to a second aspect of the present invention, there is provided a data processing apparatus for switching a browser core, comprising:
the cache data storage module is used for storing cache data corresponding to a target domain name into a uniform cache of the browser when a first webpage request of a first browser kernel accesses the target server with the domain name as the target domain name;
the cache data acquisition module is used for acquiring the cache data in the unified cache according to a second webpage request of a second browser kernel when the first browser kernel is switched to the second browser kernel;
and the webpage request sending module is used for assembling the obtained cache data and the second webpage request into a second webpage request with cache data and sending the second webpage request with the cache data to the target server.
Optionally, the cache data saving module includes:
the domain name determining unit is used for determining a target domain name and a corresponding target server according to a first webpage request when the first webpage request of a first browser kernel is received;
a web page request sending unit, configured to send the first web page request to the target server;
the cache data screening unit is used for receiving the webpage data returned by the target server, determining a target kernel as the first browser kernel and screening the cache data in the webpage data;
and the cache data storage unit is used for correspondingly storing the screened cache data and the target domain name into the unified cache.
Optionally, the cache data saving module further includes:
the cache data query unit is used for querying corresponding cache data in the unified cache according to the target domain name;
the web page request sending unit is specifically configured to:
and when the uniform cache does not have cache data corresponding to the target domain name, sending the first webpage request to the target server, otherwise, assembling the inquired cache data and the first webpage request into a first webpage request with cache data and sending the first webpage request to the target server.
Optionally, the cache data storage unit is specifically configured to:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
Optionally, the method further includes:
and the analysis rendering module is used for sending the webpage data to the first browser kernel, and the first browser kernel performs analysis rendering on the webpage data.
Optionally, the method further includes:
and the first updating module is used for receiving updated cache data sent by the first browser kernel and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
Optionally, the method further includes:
and the second updating module is used for updating the corresponding cache data in the unified cache when receiving the update data of the cache data sent by the target server.
Optionally, the cache data includes Cookie data.
According to a third aspect of the present invention, there is provided a terminal comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing a data processing method of switching browser cores as described in the first aspect.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the data processing method of switching browser cores as described in the first aspect.
The invention has the following advantages:
the invention provides a data processing method, a device, a terminal and a storage medium for switching browser kernels, which are characterized in that when a target server with a domain name as a target domain name is accessed according to a first webpage request of a first browser kernel, cache data corresponding to the target domain name is stored in a unified cache of a browser, when the browser kernel is switched to a second browser kernel, the cache data is obtained in the unified cache according to a second webpage request of the second browser kernel, the obtained cache data and the second webpage request are assembled into a second webpage request with the cache data and are sent to the target server, so that the cache data are shared by the browser kernels, the same cache data do not need to be cached separately in each browser kernel, the storage space is saved, and data information is not transmitted through the kernels, and data conversion is not needed, so that the kernel switching efficiency is effectively improved, and the page loading rate is further improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention.
Fig. 1 is a flowchart illustrating steps of a data processing method for switching a browser kernel according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another method for switching data processing of a browser kernel according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps of a data processing method for switching browser cores according to another embodiment of the present invention;
FIG. 4 is a block diagram of a data processing apparatus for switching browser cores according to an embodiment of the present invention;
fig. 5 is a block diagram of a browser according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of steps of a data processing method for switching a browser kernel according to an embodiment of the present invention, where the method may be applied to a browser, and as shown in fig. 1, the method may include:
step 101, when a first webpage request of a first browser kernel accesses a target server with a domain name as a target domain name, storing cache data corresponding to the target domain name into a uniform cache of a browser.
The domain name is the name of a computer or group of computers on the Internet, which is composed of a string of names separated by points, and is used to identify the electronic position (sometimes referred to as geographical location) of the computer during data transmission. The first web page request is a request initiated by the first browser kernel and used for requesting web page data of a target server, the first web page request comprises a target domain name, and the corresponding target server can be determined according to the target domain name. The unified cache is a storage space for the browser to uniformly store the cache data of each browser core, the cache data can be in a unified format, the browser cores can be called conveniently, the corresponding cache data in the unified cache can be updated according to the updating of the cache data by each browser core, and therefore the cache data of each browser core does not need to be cached in the browser cores independently. The browser includes at least two browser cores, such as a first browser core and a second browser core. The browser kernel comprises a webkit kernel, a Trident (IE) kernel, a Gecko kernel or other kernels.
When the first browser kernel accesses a target server of a target domain name, screening cache data needing to be cached according to webpage data returned by the target server, and correspondingly storing the cache data and the target domain name into a uniform cache of the browser. Wherein the cache data optionally comprises cookie data. Cookies are sometimes also used in their plural form, meaning data that certain websites store on the user's local terminal for the purpose of identifying the user's identity or for session tracking. The Cookie data may be, for example, a user name and password of the user, etc. The first browser kernel may be a webkit kernel, a Trident kernel, a Gecko kernel, or other kernels.
And step 102, when the first browser kernel is switched to the second browser kernel, obtaining the cache data in the unified cache according to a second webpage request of the second browser kernel.
The second browser kernel is a different browser kernel from the first browser kernel, for example, when the first browser kernel is a webkit kernel, the second browser kernel may be a Trident, Gecko, or other kernel.
When browsing webpage data returned by a target server through a first browser kernel, if a switching instruction for switching from the first browser kernel to a second browser kernel is detected, if a second webpage request of the second browser kernel is received, wherein the second webpage request comprises the target domain name, the first browser kernel needs to be switched to the second browser kernel, and at this time, cache data saved when the first browser kernel accesses the target server of the target domain name can be directly obtained in a unified cache.
And 103, assembling the acquired cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request with the cache data to the target server.
And assembling the acquired cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request to the target server, so that the target server returns the webpage data requested by the second browser kernel, and the second browser kernel analyzes and renders the webpage data, thereby achieving the purpose that each browser kernel shares the cache data.
In the data processing method for switching browser cores provided in this embodiment, when a first web page request of a first browser core accesses a target server whose domain name is a target domain name, cache data corresponding to the target domain name is stored in a unified cache of a browser, when the first browser core is switched to a second browser core, the cache data is obtained in the unified cache according to a second web page request of the second browser core, the obtained cache data and the second web page request are assembled into a second web page request with the cache data, and the second web page request is sent to the target server, so that the cache data is shared by each browser core without separately caching the same cache data in each browser core, a storage space is saved, data information is not transmitted through the cores, and data conversion is not required, the kernel switching efficiency is effectively improved, and the page loading rate is further improved.
On the basis of the technical scheme, the method can also optionally comprise the following steps:
and receiving updated cache data sent by the first browser kernel, and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
When the cache data (such as Cookie data) corresponding to the target domain name recorded in the running state of the first browser kernel is changed, the first browser kernel sends the updated cache data to the browser, and the browser updates the cache data corresponding to the target domain name in the unified cache after receiving the updated cache data, so that the cache data of each browser kernel are synchronously updated, and the real-time performance of the cache data in the unified cache is ensured.
On the basis of the technical scheme, the method can also optionally comprise the following steps:
and when receiving the updating data of the cache data sent by the target server, updating the corresponding cache data in the unified cache.
For example, when the server Cookie cache data changes, the Cookie data is sent to the browser, and the browser replaces the old Cookie data in the unified cache with the new Cookie data, so as to maintain the real-time performance of the Cookie content.
Fig. 2 is a flowchart of steps of another data processing method for switching a browser kernel according to an embodiment of the present invention, as shown in fig. 2, the method may include:
step 201, when a first web page request of a first browser kernel is received, a target domain name and a corresponding target server are determined according to the first web page request.
The first web page request is a URL (Uniform Resource Locator) request.
When the browser receives a first webpage request of a first browser kernel, a target domain name in the first webpage request is obtained, and a target server requested by the first browser kernel can be determined according to the target domain name.
Step 202, sending the first webpage request to the target server.
And sending the first webpage request to a target server, so that the target server can acquire corresponding webpage data according to the first webpage request and return the webpage data to the browser.
Step 203, receiving the web page data returned by the target server, determining that the target kernel is the first browser kernel, and screening the cache data in the web page data.
When the browser receives webpage data returned by the target server, the browser performs characteristic analysis on the webpage data to determine a target kernel, and screens cache data needing to be stored in the webpage data, such as a user name and a password of a screened user. For example, the web page content in the web page data may specify the kernel version, or the web page content contains specific kernel key information, such as ActiveX plug-in information that can only be parsed in the IE kernel.
If the target kernel is determined to be the first browser kernel, the kernel information can be recorded and stored, that is, the kernel information accessed this time is recorded as the first browser kernel, and the target domain name can be correspondingly recorded when the kernel information is recorded.
And 204, correspondingly storing the screened cache data and the target domain name into the unified cache.
The screened cache data and the target domain name are correspondingly stored in the unified cache, so that when the first browser kernel or other browser kernels access the target server of the target domain name, the cache data in the unified cache can be directly obtained, the user information is prevented from being input again by the user, and the time of the user is saved.
Step 205, when the first browser kernel is switched to the second browser kernel, the cache data is obtained in the unified cache according to the second web page request of the second browser kernel.
The specific content of this step is the same as that of step 102 in the above embodiment, and is not described here again.
And step 206, assembling the obtained cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request with cache data to the target server.
The specific content of this step is the same as that of step 103 in the above embodiment, and is not described here again.
According to the data processing method for switching the browser cores, when the first browser core accesses the target server of the target domain name, the cache data in the webpage data are stored in the unified cache, so that the first browser core or other browser cores can call the cache data in the unified cache conveniently, and the cache data in the unified cache can be shared by a plurality of browser cores.
On the basis of the above technical solution, after determining that the target kernel is the first browser kernel, the method may further include:
and sending the webpage data to the first browser inner core, and analyzing and rendering the webpage data by the first browser inner core.
After the target inner core is determined to be the first browser inner core through the characteristic analysis of the webpage data, the webpage data are sent to the first browser inner core, and therefore the first browser inner core can analyze and render the webpage data.
Fig. 3 is a flowchart of steps of a data processing method for switching a browser kernel according to another embodiment of the present invention, as shown in fig. 3, the method may include:
step 301, when receiving a first web page request of a first browser kernel, determining a target domain name and a corresponding target server according to the first web page request
The specific content of this step is the same as that of step 201 in the above embodiment, and is not described here again.
Step 302, according to the target domain name, querying corresponding cache data in the unified cache.
And when the browser receives a first webpage request of a first browser kernel, inquiring whether cache data corresponding to the target domain name exists in the unified cache.
Step 303, when the uniform cache does not have the cache data corresponding to the target domain name, sending the first web page request to the target server, otherwise, assembling the queried cache data and the first web page request into a first web page request with cache data and sending the first web page request to the target server.
And when the cache data corresponding to the target domain name does not exist in the unified cache, directly sending the first webpage request to the target server. When cache data corresponding to the target domain name is inquired in the unified cache, the inquired cache data and the first webpage request are assembled into a first webpage request with cache data, and the first webpage request with the cache data is sent to the target server. For example, when a user requests to log in a certain webpage, the browser can acquire Cookie data in the unified cache, assemble the Cookie data with the webpage request into a webpage request with the Cookie data, and send the webpage request to the target server, so that the user is prevented from inputting user information again.
When the uniform cache has cache data corresponding to the target domain name, the cache data may be data cached when the first browser kernel accesses the target server of the target domain name before, or data cached when other browser kernels access the target server of the target domain name.
Step 304, receiving the webpage data returned by the target server, determining that the target kernel is the first browser kernel, and screening the cache data in the webpage data.
The specific content of this step is the same as that of step 203 in the above embodiment, and is not described here again.
Step 305, storing the screened cache data and the target domain name into the unified cache correspondingly.
Optionally, the storing the filtered cache data and the target domain name into the unified cache correspondingly includes:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
And when the cache data corresponding to the target domain name is not inquired in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache. When the cache data corresponding to the target domain name exists in the unified cache, the screened cache data is used for updating the cache data corresponding to the target domain name in the unified cache, and the cache data in the unified cache is ensured to be the latest data.
And step 306, when the first browser kernel is switched to the second browser kernel, obtaining the cache data in the unified cache according to a second webpage request of the second browser kernel.
The specific content of this step is the same as that of step 205 in the above embodiment, and is not described here again.
Step 307, assembling the obtained cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request with cache data to the target server.
The specific content of this step is the same as that of step 206 in the above embodiment, and is not described here again.
In the data processing method for switching browser cores, when a first web page request of a first browser core is received, corresponding cache data is queried in a unified cache according to a target domain name in the first web page request, if the cache data exists, the cache data and the first web page request are sent to a target server, and if the cache data does not exist, the first web page request is directly sent to the target server, so that cache data of all browser cores are cached in the unified cache of a browser, and a plurality of browser cores share the cache data in the unified cache.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Fig. 4 is a block diagram of a data processing apparatus for switching a browser core according to an embodiment of the present invention, where the data processing apparatus for switching a browser core may be applied to a browser, and as shown in fig. 4, the data processing apparatus 400 for switching a browser core may include:
the cache data saving module 401 is configured to, when a first web page request of a first browser kernel accesses a target server whose domain name is a target domain name, save cache data corresponding to the target domain name into a unified cache of a browser;
a cache data obtaining module 402, configured to, when switching from a first browser core to a second browser core, obtain, according to a second web page request of the second browser core, the cache data in the unified cache;
a web page request sending module 403, configured to assemble the obtained cache data and the second web page request into a second web page request with cache data, and send the second web page request with cache data to the target server.
Optionally, the cache data saving module includes:
the domain name determining unit is used for determining a target domain name and a corresponding target server according to a first webpage request when the first webpage request of a first browser kernel is received;
a web page request sending unit, configured to send the first web page request to the target server;
the cache data screening unit is used for receiving the webpage data returned by the target server, determining a target kernel as the first browser kernel and screening the cache data in the webpage data;
and the cache data storage unit is used for correspondingly storing the screened cache data and the target domain name into the unified cache.
Optionally, the cache data saving module further includes:
the cache data query unit is used for querying corresponding cache data in the unified cache according to the target domain name;
the web page request sending unit is specifically configured to:
and when the uniform cache does not have cache data corresponding to the target domain name, sending the first webpage request to the target server, otherwise, assembling the inquired cache data and the first webpage request into a first webpage request with cache data and sending the first webpage request to the target server.
Optionally, the cache data storage unit is specifically configured to:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
Optionally, the method further includes:
and the analysis rendering module is used for sending the webpage data to the first browser kernel, and the first browser kernel performs analysis rendering on the webpage data.
Optionally, the method further includes:
and the first updating module is used for receiving updated cache data sent by the first browser kernel and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
Optionally, the method further includes:
and the second updating module is used for updating the corresponding cache data in the unified cache when receiving the update data of the cache data sent by the target server.
Optionally, the cache data includes Cookie data.
In the data processing apparatus for switching browser cores provided in this embodiment, when accessing a target server whose domain name is a target domain name according to a first web page request of a first browser core, a cache data storage module stores cache data corresponding to the target domain name into a unified cache of a browser, when switching from the first browser core to a second browser core, a cache data obtaining module obtains the cache data in the unified cache according to a second web page request of the second browser core, a web page request sending module assembles the obtained cache data and the second web page request into a second web page request with cache data, and sends the second web page request to the target server, so that the browser cores share the cache data, and the same cache data does not need to be cached separately in each browser core, thereby saving a storage space, and data information is not transmitted through the kernel any more, and data conversion is not needed, so that kernel switching efficiency is effectively improved, and page loading rate is further improved.
Fig. 5 is a block diagram of a browser according to an embodiment of the present invention, and as shown in fig. 5, the browser 500 may include: kernel layer 510, data processing apparatus 400 switching browser kernels. The kernel layer 510 includes at least two browser kernels, and a webkit kernel, a Trident kernel, a Gecko kernel, and other kernels are illustrated in fig. 5 as examples. The data processing apparatus 400 for switching browser cores is a data processing apparatus for switching browser cores in the foregoing embodiment, and is configured to uniformly send a web page request to a server, receive web page data of the server, and send the web page data to a target core, where the data processing apparatus includes a cache data storage module 401, a cache data obtaining module 402, and a web page request sending module 403, and specific contents of each module may be referred to in the description in the foregoing embodiment, and are not described herein again. The data processing apparatus 400 for switching browser cores further includes a unified cache for uniformly storing cache data of the browser cores.
The browser provided by the embodiment can store the cache data of each browser core in the unified cache, the same cache data can be stored only once, the storage space is saved, when the browser cores are switched, the cache data can be directly obtained from the unified cache, the cache data sharing is realized, the data information is not transmitted through the cores any more, the data conversion is not needed, the core switching efficiency is effectively improved, and the page loading rate is further improved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
Further, according to an embodiment of the present invention, there is provided a terminal, where the terminal may be a mobile phone, a computer, a tablet computer, or the like, and may include: the system comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the data processing method for switching browser kernels of the previous embodiment is realized.
According to an embodiment of the present invention, there is also provided a computer-readable storage medium including a disk memory, a CD-ROM, an optical memory, and the like, on which a computer program is stored, which, when executed by a processor, implements the data processing method of switching browser cores of the foregoing embodiments.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data processing method, the data processing device, the data processing terminal and the data processing storage medium for switching the browser kernel provided by the invention are introduced in detail, and a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (16)

1. A data processing method for switching browser kernels is characterized by comprising the following steps:
when a first webpage of a first browser kernel requests to access a target server with a domain name as a target domain name, storing cache data corresponding to the target domain name into a uniform cache of a browser; the unified cache is a storage space in which the browser uniformly stores cache data of each browser kernel, the cache data is in a unified format, and the corresponding cache data in the unified cache is updated according to the update of the cache data by each browser kernel;
when the first browser kernel is switched to a second browser kernel, the cache data are obtained in the unified cache according to a second webpage request of the second browser kernel;
assembling the obtained cache data and the second webpage request into a second webpage request with cache data, and sending the second webpage request to the target server;
wherein, the accessing the target server with the domain name as the target domain name according to the first webpage request of the first browser kernel comprises:
according to the target domain name, inquiring corresponding cache data in the unified cache;
if the cache data corresponding to the target domain name does not exist in the unified cache, sending the first webpage request to the target server; otherwise, the inquired cache data and the first webpage request are assembled into a first webpage request with cache data and sent to the target server; wherein the queried cache data comprises: the data cached when the first browser kernel accesses the target server of the target domain name before, or the data cached when other browser kernels access the target server of the target domain name.
2. The method of claim 1,
executing the following steps before the step of querying corresponding cache data in the unified cache according to the target domain name:
when a first webpage request of a first browser kernel is received, determining a target domain name and a corresponding target server according to the first webpage request;
storing the cache data corresponding to the target domain name into a uniform cache of a browser, including:
receiving webpage data returned by the target server, determining a target kernel as the first browser kernel, and screening cache data in the webpage data;
and correspondingly storing the screened cache data and the target domain name into the unified cache.
3. The method according to claim 2, wherein the storing the filtered cache data corresponding to the target domain name in the unified cache comprises:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
4. The method of claim 2, wherein after determining that the target kernel is the first browser kernel, further comprising:
and sending the webpage data to the first browser inner core, and analyzing and rendering the webpage data by the first browser inner core.
5. The method of claim 1, further comprising:
and receiving updated cache data sent by the first browser kernel, and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
6. The method of claim 1, further comprising:
and when receiving the updating data of the cache data sent by the target server, updating the corresponding cache data in the unified cache.
7. The method of any of claims 1-6, wherein the cached data comprises Cookie data.
8. A data processing apparatus for switching a browser core, comprising:
the cache data storage module is used for storing cache data corresponding to a target domain name into a uniform cache of the browser when a first webpage request of a first browser kernel accesses the target server with the domain name as the target domain name; the unified cache is a storage space in which the browser uniformly stores cache data of each browser kernel, the cache data is in a unified format, and the corresponding cache data in the unified cache is updated according to the update of the cache data by each browser kernel;
the cache data acquisition module is used for acquiring the cache data in the unified cache according to a second webpage request of a second browser kernel when the first browser kernel is switched to the second browser kernel;
the webpage request sending module is used for assembling the obtained cache data and the second webpage request into a second webpage request with cache data and sending the second webpage request to the target server;
the cache data storage module comprises:
the cache data query unit is used for querying corresponding cache data in the unified cache according to the target domain name;
the cache data storage module comprises a webpage request sending unit, and the webpage request sending unit is used for:
when the cache data corresponding to the target domain name does not exist in the unified cache, the first webpage request is sent to the target server, otherwise, the inquired cache data and the first webpage request are assembled into a first webpage request with cache data and sent to the target server, wherein the inquired cache data comprise: the data cached when the first browser kernel accesses the target server of the target domain name before, or the data cached when other browser kernels access the target server of the target domain name.
9. The apparatus of claim 8, wherein the cache data saving module further comprises:
the domain name determining unit is used for determining a target domain name and a corresponding target server according to a first webpage request when the first webpage request of a first browser kernel is received;
the cache data screening unit is used for receiving the webpage data returned by the target server, determining a target kernel as the first browser kernel and screening the cache data in the webpage data;
and the cache data storage unit is used for correspondingly storing the screened cache data and the target domain name into the unified cache.
10. The apparatus of claim 9, wherein the cache data saving unit is specifically configured to:
when the cache data corresponding to the target domain name does not exist in the unified cache, correspondingly storing the screened cache data and the target domain name into the unified cache;
and when the cache data corresponding to the target domain name exists in the unified cache, updating the cache data corresponding to the unified cache according to the screened cache data.
11. The apparatus of claim 9, further comprising:
and the analysis rendering module is used for sending the webpage data to the first browser kernel, and the first browser kernel performs analysis rendering on the webpage data.
12. The apparatus of claim 8, further comprising:
and the first updating module is used for receiving updated cache data sent by the first browser kernel and updating corresponding cache data in the unified cache, wherein the updated cache data is detected in the running process of the first browser kernel.
13. The apparatus of claim 8, further comprising:
and the second updating module is used for updating the corresponding cache data in the unified cache when receiving the update data of the cache data sent by the target server.
14. The apparatus of any of claims 8-13, wherein the cached data comprises Cookie data.
15. A terminal, comprising: a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing a data processing method for switching browser cores according to any one of claims 1 to 7.
16. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the data processing method of switching a browser core according to any one of claims 1 to 7.
CN201811302043.XA 2018-11-02 2018-11-02 Data processing method, device, terminal and storage medium for switching browser kernels Active CN109634753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811302043.XA CN109634753B (en) 2018-11-02 2018-11-02 Data processing method, device, terminal and storage medium for switching browser kernels

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811302043.XA CN109634753B (en) 2018-11-02 2018-11-02 Data processing method, device, terminal and storage medium for switching browser kernels

Publications (2)

Publication Number Publication Date
CN109634753A CN109634753A (en) 2019-04-16
CN109634753B true CN109634753B (en) 2020-02-11

Family

ID=66067282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811302043.XA Active CN109634753B (en) 2018-11-02 2018-11-02 Data processing method, device, terminal and storage medium for switching browser kernels

Country Status (1)

Country Link
CN (1) CN109634753B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782419B (en) * 2020-06-23 2023-11-14 北京青云科技股份有限公司 Cache updating method, device, equipment and storage medium
CN112579570B (en) * 2020-12-16 2023-06-23 中国辐射防护研究院 Nuclear environment data storage method and device
CN112887408B (en) * 2021-01-27 2022-11-01 合肥大多数信息科技有限公司 System and method for solving data state sharing of multi-kernel browser
CN114374557A (en) * 2022-01-07 2022-04-19 挂号网(杭州)科技有限公司 Webpage data requesting method and device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102467565B (en) * 2010-11-19 2016-05-11 北京奇虎科技有限公司 A kind of method that browser kernel switches
CN103294700B (en) * 2012-02-24 2018-01-12 腾讯科技(北京)有限公司 Method and apparatus are locally stored in a kind of data of browser-cross
CN102624891B (en) * 2012-03-08 2014-03-26 腾讯科技(深圳)有限公司 Method for switching kernel of browser and corresponding browser
CN104516885B (en) * 2013-09-26 2019-04-16 腾讯科技(深圳)有限公司 The implementation method and device of browser dual core component
CN103530329A (en) * 2013-09-27 2014-01-22 北京奇虎科技有限公司 Method and device for performing webpage loading and browsers
CN104468834B (en) * 2014-12-26 2017-12-26 北京奇虎科技有限公司 Carry out the method, apparatus and browser client of Cookie data processing

Also Published As

Publication number Publication date
CN109634753A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109634753B (en) Data processing method, device, terminal and storage medium for switching browser kernels
AU2015401229B2 (en) Website access method, apparatus, and website system
US9883002B2 (en) Method and system for accessing website
JP6091579B2 (en) Method and apparatus for handling nested fragment caching of web pages
CN102375882B (en) Method, device and browser for rapidly accessing webpage
CN105095280B (en) Browser caching method and device
EP2724251B1 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN107465707B (en) Content refreshing method and device for content distribution network
CN105930528B (en) Webpage caching method and server
KR20160030381A (en) Method, device and router for access webpage
US10165039B1 (en) Pre-connecting to a cacheable resource based on page profiles
CN109167840B (en) Task pushing method, node autonomous server and edge cache server
US9088462B2 (en) Common web accessible data store for client side page processing
CN103051706A (en) Dynamic webpage request processing system and method for dynamic website
CN103347089A (en) Method and device for separating and accelerating dynamic resources and static resources of website
CN103152367A (en) Cache dynamic maintenance updating method and system
CN108256014B (en) Page display method and device
US7949724B1 (en) Determining attention data using DNS information
CN110933193B (en) Domain name resolution method and device, electronic equipment and computer readable storage medium
US10095791B2 (en) Information search method and apparatus
CN102156697A (en) Method and terminal equipment for realizing webpage application through widget
CN106959975B (en) Transcoding resource cache processing method, device and equipment
CN104219277A (en) Rearranging a server response
CN111240750B (en) Awakening method and device for target application program
CN110830537B (en) Page processing method and device

Legal Events

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