Webpage processing method and device, storage medium and electronic equipment

By parsing the Uniform Resource Locator (URL) to obtain feature and parameter information, and determining page loading rules, the system burden and poor user experience caused by repeated page display are resolved, thereby reducing system burden and improving user experience.

CN116089761BActive Publication Date: 2026-07-14GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU BOGUAN TELECOMM TECH LTD
Filing Date
2023-01-10
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing page display methods, repeated display of the same page results in a heavy system load, a poor user experience, and requires users to close the same page multiple times.

Method used

By parsing the Uniform Resource Locator (URL), the preceding feature information and parameter information of the query are obtained, the page loading rules are determined, and the page is displayed or discarded based on the rules to avoid duplicate display.

Benefits of technology

It reduced the system load, improved the user experience, reduced the number of times users closed the page, and enhanced the timeliness and consistency of page content for users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089761B_ABST
    Figure CN116089761B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a webpage processing method and device, a storage medium and an electronic device, and relates to the technical field of computers. The method comprises: receiving a to-be-loaded page, and obtaining a uniform resource locator of the to-be-loaded page; parsing the uniform resource locator to obtain to-be-queried pre-characteristic information and to-be-queried parameter information included in the uniform resource locator; determining a page loading rule corresponding to the to-be-loaded page according to the to-be-queried pre-characteristic information and the to-be-queried parameter information; and executing the page loading rule to discard or display the to-be-loaded page. The present disclosure avoids repeated display of webpage pages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for processing web pages, a device for processing web pages, a computer-readable storage medium, and an electronic device. Background Technology

[0002] In existing page display methods, the page is displayed directly upon receiving a request. However, this method suffers from the problem of repeatedly displaying the same page, which can overload the system.

[0003] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The purpose of this disclosure is to provide a method for processing web pages, a device for processing web pages, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to some extent, the problem of heavy system burden caused by the limitations and defects of related technologies.

[0005] According to one aspect of this disclosure, a method for processing web pages is provided, comprising:

[0006] Receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded;

[0007] The Uniform Resource Locator (URL) is parsed to obtain the preceding feature information and the query parameter information included in the URL.

[0008] Based on the preceding feature information and the query parameter information, determine the page loading rule corresponding to the page to be loaded;

[0009] The page loading rules are executed to either discard or display the page to be loaded.

[0010] According to one aspect of this disclosure, a webpage processing apparatus is provided, comprising:

[0011] The page to be loaded receiving module is used to receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded.

[0012] The Uniform Resource Locator (URL) parsing module is used to parse the URL to obtain the query preceding feature information and query parameter information included in the URL.

[0013] The page loading rule determination module is used to determine the page loading rule corresponding to the page to be loaded based on the preceding feature information to be queried and the parameter information to be queried.

[0014] The page processing module is used to execute the page loading rules and discard or display the page to be loaded.

[0015] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the webpage processing method described in any of the preceding claims.

[0016] According to one aspect of this disclosure, an electronic device is provided, comprising:

[0017] Processor; and

[0018] Memory for storing the executable instructions of the processor;

[0019] The processor is configured to execute the web page processing method described above by executing the executable instructions.

[0020] This disclosure provides a webpage processing method that, on the one hand, determines the page loading rule corresponding to the page to be loaded based on the preceding feature information and the query parameter information, and then executes the page loading rule to discard or display the page to be loaded. This avoids the problem of heavy system load caused by repeatedly displaying the same page, thus reducing the system load. On the other hand, since the page loading rule is determined based on the Uniform Resource Locator (URL), and based on the uniqueness of the URL, it avoids the problem of users not being able to know the content of the page to be loaded in time due to the incorrect discarding of the page to be loaded, resulting in a poor user experience. Furthermore, by avoiding the repeated display of the same page, it reduces the number of pages that users need to close when closing a page, thus further improving the user experience.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0023] Figure 1 The flowchart illustrates a method for processing a web page according to an exemplary embodiment of the present disclosure.

[0024] Figure 2 The illustration shows an example scenario of an application scenario of a web page processing method according to an exemplary embodiment of the present disclosure.

[0025] Figure 3 The flowchart illustrates a method for determining a page loading rule corresponding to a page to be loaded based on the query preceding feature information and query parameter information, according to an example embodiment of the present disclosure.

[0026] Figure 4 The illustration shows an example of a display interface scenario obtained by displaying a page to be loaded on a display interface according to an example embodiment of the present disclosure.

[0027] Figure 5 The illustration schematically depicts a scenario in which a target loaded page is replaced from its original display location to a new location according to an example embodiment of the present disclosure.

[0028] Figure 6 The illustration shows an example scenario of replacing a target loaded page with a lottery page according to an example embodiment of the present disclosure.

[0029] Figure 7 The illustration schematically depicts a scenario example of adding a mask to a target loaded page according to an exemplary embodiment of the present disclosure.

