CN110727478A - Method, device, equipment and medium for rendering page based on mixed mode - Google Patents
Method, device, equipment and medium for rendering page based on mixed mode Download PDFInfo
- Publication number
- CN110727478A CN110727478A CN201910981759.5A CN201910981759A CN110727478A CN 110727478 A CN110727478 A CN 110727478A CN 201910981759 A CN201910981759 A CN 201910981759A CN 110727478 A CN110727478 A CN 110727478A
- Authority
- CN
- China
- Prior art keywords
- page
- network
- resource
- rendering
- difference
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method, a device, equipment and a medium for rendering a page based on a mixed mode, wherein the method comprises the steps of obtaining a page display request, and the page display request comprises a page display resource address; starting a first thread, and loading a network view component in the first thread; starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server; rendering network resources corresponding to the network file based on the network view component to obtain a target page; and displaying the target page. According to the method, the steps of loading the network view and acquiring the network file are implemented in parallel, the target page is obtained through two-step rendering based on a parallel framework, and the three acceleration designs of a local updating strategy are used in the rendering link of the target page to obviously improve the page display speed, so that the viscosity of a user is improved.
Description
Technical Field
The invention relates to the field of page rendering in a mixed mode, in particular to a method, a device, equipment and a medium for rendering a page based on the mixed mode.
Background
The mixed mode development is an application software development mode between the native development and the page development, and can achieve the purpose of displaying a page for a user under a native application framework, so that the page is convenient to use for using network resources.
In order to accelerate the rendering speed of network resources of application software developed based on a mixed mode, in the field of network televisions, the rendering speed is mainly increased by caching an off-line packet in the prior art, but the off-line packet hit rate is limited, and due to more off-line packets, more security checks are performed during loading rendering, and the increase of the rendering speed is limited.
Disclosure of Invention
The method aims to solve the technical problem that the rendering speed of application software developed in a mixed mode is low in the prior art. The embodiment of the invention provides a method, a device, equipment and a medium for rendering a page based on a mixed mode.
In one aspect, the present invention provides a method for rendering a page based on a hybrid mode, where the method includes:
acquiring a page display request, wherein the page display request comprises a page display resource address;
starting a first thread, and loading a network view component in the first thread;
starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server;
rendering the network resources corresponding to the network file based on the network view component to obtain a target page;
and displaying the target page.
In another aspect, the present invention provides an apparatus for rendering a page based on a hybrid mode, the apparatus comprising:
the page display request acquisition module is used for acquiring a page display request, and the page display request comprises a page display resource address;
the first thread module is used for starting a first thread and loading the network view component in the first thread;
the second thread module is used for starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server;
the rendering module is used for rendering the network resources corresponding to the network file based on the network view component to obtain a target page;
and the display module is used for displaying the target page.
In another aspect, the present invention provides an apparatus for rendering a page based on a mixed mode, where the apparatus includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement a method for rendering a page based on a mixed mode.
In another aspect, the present invention provides a computer storage medium having at least one instruction, at least one program, set of codes, or set of instructions stored therein, the at least one instruction, at least one program, set of codes, or set of instructions being loaded by a processor and executing a method for rendering pages based on a mixed mode.
The invention provides a method, a device, equipment and a medium for rendering a page based on a mixed mode. According to the method, the steps of loading the network view and acquiring the network file are implemented in parallel, the target page is obtained through two-step rendering based on the parallel framework, and the display speed of the page is remarkably improved by using three acceleration designs of a local updating strategy in the rendering link of the target page, so that the viscosity of a user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic rendering flow diagram of application software developed in a mixed mode in the prior art provided by the present invention;
FIG. 2 is a software framework diagram of an implementation environment of a method for rendering a page based on a mixed mode according to the present invention;
FIG. 3 is a flowchart of a method for rendering a page based on a hybrid mode according to the present invention;
FIG. 4 is a flowchart of rendering the network resource corresponding to the network file based on the network view component to obtain a target page according to the present invention;
FIG. 5 is a flowchart for comparing the network resource corresponding to the network file with the historical resource to obtain a difference resource between the network resource corresponding to the network file and the historical resource according to the present invention;
FIG. 6 is a schematic diagram of a framework of a method for rendering a page based on a mixed mode according to the present invention;
FIG. 7 is a flowchart illustrating a method for rendering a page based on a mixed mode according to the present invention;
FIG. 8 is a block diagram of an apparatus for rendering a page based on a mixed mode according to the present invention;
FIG. 9 is a block diagram of a rendering module provided by the present invention;
fig. 10 is a hardware structural diagram of an apparatus for implementing the method provided by the embodiment of the 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 obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to make the objects, technical solutions and advantages disclosed in the embodiments of the present invention more clearly apparent, the embodiments of the present invention are described in further detail below with reference to the accompanying drawings and the embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the invention and are not intended to limit the embodiments of the invention.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified. In order to facilitate understanding of the technical solutions and the technical effects thereof described in the embodiments of the present invention, the embodiments of the present invention first explain related terms:
hybrid: the framework of the mixed-mode development application program is a development mode between network development and native development, and application software developed based on the Hybird framework has the advantages of good user experience of the native development and cross-platform development of the network development. The application software developed based on Hybird looks like a native application, but can display pages. The Hybrid architecture is widely applied to the fields of mobile terminals and internet televisions at present.
WebView: and the network view component can load the display page, can be regarded as a browser and uses an open-source browser engine WebKit rendering engine to load the display page.
HTTP: hyper Text Transfer Protocol, hypertext Transfer Protocol. HTTP is based on a client/server model and is connection oriented. Typical HTTP transactions involve a client establishing a connection with a server; a client makes a request to a server; the server receives the request and returns a corresponding file as a response according to the request; the client closes the connection with the server. The HTTP connection between the client and the server is a one-time connection, which limits each connection to process only one request, and immediately closes the connection when the server returns the response of the request, and reestablishes the connection when the server requests the next time. HTTP is a stateless protocol, namely, the server does not keep any state when transacting with the client, thereby lightening the memory burden of the server and keeping the faster response speed. HTTP is an object-oriented protocol. Allowing any type of data object to be transferred.
HTTPS: hyper Text Transfer Protocol over Secure Socket Layer, HTTP transport Protocol targeting security. It is informed that SSL is added under HTTP to realize the security foundation of HTTPS is SSL, so that SSL is needed for the encrypted detailed content.
SSL: secure Sockets Layer, and its successor Transport Layer Security (TLS) is a Security protocol that provides Security and data integrity for network communications. TLS and SSL encrypt the network connection between the transport layer and the application layer.
HyperText Markup Language (HTML), a Markup Language for hypertext, is a Markup Language. The document format on the network can be unified through the labels, so that the scattered Internet resources are connected into a logic whole. HTML text is descriptive text consisting of HTML commands that can specify words, graphics, animations, sounds, tables, links, etc.
HTML5 specification of the fifth edition HTML.
As shown in fig. 1, it shows the rendering flow of the application software developed by the mixed mode in the prior art. In response to a click instruction sent by a user, a web view component (WebView) is loaded, a web access request (intercept request, a browser built-in web request) is generated through a loadUrl interface of the WebView, the web access request is transmitted to a server pointed by a web resource based on an HTTP or HTTPS protocol, so that the server feeds back a web file (HTML or HTML5) related to the web resource in the form of a data stream (stream), and the web resource is displayed by the web view component according to the web file.
As can be seen from the rendering process described in fig. 1, in the prior art, the loading of the web view component and the accessing of the network resource are in a serial relationship, and the whole rendering process is also performed in series, so that the time consumption of the rendering process includes the time consumption of the loading of the web view component, the time consumption of the accessing of the network resource, and the time consumption of the rendering. The serial rendering mode causes the rendering speed to be slow, and the content is not displayed in time so as not to meet the requirements of users.
In view of the obvious hysteresis of the rendering speed of the application software developed in the mixed mode in the prior art, a technical scheme for improving the rendering speed based on the offline packet cache is proposed in the prior art, but the offline packet hit rate is limited and the security check required during loading is more, so that the effect of improving the rendering speed is limited.
Further, not only the mobile terminal, but also the application software developed based on the hybrid mode is increasingly used in the network television, and is limited by the hardware condition and the software environment of the network television, and the disadvantage that the rendering speed of the application software developed based on the hybrid mode is slow is further highlighted. In order to improve the rendering speed of application software developed based on a hybrid mode, the embodiment of the invention provides a method for rendering a page based on a hybrid mode.
As shown in fig. 2, it shows a software framework diagram of an implementation environment of a method for rendering a page based on a mixed mode, which may be a mobile terminal environment, a network television environment or other hardware environment capable of running application software developed based on a mixed mode. The software system of the implementation environment may employ a hierarchical architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of an implementation environment.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, which are an application layer, an application framework layer, an Android runtime and system library, and a kernel layer from top to bottom. The application layer may include a series of application packages.
The application layer may include various applications, and the method for rendering a page in a hybrid mode according to the embodiment of the present invention is a method for enabling an application to quickly display a page, the method being developed based on a hybrid mode and running in the application layer.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes a number of predefined functions.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling of an Android system and a core library comprises two parts.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Referring to FIG. 3, a method of rendering a page based on a hybrid mode is shown, which may include:
s101, a page display request is obtained, and the page display request comprises a page display resource address.
Specifically, the page display request may be triggered by capturing some operation of the user on the display interface, including but not limited to: at least one of a single-click operation, a long-press operation, a pressure touch operation, a multi-click operation, a floating touch operation, a double-finger touch operation, a finger joint double-click operation and a pull-down operation.
Wherein, the single-click operation is the operation of clicking the touch screen once; the long-press operation is an operation in which the duration of pressing the touch screen exceeds a first duration; the pressure touch operation is an operation that the pressing pressure exceeds a preset pressure value; the multi-click operation is an operation in which the number of clicks exceeds a predetermined number within a predetermined time; the suspension touch operation is an operation with the time length of suspending above the touch screen exceeding a second time length; the double-finger touch operation is an operation that a user clicks a touch screen simultaneously by using double fingers; the finger joint double-click operation is an operation of a user using a finger joint double-click touch screen; the pull-down operation is an operation in which the user presses the touch screen with a finger and drags down.
S103, starting a first thread, and loading the network view component in the first thread.
And S105, starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server.
In the prior art, the page access request in the mixed-mode application software is generated based on the built-in interface of the network view component, so that after the network view component is successfully loaded, the network view component generates the page access request to render the page, and therefore the two steps of loading the page view component and generating the page access request in the mixed-mode application software in the prior art are implemented in series, and the rendering speed is reduced by implementing the two steps in series.
Different from the prior art, the page access request is not generated by relying on a built-in interface of the network view component any more in the embodiment of the invention, so that the generation of the page access request and the loading of the network view component can be carried out in parallel, thereby improving the rendering speed.
In a preferred embodiment, if the second thread fails to access, after the network view component is successfully loaded, the page display request is routed to the network view component, the network view component generates a page access request, the page access request is transmitted to a server to which the page display resource address points, and a network file fed back by the server is acquired. In this embodiment, if the second thread fails to access, the rendering logic in the prior art is reverted to, that is, a network view component built-in interface is used to generate a page access request, so that the probability of a network file request failure based on the second thread only is reduced, and the rendering robustness is improved.
And S107, rendering the network resources corresponding to the network file based on the network view component to obtain a target page.
In one possible embodiment, the network view component may be used directly to render the network file, thereby rendering the network resource corresponding to the network file to the target page.
In a preferred embodiment, the rendering speed of the target page can be increased by setting the cache.
Specifically, the rendering the network resource corresponding to the network file based on the network view component to obtain the target page, as shown in fig. 4, includes:
s1071, searching historical resources in the cache according to the page display resource address.
And S1073, rendering the historical resources by the network view component to obtain a middle page.
If the historical resource is an empty resource, that is, the cache does not store the network resource related to the page display resource address, the intermediate page is an empty page; and if the historical resources are not empty resources, rendering the historical resources to obtain an intermediate page.
S1075, comparing the network resources corresponding to the network file with the historical resources to obtain the difference resources of the network resources corresponding to the network file relative to the historical resources.
Obviously, the history resources and the difference resources comprise all contents of the network resources corresponding to the network files, the history resources and the difference resources are rendered in two steps, and the rendering of the history resources and the acquisition of the network files can be performed in parallel, so that the rendering speed is obviously improved.
In a preferred embodiment, a network resource may be split into a template and data, and then the comparing the network resource corresponding to the network file with the historical resource obtains a difference resource of the network resource corresponding to the network file with respect to the historical resource, as shown in fig. 5, includes:
s10751, extracting a first template and first data of the network resource corresponding to the network file.
S10753, extracting a second template and second data of the historical resources.
S10755, comparing the first template with the second template to obtain difference template data.
S10757, comparing the first data with the second data to obtain difference data.
S10759, obtaining difference resources according to the difference template data and the difference data.
S1077, the network view component updates the intermediate page according to the difference resources to obtain a target page.
And on the basis of the intermediate page, rendering the difference resource so as to locally update the intermediate page to obtain the target page.
In a preferred embodiment, if the network resource is split into the template and the data, the template portion of the network resource obtained according to the same page display resource address at different time periods usually has no variation or has small variation, and the variation is mainly concentrated on the data portion, i.e. the data amount of the difference template data is small or even 0, so that the difference template data can be rendered a small amount on the basis of the successful rendering of the intermediate page, and the target page can be obtained by partially rendering the difference data.
Compared with the prior art, the embodiment of the invention does not directly display the intermediate page, but intercepts the intermediate page until the intermediate page is updated to the target page, and then displays the target page. The rendering process of the middle page can be implemented in the first thread or the network view component, and the acquisition process of the network file can be implemented in the second thread, so that the rendering process of the middle page and the acquisition process of the network resource are parallel, the page is rendered in advance, the middle page is updated to the target page, the target page is updated locally, the speed is high, and the generation speed of the target page can be obviously improved.
In a preferred embodiment, the method may further include the step of updating the cache according to the difference resource.
In one embodiment, if the difference resource is empty, the cache does not need to be updated; and if the difference resource is not empty, replacing the file corresponding to the historical resource in the cache by using the network file.
In another embodiment, if the difference resource is empty, the cache does not need to be updated; and if the difference resource is not empty, respectively updating the cache according to the difference data and the difference template data.
In a preferred embodiment, the cache may also be updated automatically. In one possible embodiment, in response to a preset event or a trigger of a timer, each network address recorded in the cache is accessed, and the cache is updated according to an access result. Specifically, the updating method may be direct replacement or separate updating according to the difference data and the difference template data.
And S109, displaying the target page.
Fig. 6 is a schematic frame diagram illustrating a method for rendering a page based on a hybrid mode according to an embodiment of the present invention. Responding to a page display request triggered by a user, loading a network view component in parallel and generating a page access request; and splitting according to the fed back network file to obtain a splitting result, and rendering the page based on the splitting result. The frame schematic diagram shows two acceleration designs for improving the rendering speed of the embodiment of the invention, wherein one acceleration design is to perform the steps of loading the network view and acquiring the network file in parallel, and the other acceleration design is to split the network resource into the template and the data and perform page rendering according to the split result.
Fig. 7 is a flowchart illustrating a method for rendering a page based on a mixed mode according to an embodiment of the present invention. After the page display resource address is obtained, the network view component is initialized and loaded and the network file is requested to be carried out in parallel, and the page display request can be routed to the network view component for further processing after the network file is requested to be failed. After the network view component is loaded successfully, the historical resources can be loaded by the network view component, and the generated intermediate page is intercepted. After the network file is successfully acquired, the network file can be split to obtain a second template and second data, the second template and the second data are respectively compared with the first template and the first data of the historical resources to obtain difference resources, the middle page is updated according to the difference resources to obtain a target page, and the target page is displayed. The third acceleration design for increasing the rendering speed of the embodiment of the invention is mainly embodied in the flow diagram, namely, after history resources are rendered, the middle page is intercepted, the middle page is updated to the target page in a local updating mode and then displayed, and the page display speed is increased through two-step rendering.
According to the method for rendering the page based on the mixed mode, disclosed by the embodiment of the invention, the steps of loading the network view and acquiring the network file are implemented in parallel, the target page is rendered in two steps based on the parallel framework, and the display speed of the page is obviously improved by using three acceleration designs of a local updating strategy in the rendering link of the target page, so that the viscosity of a user is improved.
An embodiment of the present invention further provides a device for rendering a page based on a hybrid mode, and as shown in fig. 8, the device includes:
a page display request obtaining module 201, configured to obtain a page display request, where the page display request includes a page display resource address;
the first thread module 203 is used for starting a first thread and loading the network view component in the first thread;
a second thread module 205, configured to start a second thread, generate a page access request according to the page display resource address in the second thread, transmit the page access request to a server to which the page display resource address points, and obtain a network file fed back by the server;
a rendering module 207, configured to render, based on the network view component, a network resource corresponding to the network file to obtain a target page;
and a display module 209, configured to display the target page.
As shown in fig. 9, the rendering module 207 includes:
a historical resource searching unit 2071, configured to search a historical resource in the cache according to the page display resource address;
an intermediate page rendering unit 2073, configured to render the history resource by the network view component to obtain an intermediate page;
a difference resource extracting unit 2075, configured to compare the network resource corresponding to the network file with the historical resource, to obtain a difference resource of the network resource corresponding to the network file relative to the historical resource;
a local updating unit 2077, configured to update, by the network view component, the intermediate page according to the difference resource to obtain a target page.
Specifically, the embodiments of the device and the method for rendering a page based on a mixed mode are all based on the same inventive concept. For details, please refer to the method embodiment, which is not described herein.
The embodiment of the invention also provides a computer storage medium, and the computer storage medium can store a plurality of instructions. The instructions can be suitable for being loaded by a processor and executing a honeypot induction based attack perception method according to the embodiment of the invention, and the method at least comprises the following steps:
a method of rendering a page based on a hybrid mode, the method comprising:
acquiring a page display request, wherein the page display request comprises a page display resource address;
starting a first thread, and loading a network view component in the first thread;
starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server;
rendering the network resources corresponding to the network file based on the network view component to obtain a target page;
and displaying the target page.
In a preferred embodiment, the rendering the network resource corresponding to the network file based on the network view component to obtain the target page includes:
searching historical resources in a cache according to the page display resource address;
rendering the historical resources by the network view component to obtain an intermediate page;
comparing the network resources corresponding to the network file with the historical resources to obtain difference resources of the network resources corresponding to the network file relative to the historical resources;
and updating the intermediate page by the network view component according to the difference resource to obtain a target page.
In a preferred embodiment, the comparing the network resource corresponding to the network file with the historical resource to obtain a difference resource of the network resource corresponding to the network file with respect to the historical resource includes:
extracting a first template and first data of a network resource corresponding to a network file;
extracting a second template and second data of the historical resources;
comparing the first template with the second template to obtain difference template data;
comparing the first data with the second data to obtain difference data;
and obtaining difference resources according to the difference template data and the difference data.
In a preferred embodiment, the method further includes a step of updating the cache according to the difference resource, and the step of updating the cache according to the difference resource includes:
if the difference resource is not empty, replacing the file corresponding to the historical resource in the cache by using the network file;
or the like, or, alternatively,
and if the difference resource is not empty, respectively updating the cache according to the difference data and the difference template data.
In a preferred embodiment, the method further comprises the step of automatically updating the cache, wherein the automatically updating the cache comprises:
and responding to a preset event or the triggering of a timer, accessing each network address recorded in the cache, and updating the cache according to an access result.
In a preferred embodiment, the method further comprises:
if the second thread fails to access, after the network view component is loaded successfully, the page display request is routed to the network view component, the network view component generates a page access request, the page access request is transmitted to a server pointed by the page display resource address, and a network file fed back by the server is obtained.
Further, fig. 10 shows a hardware structure diagram of an apparatus for implementing the method provided by the embodiment of the present invention, and the apparatus may participate in forming or containing the device or system provided by the embodiment of the present invention. As shown in fig. 10, the device 10 may include one or more (shown as 102a, 102b, … …, 102 n) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 10 is merely illustrative and is not intended to limit the structure of the electronic device. For example, device 10 may also include more or fewer components than shown in FIG. 10, or have a different configuration than shown in FIG. 10.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in the device 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the method described in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104, so as to implement the method for rendering pages based on mixed mode described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by the communication provider of the device 10. In one example, the transmission device 106 includes a network adapter (NIC) that can be connected to other network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the device 10 (or mobile device).
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the device and server embodiments, since they are substantially similar to the method embodiments, the description is simple, and the relevant points can be referred to the partial description of the method embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (10)
1. A method for rendering a page based on a hybrid mode, the method comprising:
acquiring a page display request, wherein the page display request comprises a page display resource address;
starting a first thread, and loading a network view component in the first thread;
starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server;
rendering the network resources corresponding to the network file based on the network view component to obtain a target page;
and displaying the target page.
2. The method of claim 1, wherein the rendering the network resource corresponding to the network file based on the network view component to obtain a target page comprises:
searching historical resources in a cache according to the page display resource address;
rendering the historical resources by the network view component to obtain an intermediate page;
comparing the network resources corresponding to the network file with the historical resources to obtain difference resources of the network resources corresponding to the network file relative to the historical resources;
and updating the intermediate page by the network view component according to the difference resource to obtain a target page.
3. The method according to claim 2, wherein the comparing the network resource corresponding to the network file with the historical resource to obtain a difference resource of the network resource corresponding to the network file with respect to the historical resource comprises:
extracting a first template and first data of a network resource corresponding to a network file;
extracting a second template and second data of the historical resources;
comparing the first template with the second template to obtain difference template data;
comparing the first data with the second data to obtain difference data;
and obtaining difference resources according to the difference template data and the difference data.
4. The method according to claim 2 or 3, further comprising the step of updating the cache according to the difference resource, wherein the step of updating the cache according to the difference resource comprises:
if the difference resource is not empty, replacing the file corresponding to the historical resource in the cache by using the network file;
or the like, or, alternatively,
and if the difference resource is not empty, respectively updating the cache according to the difference data and the difference template data.
5. The method of claim 2, further comprising the step of automatically updating a cache, said automatically updating a cache comprising:
and responding to a preset event or the triggering of a timer, accessing each network address recorded in the cache, and updating the cache according to an access result.
6. The method of claim 1, further comprising:
if the second thread fails to access, after the network view component is loaded successfully, the page display request is routed to the network view component, the network view component generates a page access request, the page access request is transmitted to a server pointed by the page display resource address, and a network file fed back by the server is obtained.
7. An apparatus for rendering a page based on a hybrid mode, the apparatus comprising:
the page display request acquisition module is used for acquiring a page display request, and the page display request comprises a page display resource address;
the first thread module is used for starting a first thread and loading the network view component in the first thread;
the second thread module is used for starting a second thread, generating a page access request according to the page display resource address in the second thread, transmitting the page access request to a server pointed by the page display resource address, and acquiring a network file fed back by the server;
the rendering module is used for rendering the network resources corresponding to the network file based on the network view component to obtain a target page;
and the display module is used for displaying the target page.
8. The apparatus of claim 7, wherein the rendering module comprises:
the historical resource searching unit is used for searching the historical resources in the cache according to the page display resource address;
the intermediate page rendering unit is used for rendering the historical resources by the network view component to obtain an intermediate page;
a difference resource extraction unit, configured to compare the network resource corresponding to the network file with the historical resource, to obtain a difference resource of the network resource corresponding to the network file with respect to the historical resource;
and the local updating unit is used for updating the intermediate page by the network view component according to the difference resource to obtain a target page.
9. A computer storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of rendering pages based on a mixed mode according to any one of claims 1 to 6.
10. An apparatus for rendering pages based on mixed mode, the apparatus comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded by the processor and performing a method of rendering pages based on mixed mode according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910981759.5A CN110727478B (en) | 2019-10-16 | 2019-10-16 | Method, device, equipment and medium for rendering page based on mixed mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910981759.5A CN110727478B (en) | 2019-10-16 | 2019-10-16 | Method, device, equipment and medium for rendering page based on mixed mode |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110727478A true CN110727478A (en) | 2020-01-24 |
CN110727478B CN110727478B (en) | 2021-11-16 |
Family
ID=69221383
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910981759.5A Active CN110727478B (en) | 2019-10-16 | 2019-10-16 | Method, device, equipment and medium for rendering page based on mixed mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110727478B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111339472A (en) * | 2020-03-16 | 2020-06-26 | 上海英方软件股份有限公司 | Method, device and system for improving access speed of web system |
CN111639281A (en) * | 2020-05-29 | 2020-09-08 | 海信视像科技股份有限公司 | Page resource display method and display equipment |
CN112487324A (en) * | 2020-10-28 | 2021-03-12 | 贝壳技术有限公司 | Page generation method and device, electronic medium and storage medium |
CN112528593A (en) * | 2020-12-11 | 2021-03-19 | 北京百度网讯科技有限公司 | Document processing method and device, electronic equipment and storage medium |
CN112699321A (en) * | 2020-12-23 | 2021-04-23 | 车智互联(北京)科技有限公司 | Page loading method, computing equipment and storage medium |
CN113032078A (en) * | 2021-03-30 | 2021-06-25 | 深圳市中科明望通信软件有限公司 | Page display method and device, electronic equipment and computer readable storage medium |
CN113360807A (en) * | 2021-06-24 | 2021-09-07 | 平安普惠企业管理有限公司 | Page display method and device of mixed-mode mobile application and related equipment |
CN113452738A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Page loading method and client |
CN113778581A (en) * | 2021-07-28 | 2021-12-10 | 北京房江湖科技有限公司 | Page loading method, electronic equipment and storage medium |
CN117311708A (en) * | 2023-09-18 | 2023-12-29 | 中教畅享(北京)科技有限公司 | Dynamic modification method and device for resource display page in 3D scene of webpage end |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080094403A1 (en) * | 2003-11-19 | 2008-04-24 | Reuven Bakalash | Computing system capable of parallelizing the operation graphics processing units (GPUs) supported on a CPU/GPU fusion-architecture chip and one or more external graphics cards, employing a software-implemented multi-mode parallel graphics rendering subsystem |
CN104461491A (en) * | 2013-09-24 | 2015-03-25 | 阿里巴巴集团控股有限公司 | Running method and system of Hybrid components |
CN107368560A (en) * | 2017-07-07 | 2017-11-21 | 腾讯科技(深圳)有限公司 | Method for implementing page and device, the computer-readable recording medium of Mobile solution |
CN108520031A (en) * | 2018-03-27 | 2018-09-11 | 广东能龙教育股份有限公司 | Method for increasing webpage loading speed |
CN108595457A (en) * | 2017-12-29 | 2018-09-28 | 北京奇虎科技有限公司 | A kind of rendering intent and device of the waterfall stream page |
CN109800369A (en) * | 2018-12-14 | 2019-05-24 | 平安普惠企业管理有限公司 | Hybrid app page loading method, device and computer equipment |
CN109948090A (en) * | 2019-03-08 | 2019-06-28 | 腾讯科技(深圳)有限公司 | Webpage loading method and device |
-
2019
- 2019-10-16 CN CN201910981759.5A patent/CN110727478B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080094403A1 (en) * | 2003-11-19 | 2008-04-24 | Reuven Bakalash | Computing system capable of parallelizing the operation graphics processing units (GPUs) supported on a CPU/GPU fusion-architecture chip and one or more external graphics cards, employing a software-implemented multi-mode parallel graphics rendering subsystem |
CN104461491A (en) * | 2013-09-24 | 2015-03-25 | 阿里巴巴集团控股有限公司 | Running method and system of Hybrid components |
CN107368560A (en) * | 2017-07-07 | 2017-11-21 | 腾讯科技(深圳)有限公司 | Method for implementing page and device, the computer-readable recording medium of Mobile solution |
CN108595457A (en) * | 2017-12-29 | 2018-09-28 | 北京奇虎科技有限公司 | A kind of rendering intent and device of the waterfall stream page |
CN108520031A (en) * | 2018-03-27 | 2018-09-11 | 广东能龙教育股份有限公司 | Method for increasing webpage loading speed |
CN109800369A (en) * | 2018-12-14 | 2019-05-24 | 平安普惠企业管理有限公司 | Hybrid app page loading method, device and computer equipment |
CN109948090A (en) * | 2019-03-08 | 2019-06-28 | 腾讯科技(深圳)有限公司 | Webpage loading method and device |
Non-Patent Citations (1)
Title |
---|
小白: "浅谈小程序运行机制", 《HTTPS://SEGMENTFAULT.COM/A/1190000019131399》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111339472A (en) * | 2020-03-16 | 2020-06-26 | 上海英方软件股份有限公司 | Method, device and system for improving access speed of web system |
CN113452738A (en) * | 2020-03-27 | 2021-09-28 | 北京沃东天骏信息技术有限公司 | Page loading method and client |
CN111639281A (en) * | 2020-05-29 | 2020-09-08 | 海信视像科技股份有限公司 | Page resource display method and display equipment |
CN112487324A (en) * | 2020-10-28 | 2021-03-12 | 贝壳技术有限公司 | Page generation method and device, electronic medium and storage medium |
CN112528593A (en) * | 2020-12-11 | 2021-03-19 | 北京百度网讯科技有限公司 | Document processing method and device, electronic equipment and storage medium |
CN112528593B (en) * | 2020-12-11 | 2023-09-01 | 北京百度网讯科技有限公司 | Document processing method, device, electronic equipment and storage medium |
CN112699321A (en) * | 2020-12-23 | 2021-04-23 | 车智互联(北京)科技有限公司 | Page loading method, computing equipment and storage medium |
CN113032078A (en) * | 2021-03-30 | 2021-06-25 | 深圳市中科明望通信软件有限公司 | Page display method and device, electronic equipment and computer readable storage medium |
CN113360807A (en) * | 2021-06-24 | 2021-09-07 | 平安普惠企业管理有限公司 | Page display method and device of mixed-mode mobile application and related equipment |
CN113778581A (en) * | 2021-07-28 | 2021-12-10 | 北京房江湖科技有限公司 | Page loading method, electronic equipment and storage medium |
CN117311708A (en) * | 2023-09-18 | 2023-12-29 | 中教畅享(北京)科技有限公司 | Dynamic modification method and device for resource display page in 3D scene of webpage end |
CN117311708B (en) * | 2023-09-18 | 2024-04-05 | 中教畅享科技股份有限公司 | Dynamic modification method and device for resource display page in 3D scene of webpage end |
Also Published As
Publication number | Publication date |
---|---|
CN110727478B (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110727478B (en) | Method, device, equipment and medium for rendering page based on mixed mode | |
EP3465467B1 (en) | Web page accelerations for web application hosted in native mobile application | |
RU2605919C2 (en) | Method and apparatus for displaying push messages | |
EP2603865B1 (en) | Exposing resource capabilities to web applications | |
CN103942225A (en) | Method and system for invoking resources of Hybrid App client and client | |
CN108021583B (en) | Page loading method and client | |
CN109308241B (en) | Method and device for monitoring starting process of application program, terminal equipment and storage medium | |
US20130311615A1 (en) | Updating Web Resources | |
CN105045887A (en) | Mixed mode cross-domain data interaction system and method | |
CN107291759B (en) | Method and device for processing browser page resources | |
US9678814B2 (en) | Implementing a java method | |
WO2015080903A1 (en) | Systems and methods for executing aspects of a document | |
CN111198998A (en) | Network page loading method, device and system based on Ajax request | |
JP6999002B2 (en) | Web page processing methods, web page processing devices, electronic devices, non-temporary computer-readable storage media and computer programs | |
US10103961B2 (en) | Collecting client-side application performance monitoring information | |
US9648078B2 (en) | Identifying a browser for rendering an electronic document | |
CN105095220B (en) | A kind of browser implementation method, terminal and virtualization agent device | |
CN109145236A (en) | Page file processing method, apparatus and system | |
CN106599045B (en) | Request sending method and device | |
US9059959B2 (en) | Client side management of HTTP sessions | |
CN109725887B (en) | Data interaction method and device based on message research and development framework and terminal equipment | |
CN103593396A (en) | Network resource extracting method and device based on browser | |
CN113536168B (en) | Component processing method and device | |
CN113157274B (en) | Software development method and device based on micro front end, electronic equipment and storage medium | |
CN103942277A (en) | Method and device for downloading file in browsers and browsers |
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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40021535 Country of ref document: HK |
|
GR01 | Patent grant | ||
GR01 | Patent grant |