Web page loading method and device, electronic device, and storage medium
By receiving the request of the web page loading process in the target process, detecting and obtaining or creating web page content, it solves the problem of memory usage and low operating efficiency caused by multiple processes opening the same web page, and achieves more efficient web page loading and user experience.
Patent Information
- Application Number
- CN202011480468.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-12-15
AI Technical Summary
Multiple processes opening multiple identical web pages cause program running speed to slow down and page freezes to occur.
By determining the target process with the smallest memory footprint, establishing inter-process communication, receiving request information from the web page loading process, detecting whether there are matching web page attribute parameters in the cache database, obtaining or creating web page content and objects, realizing web page loading, and avoiding multiple times Creation and waste of resources.
It improves the utilization of the target process, reduces memory usage, avoids slow page loading and freezes, improves user experience, and increases web page loading speed and data utilization.
Smart Images

Figure CN112507259B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of Internet technology, PC (Personal Computer) software is also changing with each passing day, but the most notable thing is that the installation packages of PC software are getting bigger and bigger, which is not easy to manage; therefore, relevant technical personnel proposed to split the programs in the software into multiple processes, so that the functions of each process are relatively independent, but each process depends on each other when running.
[0003] However, when multiple processes are running, multiple identical web pages may need to be opened, which will occupy a large amount of program running memory, reduce the program running rate, and often cause page freezes; at the same time, multiple processes opening multiple web pages will also cause information interference to users and affect the user experience. Therefore, how to avoid the problem of multiple processes opening multiple identical web pages is of great practical significance.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a web page loading method, device, electronic device and computer-readable storage medium, thereby at least to a certain extent overcoming the problem of multiple processes opening multiple identical web pages resulting in a low program running rate.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to a first aspect of an embodiment of the present disclosure, a web page loading method is provided, comprising: determining a target process, and receiving, through the target process, request information for a web page loading process to create a target web page; obtaining, based on the target process, web page attribute parameters corresponding to the target web page in the request information, and detecting whether there are target attribute parameters matching the web page attribute parameters in a preset cache database; in response to detecting the existence of the target attribute parameters in the cache database, obtaining, through the target process, web page content corresponding to the target web page based on the web page attribute parameters, and obtaining web page objects stored in the cache database; constructing the target web page according to the web page content and the web page object to enable the web page loading process to load the target web page.
[0008] In some example embodiments of the present disclosure, based on the aforementioned scheme, the method further includes: in response to detecting that the target attribute parameters do not exist in the cache database, creating the target web page based on the web page attribute parameters by the target process to enable the web page loading process to load the target web page; and caching the web page attribute parameters and the web page object corresponding to the target web page in the cache database.
[0009] In some example embodiments of the present disclosure, based on the aforementioned scheme, determining the target process includes: obtaining the corresponding memory usage of multiple processes when running from the task manager; and taking the process with the smallest memory usage among the multiple processes as the target process.
[0010] In some example embodiments of the present disclosure, based on the aforementioned scheme, before determining the target process and receiving, through the target process, the request information of the web page loading process for creating the target web page, it also includes: establishing inter-process communication between the target process and the web page loading process through a preset inter-process communication method; wherein the preset inter-process communication method includes one or more combinations of pipe communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area communication.
[0011] In some example embodiments of the present disclosure, based on the aforementioned scheme, before receiving request information for creating a target web page by a web page loading process through a target process, and obtaining web page attribute parameters corresponding to the target web page in the request information, it also includes: obtaining a preset configuration file, and determining the web page attribute parameters and environmental parameters corresponding to the target process according to the configuration file; initializing the web page attribute parameters and the environmental parameters to obtain the initialized target process.
[0012] In some example embodiments of the present disclosure, based on the aforementioned scheme, the web page attribute parameters include first web page identification data, the target attribute parameters include second web page identification data, and the method of obtaining the web page attribute parameters corresponding to the target web page in the request information based on the target process, and detecting whether there are target attribute parameters matching the web page attribute parameters in a preset cache database, includes: obtaining the second web page identification data corresponding to the target attribute parameters from the cache database through the target process, and determining the first web page identification data corresponding to the web page attribute parameters; and detecting whether there is the second web page identification data matching the first web page identification data in the cache database.
[0013] In some example embodiments of the present disclosure, based on the aforementioned scheme, the web page attribute parameters also include resource location data, and in response to detecting the existence of the target attribute parameters in the cache database, obtaining the web page content corresponding to the target web page based on the web page attribute parameters through the target process, and obtaining the web page object stored in the cache database includes: obtaining first web page identification data for calling the web page object and resource location data for loading the web page content through the target process; loading the web page content of the target web page based on the resource location data through the target process; and calling the web page object corresponding to the target web page from the cache database through the target process based on the first web page identification data.
[0014] In some example embodiments of the present disclosure, based on the aforementioned scheme, in response to detecting that the target attribute parameters do not exist in the cache database, creating the target web page based on the web page attribute parameters by the target process to enable the web page loading process to load the target web page includes: obtaining first web page identification data and resource location data corresponding to the web page attribute parameters by the target process; obtaining a web page object corresponding to the first web page identification data from a network server based on the first web page identification data by the target process, and obtaining web page content corresponding to the web page object based on the resource location data; creating the target web page based on the web page object and the web page content by the target process to enable the web page loading process to load the target web page.
[0015] In some example embodiments of the present disclosure, based on the aforementioned scheme, the method further includes: in response to the target process receiving a request information to close the target web page, deleting the first web page identification data and the web page object in the cache database by the target process to close the target web page.
[0016] According to a second aspect of an embodiment of the present disclosure, a web page loading device is provided, comprising: a target process determination module, used to determine a target process, and receive, through the target process, request information for a web page loading process to create a target web page; a web page attribute parameter detection module, used to obtain, based on the target process, web page attribute parameters corresponding to the target web page in the request information, and detect whether there are target attribute parameters matching the web page attribute parameters in a preset cache database; a web page content and web page object acquisition module, used to, in response to detecting the presence of the target attribute parameters in the cache database, obtain, through the target process, web page content corresponding to the target web page based on the web page attribute parameters, and obtain web page objects stored in the cache database; a target web page loading module, used to construct the target web page according to the web page content and the web page object to enable the web page loading process to load the target web page.
[0017] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target web page loading module also includes a cache database cache unit, and the cache database cache unit is used to: in response to detecting that the target attribute parameters do not exist in the cache database, create the target web page based on the web page attribute parameters through the target process to realize the loading of the target web page by the web page loading process; and cache the web page attribute parameters and the web page object corresponding to the target web page in the cache database.
[0018] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target process determination module also includes a target process determination unit, and the target process determination unit is used to: obtain the corresponding memory usage of multiple processes when running from the task manager; and take the process with the smallest memory usage among the multiple processes as the target process.
[0019] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device also includes a multi-process communication establishing unit, and the multi-process communication establishing unit is used to: establish inter-process communication between the target process and the web page loading process through a preset inter-process communication method; wherein the preset inter-process communication method includes one or more combinations of pipeline communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area communication.
[0020] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device also includes a target process initialization unit, and the target process initialization unit is used to: obtain a preset configuration file, and determine the web page attribute parameters and environment parameters corresponding to the target process according to the configuration file; initialize the web page attribute parameters and the environment parameters to obtain the initialized target process.
[0021] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page attribute parameter detection module also includes a web page attribute parameter detection unit, and the web page attribute parameter detection unit is used to: obtain the second web page identification data corresponding to the target attribute parameter from the cache database through the target process, and determine the first web page identification data corresponding to the web page attribute parameter; and detect whether there is the second web page identification data matching the first web page identification data in the cache database.
[0022] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page content and web page object acquisition module also includes a target web page loading unit, and the target web page loading unit is used to: obtain, through the target process, first web page identification data for calling a web page object and resource location data for loading web page content; call, through the target process based on the first web page identification data, the web page object corresponding to the target web page from the cache database; and load the web page content of the target web page through the target process based on the resource location data.
[0023] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target web page loading module also includes a target web page loading unit, and the target web page loading unit is used to: obtain the first web page identification data and resource location data corresponding to the web page attribute parameters through the target process; obtain the web page object corresponding to the first web page identification data from the network server based on the first web page identification data through the target process, and obtain the web page content corresponding to the web page object based on the resource location data; create the target web page based on the web page object and the web page content through the target process to realize the loading of the target web page by the web page loading process.
[0024] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device also includes a target page closing unit, and the target page closing unit is used to: in response to the target process receiving a request information to close the target web page, delete the first web page identification data and the web page object in the cache database through the target process to close the target web page.
[0025] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the web page loading methods described above is implemented.
[0026] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the webpage loading method according to any one of the above items is implemented.
[0027] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0028] The web page loading method in the example embodiment of the present disclosure determines a target process, and receives, through the target process, request information for creating a target web page by the web page loading process; obtains web page attribute parameters corresponding to the target web page in the request information based on the target process, and detects whether there are target attribute parameters matching the web page attribute parameters in a preset cache database; in response to detecting the existence of the target attribute parameters in the cache database, obtains, through the target process, web page content corresponding to the target web page based on the web page attribute parameters, and obtains the web page object stored in the cache database; and constructs the target web page according to the web page content and the web page object to enable the web page loading process to load the target web page. On the one hand, by determining the target process and establishing communication between the target process and the web page loading process, after the target process receives the request message of the web page loading process and obtains the web page attribute parameters corresponding to the target web page in the request message, the target process obtains the web page content corresponding to the target web page based on the web page attribute parameters, and loads the web page object corresponding to the target web page from the cache database, thereby realizing the loading of the target web page, improving the utilization rate of the target process, reducing the memory usage of loading the target web page, and avoiding the problem of low application running efficiency, thereby causing slow page loading and page jamming; on the other hand, when other processes need to load the target web page, they can also load the web page object corresponding to the target web page from the cache database through the target process, and reload the web page content corresponding to the target web page based on the web page attribute parameters sent by other processes, thereby avoiding the need for multiple processes to open the same target web page multiple times and the need to create the target web page multiple times, thereby reducing resource consumption; on the other hand, when it is detected that there are target attribute parameters in the cache database, the target process obtains the web page content corresponding to the target web page based on the web page attribute parameters, obtains the web page object stored in the cache database, and quickly builds a new target web page in combination with the cached web page object and the updated web page content, thereby improving the loading rate of the target web page and the utilization rate of data, thereby improving the user experience.
[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0031] Figure 1 A schematic diagram schematically illustrates a webpage loading method according to some embodiments of the present disclosure;
[0032] Figure 2 A schematic diagram schematically shows another webpage loading method process according to some embodiments of the present disclosure;
[0033] Figure 3 A schematic diagram of a process for determining a target process according to some embodiments of the present disclosure is schematically shown;
[0034] Figure 4 A schematic diagram schematically shows a process flow diagram of target process initialization according to some embodiments of the present disclosure;
[0035] Figure 5 A schematic diagram schematically shows a flow chart of detecting whether first webpage identification data matches second webpage identification data according to some embodiments of the present disclosure;
[0036] Figure 6 A schematic diagram of a process of obtaining web page objects and web page contents according to some embodiments of the present disclosure is schematically shown;
[0037] Figure 7 Another flowchart of obtaining web page objects and web page contents according to some embodiments of the present disclosure is schematically shown;
[0038] Figure 8 A schematic diagram schematically shows a webpage loading device according to some embodiments of the present disclosure;
[0039] Fig. 9 A schematic diagram schematically shows a structure of a computer system of an electronic device according to some embodiments of the present disclosure;
[0040] Fig.10 A schematic diagram of a computer-readable storage medium according to some embodiments of the present disclosure is schematically shown.
[0041] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0042] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0043] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0044] Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0045] In this exemplary embodiment, a webpage loading method is first provided, which can be applied to terminal devices such as mobile phones and computers, and can also be applied to servers. The terminal device includes a data detection unit such as a data detector, and a data cache unit such as a cache database.
[0046] Figure 1 The following is a schematic diagram of a webpage loading method process according to some embodiments of the present disclosure. Figure 1 As shown, the webpage loading method may include the following steps:
[0047] Step S110, determining a target process, and receiving, through the target process, request information from the webpage loading process for creating a target webpage;
[0048] Step S120, obtaining webpage attribute parameters corresponding to the target webpage in the request information based on the target process, and detecting whether there are target attribute parameters matching the webpage attribute parameters in a preset cache database;
[0049] Step S130, in response to detecting that the target attribute parameter exists in the cache database, obtaining webpage content corresponding to the target webpage based on the webpage attribute parameter through the target process, and obtaining the webpage object stored in the cache database;
[0050] Step S140 , constructing the target web page according to the web page content and the web page object to enable the web page loading process to load the target web page.
[0051] According to the web page loading method in this example embodiment, on the one hand, by determining the target process and establishing communication between the target process and the web page loading process, after the target process receives the request message of the web page loading process and obtains the web page attribute parameters corresponding to the target web page in the request message, the target process obtains the web page content corresponding to the target web page based on the web page attribute parameters, and loads the web page object corresponding to the target web page from the cache database, thereby realizing the loading of the target web page, thereby improving the utilization rate of the target process, reducing the memory usage of loading the target web page, and avoiding the low operating efficiency of the application, thereby causing the phenomenon of slow page loading and page jamming; on the other hand, other processes need to load the target process, When a web page is being updated, the target process can also load the web page object corresponding to the target web page from the cache database through the target process, and reload the web page content corresponding to the target web page based on the web page attribute parameters sent by other processes, thereby avoiding the need for multiple processes to open the same target web page multiple times and the need to create the target web page multiple times, thereby reducing resource consumption; on the other hand, when it is detected that there are target attribute parameters in the cache database, the target process obtains the web page content corresponding to the target web page based on the web page attribute parameters, and obtains the web page object stored in the cache database, and quickly constructs a new target web page in combination with the cached web page object and the updated web page content, thereby improving the web page loading rate and data utilization, thereby improving the user experience.
[0052] The webpage loading method in this exemplary embodiment is further described below by taking the webpage loading method applied to a terminal device as an example.
[0053] In step S110, a target process is determined, and request information for creating a target web page from a web page loading process is received through the target process.
[0054] In an example embodiment of the present disclosure, the target process may refer to a process with fewer functions and which occupies less memory during operation. For example, the target process may be a process that does not have complex functions such as video playback and screen recording, or it may be a medium process used to communicate with other processes. Of course, the target process may also be other processes that occupy less memory, and this example embodiment does not specifically limit this.
[0055] The webpage loading process may refer to a process that has a need to load a webpage, and the target webpage may refer to a webpage that needs to be loaded by the webpage loading process, which is not particularly limited in this embodiment.
[0056] Preferably, a task browser can be used to select a process with the least memory usage from multiple processes as the target process, and then communication can be established between the target process and other processes using methods such as pipes, first-in-first-out, message queues, semaphores, and shared memory areas, making it easier for the web page loading process to send the web page loading request to the target process.
[0057] In step S120, web page attribute parameters corresponding to the target web page in the request information are obtained based on the target process, and it is detected whether there are target attribute parameters matching the web page attribute parameters in a preset cache database.
[0058] In an example embodiment of the present disclosure, web page attribute parameters may refer to attribute parameters required for loading a web page. For example, web page attribute parameters may be web page identification data such as WebID, or resource location data such as WebURL. Of course, web page attribute parameters may also be other attribute parameters used to load a web page, and this example embodiment does not specifically limit this.
[0059] The target attribute parameter may refer to an attribute parameter stored in a cache database. For example, the target attribute parameter may be a web page attribute parameter corresponding to a target web page, or a web page attribute parameter corresponding to other web pages, or a user attribute parameter for opening a web page. This embodiment does not specifically limit this.
[0060] Optionally, the web page loading process can package the web page attribute parameters for opening the target web page and send them to the target process. The target process parses the web page attribute parameters sent by the web page loading process, and then queries the cache database whether there are target attribute parameters corresponding to the web page attribute parameters sent by the web page loading process. If there are target attribute parameters matching the web page attribute parameters in the cache database, the web page interface corresponding to the web page identification data can be directly called from the cache database, and the web page content can be further loaded according to the resource location data.
[0061] In step S130, in response to detecting that the target attribute parameter exists in the cache database, the target process obtains the webpage content corresponding to the target webpage based on the webpage attribute parameter, and obtains the webpage object stored in the cache database.
[0062] In an example embodiment of the present disclosure, a web page object may refer to a web page interface architecture. For example, a web page object may be a web page interface architecture that includes buttons such as download, print, favorite, and login. A web page object may also be a web page interface architecture that includes a display area for author information or related searches. Of course, a web page object may also be other scroll bars that make up the web page interface architecture, and this example embodiment does not specifically limit this.
[0063] When the target process detects that there is second web page identification data in the cache database that matches the first web page identification data sent by the web page loading process, the target process can directly obtain the web page identification data from the cache database, obtain the web page object corresponding to the target web page based on the web page identification data, and load the web page content corresponding to the target web page based on the resource location data in the web page attribute parameters sent by the web page loading process, and then can realize the loading of the target web page based on the web page object and web page content of the target web page.
[0064] In step S140, the target web page is constructed according to the web page content and the web page object to enable the web page loading process to load the target web page.
[0065] In an example embodiment of the present disclosure, web page content may refer to specific information that is desired to be delivered to a user. For example, web page content may be specific text content in a web page interface such as a web page title and text information under the title. Web page content may also be specific picture content. Of course, web page content may also be other audio or animation content, and this example embodiment does not specifically limit this.
[0066] Preferably, when the target process detects that the web page identification data sent by the web page loading process exists in the cache database, it can directly call the web page identification data to obtain the web page object of the target web page, and then load the web page content corresponding to the target web page according to the resource location data sent by the web page loading process, and construct the target web page through the web page object and web page content corresponding to the target web page; since inter-process communication has been established between the target process and the web page loading process, after the target web page is constructed by the target process, the web page loading process can load the target web page through inter-process communication.
[0067] Figure 2 A schematic diagram schematically illustrates another webpage loading method process according to some embodiments of the present disclosure.
[0068] refer to Figure 2 As shown, when it is detected that there is no target attribute parameter matching the webpage attribute parameter in the cache database, the webpage loading method may include the following steps:
[0069] Step S210, in response to detecting that the target attribute parameter does not exist in the cache database, creating the target web page based on the web page attribute parameter by the target process to enable the web page loading process to load the target web page;
[0070] Step S220: Cache the webpage attribute parameters and the webpage object corresponding to the target webpage into the cache database.
[0071] Among them, the cache database can refer to a tool for caching data. For example, the cache database can be a non-relational database, a relational database, or an in-memory database. Of course, the cache database can also refer to other tools for caching data, and this example embodiment does not make any special limitations on this.
[0072] Preferably, when the target process detects that there is no second web page identification data matching the first web page identification data sent by the web page loading process in the cache database, the target process can obtain the web page object corresponding to the web page identification data from the network server according to the first web page identification data. Furthermore, the corresponding web page content can be loaded according to the resource location data in the web page attribute parameter sent by the web page loading process, and then the target web page is loaded according to the web page object and the web page content, and the web page object corresponding to the target web page and the first web page identification data are stored in a cache database such as a memory cache database. When the target process detects that other processes need to open the target process, it only needs to obtain the web page object from the cache database such as the memory, and reload the target web page according to the resource location data sent by the other processes, and does not need to spend more time reading the first web page identification data and the corresponding web page object from other databases, nor does it need the target process to parse the corresponding web page attribute parameters according to the data packets sent by other processes, and then call the web page object and web page content according to the web page attribute parameters, thereby improving the loading rate of the target web page and at the same time, improving the utilization rate of the data.
[0073] Figure 3 A flowchart of determining a target process according to some embodiments of the present disclosure is schematically shown.
[0074] refer to Figure 3 As shown, the process of determining the target process may include the following steps:
[0075] In step S310, the memory usage corresponding to the running of multiple processes is obtained from the task manager;
[0076] In step S320, the process with the smallest memory usage among the multiple processes is used as the target process.
[0077] Among them, memory usage can refer to the memory occupied by the computer terminal when the process is running. For example, the memory usage can be the percentage of the PC's memory occupied when the process is running, or it can be the specific amount of memory occupied by the PC when the process is running. Of course, the memory usage can also be other indicators used to measure the size of the memory occupied by the process when it is running. This example embodiment does not make any special limitations on this.
[0078] Preferably, the memory usage of each process can be obtained through the task manager, and a lightweight process with fewer functions and smaller memory usage can be selected from multiple processes as the target process. The target process can be used to receive data packets sent by other processes, parse the web page attribute parameters in the data packets, and load the web page according to the web page attribute parameters, so that other processes can directly obtain the web page object and web page content, avoiding other processes from consuming memory space for loading web pages during operation, improving the utilization rate of the lightweight process, and then improving the resource utilization rate of the system.
[0079] In an exemplary embodiment of the present disclosure, before determining the target process and receiving, through the target process, the request information of the web page loading process for creating the target web page, inter-process communication between the target process and the web page loading process can be established through a preset inter-process communication method; wherein the preset inter-process communication method can include any one of pipeline communication, first-in-first-out communication, message queue communication, semaphore communication or shared memory area communication, and of course, it can also be a combination of various forms of pipeline communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area, and the present exemplary embodiment is not limited to this.
[0080] Preferably, communication between the target process and the web page loading process can be established through one or more combinations of preset pipeline communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area communication, so that data of the web page loading process can be sent to the target process, and resources in the target process can be shared with the web page process, thereby improving the communication efficiency and resource sharing efficiency between the target process and the web page loading process.
[0081] Figure 4 A flowchart of target process initialization according to some embodiments of the present disclosure is schematically shown.
[0082] refer to Figure 4 As shown, the process of initializing the target process may include the following steps:
[0083] In step S410, a preset configuration file is obtained, and the webpage attribute parameters and environment parameters corresponding to the target process are determined according to the configuration file;
[0084] In step S420, the webpage attribute parameters and the environment parameters are initialized to obtain the initialized target process.
[0085] Among them, the configuration file may refer to a file containing configuration resources for implementing web page loading. For example, the configuration file may be a configuration resource file containing web page identification data and resource location data, or it may be a configuration resource file corresponding to the typesetting format, or it may be a configuration resource file corresponding to the domain name resolution. Of course, the configuration file may also refer to other configuration resource files, and this example embodiment does not make any special limitations on this.
[0086] Environmental parameters may refer to necessary parameters for rendering web pages, for example, environmental parameters may refer to border color parameters, background brightness parameters, page resolution, etc. Of course, environmental parameters may also refer to other parameters for rendering web pages, and this embodiment does not specifically limit this.
[0087] After initializing the web page attribute parameters and environment parameters of the target process, when the target process receives a request to load the target web page sent by the web page loading process, the target web page can be directly loaded according to the web page attribute parameters contained in the request information in the web page loading process, thereby avoiding incompatibility issues caused by different browsers loading the target web page.
[0088] Figure 5 The flowchart of detecting whether first web page identification data matches second web page identification data according to some embodiments of the present disclosure is schematically shown.
[0089] refer to Figure 5 As shown, the process of detecting whether the first webpage identification data matches the second webpage identification data may include the following steps:
[0090] In step S510, the target process obtains the second webpage identification data corresponding to the target attribute parameter from the cache database, and determines the first webpage identification data corresponding to the webpage attribute parameter;
[0091] In step S520, it is detected whether there is the second webpage identification data matching the first webpage identification data in the cache database.
[0092] The first web page identification data may refer to the web page identification data sent by the web page loading process to the target process, and the second web page identification data may refer to the web page identification data in the cache database.
[0093] Preferably, the target process can parse the web page attribute parameters sent by the web page loading process, and detect whether there is second web page identification data matching the first web page identification data in the cache database. If there is second web page identification data matching the first web page identification data in the cache database, the target process can directly call the web page object corresponding to the first web page identification data from the cache database, and there is no need for the target process to send a request message containing the first web page identification data to the web page server, and then the web page server may pass the corresponding web page object to the target server through user payment, which greatly avoids the problems of high delay and high cost in web page loading.
[0094] Figure 6 The following schematically shows a flow chart of obtaining web page objects and web page contents according to some embodiments of the present disclosure. Figure 6 As shown, obtaining web page objects and web page content may include the following steps:
[0095] In step S610, first web page identification data for calling a web page object and resource location data for loading web page content are obtained through the target process;
[0096] In step S620, the target process loads the webpage content of the target webpage based on the resource location data;
[0097] In step S630, the target process calls the web page object corresponding to the target web page from the cache database based on the first web page identification data.
[0098] Among them, resource location data may refer to location data used to determine the location of a document or other data in a web page. For example, the resource location data may be location data for determining the location of a web page title of a web page, or may be location data for determining the location of text and images under the web page title in a web page. Of course, the resource location data may also be location data for determining the location of other content, and this embodiment does not specifically limit this.
[0099] Preferably, when the target process detects that there is a second web page identification data matching the first web page identification data in the cache database, the second web page identification data can be directly called from the cache database, and then the web page object is obtained according to the second web page identification data, and the web page content is obtained according to the resource location data, so that the target process can load a complete target web page according to the web page object and the web page content, and the web page loading process can further obtain the target web page through communication with the target process. Since the web page loading process does not need to occupy additional memory to open the target web page, but loads the target web page through the target process and shares the target web page, the operating efficiency of the web page loading process is reduced, and directly calling the web page object from the cache database also greatly improves the loading rate of the target page; when other processes need to open the target process, the target process only needs to refresh the target web page content according to the resource location data sent by other processes, and the target web page can be shared with other processes, avoiding multiple processes opening the same target web page multiple times, resulting in excessive memory usage of the computer terminal and the phenomenon of web page interface jamming, further causing information confusion to users and poor user experience.
[0100] Figure 7 Another process flow diagram for obtaining web page objects and web page contents according to some embodiments of the present disclosure is schematically shown. Figure 7 As shown, obtaining web page objects and web page content may include the following steps:
[0101] In step S710, first web page identification data and resource location data corresponding to the web page attribute parameter are obtained through the target process;
[0102] In step S720, the target process obtains the web page object corresponding to the first web page identification data from the network server based on the first web page identification data, and obtains the web page content corresponding to the web page object based on the resource location data;
[0103] In step S730, the target web page is created by the target process based on the web page object and the web page content to enable the web page loading process to load the target web page.
[0104] Among them, the network server can refer to a server that stores and allocates network shared resources. For example, the network server can be a server for sharing files, a server for providing applications, or a server for sharing disk space. Of course, the network server can also be other servers that store or allocate network resources, and this embodiment does not specifically limit this.
[0105] Preferably, the target process can parse out the first web page identification data and resource location data in the web page attribute parameters according to the web page attribute parameters sent by the web page loading process, and then the target process sends a request message to the web page server based on the first web page identification data, and the network server parses the address of the target process and the first web page identification data, and then sends the web page object corresponding to the first web page identification data to the target process. At the same time, the target process obtains the web page content of the target web page according to the resource location data, thereby loading the target web page based on the web page object, web page content and environmental parameters, and caches the web page object corresponding to the target web page and the first web page identification data into a cache database. When other processes need to open the target web page, they can directly obtain the web page object corresponding to the target web page from the cache database, which greatly improves the data utilization efficiency and the convenience of loading the target web page.
[0106] In an exemplary embodiment of the present disclosure, after opening the target web page, the target web page can be closed according to the following steps: in response to the target process receiving a request information for closing the target web page, the first web page identification data and the web page object in the cache database are deleted by the target process to close the target web page.
[0107] Preferably, after the target process opens the target web page, the target process can share the target web page with the web page loading process through a preset communication method. When the target process detects the web page closing request information sent by the web page loading process, and when it detects that other processes do not load the target web page, the target web page can be closed by deleting the web page object and web page identification data corresponding to the target web page, thereby improving the smoothness of program operation in the web page loading process.
[0108] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0109] In addition, in this exemplary embodiment, a webpage loading device is also provided. Figure 8 As shown, the webpage loading device 800 includes: a target process determination module 810, a webpage attribute parameter detection module 820, a webpage content and webpage object acquisition module 830, and a target webpage loading module 840. Among them:
[0110] The target process determination module 810 is used to determine the target process and receive the request information of the web page loading process for creating the target web page through the target process; the web page attribute parameter detection module 820 is used to obtain the web page attribute parameters corresponding to the target web page in the request information based on the target process, and detect whether there are target attribute parameters matching the web page attribute parameters in the preset cache database; the web page content and web page object acquisition module 830 is used to obtain the web page content corresponding to the target web page based on the web page attribute parameters through the target process in response to detecting the existence of the target attribute parameters in the cache database, and obtain the web page object stored in the cache database; the target web page loading module 840 is used to construct the target web page according to the web page content and the web page object to realize the loading of the target web page by the web page loading process.
[0111] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target web page loading module 840 also includes a cache database cache unit, and the cache database cache unit is used to: in response to detecting that the target attribute parameters do not exist in the cache database, create the target web page based on the web page attribute parameters through the target process to realize the loading of the target web page by the web page loading process; and cache the web page attribute parameters and the web page object corresponding to the target web page in the cache database.
[0112] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target process determination module 810 also includes a target process determination unit, and the target process determination unit is used to: obtain the corresponding memory usage of multiple processes when running from the task manager; and take the process with the smallest memory usage among the multiple processes as the target process.
[0113] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device 800 also includes a multi-process communication establishing unit, and the multi-process communication establishing unit is used to: establish inter-process communication between the target process and the web page loading process through a preset inter-process communication method; wherein the preset inter-process communication method includes one or more combinations of pipe communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area communication.
[0114] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device 800 also includes a target process initialization unit, and the target process initialization unit is used to: obtain a preset configuration file, and determine the attribute parameters and environment parameters corresponding to the target process according to the configuration file; initialize the attribute parameters and the environment parameters to obtain the initialized target process.
[0115] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page attribute parameter detection module 820 also includes a web page attribute parameter detection unit, and the web page attribute parameter detection unit is used to: obtain the second web page identification data corresponding to the target attribute parameter from the cache database through the target process, and determine the first web page identification data corresponding to the web page attribute parameter; and detect whether there is the second web page identification data matching the first web page identification data in the cache database.
[0116] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page content and web page object acquisition module 830 also includes a web page content and web page object acquisition unit, and the web page content and web page object acquisition unit is used to: obtain, through the target process, first web page identification data for calling a web page object and resource location data for loading web page content; load the web page content of the target web page based on the resource location data through the target process; and call, through the target process based on the first web page identification data, the web page object corresponding to the target web page from the cache database.
[0117] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the target web page loading module 830 also includes a target web page loading unit, and the target web page loading unit is used to: obtain the first web page identification data and resource location data corresponding to the web page attribute parameters through the target process; obtain the web page object corresponding to the first web page identification data from the network server based on the first web page identification data through the target process, and obtain the web page content corresponding to the web page object based on the resource location data; create the target web page based on the web page object and the web page content through the target process to realize the loading of the target web page by the web page loading process.
[0118] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the web page loading device 800 also includes a target page closing unit, and the target page closing unit is used to: in response to the target process receiving a request information to close the target web page, delete the first web page identification data and the web page object in the cache database through the target process to close the target web page.
[0119] The specific details of each module of the web page loading device mentioned above have been described in detail in the corresponding web page loading method, so they will not be repeated here.
[0120] It should be noted that although several modules or units of the web page loading device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units for concretization.
[0121] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above webpage loading method is also provided.
[0122] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware embodiments, complete software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0123] Refer to the following Fig. 9 hereinafter describes an electronic device 900 according to such an embodiment of the present disclosure. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0124] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: the at least one processing unit 910, the at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), and a display unit 940.
[0125] The storage unit stores a program code, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 910 can perform the following steps: Figure 1In step S110 shown in the figure, a target process is determined, and request information for creating a target web page by a web page loading process is received through the target process; in step S120, web page attribute parameters corresponding to the target web page in the request information are obtained based on the target process, and a target attribute parameter matching the web page attribute parameter is detected in a preset cache database; in step S130, in response to detecting the existence of the target attribute parameter in the cache database, web page content corresponding to the target web page is obtained through the target process based on the web page attribute parameter, and a web page object stored in the cache database is obtained; in step S140, the target web page is constructed with the web page object according to the web page content to enable the web page loading process to load the target web page.
[0126] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 921 and / or a cache memory unit 922 , and may further include a read-only memory unit (ROM) 923 .
[0127] The storage unit 920 may also include a program / utility 924 having a set (at least one) of program modules 925, such program modules 925 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0128] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0129] The electronic device 900 may also communicate with one or more external devices 970 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0130] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0131] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0132] refer to Fig.10 As shown, a program product 1000 for implementing the above-mentioned webpage loading method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0133] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0134] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0135] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0136] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0137] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0138] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0139] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0140] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A webpage loading method, characterized in that: include: Determine a target process, and receive, through the target process, request information from the webpage loading process for creating a target webpage; Acquire webpage attribute parameters corresponding to the target webpage in the request information based on the target process, and detect whether there are target attribute parameters matching the webpage attribute parameters in a preset cache database; In response to detecting that the target attribute parameter exists in the cache database, obtaining, through the target process, webpage content corresponding to the target webpage based on the webpage attribute parameter, and obtaining the webpage object stored in the cache database; The target web page is constructed according to the web page content and the web page object to enable the web page loading process to load the target web page.
2. The webpage loading method according to claim 1, characterized in that: The method further comprises: In response to detecting that the target attribute parameter does not exist in the cache database, creating the target web page based on the web page attribute parameter by the target process to enable the web page loading process to load the target web page; and The web page attribute parameters and the web page object corresponding to the target web page are cached in the cache database.
3. The webpage loading method according to claim 1, characterized in that: The target determination process includes: Get the memory usage of multiple processes from the task manager. The process with the smallest memory usage among the multiple processes is taken as the target process.
4. The webpage loading method according to claim 1, characterized in that: Before determining the target process and receiving, through the target process, the request information for creating the target web page from the web page loading process, the process further includes: The inter-process communication between the target process and the web page loading process is established through a preset inter-process communication method; wherein the preset inter-process communication method includes one or more combinations of pipeline communication, first-in-first-out communication, message queue communication, semaphore communication and shared memory area communication.
5. The webpage loading method according to claim 1, characterized in that: Before receiving, through the target process, request information for creating a target web page from a web page loading process and obtaining web page attribute parameters corresponding to the target web page in the request information, the method further includes: Obtaining a preset configuration file, and determining the webpage attribute parameters and environment parameters corresponding to the target process according to the configuration file; Initialization processing is performed on the webpage attribute parameters and the environment parameters to obtain the initialized target process.
6. The webpage loading method according to claim 1, characterized in that: The webpage attribute parameter includes first webpage identification data, the target attribute parameter includes second webpage identification data, and the step of obtaining the webpage attribute parameter corresponding to the target webpage in the request information based on the target process, and detecting whether there is a target attribute parameter matching the webpage attribute parameter in a preset cache database includes: Acquiring, through the target process, second web page identification data corresponding to the target attribute parameter from the cache database, and determining first web page identification data corresponding to the web page attribute parameter; and Check whether the cache database contains the second web page identification data that matches the first web page identification data.
7. The webpage loading method according to claim 1, characterized in that: The web page attribute parameters also include resource location data. In response to detecting that the target attribute parameters exist in the cache database, obtaining web page content corresponding to the target web page based on the web page attribute parameters through the target process, and obtaining the web page object stored in the cache database, includes: Acquiring, through the target process, first web page identification data for calling a web page object and resource location data for loading web page content; Loading the webpage content of the target webpage based on the resource location data by the target process; The web page object corresponding to the target web page is called from the cache database by the target process based on the first web page identification data.
8. The webpage loading method according to claim 2, characterized in that: In response to detecting that the target attribute parameter does not exist in the cache database, creating the target web page based on the web page attribute parameter by the target process to enable the web page loading process to load the target web page, includes: Acquiring, through the target process, first web page identification data and resource location data corresponding to the web page attribute parameter; Acquire, by the target process, a web page object corresponding to the first web page identification data from a network server based on the first web page identification data, and acquire web page content corresponding to the web page object based on the resource location data; The target web page is created by the target process based on the web page object and the web page content so as to enable the web page loading process to load the target web page.
9. The webpage loading method according to any one of claims 1 to 6, characterized in that: The method further comprises: In response to the target process receiving the request information for closing the target webpage, the target process deletes the first webpage identification data and the webpage object in the cache database to close the target webpage.
10. A webpage loading device, characterized in that: include: A target process determination module, used to determine a target process and receive request information from a webpage loading process for creating a target webpage through the target process; A web page attribute parameter detection module, used to obtain the web page attribute parameters corresponding to the target web page in the request information based on the target process, and detect whether there are target attribute parameters matching the web page attribute parameters in a preset cache database; A web page content and web page object acquisition module, configured to, in response to detecting that the target attribute parameter exists in the cache database, acquire the web page content corresponding to the target web page based on the web page attribute parameter through the target process, and acquire the web page object stored in the cache database; The target webpage loading module is used to construct the target webpage according to the webpage content and the webpage object to realize the loading of the target webpage by the webpage loading process.
11. An electronic device, characterized in that: include: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the webpage loading method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the webpage loading method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Webpage display method and device
CN106936727A
Page rendering processing method, device and equipment and readable storage medium
CN111177601A