[0030] Figure 8 The flowchart schematically illustrates another method for processing a web page according to an example embodiment of the present disclosure.

[0031] Figure 9 A block diagram schematically illustrates a web page processing apparatus according to an exemplary embodiment of the present disclosure.

[0032] Figure 10 An electronic device for implementing the above-described webpage processing method is illustrated according to an example embodiment of the present disclosure. Detailed Implementation

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0034] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0035] In live streaming, to enhance user interaction, users can typically trigger page loading through various entry points such as toolbars, public chat, and pop-ups. However, this can lead to issues where different entry points might trigger the loading of the same page. For example, a user might open a page in the public chat, and then the live stream might push a pop-up window that opens the same page. In this case, the live stream loads two identical pages. In subsequent operations, the live stream might load at least two identical pages, resulting in a heavy system load. Furthermore, since multiple identical pages might be stored, there's a risk of content display discrepancies between them. Additionally, if a user wants to close a page, they must perform the same close operation multiple times, leading to a poor user experience.

[0036] This exemplary embodiment first provides a method for processing web pages. This method can run on a terminal device, which can be a mobile terminal, personal computer, desktop computer, or tablet computer, etc. Of course, those skilled in the art can also run the method disclosed herein on other platforms as needed, and this exemplary embodiment does not make any special limitations on this. Specifically, refer to... Figure 1 As shown, the processing method for this webpage may include the following steps:

[0037] Step S110. Receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded;

[0038] Step S120. Parse the Uniform Resource Locator to obtain the query preceding feature information and query parameter information included in the Uniform Resource Locator;

[0039] Step S130. Determine the page loading rule corresponding to the page to be loaded based on the preceding feature information to be queried and the parameter information to be queried;

[0040] Step S140. Execute the page loading rule to discard or display the page to be loaded.

[0041] In the above-mentioned webpage processing method, on the one hand, since the page loading rules corresponding to the page to be loaded can be determined based on the preceding feature information and the query parameters, and then the page loading rules are executed to discard or display the page to be loaded, the problem of heavy system load caused by repeated display of the same page can be avoided, thus reducing the system load. On the other hand, since the page loading rules are determined based on the Uniform Resource Locator (URL), and based on the uniqueness of the URL, the problem of users not being able to see the content of the page to be loaded in time due to the incorrect discarding of the page to be loaded, resulting in a poor user experience, can be avoided. Furthermore, since the repeated display of the same page can be avoided, the number of pages that users need to close when closing the page can be reduced, thus further improving the user experience.

[0042] The following will provide a detailed explanation and description of the webpage processing method of the exemplary embodiments of this disclosure, in conjunction with the accompanying drawings.

[0043] First, the inventive objective of the exemplary embodiments of this disclosure will be explained and described. Specifically, the webpage processing method described in the exemplary embodiments of this disclosure, during live video streaming, processes multiple identical webpages input through different application programming interfaces (APIs) or the same API, or pages with some identical parameters. This avoids the problem of identical webpages displayed on the same screen, thereby improving user experience while reducing the system load on the terminal device.

[0044] Secondly, the application scenarios of the exemplary embodiments of this disclosure will be explained and described. Specifically, refer to... Figure 2As shown, the webpage processing method described in the example embodiments of this disclosure can be applied to scenarios including a terminal device 210 and a server 220. The terminal device and the server can communicate via a wired or wireless network; the terminal device can implement the webpage processing method described in the example embodiments of this disclosure, and the server can provide the terminal device with the data required to display the page to be loaded.

[0045] Furthermore, in a webpage processing method provided in the exemplary embodiments of this disclosure:

[0046] In step S110, the page to be loaded is received, and the Uniform Resource Locator (URL) of the page to be loaded is obtained.

[0047] Specifically, in practical applications, during live streaming by broadcasters or while viewers are watching the live video, there may be situations where additional pop-ups, public chat windows, or toolbars need to be displayed on the live streaming interface. In such scenarios, at certain specific time points, additional pages that need to be displayed can be generated through active or passive triggering. Therefore, when a page needs to be displayed, it can be received through the corresponding application programming interface (API). Furthermore, upon receiving the page, its Uniform Resource Locator (URL) can be obtained.

[0048] In step S120, the Uniform Resource Locator (URL) is parsed to obtain the preceding feature information and the query parameter information included in the URL.

[0049] Specifically, parsing the Uniform Resource Locator (URL) to obtain the query preceding feature information and query parameter information included in the URL can be achieved as follows: First, the URL is matched based on a preset first regular expression model to obtain a first matching result, and the first matching result is extracted from the URL to obtain the query preceding feature information; Second, the portion of the URL other than the first matching result is matched based on a preset second regular expression model to obtain a second matching result, and the second matching result is extracted from the URL to obtain the query parameter information.

