Method, device, electronic device, and storage medium for browsing web pages
By setting the same name information for the web page and the path, the limitations and compatibility issues of nginx configuration and hashing methods are resolved, achieving more efficient and lower-error web browsing and improving universal applicability.
Patent Information
- Application Number
- CN202110179369.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-02-09
AI Technical Summary
When it comes to avoiding 404 web page errors, existing technologies have limitations in nginx configuration, high cost, and low efficiency, and hashing methods have parameter confusion and compatibility issues, resulting in a high web page error rate and poor universal applicability.
By setting the corresponding web pages and paths to have the same name information, determining the target path according to the name information of the target web page, and generating and outputting the target web page, the limitations of nginx configuration and the compatibility issues of the hash method are avoided.
It improves the universal applicability of web browsing, reduces the probability of web page errors, and reduces configuration costs and error rates.
Smart Images

Figure CN114912000B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, electronic device, storage medium, and program product for browsing a web page. Background Art
[0002] With the development of Internet technology and clients, users connect to corresponding servers through clients set on user devices and browse web pages provided by the servers. That is, users can browse web pages through user devices.
[0003] When a client is browsing a web page, the server may not be able to provide information normally or the server cannot respond. In this case, the server may return an error page to the client, such as a 404 page. In the prior art, in order to avoid the appearance of a 404 page, a common method is to configure nginx to rewrite the HTML page of the 404 page to index.htm in the root directory. In this way, when the web page requested by the client is a 404 page, the server finds the corresponding HTML page in the root directory and returns the corresponding HTML page to the client so that the client can display the corresponding HTML page.
[0004] However, different applications may include multiple web pages, and configuration is required for different web pages. There may be misoperations, resulting in web page errors. Summary of the Invention
[0005] Embodiments of the present application provide a method, apparatus, electronic device, storage medium, and program product for browsing a web page, to solve the problem of web page errors.
[0006] In a first aspect, an embodiment of the present application provides a method for browsing a web page, the method comprising:
[0007] Determining the name information of the target web page according to the acquired web page access request; wherein the web page access request is used to request access to the target web page;
[0008] According to the name information of the target webpage, a target path corresponding to the target webpage is determined, and the target webpage is generated and output according to the target path; wherein each path includes name information, and the corresponding webpage and the path have the same name information.
[0009] In some embodiments, determining a target path corresponding to the target webpage according to the name information of the target webpage includes:
[0010] Traversing the name information of each path according to the name information of the target webpage to obtain a path having the same name information as the target webpage;
[0011] The path having the same name information as the target webpage is determined as the target path corresponding to the target webpage.
[0012] In some embodiments, before determining a target path corresponding to the target webpage according to the name information of the target webpage, and generating and outputting the target webpage according to the target path, the method further includes:
[0013] Obtaining path configuration information corresponding to each path, and obtaining webpage configuration information corresponding to each webpage; wherein each path configuration information and each webpage configuration information include corresponding name information;
[0014] Determine the web pages and paths that have corresponding relationships based on the configuration information of each path and the configuration information of each web page;
[0015] The name information corresponding to the web pages and paths that have a corresponding relationship is adjusted to the same name information.
[0016] In some embodiments, adjusting the name information corresponding to the corresponding web pages and paths to the same name information includes:
[0017] Adjusting the suffix information of the name information of the corresponding web page configuration information to html, and obtaining the adjusted name information of the web page;
[0018] Adjusting the name information of the path configuration information having a corresponding relationship according to the prefix information of the name information of the webpage configuration information having a corresponding relationship and the adjusted suffix information to obtain the name information of the adjusted path;
[0019] The name information of the adjusted webpage is the same as the name information of the adjusted path.
[0020] In some embodiments, the suffix information of the name information of the corresponding web page configuration information is adjusted to html, and the adjusted name information of the web page is obtained, including:
[0021] A file name array is obtained from the corresponding web page configuration information, and the suffix information of the name information in the file name array is replaced with html to obtain the adjusted name information of the web page.
[0022] In some embodiments, the name information of the path configuration information having a corresponding relationship is adjusted according to the prefix information of the name information of the webpage configuration information having a corresponding relationship and the adjusted suffix information to obtain the adjusted path name information, including:
[0023] Obtain the prefix information of the name information from the web page configuration information with a corresponding relationship, and adjust the prefix information of the name information in the path configuration information with a corresponding relationship to the prefix information that is the same as the prefix information of the web page configuration information with a corresponding relationship, and add the suffix information of html to the path configuration information with a corresponding relationship to obtain the name information of the adjusted path.
[0024] In some embodiments, after obtaining a file name array from the corresponding web page configuration information and replacing the suffix information of the name information of the file name array with html to obtain the adjusted name information of the web page, the method further includes:
[0025] A web page frame is generated based on the adjusted web page name information and the file name array.
[0026] In some embodiments, generating and outputting the target webpage according to the target path includes:
[0027] Determining a target web page frame of the target web page from the web page frames according to the target path;
[0028] The webpage content of the target webpage frame is selected from a preset view layer folder according to the target webpage frame, and the target webpage is generated and output according to the webpage content and the target webpage frame.
[0029] In a second aspect, an embodiment of the present application provides a device for browsing a web page, comprising:
[0030] A first determining module is configured to determine the name information of a target web page according to an acquired web page access request, wherein the web page access request is used to request access to the target web page;
[0031] A second determining module is configured to determine a target path corresponding to the target web page based on the name information of the target web page; wherein each path includes name information, and the web page and the path having the corresponding relationship have the same name information;
[0032] A generating module, configured to generate the target webpage according to the target path;
[0033] An output module is used to output the target web page.
[0034] In some embodiments, the second determination module is used to traverse the name information of each path according to the name information of the target web page, obtain the path with the same name information as the target web page, and determine that the path with the same name information as the target web page is the target path that has a corresponding relationship with the target web page.
[0035] In some embodiments, the apparatus further comprises:
[0036] an acquisition module, configured to acquire path configuration information corresponding to each path, and acquire webpage configuration information corresponding to each webpage; wherein each path configuration information and each webpage configuration information include corresponding name information;
[0037] A third determining module is used to determine the web pages and paths that have a corresponding relationship based on the configuration information of each path and the configuration information of each web page;
[0038] The adjustment module is used to adjust the name information corresponding to the web pages and paths that have a corresponding relationship to the same name information.
[0039] In some embodiments, the adjustment module is used to adjust the suffix information of the name information of the web page configuration information with a corresponding relationship to html to obtain the name information of the adjusted web page, and adjust the name information of the path configuration information with a corresponding relationship based on the prefix information of the name information of the web page configuration information with a corresponding relationship and the adjusted suffix information to obtain the name information of the adjusted path, wherein the name information of the adjusted web page is the same as the name information of the adjusted path.
[0040] In some embodiments, the adjustment module is used to obtain a file name array from the corresponding web page configuration information, and replace the suffix information of the name information of the file name array with html to obtain the name information of the adjusted web page.
[0041] In some embodiments, the adjustment module is used to obtain the prefix information of the name information from the web page configuration information with a corresponding relationship, and adjust the prefix information of the name information in the path configuration information with a corresponding relationship to the same prefix information as the prefix information of the web page configuration information with a corresponding relationship, and add the suffix information of html to the path configuration information with a corresponding relationship to obtain the name information of the adjusted path.
[0042] In some embodiments, the adjustment module is used to generate a web page frame based on the name information of the adjusted web page and the file name array.
[0043] In some embodiments, the generation module is used to determine the target web page frame of the target web page from the web page frame according to the target path, select the web page content of the target web page frame from a preset view layer folder according to the target web page frame, and generate the target web page based on the web page content and the target web page frame.
[0044] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;
[0045] Memory; a memory for storing instructions executable by the processor;
[0046] The processor is configured to execute the method as described in the first aspect.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which implements the method described in the first aspect when executed by a processor.
[0049] An embodiment of the present application provides a method, device, electronic device, storage medium, and program product for browsing web pages, including: determining name information of a target web page based on an acquired web page access request, wherein the web page access request is used to request access to the target web page, determining a target path corresponding to the target web page based on the name information of the target web page, and generating and outputting the target web page based on the target path, wherein each path includes name information, and the web pages with a corresponding relationship and the path have the same name information. In this embodiment, by setting the web pages with a corresponding relationship and the path to have the same name information, and determining the target path corresponding to the target web page based on the name information of the target web page, thereby generating and outputting the target web page, it is possible to avoid the large limitations and high error rate caused by nginx configuration, and also avoid the incompatibility between different platforms caused by the hash method, thereby improving the universal applicability of browsing web pages and reducing the probability of web page errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0051] Figure 1 A schematic diagram of an application scenario of the method for browsing pages according to an embodiment of the present application;
[0052] Figure 2 A flowchart of a method for browsing a web page according to an embodiment of the present application;
[0053] Figure 3 A flowchart of a method for browsing a web page according to another embodiment of the present application;
[0054] Figure 4 A schematic diagram of a device for browsing web pages according to an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a web browsing device according to another embodiment of the present application;
[0056] Figure 6 A schematic diagram of an electronic device according to an embodiment of the present application.
[0057] The above drawings illustrate specific embodiments of the present disclosure, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of the present disclosure to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0058] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0059] The terms used in the embodiments of this application are explained as follows:
[0060] Web page: A web page is the basic element of a website and is a platform for carrying various website applications. A web page is generally a text file containing HTML tags. It can be stored in any computer and is a "page" in the World Wide Web. It is in the Hypertext Markup Language format. Web pages usually use image files to provide pictures and can be read through a web browser.
[0061] In this embodiment, the web page includes two parts: a web page frame and web page content.
[0062] Touch screen: refers to touching the touch screen installed on the front of the display with a finger or other object, and then the system locates and selects information input according to the icon or menu position touched by the finger. The touch screen consists of a touch detection component and a touch screen controller.
[0063] Path: refers to the routing path that a system (such as the web browsing device in this embodiment) uses to jump to a corresponding web page based on a web page access request.
[0064] The present invention provides a method for browsing web pages. Figure 1 The application scenario shown in Figure 1 In the application scenario shown, user 101 may send a webpage access request to server 103 via user device 102 .
[0065] In one example, the user 101 may send a webpage access request to the server 103 via the user device 102 in a voice-based manner.
[0066] For example, the user device 102 may be provided with a sound collector, and may collect the voice corresponding to the web page access request initiated by the user 101 based on the sound collector, and may generate and send a web page access request to the server 103 based on the collected voice corresponding to the web page request.
[0067] In another example, the user 101 may send a web page access request to the server 103 via the user device 102 in a touch-screen manner.
[0068] For example, the user device 102 is provided with a display, and the display has a touch screen function, then the user 101 can send a web page access request to the server 103 based on the user device 102 by touch screen selection and / or touch screen input.
[0069] Specifically, the user device 102 can display an input box on the display, and the user 101 can enter the name or address of the web page and other information in the input box. The user device 102 can generate and send a web page access request to the server 103 based on the information entered by the user 101 in the input box (such as the name of the web page or the address of the web page and other information).
[0070] Accordingly, the server 103 receives the webpage access request sent by the user device 102 , and transmits the webpage corresponding to the webpage access request to the user device 102 .
[0071] Correspondingly, the user device 102 receives the web page corresponding to the web page request sent by the server 103, and outputs and displays the web page corresponding to the web page request through the display.
[0072] Among them, user equipment includes but is not limited to Figure 1 The laptop, desktop computer, and mobile phone shown in the figure. The server may include a local server and a cloud server. The interaction between the user device and the server can be specifically reflected as the interaction between the client set in the user device and the server.
[0073] It is understandable that when a user accesses a web page based on a user device, there may be a situation where the server cannot provide the web page. When the server cannot provide the web page, the server can transmit a web page indicating an error to the user device.
[0074] For example, when using the history mode in a single page web application (SPA) to redirect a path, the redirected path is not the actual path, so the HTML file cannot be found, resulting in a 404 page error.
[0075] In the related art, there are usually two ways to avoid the 404 web page situation, one is the configuration method, and the other is the hash method.
[0076] Exemplarily, the configuration method can be: by configuring nginx, the HTML page of the 404 web page is rewritten to the index.htm in the root directory, so that when the web page requested by the user device is a 404 web page, the server finds the corresponding HTML page from the root directory and returns the corresponding HTML page to the user device so that the user device can display the corresponding HTML page.
[0077] Exemplarily, the hashing method may be: adding parameters (including symbols), such as "#", etc., before the hash path, and determining the corresponding HTML web page based on the path name after the "#".
[0078] However, if you try to avoid 404 pages through configuration, you may encounter the following problems:
[0079] On the one hand, nginx's configuration permissions have certain limitations, which may result in high configuration costs and low efficiency. On the other hand, there may be multiple web pages under the same application. If configuration is required for each web page, it may result in a large amount of configuration, high maintenance costs, and a high error rate.
[0080] Using hashing to avoid 404 pages may have the following problems:
[0081] On the one hand, the parameters are confusing, such as the different positions of "#", which can easily lead to low accuracy; on the other hand, compatibility issues between different platforms cause some web pages to fail to jump successfully on some platforms.
[0082] In order to avoid at least one of the above problems, the inventors of this application have creatively worked to obtain the inventive concept of this application: the web page and the path that have a corresponding relationship have the same name information, and the path that has a corresponding relationship with the web page is determined based on the same name information, and the web page corresponding to the path is generated and output according to the determined path.
[0083] Based on the above-mentioned inventive concept, an embodiment of the present application provides a method for browsing web pages.
[0084] See 2, Figure 2 A flowchart of a method for browsing web pages according to an embodiment of the present application is shown.
[0085] like Figure 2 As shown, the method includes:
[0086] S201: Determine the name information of the target web page according to the obtained web page access request.
[0087] The web page access request is used to request access to a target web page.
[0088] For example, the execution subject of this embodiment may be a device for browsing web pages, and the device for browsing web pages may be a server (including a local server and a cloud server), a computer, a processor, and a chip, etc., which is not limited in this embodiment.
[0089] For example, when the web browsing method of this embodiment is applied to Figure 1 In the application scenario shown, the device for browsing the web page can be as follows Figure 1 The server shown in .
[0090] Based on the above understanding of web pages, it can be known that a web page can be a text file including HTML tags, and the name information can be understood as the name of the HTML tag, such as a.html (web page a), or b.html (web page b).
[0091] In this embodiment, after the webpage browsing device obtains the webpage access request, since the webpage access request is used to request access to a target webpage, the webpage browsing device may determine the name information of the target webpage based on the target webpage.
[0092] For example, when the web browsing method of this embodiment is applied to Figure 1 In the application scenario shown, this step can be understood as: the server can receive a web page access request sent by a user device, and determine the target web page that the user wants to access based on the web page access request, and determine the name information of the target web page.
[0093] S202: Determine a target path corresponding to the target webpage according to the name information of the target webpage.
[0094] Each path includes name information, and the web pages and paths that have a corresponding relationship have the same name information.
[0095] For example, the web pages and paths that have a corresponding relationship have the same name information. This means that if path A can be used to jump to page B, then path A and web page B are said to have a corresponding relationship. In other words, the existence of a corresponding relationship means that the path in the corresponding relationship can be used to jump to the web page in the corresponding relationship.
[0096] It is worth noting that, in this embodiment, since the web pages and paths with corresponding relationships have the same name information, after the web browsing device determines the name information of the target web page, it can determine the path with corresponding relationships with the target web page based on the name information of the target web page, and the determined path can be called the target path.
[0097] S203: Generate and output a target webpage according to the target path.
[0098] For example, in combination with Figure 1 In the application scenario shown, if the server determines the target path, it can generate a target webpage based on the target path and transmit the generated target webpage to the user device so that the user device displays the target webpage.
[0099] Based on the above analysis, it can be seen that an embodiment of the present application provides a method for browsing web pages, the method including: determining the name information of a target web page based on an obtained web page access request, wherein the web page access request is used to request access to the target web page, determining a target path corresponding to the target web page based on the name information of the target web page, and generating and outputting the target web page based on the target path, wherein each path includes name information, and the web page with a corresponding relationship has the same name information as the path. In this embodiment, by setting the web page with a corresponding relationship and the path to have the same name information, and determining the target path corresponding to the target web page based on the name information of the target web page, thereby generating and outputting the target web page, it can avoid the problems of large limitations and high error rate caused by nginx configuration, and can also avoid the incompatibility problems between different platforms caused by the hash method, thereby improving the universal applicability of browsing web pages and reducing the probability of web page errors.
[0100] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of a method for browsing web pages according to another embodiment of the present application.
[0101] like Figure 3 As shown, the method includes:
[0102] S301: Acquire path configuration information corresponding to each path, and acquire webpage configuration information corresponding to each webpage.
[0103] Wherein, each path configuration information and each webpage configuration information includes respective corresponding name information.
[0104] Exemplarily, each path has path configuration information, and the path configuration information includes name information of each path. For example, path A has path configuration information, and the path configuration information of path A includes name information of path A, such as a.
[0105] Similarly, each web page has web page configuration information, and the web page configuration information includes the name information of each web page. For example, web page B has web page configuration information, and the web page configuration information of web page B includes the name information of web page B, such as b.vue.
[0106] S302: Determine corresponding web pages and paths based on the configuration information of each path and the configuration information of each web page.
[0107] Based on the above examples, it can be seen that the web pages and paths with corresponding relationships can be understood as: based on the paths with corresponding relationships, you can jump to the web page. In this step, the device for browsing the web page can determine the paths and web pages with jump relationships, that is, the paths and web pages with corresponding relationships, based on the configuration information of each path and the configuration information of each web page.
[0108] S303: Adjust the name information corresponding to the web pages and paths that have a corresponding relationship to be the same name information.
[0109] For example, if there is a corresponding relationship between path A and webpage B, that is, webpage B can be jumped to through path A, the name information of path A and the name information of webpage B can be adjusted to the same name information.
[0110] In some embodiments, S303 may include the following steps:
[0111] Step 1: Adjust the suffix information of the name information of the corresponding web page configuration information to html, and obtain the adjusted name information of the web page.
[0112] For example, if the name information of the web page configuration information is a.vue, the device for browsing the web page adjusts a.vue to a.html, and a.html is the name information of the adjusted web page.
[0113] In some embodiments, step 1 may specifically include: obtaining a file name array from corresponding web page configuration information, and replacing the suffix information of the name information in the file name array with html to obtain the adjusted name information of the web page.
[0114] For example, a device for browsing web pages uses node to read files in a view layer folder (views), obtains a file name array, and adjusts the suffix information of the name information of the file name array to html through a packaging plug-in (such as html-webpack-plugin).
[0115] Step 2: According to the prefix information and the adjusted suffix information of the name information of the corresponding webpage configuration information, the name information of the corresponding path configuration information is adjusted to obtain the adjusted path name information.
[0116] The name information of the adjusted webpage is the same as the name information of the adjusted path.
[0117] Exemplarily, the name information of the path is adjusted based on a.html to obtain the adjusted name information of the path.
[0118] In some embodiments, step 2 may specifically include: obtaining the prefix information of the name information from the web page configuration information with a corresponding relationship, and adjusting the prefix information of the name information in the path configuration information with a corresponding relationship to the prefix information that is the same as the prefix information of the web page configuration information with a corresponding relationship, and adding the suffix information of html to the path configuration information with a corresponding relationship to obtain the name information of the adjusted path.
[0119] In combination with the above example, if the name information of the adjusted web page is a.html, the device for browsing the web page adjusts the prefix information of the name information in the path configuration information to a, and adds html on this basis, so that the name information of the adjusted path is also a.html.
[0120] S304: Generate a web page frame based on the adjusted web page name information and file name array.
[0121] For example, if the web browsing method of this embodiment is applied to Figure 1 The application scenario shown is that the device for browsing the web page is as follows Figure 1 , this step can be understood as: the server generates and publishes the web page frame based on the adjusted web page name information and file name array.
[0122] S305: Determine the name information of the target web page according to the obtained web page access request.
[0123] The web page access request is used to request access to a target web page.
[0124] For example, the description of S305 can refer to S101 and will not be repeated here.
[0125] S306: Traverse the name information of each path according to the name information of the target webpage to obtain a target path having the same name information as the target webpage.
[0126] It can be understood that different web pages are stored in the device for browsing web pages (such as a server), and different web pages are jumped through different paths. In this embodiment, after the device for browsing web pages determines the name information of the target web page, since the name information of the target web page and the target path with a corresponding relationship have the same name information, the device for browsing web pages can traverse the name information of each path in the device for browsing web pages based on the name information of the target web page, thereby obtaining a path with the same name information as the target web page, and this path is called the target path.
[0127] In other embodiments, a mapping relationship between corresponding web pages and paths may be constructed based on name information, and when the web browsing device determines the name information of the target web page, the target path corresponding to the target web page is determined based on the mapping relationship.
[0128] S307: Determine the target web page frame of the target web page from the web page frames according to the target path.
[0129] For example, after the webpage browsing device determines the target path, it can jump to the target webpage frame of the target webpage based on the target path.
[0130] S308: Selecting webpage content of the target webpage frame from a preset view layer folder according to the target webpage frame, and generating and outputting the target webpage according to the webpage content and the target webpage frame.
[0131] Exemplarily, the target web page frame is the frame of the target web page, which has not yet been filled with web page content. After determining the target web page frame, the web browsing device selects the web page content of the target web page frame from the view layer folder and mounts the web page content to the target web page frame, thereby generating the target web page.
[0132] According to another aspect of the embodiment of the present application, the embodiment of the present application provides a device for browsing a web page, which is used to execute the method for browsing a web page as described in any of the above embodiments, such as executing the method as described in the embodiment. Figure 2 or Figure 3 The method of browsing the web page shown.
[0133] See also Figure 4 , Figure 4 A schematic diagram of a device for browsing web pages according to an embodiment of the present application.
[0134] like Figure 4 As shown, the device 400 for browsing web pages includes:
[0135] The first determining module 401 is configured to determine the name information of a target web page according to an acquired web page access request, wherein the web page access request is used to request access to the target web page.
[0136] The second determining module 402 is configured to determine a target path corresponding to the target webpage according to the name information of the target webpage; wherein each path includes name information, and the corresponding webpage and the path have the same name information.
[0137] The generating module 403 is configured to generate the target webpage according to the target path.
[0138] The output module 404 is configured to output the target web page.
[0139] In some embodiments, the second determination module 402 is used to traverse the name information of each path according to the name information of the target web page, obtain the path with the same name information as the target web page, and determine that the path with the same name information as the target web page is the target path that has a corresponding relationship with the target web page.
[0140] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a device for browsing web pages according to another embodiment of the present application.
[0141] like Figure 5 As shown, the device 500 for browsing web pages includes:
[0142] The acquisition module 501 is configured to acquire the path configuration information corresponding to each path and acquire the webpage configuration information corresponding to each webpage; wherein each path configuration information and each webpage configuration information both include corresponding name information.
[0143] The third determining module 502 is configured to determine corresponding web pages and paths according to the configuration information of each path and the configuration information of each web page.
[0144] The adjustment module 503 is configured to adjust the name information corresponding to the web pages and paths that have a corresponding relationship to be the same name information.
[0145] In some embodiments, the adjustment module 503 is used to adjust the suffix information of the name information of the web page configuration information with a corresponding relationship to html to obtain the name information of the adjusted web page, and adjust the name information of the path configuration information with a corresponding relationship according to the prefix information of the name information of the web page configuration information with a corresponding relationship and the adjusted suffix information to obtain the name information of the adjusted path, wherein the name information of the adjusted web page is the same as the name information of the adjusted path.
[0146] In some embodiments, the adjustment module 503 is configured to obtain a file name array from the corresponding web page configuration information, and replace the suffix information of the name information in the file name array with html to obtain the adjusted web page name information.
[0147] In some embodiments, the adjustment module 503 is used to obtain the prefix information of the name information from the web page configuration information with a corresponding relationship, and adjust the prefix information of the name information in the path configuration information with a corresponding relationship to the same prefix information as the prefix information of the web page configuration information with a corresponding relationship, and add the suffix information of html to the path configuration information with a corresponding relationship to obtain the name information of the adjusted path.
[0148] In some embodiments, the adjustment module 503 is configured to generate a web page frame based on the name information of the adjusted web page and the file name array.
[0149] The first determining module 504 is configured to determine the name information of a target web page according to the acquired web page access request, wherein the web page access request is used to request access to the target web page.
[0150] The second determining module 505 is configured to determine a target path corresponding to the target webpage according to the name information of the target webpage; wherein each path includes name information, and the webpages corresponding to the path have the same name information.
[0151] The generating module 506 is configured to generate the target webpage according to the target path.
[0152] In some embodiments, the generation module 506 is used to determine the target web page frame of the target web page from the web page frame according to the target path, select the web page content of the target web page frame from a preset view layer folder according to the target web page frame, and generate the target web page based on the web page content and the target web page frame.
[0153] The output module 507 is configured to output the target web page.
[0154] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0155] According to an embodiment of the present application, the present application also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0156] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0157] like Figure 6 As shown, electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of device 600 can also be stored in RAM 603. Computing unit 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0158] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0159] The computing unit 601 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the method of browsing a web page. For example, in some embodiments, the method of browsing a web page can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method of browsing a web page described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the method of browsing a web page by any other appropriate means (e.g., by means of firmware).
[0160] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0161] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0162] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer 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 foregoing.
[0163] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0164] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0165] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0166] Other embodiments of the present disclosure will readily occur to those skilled in the art 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 not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0167] 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 method for browsing a web page, the method comprising: Determining the name information of the target web page according to the acquired web page access request; wherein the web page access request is used to request access to the target web page; Traversing the name information of each path according to the name information of the target webpage to obtain a path having the same name information as the target webpage; Determining a path having the same name information as the target webpage as a target path corresponding to the target webpage, and generating and outputting the target webpage according to the target path; wherein each path includes name information, and the corresponding webpage has the same name information as the path; Before traversing the name information of each path based on the name information of the target webpage to obtain a path having the same name information as the target webpage, the method further includes: obtaining path configuration information corresponding to each path and obtaining webpage configuration information corresponding to each webpage; wherein each path configuration information and each webpage configuration information both include corresponding name information; Determine the web pages and paths that have corresponding relationships based on the configuration information of each path and the configuration information of each web page; The name information corresponding to the web pages and paths that have a corresponding relationship is adjusted to the same name information.
2. The method according to claim 1, wherein Adjust the name information corresponding to the corresponding web pages and paths to the same name information, including: Adjusting the suffix information of the name information of the corresponding web page configuration information to html, and obtaining the adjusted name information of the web page; Adjusting the name information of the path configuration information having a corresponding relationship according to the prefix information of the name information of the webpage configuration information having a corresponding relationship and the adjusted suffix information to obtain the name information of the adjusted path; The name information of the adjusted webpage is the same as the name information of the adjusted path.
3. The method according to claim 2, wherein: The suffix information of the name information of the corresponding web page configuration information is adjusted to html, and the adjusted web page name information is obtained, including: A file name array is obtained from the corresponding web page configuration information, and the suffix information of the name information in the file name array is replaced with html to obtain the adjusted name information of the web page.
4. The method according to claim 2, wherein: Adjusting the name information of the path configuration information having a corresponding relationship according to the prefix information and the adjusted suffix information of the name information of the webpage configuration information having a corresponding relationship to obtain the adjusted path name information includes: Obtain the prefix information of the name information from the web page configuration information with a corresponding relationship, and adjust the prefix information of the name information in the path configuration information with a corresponding relationship to the prefix information that is the same as the prefix information of the web page configuration information with a corresponding relationship, and add the suffix information of html to the path configuration information with a corresponding relationship to obtain the name information of the adjusted path.
5. The method according to claim 2, wherein: After obtaining a file name array from the corresponding web page configuration information and replacing the suffix information of the name information of the file name array with html to obtain the adjusted name information of the web page, the method further includes: A web page frame is generated based on the adjusted web page name information and the file name array.
6. The method according to claim 5, wherein: Generating and outputting the target webpage according to the target path includes: Determining a target web page frame of the target web page from the web page frames according to the target path; The webpage content of the target webpage frame is selected from a preset view layer folder according to the target webpage frame, and the target webpage is generated and output according to the webpage content and the target webpage frame.
7. A device for browsing web pages, comprising: A first determining module is configured to determine the name information of a target web page according to an acquired web page access request, wherein the web page access request is used to request access to the target web page; A second determining module is configured to determine a target path corresponding to the target web page based on the name information of the target web page; wherein each path includes name information, and the web page and the path having the corresponding relationship have the same name information; A generating module, configured to generate the target webpage according to the target path; An output module, configured to output the target web page; The second determining module is configured to traverse the name information of each path according to the name information of the target webpage, obtain a path having the same name information as the target webpage, and determine the path having the same name information as the target webpage as the target path having a corresponding relationship with the target webpage; The web browsing device further includes: an acquisition module, configured to acquire path configuration information corresponding to each path, and acquire web page configuration information corresponding to each web page; wherein each path configuration information and each web page configuration information includes corresponding name information; A third determining module is used to determine the web pages and paths that have a corresponding relationship based on the configuration information of each path and the configuration information of each web page; The adjustment module is used to adjust the name information corresponding to the web pages and paths that have a corresponding relationship to the same name information.
8. An electronic device comprising: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is configured to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Webpage cache method and server
CN105930528A
Webpage access method, terminal and computer readable storage medium
CN107423365A