Web display method, device, equipment, storage medium and program product
The network monitoring handle object in IOS systems retrieves cached web page elements from a local database to ensure web page display efficiency even in disconnected states, addressing the IOS operation system's inability to display web pages offline.
Patent Information
- Application Number
- CN202111413798.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-11-25
AI Technical Summary
The IOS operating system cannot realize web page display when the network is disconnected, which affects the efficiency of web page display.
Get the encapsulated network request submitted by the IOS operating system through the network monitoring handle object, get the target URL address, and query the web page element cache database to return the web page element, or get and cache the web page element from the server when it is not queried.
When the IOS system is disconnected from the Internet, it directly obtains web page elements from the cache database, which improves the efficiency of web page display.
Smart Images

Figure CN113901362B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a web page display method, device, equipment, storage medium, and program product. Background Art
[0002] With the rapid development of Internet technology, it has become a routine operation for users to use various functional application software in the operating system of mobile devices. Moreover, during the use of application software, relevant content is often obtained through network requests and web pages are displayed. Among them, the IOS operating system is an operating system in common mobile devices today. However, the IOS operating system cannot achieve web page display when the network is disconnected, thus affecting the efficiency of web page display. Therefore, the problem of achieving web page display in the case of the IOS operating system being disconnected from the network needs to be solved urgently. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a web page display method, device, equipment, readable storage medium, and program product that can improve the efficiency of web page display.
[0004] In a first aspect, this application provides a web page display method. The method includes:
[0005] A network monitoring handle object obtains an encapsulated object submitted by the operating system. The encapsulated object includes a network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; the network monitoring handle object obtains the target URL address corresponding to the network request according to the encapsulated object; the network monitoring handle object queries the web page element cache database based on the target URL address, and when a first web page element corresponding to the target URL address is found, returns the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
[0006] In one embodiment, the network monitoring handle object obtains the target URL address corresponding to the network request according to the encapsulated object, including: the network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulated object; the network monitoring handle object standardizes the target fields in the original URL address to obtain the target URL address, where the target fields include at least one of an encrypted field and a timestamp field.
[0007] In one embodiment, the method further includes: when the first web page element corresponding to the target URL address is not found, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns a second web page element, stores the second web page element corresponding to the target URL address in the web page element cache database.
[0008] In one embodiment, storing the second web page element and the target URL address in the web page element cache database includes: obtaining the domain name corresponding to the initiated network request; determining a storage path based on the domain name, and creating a storage node in the web page element cache database based on the storage path; storing the second web page element and the target URL address in the storage node.
[0009] In one embodiment, the web page element cache database is a linked list, and the method further includes: deleting data exceeding the length of the linked list from the web page element cache database in the order of the deposit time and the read time.
[0010] In one embodiment, before the network monitoring handle object obtains the encapsulated object submitted by the operating system, the method further includes: registering the network monitoring handle object when creating a browser object.
[0011] In one embodiment, the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing data in the web page element cache database based on the target URL address.
[0012] In a second aspect, the present application also provides a web page display device. The device includes:
[0013] A first obtaining module, configured to obtain, by a network monitoring handle object, an encapsulated object submitted by an operating system, where the encapsulated object includes a network request intercepted and encapsulated by the operating system, and the operating system is an IOS operating system; a second obtaining module, configured to obtain, by the network monitoring handle object, a target URL address corresponding to the network request according to the encapsulated object; a query module, configured to query, by the network monitoring handle object, a web page element cache database based on the target URL address, and when a first web page element corresponding to the target URL address is queried, return the first web page element to an initiating object of the network request for the initiating object to display a web page based on the first web page element.
[0014] In one embodiment, the second obtaining module is specifically configured to: obtain, by the network monitoring handle object, an original URL address corresponding to the network request according to the encapsulated object; and standardize a target field in the original URL address by the network monitoring handle object to obtain the target URL address, where the target field includes at least one of an encrypted field and a timestamp field.
[0015] In one embodiment, the device further includes:
[0016] A storage module, when a first web element corresponding to the target URL address is not queried, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns a second web element, stores the second web element corresponding to the target URL address in the web element cache database.
[0017] In one embodiment, the storage module is specifically configured to: obtain the domain name corresponding to the initiated network request; determine the storage path based on the domain name, and create a storage node in the web element cache database based on the storage path; store the second web element corresponding to the target URL address in the storage node.
[0018] In one embodiment, the web element cache database is a linked list, and the apparatus further includes:
[0019] A deletion module, configured to delete data exceeding the length of the linked list from the web element cache database in the order of the deposit time and the read time.
[0020] In one embodiment, before the network monitoring handle object obtains the encapsulated object submitted by the operating system, the apparatus further includes:
[0021] A creation module, configured to register the network monitoring handle object when creating a browser object.
[0022] In one embodiment, the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing the data in the web element cache database based on the target URL address.
[0023] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the first aspects above are implemented.
[0024] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects above are implemented.
[0025] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects above are implemented.
[0026] The above web page display method, device, computer device, storage medium and program product obtain an encapsulated object of a network request submitted by the IOS operating system through a network monitoring handle object, and obtain the target URL address corresponding to the network request according to the encapsulated object, so that the web page element cache database can be queried according to the target URL address, and when the first web page element corresponding to the target URL address is found, the first web page element is returned to the initiating object of the network request for the initiating object to display the web page based on the first web page element; therefore, when the first web page element cannot be obtained from the server due to network disconnection, the first web page element can be directly obtained from the web page element cache database, realizing the display of the web page when the IOS system is disconnected from the network and greatly improving the efficiency of web page display. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic flowchart of the web page display method in an embodiment;
[0028] Figure 2 It is a schematic flowchart of obtaining the URL address in an embodiment;
[0029] Figure 3 It is a schematic flowchart of storing the second web page element in an embodiment;
[0030] Figure 4 It is a schematic flowchart of obtaining the web page element in an embodiment;
[0031] Figure 5 It is a structural block diagram of the web page display device in an embodiment;
[0032] Figure 6 It is a structural block diagram of the second web page display device in an embodiment;
[0033] Figure 7 It is a structural block diagram of the third web page display device in an embodiment;
[0034] Figure 8 It is a structural block diagram of the fourth web page display device in an embodiment;
[0035] Figure 9 It is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0037] With the rapid development of Internet technology, it has become a common operation for users to use application software with various functions in the operating system of mobile devices. Moreover, during the use of application software, relevant content is often obtained through network requests and web pages are displayed. Among them, the IOS operating system is the operating system in common mobile devices today. However, the IOS operating system cannot achieve web page display when the network is disconnected, thus affecting the efficiency of web page display. Therefore, the problem of achieving web page display in the case of the IOS operating system being disconnected from the network needs to be solved urgently.
[0038] In one embodiment, as Figure 1 shown, a web page display method is provided. In this embodiment, this method is exemplified by being applied to a terminal. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0039] Step 101, a network monitoring handle object obtains an encapsulated object submitted by the operating system. The encapsulated object includes a network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system.
[0040] Among them, when a user clicks on a web page link in the application software to view relevant web page elements, a network request to obtain the web page elements needs to be sent to the server of the application software, and according to the response of the application software to the network request, the relevant web page elements are displayed. The web page elements include HTML (HyperText Mark-up Language) files, CSS (Cascading Style Sheets) files, and JAVAScript, etc.; among them, in the IOS operating system, when the network is disconnected, the system will intercept the network request and encapsulate it into a network request object, that is, the encapsulated object; the network monitoring handle object pre-established in the application software implements the WKURLSchemehandler protocol of the IOS system; when a network request corresponding to the web page link is initiated, the network monitoring handle object can obtain the encapsulated object, so as to further obtain the network request.
[0041] Step 102, the network monitoring handle object obtains the target URL address corresponding to the network request according to the encapsulated object.
[0042] Among them, when the network monitoring handle object obtains the encapsulated object submitted by the operating system, since the encapsulated object is intercepted and encapsulated by the system for network requests, the network request can be obtained based on this encapsulated object. Specifically, the network request includes the URL (Uniform Resource Locator) address of the web page link of the web page elements to be obtained, that is, the target URL address. When the network monitoring handle object obtains the encapsulated object submitted by the operating system, since the network monitoring handle object implements the WKURLSchemeHandler protocol of the IOS system, through this protocol, the encapsulated object can be obtained, and further the target URL address can be obtained.
[0043] Step 103: The network monitoring handle object queries the web page element cache database based on the target URL address. When the first web page element corresponding to the target URL address is found, the first web page element is returned to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
[0044] Among them, a web page element cache database is established in the mobile device, which includes the web page elements corresponding to the web page links clicked by the user in the application software. Each web page element is obtained from the server through the corresponding network requests. In the web page element cache database, the URL address in the network request corresponding to each web page link and the web page element are stored correspondingly. When the network monitoring handle object obtains the target URL address of the web page link of the web page elements to be obtained, it queries the web page element cache database based on the target URL address, thereby finding the web page element corresponding to the target URL address, which is the first web page element. The first web page element is returned to the initiating object of the network request, that is, sent to the web page link corresponding to the network request, for the initiating object to display the web page based on the first web page element.
[0045] In the above web page display method, the network monitoring handle object obtains the encapsulated object of the network request submitted by the IOS operating system, and obtains the target URL address corresponding to the network request based on this encapsulated object. Thus, the web page element cache database can be queried based on the target URL address. When the first web page element corresponding to the target URL address is found, the first web page element is returned to the initiating object of the network request for the initiating object to display the web page based on the first web page element. Therefore, in the case where the first web page element cannot be obtained from the server when the network is disconnected, by directly obtaining the first web page element from the web page element cache database, the web page display of the IOS system when the network is disconnected is realized, and there is no need to obtain the first web page element from the server, thus greatly improving the efficiency of web page display.
[0046] In one embodiment, before the network monitoring handle object obtains the encapsulated object submitted by the operating system, the method further includes: registering the network monitoring handle object when creating a browser object.
[0047] The network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing the data in the web page element cache database based on the target URL address.
[0048] Among them, in the application software, the page loaded after clicking each web page link for displaying web page elements is the browser object, and the web page elements obtained according to the network request are displayed on the web page in the browser object; when creating the browser object, the network monitoring handle object is registered in the application software. Further, the network monitoring handle object includes a network session control object and a network request cache object; among them, the network session control object is specifically used to obtain the encapsulated object encapsulated according to the network request submitted by the operating system, and describe various attributes of the network request, such as the hyperlink address, etc.; and, the network session control object is also specifically used to obtain the target URL address based on the encapsulated object, so that the first web page element can be further obtained according to the target URL address. The network monitoring handle object also includes a network request cache object, and the network request cache object is specifically used to manage the data in the web page element cache database based on the target URL address, that is, store each URL address and each web page element obtained from the server according to the URL address in the web page element cache database, and in the case of network disconnection, based on the target URL address obtained by the network session control object, find the corresponding first web page element in the web page element cache database, so that the network session control object returns the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
[0049] By establishing a network monitoring handle object, the target URL address can be obtained, so that the first web page element corresponding to the target URL address can be directly obtained from the web page element cache database, reducing the time for the network request initiating object to obtain the first web page element and improving the efficiency of web page display.
[0050] In one embodiment, as Figure 2 shown, it shows a schematic flow diagram of a method for obtaining a URL address provided by an embodiment of the present application. The network monitoring handle object obtains the target URL address corresponding to the network request according to the encapsulated object, including:
[0051] Step 201, the network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulated object.
[0052] Step 202: The network monitoring handle object standardizes the target fields in the original URL address to obtain the target URL address, where the target fields include at least one of an encrypted field and a timestamp field.
[0053] Among them, the network monitoring handle object obtains the encapsulated object submitted by the operating system, and the URL address obtained therefrom is the original URL address; the original URL address also includes fields such as encryption and timestamp, and these fields such as encryption and timestamp are the target fields. Since it is necessary to use the URL address as an index to obtain the corresponding web page elements from the web page element cache database, for the original URL address, the fields such as encryption and timestamp in it are standardized and converted into a standard format; for example, for the same web page link, network requests have been initiated at different times, then the URL addresses in the respective network requests corresponding to the web page link at different times are the same, but the fields such as encryption and timestamp in them are different. However, since the URL address is used as an index to query the corresponding web page elements, the existence of fields such as encryption and timestamp will affect the speed and accuracy of querying web page elements. Therefore, the fields such as encryption and timestamp are converted into the 00000000 format to eliminate their influence on querying web page elements. Therefore, the network monitoring handle object standardizes the target fields in the original URL address to obtain the target URL address, and then queries the required web page elements in the web page element cache database according to the target URL address.
[0054] By converting the target fields in the original URL address into a standard format, the influence of fields other than the URL address on querying web page elements is eliminated, thereby improving the query accuracy and speed; moreover, when storing the target URL address and the corresponding web page elements in the web page element cache database, the memory occupancy can also be reduced.
[0055] In one embodiment, the method further includes: when the first web page element corresponding to the target URL address is not queried, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns the second web page element, stores the second web page element corresponding to the target URL address in the web page element cache database.
[0056] Among them, after the network monitoring handle object obtains the target URL address, it searches the network element cache database for the required first web page element according to the target URL address. Since each web page element is obtained from the server and stored in the network element cache database, when the first web page element corresponding to the target URL address is not found in the network element cache database, it is necessary to obtain the corresponding web page element from the server. Therefore, the network monitoring handle object initiates a network request to the server based on the original URL address, and obtains the corresponding web page element returned by the server according to the response of the server. The web page element returned by the server that is not found in the network element cache database is the second web page element; further, the second web page element is stored in the web page element cache database corresponding to the target URL address after standardization, and the second web page element is returned to the initiating object of the network request, so that the initiating object can display the web page based on the second web page element; when the network monitoring handle object obtains the target URL address again next time, the second web page element can be directly obtained by querying the web page element cache database according to the target URL address. Compared with directly obtaining the second web page element from the server, the acquisition time is reduced and the acquisition efficiency is improved, so as to display the web page as soon as possible.
[0057] In one embodiment, Figure 3 As shown, it shows a schematic diagram of a process of storing a second web page element provided by an embodiment of the present application, storing the second web page element and the target URL address in the web page element cache database correspondingly, including:
[0058] Step 301, obtaining the domain name corresponding to the initiated network request.
[0059] When the server returns the web page element and stores it in the web page element cache database, in order to store the URL address and the corresponding web page element in correspondence, it is first necessary to obtain the domain name corresponding to the initiated network request from the target URL address.
[0060] Step 302: determine a storage path based on the domain name, and create a storage node in the web page element cache database based on the storage path.
[0061] Step 303: Store the second webpage element and the target URL address in the storage node in correspondence with each other.
[0062] Among them, all web page elements are classified according to domain names in the web page element cache database; after obtaining the domain name of the network request corresponding to the target URL address, the storage path of the second web page element in the mobile device is determined based on the domain name, and a storage node is further created in the web page element cache database based on the storage path, so that the second web page element can be stored in the storage node corresponding to the target URL address.
[0063] In one embodiment, the method further includes: deleting data that exceeds the length of the linked list from the web page element cache database in the order of the storage time and the reading time.
[0064] Among them, there are multiple URL addresses corresponding to web page elements stored in the web page element cache database. The web page element cache database is a linked list. The URL addresses and web page elements are stored in the linked list according to the storage time. And whenever the corresponding web page element is read from the linked list according to a certain URL address for web page display, the URL address and the corresponding web page element are updated to the latest stored state in the linked list and become the latest stored set of data. The length of the linked list is limited. When the data stored in the linked list exceeds the length of the linked list, the data that exceeds the length of the linked list is deleted from the web page element cache database. Among them, according to the rule of storing data in the linked list, the data that exceeds the length of the linked list is the data that was initially stored and has not been read recently, and its reading frequency is lower than that of the data that does not exceed the length of the linked list. Therefore, deleting the data that exceeds the length of the linked list, that is, deleting it from the web page element cache database, can avoid the situation of data redundancy occupying memory.
[0065] In one embodiment, as Figure 4 shown, it shows a schematic flow chart of obtaining a web page element provided by an embodiment of the present application, including:
[0066] Step 401, the network monitoring handle object obtains the encapsulated object submitted by the operating system.
[0067] Among them, before the network monitoring handle object obtains the encapsulated object submitted by the operating system, the network monitoring handle object is registered when creating the browser object. The network monitoring handle object includes a network session control object and a network request cache object. The network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object. The network request cache object is used to implement the function of managing the data in the web page element cache database based on the target URL address.
[0068] Step 402, the network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulated object.
[0069] Step 403, standardize the target field in the original URL address to obtain the target URL address.
[0070] Among them, the target fields include at least one of the encrypted field and the timestamp field; for the same web page link, network requests have been initiated at different times, then the URL addresses in the respective network requests corresponding to the web page link at different times are the same, but fields such as encryption and timestamp are different. However, since the corresponding web page elements are queried using the URL address as the index, the existence of fields such as encryption and timestamp will affect the speed and accuracy of querying web page elements. Convert fields such as encryption and timestamp into the 00000000 format to eliminate their impact on querying web page elements. Therefore, the network monitoring handle object standardizes the target fields in the original URL address to obtain the target URL address, and then queries the required web page elements in the web page element cache database based on the target URL address.
[0071] Step 404, the network monitoring handle object queries the web page element cache database based on the target URL address to obtain the first web page element corresponding to the target URL address.
[0072] Among them, in the web page element cache database, the URL addresses and web page elements in the network requests corresponding to each web page link are stored corresponding to each other based on the target URL address queried by the network monitoring handle object. When the network monitoring handle object obtains the target URL address of the web page link for which it needs to obtain the web page element, it queries the web page element cache database based on the target URL address, thereby querying the web page element corresponding to the target URL address, which is the first web page element; the first web page element is returned to the initiating object of the network request, that is, sent to the web page link corresponding to the network request, for the initiating object to display the web page based on the first web page element.
[0073] Step 405, return the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
[0074] Step 406, when the first web page element corresponding to the target URL address is not queried, the network monitoring handle object initiates a network request to the server based on the original URL address to obtain the second web page element returned by the server.
[0075] Step 407, the second web page element is stored corresponding to the target URL address in the web page element cache database, and the second web page element is returned to the initiating object of the network request.
[0076] Among them, the web page elements returned by the server that are not found in the network element cache database are the second web page elements; further, the second web page elements are stored in the web page element cache database corresponding to the target URL address after being standardized, and the second web page elements are returned to the initiator of the network request for the initiator to display the web page based on the second web page elements.
[0077] The web page element cache database is a linked list. The storage path of the second web page element is determined according to the domain name corresponding to the initiated network request, and a storage node is created in the web page element cache database based on the storage path for storing the second web page element; and the data exceeding the length of the linked list is deleted from the web page element cache database in the order of the storage time and the reading time.
[0078] It should be understood that although the steps in the flowcharts involved in the above-mentioned embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps in other steps.
[0079] Based on the same inventive concept, an embodiment of the present application also provides a web page display device for implementing the above-mentioned web page display method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the web page display device provided below can refer to the limitations on the web page display method in the above text, and will not be repeated here.
[0080] In one embodiment, as Figure 5 shown, a web page display device is provided, including: a first acquisition module 501, a second acquisition module 502, and a query module 503, where:
[0081] The first acquisition module 501 is used for the network monitoring handle object to acquire the encapsulated object submitted by the operating system. The encapsulated object includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system.
[0082] The second acquisition module 502 is used for the network monitoring handle object to acquire the target URL address corresponding to the network request according to the encapsulated object.
[0083] A query module 503 is configured to query a web page element cache database based on the target URL address by the network monitoring handle object, and when a first web page element corresponding to the target URL address is queried, return the first web page element to the initiating object of the network request for the initiating object to display a web page based on the first web page element.
[0084] In one embodiment, the second obtaining module 502 is specifically configured to: obtain, by the network monitoring handle object, an original URL address corresponding to a network request according to the encapsulation object; and perform normalization processing on a target field in the original URL address by the network monitoring handle object to obtain the target URL address, where the target field includes at least one of an encrypted field and a timestamp field.
[0085] In one embodiment, as Figure 6 shown, it shows a block diagram of a second web page display device provided by an embodiment of the present application. The web page display device 600 further includes:
[0086] A storage module 504 is configured to, when a first web page element corresponding to the target URL address is not queried, initiate a network request to a server based on the original URL address by the network monitoring handle object, and when a second web page element is returned by the server, store the second web page element corresponding to the target URL address in the web page element cache database.
[0087] In one embodiment, the storage module 504 is specifically configured to: obtain a domain name corresponding to the initiated network request; determine a storage path based on the domain name, and create a storage node in the web page element cache database based on the storage path; and store the second web page element corresponding to the target URL address in the storage node.
[0088] In one embodiment, as Figure 7 shown, it shows a block diagram of a third web page display device provided by an embodiment of the present application. The web page display device 700 further includes:
[0089] A deletion module 505 is configured to delete data exceeding the linked list length from the web page element cache database in the order of storage time and reading time.
[0090] In one embodiment, as Figure 8 shown, it shows a block diagram of a fourth web page display device provided by an embodiment of the present application. The web page display device 800 further includes:
[0091] A creation module 506 is configured to register the network monitoring handle object when creating a browser object.
[0092] In one embodiment, the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to obtain the encapsulated object submitted by the operating system and obtain the target URL address based on the encapsulated object; the network request cache object is used to manage the data in the web page element cache database based on the target URL address.
[0093] Each module in the above web page display device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0094] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a web page display method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0095] Those skilled in the art can understand that Figure 9 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0096] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0097] The network monitoring handle object obtains the encapsulated object submitted by the operating system, which includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; the network monitoring handle object obtains the target URL address corresponding to the network request based on the encapsulated object; the network monitoring handle object queries the web page element cache database based on the target URL address, and when the first web page element corresponding to the target URL address is queried, the first web page element is returned to the initiating object of the network request, so that the initiating object can display the web page based on the first web page element.
[0098] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0099] The network monitoring handle object is registered when the browser object is created; the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to realize the function of obtaining the encapsulation object submitted by the operating system, and obtaining the target URL address based on the encapsulation object; the network request cache object is used to realize the function of managing the data in the web page element cache database based on the target URL address.
[0100] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0101] The network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulation object; the network monitoring handle object standardizes the target field in the original URL address to obtain the target URL address, wherein the target field includes at least one of an encryption field and a timestamp field.
[0102] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0103] When the first web page element corresponding to the target URL address is not found, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns the second web page element, the second web page element and the target URL address are stored in the web page element cache database.
[0104] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0105] The domain name corresponding to the initiated network request is obtained; a storage path is determined based on the domain name, and a storage node is created in the web page element cache database based on the storage path; and the second web page element and the target URL address are stored in the storage node in correspondence with each other.
[0106] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0107] According to the order of storage time and reading time, the data exceeding the length of the linked list is deleted from the web page element cache database.
[0108] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0109] The network monitoring handle object obtains the encapsulated object submitted by the operating system, which includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; the network monitoring handle object obtains the target URL address corresponding to the network request based on the encapsulated object; the network monitoring handle object queries the web page element cache database based on the target URL address, and when the first web page element corresponding to the target URL address is queried, the first web page element is returned to the initiating object of the network request, so that the initiating object can display the web page based on the first web page element.
[0110] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0111] The network monitoring handle object is registered when the browser object is created; the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to realize the function of obtaining the encapsulation object submitted by the operating system, and obtaining the target URL address based on the encapsulation object; the network request cache object is used to realize the function of managing the data in the web page element cache database based on the target URL address.
[0112] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0113] The network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulation object; the network monitoring handle object standardizes the target field in the original URL address to obtain the target URL address, wherein the target field includes at least one of an encryption field and a timestamp field.
[0114] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0115] When the first web page element corresponding to the target URL address is not found, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns the second web page element, the second web page element and the target URL address are stored in the web page element cache database.
[0116] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0117] Obtain the domain name corresponding to the initiated network request; determine the storage path based on the domain name, and create a storage node in the web page element cache database based on the storage path; store the second web page element corresponding to the target URL address in the storage node.
[0118] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0119] Delete the data exceeding the linked list length from the web page element cache database in the order of the deposit time and the read time.
[0120] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0121] The network monitoring handle object obtains the encapsulated object submitted by the operating system, and the encapsulated object includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; the network monitoring handle object obtains the target URL address corresponding to the network request according to the encapsulated object; the network monitoring handle object queries the web page element cache database based on the target URL address, and when the first web page element corresponding to the target URL address is found, returns the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
[0122] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0123] Register the network monitoring handle object when creating a browser object; the network monitoring handle object includes a network session control object and a network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing the data in the web page element cache database based on the target URL address.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0125] The network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulated object; the network monitoring handle object normalizes the target field in the original URL address to obtain the target URL address, where the target field includes at least one of an encrypted field and a timestamp field.
[0126] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0127] When the first web page element corresponding to the target URL address is not found, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns the second web page element, the second web page element and the target URL address are stored in the web page element cache database.
[0128] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0129] The domain name corresponding to the initiated network request is obtained; a storage path is determined based on the domain name, and a storage node is created in the web page element cache database based on the storage path; and the second web page element and the target URL address are stored in the storage node in correspondence with each other.
[0130] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0131] According to the order of storage time and reading time, the data exceeding the length of the linked list is deleted from the web page element cache database.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0133] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0134] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0135] The above-described embodiments merely represent several implementation manners of this application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application should be subject to the appended claims.
Claims
1. A web page display method, characterized in that, The method includes: The network monitoring handle object obtains the encapsulated object submitted by the operating system. The encapsulated object includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; The network monitoring handle object obtains the original URL address corresponding to the network request according to the encapsulated object, and standardizes the target field in the original URL address to obtain the target URL address, where the target field includes at least one of the encrypted field and the timestamp field; The network monitoring handle object includes the object registered when creating the browser object, the network session control object, and the network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing the data in the web page element cache database based on the target URL address; The network monitoring handle object queries the web page element cache database based on the target URL address, and when the first web page element corresponding to the target URL address is found, returns the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
2. The method according to claim 1, characterized in that, The method further includes: When the first web page element corresponding to the target URL address is not found, the network monitoring handle object initiates a network request to the server based on the original URL address, and when the server returns the second web page element, stores the second web page element and the target URL address in the web page element cache database in a corresponding manner.
3. The method according to claim 2, wherein The storing the second web page element and the target URL address in the web page element cache database in a corresponding manner includes: Obtaining the domain name corresponding to the initiated network request; Determining the storage path based on the domain name, and creating a storage node in the web page element cache database based on the storage path; Storing the second web page element and the target URL address in the storage node in a corresponding manner.
4. The method according to claim 1, wherein The web page element cache database is a linked list, and the method further includes: Deleting the data exceeding the length of the linked list from the web page element cache database in the order of the storage time and the reading time.
5. The method according to claim 1, wherein Before the network monitoring handle object obtains the encapsulated object submitted by the operating system, the method further includes: Registering the network monitoring handle object when creating the browser object.
6. A web display device, characterized in that, The device includes: The first obtaining module is used for the network monitoring handle object to obtain the encapsulated object submitted by the operating system. The encapsulated object includes the network request intercepted and encapsulated by the operating system, and the operating system is the IOS operating system; The second obtaining module is used for the network monitoring handle object to obtain the original URL address corresponding to the network request according to the encapsulated object, and standardize the target field in the original URL address to obtain the target URL address, where the target field includes at least one of the encrypted field and the timestamp field; The network monitoring handle object includes an object registered when creating a browser object, a network session control object, and a network request cache object; the network session control object is used to implement the function of obtaining the encapsulated object submitted by the operating system and obtaining the target URL address based on the encapsulated object; the network request cache object is used to implement the function of managing the data in the web page element cache database based on the target URL address; A query module, configured to query the web page element cache database by the network monitoring handle object based on the target URL address, and when a first web page element corresponding to the target URL address is queried, return the first web page element to the initiating object of the network request for the initiating object to display the web page based on the first web page element.
7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Webpage intercepting method and device based on iOS device
CN103366019A
Client offline H5 page loading method and device, computer equipment and medium
CN113315829A