[0050] For example, taking the Uniform Resource Locator (URL) of a page to be loaded as https: / / www.xxx.com?page=a&tab=b# / home as an example, the specific parsing process will be explained. First, the URL can be matched based on a first regular expression model to obtain a first matching result; where the first matching result can be https: / / www.xxx.com; the first regular expression model described here is a regular expression model for matching preceding feature information, and in specific applications, it can be set according to actual needs, and this example does not impose special restrictions on it. Further, after obtaining the first matching result, the URL can be matched based on a second regular expression model to obtain a second matching result; where the second matching result can be page=a&tab=b; the second regular expression model described here is a regular expression model for matching parameter information, and in specific applications, it can be set according to actual needs, and this example does not impose special restrictions on it; and taking https: / / www.xxx.com?page=a&tab=b# / home as an example... For example, page=a&tab=b# / home, the preceding feature information to be queried can be https: / / www.xxx.com; the query parameter information can be: {"page":"a","tab":"b"}.

[0051] In one feasible example embodiment, parsing the Uniform Resource Locator (URL) to obtain the query preceding feature information and query parameter information included in the URL can also be achieved as follows: The URL is segmented based on a preset word segmentation model to obtain the word groups and symbols included in the URL; wherein, the preset word segmentation model described here may include convolutional neural network models, recurrent neural network models, deep neural network models, and decision tree models, etc., and this example does not impose any special limitations on it; further, after obtaining the magnetic beads and symbols, preset symbols and preset word groups can be extracted, and based on the positional relationship of the preset symbols and preset word groups in the URL, the query preceding feature information and query parameter information are generated.

[0052] In step S130, the page loading rule corresponding to the page to be loaded is determined based on the preceding feature information to be queried and the parameter information to be queried.

[0053] In this example embodiment, reference Figure 3 As shown, determining the page loading rule corresponding to the page to be loaded based on the preceding feature information and the query parameter information may include the following steps:

[0054] Step S310: Obtain the page parameter mapping table of the currently loaded pages displayed on the current display interface, and match the target preceding feature information corresponding to the preceding feature information to be queried in the page parameter mapping table.

[0055] Specifically, firstly, a page parameter mapping table of all currently loaded pages displayed on the terminal device's screen can be obtained from a preset database set locally on the terminal device. This page parameter mapping table can include the preceding feature information and page parameter information of each currently loaded page, and there is a mapping relationship between the preceding feature information and the page parameter information. Further, after obtaining the page parameter mapping table, it can be determined whether there is target preceding feature information corresponding to the feature information to be queried among the preceding feature information included in the page parameter mapping table; that is, it is necessary to initially determine whether the page to be loaded has been displayed on the terminal device's screen.

[0056] Step S320: When it is determined that there is no target preceding feature information corresponding to the preceding feature information to be queried in the page parameter mapping table, the page loading rule corresponding to the page to be loaded is determined as the first loading rule.

[0057] Specifically, if the page parameter mapping table does not include the target preceding feature information corresponding to the feature information to be queried, it can be determined that the page to be loaded is not displayed on the display interface of the terminal device. In this case, the first loading rule corresponding to the page to be loaded is: display the page to be loaded.

[0058] Step S330: When it is determined that there is target preceding feature information corresponding to the preceding feature information to be queried in the page parameter mapping table, the target page parameter corresponding to the target preceding feature information is obtained from the page parameter mapping table, and the parameter information to be queried and the target page parameter are compared.

[0059] Specifically, if the target preceding feature information corresponding to the preceding feature information to be queried exists in the page parameter mapping table, it is necessary to further determine whether the page to be loaded has already been displayed on the terminal device's display interface. The specific execution process may include: first, based on the corresponding mapping relationship, obtaining the target page parameters corresponding to the target preceding feature information from the page parameter mapping table, and then further comparing the query parameter information and the target page parameters. Further, this comparison process can be implemented as follows: obtaining all first sub-page parameters included in the query parameter information and all second sub-page parameters included in the target page parameters, and comparing the first sub-page parameters and second sub-page parameters one by one; wherein, if the first sub-page parameters and the second sub-page parameters are completely consistent, it is determined that the query parameter information is consistent with the target page parameters; if any sub-parameter in the first sub-page parameters is inconsistent with the second sub-page parameters, it is determined that the query parameter information is inconsistent with the target page parameters.

[0060] For example, assuming the target page parameter is {"page":"a"} and the query parameter is {"page":"a","tab":"b"}, then it is determined that the query parameter is inconsistent with the target page parameter. Similarly, if the target page parameter is {"page":"a"} and the query parameter is {"tab":"b"}, then it is determined that the query parameter is inconsistent with the target page parameter. And again, if the target page parameter is {"page":"a"} and the query parameter is {"page":"b"}, then it is determined that the query parameter is inconsistent with the target page parameter. It should be noted that, in the specific application process, when determining whether the query parameter information is consistent with the target page parameter, if any sub-parameter is inconsistent, it can be determined that the query parameter information is inconsistent with the target page parameter. Only when the query parameter information and the target page parameter are identical can it be determined that the query parameter information is consistent with the target page parameter. Of course, in actual application, the specific sub-parameters involved can be set according to actual needs, and this example does not impose special restrictions on this. That is, the sub-parameters involved here include, but are not limited to, "page" and / or "tab", etc.

[0061] Step S340: If the target page parameters are consistent with the query parameter information, then the page loading rule corresponding to the page to be loaded is determined to be the second loading rule; if the target page parameters are inconsistent with the query parameter information, then the page loading rule corresponding to the page to be loaded is determined to be the third loading rule.

[0062] Specifically, if the target page parameters match the query parameters, the second loading rule corresponding to the page to be loaded is to discard the page to be loaded; if the target page parameters do not match the query parameters, the third loading rule corresponding to the page to be loaded is to replace the already loaded page with the page to be loaded. This method avoids reloading the page to be loaded and solves the problem of users being unable to view information on the page to be loaded due to the omission of the page being loaded.

[0063] In step S140, the page loading rule is executed to discard or display the page to be loaded.

[0064] In this example embodiment, executing the page loading rule to discard or display the page to be loaded can be achieved in the following ways: On the one hand, when the page loading rule is determined to be a first loading rule, the first loading rule is executed to display the page to be loaded on the display interface; on the other hand, when the page loading rule is determined to be a second loading rule, the second loading rule is executed to discard the page to be loaded; and on yet another hand, when the page loading rule is determined to be a third loading rule, the third loading rule is executed to replace the target loaded page corresponding to the page to be loaded on the display interface based on the page to be loaded.

[0065] The following will explain and illustrate the specific execution process of the page to be loaded based on each loading rule.

[0066] First, in one example embodiment, if the page loading rule is a first loading rule, then the first loading rule is executed to display the page to be loaded on the display interface. Displaying the page to be loaded on the display interface can be achieved as follows: First, obtain the text file required to load the page to be loaded, and parse the text file to obtain a page object model corresponding to the page to be loaded; wherein the text file includes a Hypertext Markup Language file and / or a Cascading Style Sheets file; second, generate a page rendering tree based on the page object model, and calculate the page layout of the page to be loaded based on the page rendering tree; then, render the page layout to obtain the page to be loaded, and display the page to be loaded on the display interface. The process of parsing the text file to obtain a page object model corresponding to the page to be detected, and generating a page rendering tree based on the page object model, can be achieved as follows: First, parse the hypertext markup language file to obtain a document object model; and / or parse the cascading style sheet file to obtain a cascading style sheet object model; second, generate a page rendering tree based on the document object model and / or the cascading style sheet object model.

[0067] In one example embodiment, when a page to be loaded needs to be displayed, the terminal device first requests a text file corresponding to that page from the server. This text file may include an HTML (HyperText Markup Language) file and a CSS (Cascading Style Sheets) file, depending on the specific file required by the page to be loaded; this example does not impose any special restrictions. Upon receiving the text file, the terminal device begins parsing it. The result of parsing the HTML file is the DOM (Document Object Model). At this point, the HTML document is loaded and parsed. If a CSS file is available, a CSSOM (Cascading Style Sheets Object Model) can be generated from it. Furthermore, the DOM and CSSOM are then merged to generate the page rendering tree. (Tree); With the page rendering tree, we can know the styles of all the nodes in the page to be loaded, and then calculate their exact size and position on the display interface of the display terminal based on these nodes and styles, that is, we can calculate the page layout; With the page layout information, we can display it on the display interface; For an example diagram of the display interface scene obtained by displaying the page to be loaded on the display interface, please refer to Figure 4 As shown.

[0068] It should be noted that the terminal devices described in this example embodiment may include mobile terminal devices with the Android operating system, mobile terminal devices with the iOS operating system, personal computers, and desktop computers. Therefore, in specific applications, an HTML page can be loaded through WebView in an Android system; an HTML page can be loaded through UIWebView in an iOS system; an HTML page can be loaded through QWebEngineView on a PC; and an HTML page can be loaded through an iframe on a desktop website.

[0069] In one example embodiment, after obtaining the page to be loaded, the method for processing the webpage further includes: generating a key-value mapping relationship corresponding to the page to be loaded, using the query preceding feature information of the page to be loaded as the key and the query parameter information as the value, and storing the key-value mapping relationship corresponding to the page to be loaded in the page parameter mapping table. That is, after the page to be loaded is displayed, it is also necessary to store the key-value mapping relationship of the displayed page in the page parameter mapping table to avoid subsequent duplicate display. Wherein, if the Uniform Resource Locator of the page to be loaded is https: / / www.xxx.com?page=a&tab=b# / home, then the key-value mapping relationship of the page to be loaded is: key: https: / / www.xxx.com; value: "page":"a", "tab":"b".

[0070] Secondly, in one example embodiment, if the page loading rule is the second loading rule, then the page to be loaded is discarded according to the second loading rule, that is, the page to be loaded is directly discarded without any processing. Simultaneously, after discarding the page to be loaded, the processing method for the webpage further includes: determining the target loaded page corresponding to the discarded page to be loaded based on the target page parameters and the target preceding feature information corresponding to the target page parameters, and refreshing the target loaded page. That is, if it is necessary to discard the page to be loaded, the loaded page corresponding to the discarded page to be loaded can be refreshed. For example, the display level of the loaded page corresponding to the discarded page to be loaded can be raised to the highest level, thereby improving the user's awareness of the discarded page to be loaded or the loaded page corresponding to the discarded page to be loaded, and avoiding the problem that the user cannot obtain the page information included in the page to be loaded in a timely manner.

[0071] Furthermore, in one example embodiment, if the page loading rule is a third loading rule, then the third loading rule is executed to replace the target loaded page on the display interface corresponding to the page to be loaded based on the page to be loaded. The specific replacement process may include: determining the page to be replaced on the display interface corresponding to the page to be loaded based on the target page parameters and the target preceding feature information corresponding to the target page parameters; replacing the page to be replaced based on the page to be loaded, and displaying the page to be loaded; wherein the page to be loaded carries preset page parameters, the preset page parameters including display position parameters and / or specific execution function parameters, the specific execution function parameters including execution preset activity function parameters and / or execution overlay processing function parameters.

[0072] In one example embodiment, during the process of replacing a target loaded page corresponding to the page to be loaded on the display interface based on the page to be loaded, the specific replacement process is as follows: unloading the target loaded page and displaying the page to be loaded; wherein, the specific display process may include: first, obtaining the text file required to load the page to be loaded, and parsing the text file to obtain the page object model corresponding to the page to be loaded; wherein, the text file includes a Hypertext Markup Language file and / or a Cascading Style Sheets file; second, generating a page rendering tree based on the page object model, and calculating the page layout of the page to be loaded based on the page rendering tree; then, rendering the page layout to obtain the page to be loaded, and displaying the page to be loaded on the display interface. The process of parsing the text file to obtain a page object model corresponding to the page to be detected, and generating a page rendering tree based on the page object model, can be achieved as follows: First, parse the hypertext markup language file to obtain a document object model; and / or parse the cascading style sheet file to obtain a cascading style sheet object model; second, generate a page rendering tree based on the document object model and / or the cascading style sheet object model. In other words, during the specific application process, a text file corresponding to the page to be loaded is requested from the server. This text file can include HTML (Hypertext Markup Language) files and CSS (Cascading Style Sheets) files, depending on the files required by the page to be loaded. This example does not impose any special restrictions on this. Simultaneously, once the terminal device receives the text file, it begins parsing it. The result of parsing the HTML file is the DOM (Document Object Model). At this point, the HTML document is loaded and parsed. If a CSS file is available, a CSSOM (Cascading Style Sheets Object Model) can be generated from it. Further, the DOM and CSSOM are merged to generate a render tree. With the render tree, all the node styles included in the page to be loaded can be known. Based on these nodes and styles, their exact size and position on the display interface of the terminal can be calculated, i.e., the page layout can be calculated. With the page layout information, it can then be displayed on the display interface.

[0073] It should be added that by using the page to be loaded to replace the target loaded page, the old display interface can be unloaded in a timely manner and the latest display interface can be displayed. This ensures that there are no similar display interfaces on the screen, and thus avoids the problem of poor user experience caused by the asynchronous display of content between different pages.

[0074] Furthermore, the display interface is obtained by replacing the target loaded page corresponding to the page to be loaded on the display interface during standby. For details, please refer to [link / reference]. Figure 5 , Figure 6 as well as Figure 7 As shown. Among them, Figure 5 To replace the target loaded page from its original display location to a new location for display; Figure 6 To replace the target loaded page with the lottery page; Figure 7 To add a mask to the target already loaded page.

[0075] Furthermore, the processing method for this webpage also includes: unloading the page to be replaced, and deleting the target page parameters and target preceding feature information corresponding to the page to be replaced in the page parameter mapping table; at the same time, it is also necessary to add the key-value mapping relationship of the page to be loaded to the page parameter mapping table; wherein, the specific generation process of the key-value mapping relationship is consistent with the generation process described above, and this example does not impose any special restrictions on it.

[0076] Thus, the webpage processing method described in the exemplary embodiments of this disclosure has been fully implemented. Based on the foregoing description, it can be understood that the webpage processing method described in the exemplary embodiments of this disclosure can address the issue of multiple identical pages being loaded from different entry points or from the same entry point in a live streaming room. This provides a method for processing webpages, thereby controlling that only one identical page can be loaded from different entry points or from the same entry point, thus avoiding the repeated loading of multiple identical pages and improving the user experience.

[0077] The following will combine Figure 8 The processing method for web pages in the example embodiments of this disclosure will be further explained and described. Specifically, refer to... Figure 8 As shown, the processing method for this webpage may include the following steps:

[0078] Step S801: Receive the page to be loaded and determine whether the page is currently loaded in the displayed interface; if it is not loaded, proceed to step S802; if it has been loaded, proceed to step S803. Specifically, before loading a page, the URL of the page can be parsed by the URL parsing module to obtain the part before the query parameters and the query parameters. Then, the page management module checks whether the page has been recorded in the map. If the page has been recorded, it means that the page has been loaded; if the page has not been recorded, it means that the page has not been loaded.

[0079] Step S802: Display the page to be loaded; specifically, if the page is not recorded in the map, it means that the page has not been loaded, so load the page and store the first part of the query parameters and the query parameters as key and value in the map;

[0080] Step S803: Determine whether the query parameter information of the page to be loaded is consistent with the page parameters of the loaded page; if consistent, proceed to step S804; if inconsistent, proceed to step S805.

[0081] Step S804: Discard loading a new page, that is, retain the already loaded page, so the current interface displays the already loaded page in the history;

[0082] In step S805, the loaded page is replaced with the page that needs to be loaded, that is, the loaded page is closed and the new page that needs to be loaded is loaded to achieve the purpose of replacement, and at this time the information recorded in the map for that page is updated.

[0083] This disclosure also provides an example embodiment of a web page processing apparatus. Specifically, refer to... Figure 9 As shown, the webpage processing device may include a page receiving module 910, a Uniform Resource Locator (URL) parsing module 920, a page loading rule determination module 930, and a page processing module 940. Specifically:

[0084] The page to be loaded receiving module 910 can be used to receive the page to be loaded and obtain the Uniform Resource Locator of the page to be loaded;

[0085] The Uniform Resource Locator (URL) parsing module 920 can be used to parse the URL to obtain the query preceding feature information and query parameter information included in the URL.

[0086] The page loading rule determination module 930 can be used to determine the page loading rule corresponding to the page to be loaded based on the query preceding feature information and query parameter information.

[0087] The page processing module 940 can be used to execute the page loading rules and discard or display the page to be loaded.

[0088] In an exemplary embodiment of this disclosure, determining the page loading rule corresponding to the page to be loaded based on the query preceding feature information and the query parameter information includes: obtaining a page parameter mapping table of currently loaded pages displayed on the current display interface, and matching the target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table; when it is determined that there is no target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, determining the page loading rule corresponding to the page to be loaded as a first loading rule; when it is determined that there is target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, obtaining the target page parameter corresponding to the target preceding feature information from the page parameter mapping table, and comparing the query parameter information and the target page parameter; if the target page parameter is consistent with the query parameter information, determining the page loading rule corresponding to the page to be loaded as a second loading rule; if the target page parameter is inconsistent with the query parameter information, determining the page loading rule corresponding to the page to be loaded as a third loading rule.

[0089] In one exemplary embodiment of this disclosure, comparing the query parameter information and the target page parameters includes: obtaining all first sub-page parameters included in the query parameter information and all second sub-page parameters included in the target page parameters, and comparing the first sub-page parameters and the second sub-page parameters one by one; wherein, if the first sub-page parameters and the second sub-page parameters are completely consistent, it is determined that the query parameter information and the target page parameters are consistent; if any sub-parameter in the first sub-page parameters is inconsistent with the second sub-page parameters, it is determined that the query parameter information and the target page parameters are inconsistent.

[0090] In one exemplary embodiment of this disclosure, executing the page loading rule to discard or display the page to be loaded includes: when the page loading rule is determined to be a first loading rule, executing the first loading rule to display the page to be loaded on the display interface; when the page loading rule is determined to be a second loading rule, executing the second loading rule to discard the page to be loaded; and when the page loading rule is determined to be a third loading rule, executing the third loading rule to replace the target loaded page corresponding to the page to be loaded on the display interface based on the page to be loaded.

[0091] In one exemplary embodiment of this disclosure, displaying the page to be loaded on a display interface includes: obtaining a text file required for loading the page to be loaded, parsing the text file to obtain a page object model corresponding to the page to be loaded; wherein the text file includes a Hypertext Markup Language file and / or a Cascading Style Sheets file; generating a page rendering tree based on the page object model, and calculating the page layout of the page to be loaded based on the page rendering tree; rendering the page layout to obtain the page to be loaded, and displaying the page to be loaded on the display interface.

[0092] In one exemplary embodiment of this disclosure, the webpage processing apparatus further includes:

[0093] The key-value mapping relationship storage module can be used to generate a key-value mapping relationship corresponding to the page to be loaded, using the query preceding feature information of the page to be loaded as the key and the query parameter information as the value, and store the key-value mapping relationship corresponding to the page to be loaded in the page parameter mapping table.

[0094] In one exemplary embodiment of this disclosure, the webpage processing apparatus further includes:

[0095] The target loaded page refresh module can be used to determine the target loaded page corresponding to the discarded unloaded page based on the target page parameters and the target preceding feature information corresponding to the target page parameters, and refresh the target loaded page.

[0096] In one exemplary embodiment of this disclosure, replacing a target loaded page on the display interface corresponding to the page to be loaded based on the page to be loaded includes: determining a page to be replaced on the display interface corresponding to the page to be loaded based on the target page parameters and target preceding feature information corresponding to the target page parameters; replacing the page to be replaced based on the page to be loaded, and displaying the page to be loaded; wherein the page to be loaded carries preset page parameters, the preset page parameters including display position parameters and / or specific execution function parameters, the specific execution function parameters including execution preset activity function parameters and / or execution overlay processing function parameters.

[0097] In one exemplary embodiment of this disclosure, the webpage processing apparatus further includes:

[0098] The page to be replaced unloading module can be used to unload the page to be replaced and delete the target page parameters and target preceding feature information corresponding to the page to be replaced in the page parameter mapping table.

[0099] In one exemplary embodiment of this disclosure, parsing the Uniform Resource Locator (URL) to obtain the query preceding feature information and query parameter information included in the URL includes: matching the URL based on a preset first regular expression model to obtain a first matching result, and extracting the first matching result from the URL to obtain the query preceding feature information; matching the portion of the URL other than the first matching result based on a preset second regular expression model to obtain a second matching result, and extracting the second matching result from the URL to obtain the query parameter information.

[0100] The specific details of each module in the display device of the aforementioned web page have been described in detail in the corresponding web page display method, so they will not be repeated here.

[0101] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0102] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0103] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0104] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0105] The following reference Figure 10 To describe an electronic device 1000 according to such an embodiment of the present disclosure. Figure 10 The electronic device 1000 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0106] like Figure 10 As shown, the electronic device 1000 is manifested in the form of a general-purpose computing device. The components of the electronic device 1000 may include, but are not limited to: at least one processing unit 1010, at least one storage unit 1020, a bus 1030 connecting different system components (including storage unit 1020 and processing unit 1010), and a display unit 1040.

[0107] The storage unit stores program code that can be executed by the processing unit 1010, causing the processing unit 1010 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 1010 can perform actions such as... Figure 1 The steps shown are as follows: Step S110: Receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded; Step S120: Parse the URL to obtain the query preceding feature information and query parameter information included in the URL; Step S130: Determine the page loading rule corresponding to the page to be loaded based on the query preceding feature information and query parameter information; Step S140: Execute the page loading rule to discard or display the page to be loaded.

[0108] Storage unit 1020 may include readable media in the form of volatile storage units, such as random access memory (RAM) 10201 and / or cache memory 10202, and may further include read-only memory (ROM) 10203.

[0109] Storage unit 1020 may also include a program / utility 10204 having a set (at least one) program module 10205, such program module 10205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0110] Bus 1030 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.

[0111] Electronic device 1000 can also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1000, and / or any device that enables electronic device 1000 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1050. Furthermore, electronic device 1000 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1060. As shown, network adapter 1060 communicates with other modules of electronic device 1000 via bus 1030. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0112] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0113] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.

[0114] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may 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, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0115] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0116] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0117] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0118] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0119] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0120] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not invented by this disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method for processing web pages, characterized in that, include: Receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded; The Uniform Resource Locator (URL) is parsed to obtain the preceding feature information and the query parameter information included in the URL. Based on the query preceding feature information and query parameter information, determine the page loading rule corresponding to the page to be loaded, including: obtaining the page parameter mapping table of currently loaded pages already displayed on the current display interface, and matching the target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table; when it is determined that there is no target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, determine the first loading rule corresponding to the page to be loaded as displaying the page to be loaded; when it is determined that there is target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, obtain the target page parameter corresponding to the target preceding feature information from the page parameter mapping table, and compare the query parameter information and the target page parameter; if the target page parameter is consistent with the query parameter information, determine the second loading rule corresponding to the page to be loaded as discarding the page to be loaded; if the target page parameter is inconsistent with the query parameter information, determine the third loading rule corresponding to the page to be loaded as replacing the page to be loaded. The page loading rules are executed to either discard or display the page to be loaded.

2. The webpage processing method according to claim 1, characterized in that, The parameters to be queried and the parameters of the target page are compared, including: Obtain all the first subpage parameters included in the parameter information to be queried, and all the second subpage parameters included in the target page parameters, and compare the first subpage parameters and the second subpage parameters one by one; Specifically, if the parameters of the first subpage are completely identical to those of the second subpage, then the parameter information to be queried is determined to be identical to the parameter of the target page; if any sub-parameter in the first subpage is inconsistent with the parameter of the second subpage, then the parameter information to be queried is determined to be inconsistent with the parameter of the target page.

3. The webpage processing method according to claim 1, characterized in that, Execute the page loading rules to discard or display the page to be loaded, including: When the page loading rule is determined to be the first loading rule, the first loading rule is executed to display the page to be loaded on the display interface; When the page loading rule is determined to be the second loading rule, the second loading rule is executed to discard the page to be loaded; When the page loading rule is determined to be the third loading rule, the third loading rule is executed to replace the target loaded page on the display interface that corresponds to the page to be loaded based on the page to be loaded.

4. The webpage processing method according to claim 3, characterized in that, Displaying the page to be loaded on the display interface includes: Obtain the text file required to load the page to be loaded, and parse the text file to obtain the page object model corresponding to the page to be loaded; wherein, the text file includes a Hypertext Markup Language file and / or a Cascading Style Sheets file; A page rendering tree is generated based on the page object model, and the page layout of the page to be loaded is calculated based on the page rendering tree. The page layout is rendered to obtain the page to be loaded, and the page to be loaded is displayed on the display interface.

5. The webpage processing method according to claim 4, characterized in that, After obtaining the page to be loaded, the method for processing the webpage also includes: Using the query preceding feature information of the page to be loaded as the key and the query parameter information as the value, a key-value mapping relationship corresponding to the page to be loaded is generated, and the key-value mapping relationship corresponding to the page to be loaded is stored in the page parameter mapping table.

6. The webpage processing method according to claim 3, characterized in that, After discarding the page to be loaded, the method for processing the webpage further includes: Based on the target page parameters and the target preceding feature information corresponding to the target page parameters, the target loaded page corresponding to the discarded unloaded page is determined, and the target loaded page is refreshed.

7. The webpage processing method according to claim 3, characterized in that, Based on the page to be loaded, the target loaded page corresponding to the page to be loaded on the display interface is replaced, including: Based on the target page parameters and the target preceding feature information corresponding to the target page parameters, determine the page to be replaced on the display interface that corresponds to the page to be loaded; The page to be replaced is replaced based on the page to be loaded, and the page to be loaded is then displayed. The page to be loaded carries preset page parameters, which include display position parameters and / or specific execution function parameters, including preset activity function parameters and / or masking function parameters.

8. The webpage processing method according to claim 7, characterized in that, The method for processing the webpage also includes: The page to be replaced is uninstalled, and the target page parameters and target preceding feature information corresponding to the page to be replaced are deleted from the page parameter mapping table.

9. The method for processing web pages according to claim 1, characterized in that, Parsing the Uniform Resource Locator (URL) yields the query preceding feature information and query parameter information included in the URL, including: The Uniform Resource Locator (URL) is matched based on a preset first regular expression model to obtain a first matching result, and the first matching result is extracted from the URL to obtain the query preceding feature information; The second regular expression model is used to match the part of the Uniform Resource Locator (URL) excluding the first matching result to obtain the second matching result. The second matching result is then extracted from the URL to obtain the parameter information to be queried.

10. A webpage processing apparatus, characterized in that, include: The page to be loaded receiving module is used to receive the page to be loaded and obtain the Uniform Resource Locator (URL) of the page to be loaded. The Uniform Resource Locator (URL) parsing module is used to parse the URL to obtain the query preceding feature information and query parameter information included in the URL. The page loading rule determination module is used to determine the page loading rule corresponding to the page to be loaded based on the query preceding feature information and query parameter information. This includes: obtaining a page parameter mapping table of currently loaded pages displayed on the current display interface, and matching the target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table; when it is determined that there is no target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, determining a first loading rule corresponding to the page to be loaded to display the page to be loaded; when it is determined that there is target preceding feature information corresponding to the query preceding feature information in the page parameter mapping table, obtaining the target page parameter corresponding to the target preceding feature information from the page parameter mapping table, and comparing the query parameter information and the target page parameter; if the target page parameter is consistent with the query parameter information, determining a second loading rule corresponding to the page to be loaded to discard the page to be loaded; if the target page parameter is inconsistent with the query parameter information, determining a third loading rule corresponding to the page to be loaded to replace the page to be loaded. The page processing module is used to execute the page loading rules and discard or display the page to be loaded.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the web page processing method according to any one of claims 1-9.

12. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the web page processing method according to any one of claims 1-9 by executing the executable instructions.

Citation Information

Patent Citations

  • Webpage processing method, device and system

    CN109933737A

  • Website disaster tolerance method and device

    CN111416738A