Webpage resource acquisition method and device, and computer readable storage medium
Patent Information
- Application Number
- CN202210867794.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-07-21
AI Technical Summary
In existing technologies, when obtaining web page resources by sending resource requests to the server, there are problems such as slow network transmission, wasted bandwidth, and non-persistent caching, which affect the rate at which web page resources can be obtained.
By matching resource identifier information in local storage space to obtain download status information, and obtaining second resource data from remote server according to the status, combined with breakpoint resume and path matching, persistent storage and fast retrieval of web page resources can be achieved.
It enables persistent storage of web page resources, saving network bandwidth and traffic consumption, and improving the retrieval speed and loading smoothness of web page resources.
Smart Images

Figure CN115203613B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to, but is not limited to, the technical field of computer technology, and in particular to a webpage resource acquisition method and device and computer readable storage medium. BACKGROUND
[0002] With the rapid development of Internet technology, the webpage resources of the Internet are becoming more and more abundant, and users can access various types of webpage resources through terminals. There are mainly two ways to acquire webpage resources of the terminal: first, the terminal sends a hypertext transfer protocol webpage resource request to a remote server, and the remote server returns the acquired webpage resource to the terminal after acquiring the webpage resource requested by the terminal; second, the local webpage Document Object Model (DOM) structure of the terminal has cached webpage resources, and the webpage resources corresponding to the webpage resource request are matched from the local webpage DOM structure. The way of acquiring remote webpage resources by sending a resource request to the server is limited by network transmission, and the process of presenting webpage resources by the terminal may be slow or not smooth, which not only occupies network bandwidth but also wastes traffic. The way of acquiring cached webpage resources from the local webpage DOM structure cannot achieve the persistence of the cache, and the webpage resource needs to be requested from the remote server again after operations such as exiting or refreshing the page, thereby affecting the acquisition rate of the webpage resource. SUMMARY
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiment of the present application provides a webpage resource acquisition method, device and computer readable storage medium, which can effectively improve the acquisition rate of webpage resources.
[0005] In a first aspect, the embodiment of the present application provides a webpage resource acquisition method, comprising:
[0006] When a webpage resource request is acquired, resource identification information is acquired from the webpage resource request;
[0007] The resource identification information is matched with resource data stored in a local storage space to obtain a first matching result;
[0008] When the first matching result meets a first preset condition, first resource data corresponding to the resource identification information is acquired from the local storage space, and download state information of the first resource data is determined;
[0009] Second resource data is acquired from a remote server according to the download state information and the resource identification information;
[0010] According to the second resource data saving to the local storage space;
[0011] According to the first resource data and the second resource data, target resource data is obtained.
[0012] In some embodiments, the resource identification information includes a first resource loading path; and the second resource data is obtained from the remote server according to the download state information and the resource identification information, including:
[0013] When the download state information meets a second preset condition, it is determined whether the remote server supports breakpoint resuming for the first resource data, wherein the first preset condition represents that the first resource data is in a download interruption state;
[0014] When the remote server supports breakpoint resuming for the first resource data, breakpoint resuming request information is obtained, and the second resource data is obtained from the remote server according to the breakpoint resuming request information and the first resource loading path;
[0015] When the remote server does not support breakpoint resuming for the first resource data, a temporary file related to the first resource data in the local storage space is deleted, and the second resource data is obtained from the remote server according to the first resource loading path.
[0016] In some embodiments, the target resource data is obtained according to the first resource data and the second resource data, including:
[0017] When the remote server supports breakpoint resuming for the first resource data, the first resource data and the second resource data are subjected to data merging processing to obtain the target resource data;
[0018] When the remote server does not support breakpoint resuming for the first resource data, the first resource data is deleted, and the second resource data is determined as the target resource data.
[0019] In some embodiments, the second resource data includes a second resource loading path, and after the target resource data is obtained according to the first resource data and the second resource data, the method further includes:
[0020] The second resource loading path and the first resource loading path are subjected to matching processing to obtain a second matching result;
[0021] When the second matching result represents that the second resource loading path and the first resource loading path are different from each other, the second resource loading path is determined as a target resource loading path of the target resource data.
[0022] In some embodiments, after the target resource data is obtained according to the first resource data and the second resource data, the method further comprises:
[0023] obtaining a reference time length, the reference time length being a time length during which the local storage space stores the target resource data;
[0024] when the reference time length exceeds a preset time period, newly obtaining second resource data from the remote server according to the target resource loading path;
[0025] determining the newly obtained second resource data as new target resource data.
[0026] In some embodiments, after the resource identification information is matched with the resource data stored in the local storage space to obtain a first matching result, the method further comprises:
[0027] when the first matching result does not satisfy the preset condition, obtaining the first resource data corresponding to the resource identification information from the local storage space;
[0028] determining the first resource data as the target resource data.
[0029] In some embodiments, after the target resource data is obtained according to the first resource data and the second resource data, the method further comprises:
[0030] generating a network view for displaying the target resource data;
[0031] displaying the target resource data on an interface of a preset application program by using the network view.
[0032] In a second aspect, an embodiment of the present application provides a web page resource obtaining device, which comprises:
[0033] a resource identification information obtaining module, configured to obtain resource identification information from a web page resource request when the web page resource request is obtained;
[0034] a data matching module, configured to match the resource identification information with resource data stored in a local storage space to obtain a first matching result;
[0035] a download state information obtaining module, configured to obtain first resource data corresponding to the resource identification information from the local storage space and determine download state information of the first resource data when the first matching result satisfies a preset condition;
[0036] a second resource data obtaining module, configured to obtain second resource data from a remote server according to the download state information and the resource identification information;
[0037] a data storage module, configured to save the second resource data to the local storage space;
[0038] a target resource data obtaining module, configured to obtain target resource data according to the first resource data and the second resource data.
[0039] In a third aspect, an embodiment of the present application further provides a web resource obtaining device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the web resource obtaining method according to the first aspect when executing the computer program.
[0040] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is used to execute the web resource obtaining method according to the first aspect.
[0041] The embodiment of the present application comprises: obtaining resource identification information from a web resource request when the web resource request is obtained; performing matching processing on the resource identification information and resource data stored in a local storage space to obtain a first matching result; obtaining first resource data corresponding to the resource identification information from the local storage space when the first matching result satisfies a first preset condition, and determining download state information of the first resource data; obtaining second resource data from a remote server according to the download state information and the resource identification information; saving the second resource data to the local storage space; and obtaining target resource data according to the first resource data and the second resource data. According to the scheme provided by the embodiment of the present application, the web resource obtained from the remote server is saved to the local storage space, so that the persistent storage of the web resource can be realized, and in the case that a resource request corresponding to the web resource stored in the local storage space is received, the network bandwidth and the traffic occupation can be greatly saved, so that the web resource obtaining rate is improved.
[0042] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art upon examination of the following or can be learned by practice of the present application. The objects and other advantages of the present application can be achieved and attained by the structures particularly pointed out in the description, the claims and the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings are used to provide further understanding of the technical solutions of the present application, and constitute a part of the specification, and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical solutions of the present application.
[0044] Figure 1 is a step flow chart of a web resource acquisition method provided by an embodiment of the present application;
[0045] Figure 2 is a step flow chart of acquiring second resource data provided by another embodiment of the present application;
[0046] Figure 3 is a step flow chart of obtaining target resource data provided by another embodiment of the present application;
[0047] Figure 4 is a step flow chart of determining a target resource loading path provided by another embodiment of the present application;
[0048] Figure 5 is a step flow chart of obtaining target resource data provided by another embodiment of the present application;
[0049] Figure 6 is a step flow chart of obtaining target resource data provided by another embodiment of the present application;
[0050] Figure 7 is a step flow chart of displaying target resource data provided by another embodiment of the present application;
[0051] Figure 8 is a module schematic diagram of a web resource acquisition device provided by another embodiment of the present application;
[0052] Figure 9 is a step flow chart of a web resource acquisition method provided by another embodiment of the present application;
[0053] Figure 10 is a structural diagram of a web resource acquisition device provided by another embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is 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 do not limit the present application.
[0055] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the description, claims or above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0056] The application discloses a webpage resource acquisition method and device, and a computer readable storage medium. The webpage resource acquisition method comprises the following steps: obtaining resource identification information from a webpage resource request when the webpage resource request is acquired; performing matching processing on the resource identification information and resource data stored in a local storage space to obtain a first matching result; acquiring first resource data corresponding to the resource identification information from the local storage space and determining download state information of the first resource data when the first matching result meets a first preset condition; acquiring second resource data from a remote server according to the download state information and the resource identification information; saving the second resource data to the local storage space; and obtaining target resource data according to the first resource data and the second resource data. According to the scheme provided in the embodiment of the application, webpage resources acquired from the remote server are saved to the local storage space, so that persistent storage of the webpage resources can be realized, and in the case that a resource request corresponding to the webpage resources stored in the local storage space is received, network bandwidth and traffic occupation can be greatly saved, so that the webpage resource acquisition rate is improved.
[0057] The embodiments of the application will be further described below with reference to the drawings.
[0058] As Figure 1 shown, Figure 1 is a step flowchart of an adjusting method of a neural network model provided by an embodiment of the application. The business index reporting method comprises but is not limited to the following steps:
[0059] Step S110: obtaining resource identification information from a webpage resource request when the webpage resource request is acquired;
[0060] Step S120: performing matching processing on the resource identification information and resource data stored in a local storage space to obtain a first matching result;
[0061] Step S130: acquiring first resource data corresponding to the resource identification information from the local storage space and determining download state information of the first resource data when the first matching result meets a first preset condition;
[0062] Step S140: acquiring second resource data from a remote server according to the download state information and the resource identification information.
[0063] It should be noted that the embodiments of the present application do not limit the storage layout of the local storage space, which can be divided into different storage areas according to different types of web resources, for example, the local storage space is divided into three storage areas, the first storage area is used to load and store video resources, the second storage area is used to load and store picture resources, and the third storage area is used to load and store audio resources, which can well manage and plan web resources.
[0064] It can be understood that a web page is composed of individual tags, when receiving a network resource request, it can be that a user uses an Android application program and clicks a link entry of an interface, the link entry corresponds to an attribute tag (i.e. resource identification information), thereby triggering the application program to load resources, in the process of loading resources, the application program kernel will gradually read each resource identification information and the attributes in the resource identification information to load resources. The following will take a specific example to explain the specific process of loading resources by the application program: after obtaining the resource identification information corresponding to the web resource request, the application program kernel first determines the specific type of the resource identification information, for example, the type corresponding to the resource identification information is a video tag, the code form of the video tag is <video public attribute custom attribute>, the public attribute indicates the target resource identification pointed to by the video tag, and the custom attribute is associated with the storage area of the local storage space and is used to identify the storage area of the local storage space storing video resources; the application program kernel determines that the target storage area of the local storage space corresponding to the custom attribute is the first storage area, matches the target resource identification with all resource data in the first storage area to obtain a first matching result, when the first matching result satisfies a first preset condition, i.e. the first resource data corresponding to the target resource identification in the first storage area is incomplete, determines the download state information of the first resource data, according to the download state information and the resource identification information carrying the target resource identification, sends a resource request to a remote server, and obtains second resource data fed back by the remote server and stores it in the first storage area of the local storage space, according to the first resource data and the second resource data, obtains complete target resource data, the storage area of the local storage space can be understood as an application data folder of the Android application program, which is more stable than the Web web page cache file method, reduces the space occupation caused by unnecessary resource caching, and by saving the complete resource data to the application data folder, the persistent storage of web resources can be realized, when the resource request corresponding to the web resource stored in the local storage space is received again, a large amount of network bandwidth and traffic occupation can be saved, thereby improving the acquisition rate of web resources; and the present application realizes automatic switching of remote and local resources for loading web resources, and the overall page presentation is more smooth.
[0065] It should be noted that the embodiments of the present application do not limit the specific manner of judging whether the first matching result meets the first preset condition, i.e., judging whether the first resource data is complete. The specific manner can be that a file form of the first resource data stored in the target storage area of the local storage space is detected. When a file corresponding to the first resource data is named with a suffix.tmp, i.e., a temporary file, it is determined that the first resource data is not downloaded completely, and the complete resource data needs to be downloaded from the remote server and saved to the local storage space. Alternatively, the application program can determine the source of the resource data used by the webpage loading by obtaining a return parameter of the shouldInterceptRequest function. For example, the shouldInterceptRequest function returns a WebResourceResponse object, and it is determined that the resource data used by the webpage loading is a local resource rather than a remote resource.
[0066] In addition, with reference to Figure 2 In an embodiment, the resource identification information includes a first resource loading path, Figure 1 The step S140 in the illustrated embodiment includes but is not limited to the following steps:
[0067] The step S210 includes but is not limited to the following steps:
[0068] The step S220 includes but is not limited to the following steps:
[0069] The step S230 includes but is not limited to the following steps:
[0070] It can be understood that when the first resource data corresponding to the web resource request stored in the local storage space is incomplete, it is necessary to determine the download state information of the first resource data, when the download state information meets the second preset condition, that is, the first resource data is in a download interruption state, the download interruption can be caused by web closing, network anomaly and the like, and the file breakpoint continuation refers to: the resource data is divided into a plurality of module nodes, the client records the module nodes that have been downloaded when downloading, so that after the resource data is interrupted, the next time the client connects the remote server, the resource data can be continued to be downloaded from the recorded module nodes, instead of starting to download the complete resource data from the beginning; by judging whether the remote server supports the breakpoint continuation of the first resource data, the specific way of requesting the remote server to download the resource data corresponding to the first resource data can be determined, when the remote server supports the breakpoint continuation of the first resource data, the breakpoint continuation request information (that is, the module nodes that have been downloaded of the first resource data) is acquired, the second resource data is acquired from the remote server according to the breakpoint continuation request information and the first resource loading path, that is, the android application continues to request the resource data download from the recorded module nodes, at this time, the second resource data is the remaining resource data after the first resource data has been downloaded; when the remote server does not support the breakpoint continuation of the first resource data, the temporary files related to the first resource data in the local storage space are deleted, and the second resource data is acquired from the remote server according to the first resource loading path, at this time, the second resource data is complete resource data; when the download state information does not meet the second preset condition, that is, the first resource data is in a downloading state, the downloading state is maintained until the complete resource data is downloaded from the remote server.
[0071] It can be understood that the temporary file refers to a file with a.tmp suffix, which is a file generated by various software or systems running, when the remote server does not support the breakpoint continuation, these temporary files are useless garbage files for the application, and deleting these temporary files can obtain more use space for the local storage space.
[0072] It should be noted that the application embodiments do not limit the specific method of determining whether the download state information meets the second preset condition, it can be understood that the application end will put the download task into the download queue when downloading the resource data, and delete the downloaded download task in the download queue when the download task is completed, so that whether the download task exists in the download queue can be determined, so as to determine the download state information of the first resource data, that is, to determine whether the first resource data is in a downloading state or a download interruption state.
[0073] In addition, with reference to Figure 3 In an embodiment, Figure 1The step S160 in the illustrated embodiment includes but is not limited to the following steps:
[0074] The step S310 comprises, when the remote server supports the breakpoint resuming for the first resource data, performing data merging processing on the first resource data and the second resource data to obtain the target resource data.
[0075] The step S320 comprises, when the remote server does not support the breakpoint resuming for the first resource data, deleting the first resource data and determining the second resource data as the target resource data.
[0076] It can be understood that, when the remote server supports the breakpoint resuming for the first resource data, the Android application acquires the breakpoint resuming request information (i.e. the module node of the first resource data that has been downloaded), acquires the second resource data from the remote server according to the breakpoint resuming request information and the first resource loading path, i.e. continues to request the resource data download from the recorded module node, at this time, the second resource data is the remaining resource data after the module node of the first resource data that has been downloaded, performs data merging processing on the first resource data and the second resource data to obtain the complete target resource data; when the remote server does not support the breakpoint resuming for the first resource data, deletes the first resource data and determines the second resource data as the target resource data.
[0077] In addition, with reference to Figure 4 In an embodiment, the second resource data comprises a second resource loading path, and the step S410 comprises matching the second resource loading path with the first resource loading path to obtain a second matching result. Figure 1 The webpage resource obtaining method further comprises but is not limited to the following steps after the step S160 in the illustrated embodiment:
[0078] The step S410 comprises matching the second resource loading path with the first resource loading path to obtain a second matching result.
[0079] The step S420 comprises, when the second matching result represents that the second resource loading path and the first resource loading path are different from each other, determining the second resource loading path as the target resource loading path of the target resource data.
[0080] It can be understood that the resource loading path, that is, the uniform resource locator (URL), that is, the web page address corresponding to the target resource data, is the key information for finding the resource data. Since network information is frequently updated, the first resource loading path recorded in the original local storage space of the application program may have been changed, and therefore it is necessary to reconfirm the accurate resource loading path. In the embodiment of the present application, the second resource loading path and the first resource loading path are matched to obtain a second matching result. When the second matching result indicates that the second resource loading path and the first resource loading path are different from each other, that is, the resource loading path of the target resource has been changed, the changed latest second resource loading path is determined as the target resource loading path of the target resource data, thereby providing an effective data basis for subsequent acquisition of the resource data corresponding to the resource loading path.
[0081] In addition, with reference to Figure 5 In an embodiment, after step S 120 in the embodiment shown in FIG. 1 is performed, the webpage resource acquisition method further includes but is not limited to the following steps: Figure 1
[0082] Step S510, acquiring a reference duration, the reference duration being a duration for which the target resource data is stored in the local storage space;
[0083] Step S520, when the reference duration exceeds a preset time period, reacquiring new second resource data from the remote server according to the target resource loading path;
[0084] Step S530, determining the new second resource data as new target resource data.
[0085] It can be understood that after the target resource data is acquired in the local storage space, a duration for which the target resource data is stored in the local storage space is calculated to obtain a reference duration. The reference duration is compared with the preset time period. When the reference duration exceeds the preset time period, a second webpage resource request is re-sent to the remote server according to the target resource loading path, and new second resource data corresponding to the second webpage resource request and fed back by the remote server is acquired. The new second resource data is determined as new target resource data.
[0086] It should be noted that the embodiment of the present application does not limit the specific value of the second threshold value, which can be determined by a person skilled in the art according to actual conditions.
[0087] In addition, with reference to Figure 6 In an embodiment, after step S 120 in the embodiment shown in FIG. 1 is performed, the webpage resource acquisition method further includes but is not limited to the following steps: Figure 1
[0088] Step S610, when the first matching result does not satisfy the preset condition, obtaining the first resource data corresponding to the resource representation information from the local storage space;
[0089] Step S620, determining the first resource data as the target resource data.
[0090] It can be understood that after the resource identification information is matched with the resource data stored in the local storage space to obtain the first matching result, when the first matching result does not satisfy the preset condition, that is, the complete resource data corresponding to the resource representation information exists in the local storage space, the first resource data stored in the local storage space is determined as the target resource data.
[0091] In addition, referring to Figure 7 In an embodiment, after step S160 in the embodiment shown in the figure is performed, the webpage resource obtaining method further includes but is not limited to the following steps: Figure 1
[0092] Step S710, generating a network view for displaying the target resource data;
[0093] Step S720, displaying the target resource data on the interface of the preset application program by using the network view.
[0094] It can be understood that after it is determined that the local storage space stores the complete target resource data, the network view for displaying the target resource data is generated, and the target resource data is displayed on the interface of the preset application program by using the network view. Since the target resource data is stored in the local storage space, the webpage content can be displayed or displayed more quickly in the case of weak network or no network.
[0095] In addition, referring to Figure 8 , Figure 8 is a module schematic diagram of a webpage resource obtaining device provided by another embodiment of the present application; one embodiment of the present application further provides a webpage resource obtaining device 800, which includes:
[0096] The resource identification information obtaining module 810 is used for obtaining the resource identification information from the webpage resource request when the webpage resource request is obtained.
[0097] The data matching module 820 is used for matching the resource identification information with the resource data stored in the local storage space to obtain a first matching result.
[0098] The download state information obtaining module 830 is configured to obtain first resource data corresponding to the resource representation information from the local storage space when the first matching result meets the preset condition, and determine download state information of the first resource data.
[0099] The second resource data obtaining module 840 is configured to obtain second resource data from a remote server according to the download state information and the resource identifier information.
[0100] The data storage module 850 is configured to save the second resource data to the local storage space.
[0101] The target resource data obtaining module 860 is configured to obtain target resource data according to the first resource data and the second resource data.
[0102] In addition, in order to provide a more detailed description of the web resource obtaining method provided in the present application, the technical solutions of the present application are described below with a specific example.
[0103] Example one, referring to Figure 9 , Figure 9 is a step flow chart of a web resource obtaining method provided by another embodiment of the present application. The web resource obtaining method includes but is not limited to the following steps:
[0104] Step S910, after the application program end receives the web resource request, the first resource data corresponding to the web resource request is matched from the local storage space corresponding to the application program, and it is determined whether the first resource data is complete resource data;
[0105] Step S920, when the first resource data is complete resource data, the first resource data is determined as target resource data, and the target resource data is displayed on the interface of the preset application program;
[0106] Step S930, when the first resource data is not complete resource data, the download state information of the first resource data is determined, which is used to determine the download state of the first resource data.
[0107] Step S940, when the download state information indicates that the first resource data is in the downloading state, the download state of the first resource data is maintained until the target resource data is obtained after the downloading is completed.
[0108] Step S950, when the download state information indicates that the first resource data is in the interrupted downloading state, it is determined whether the remote server supports the breakpoint resume of the first resource data.
[0109] When the remote server supports breakpoint continuation for the first resource data, the application acquires breakpoint continuation request information, acquires second resource data from the remote server according to the breakpoint continuation request information and the first resource loading path, performs data merging processing on the first resource data and the second resource data, obtains target resource data, and displays the target resource data.
[0110] When the remote server does not support breakpoint continuation for the first resource data, the temporary file related to the first resource data in the local storage space is deleted, second resource data is acquired from the remote server according to the first resource loading path, the second resource data is determined as target resource data, and the target resource data is displayed.
[0111] In addition, with reference to Figure 10 , Figure 10 is a structural diagram of a web resource acquisition device provided by another embodiment of the present application. One embodiment of the present application further provides a web resource acquisition device 1000, which comprises a memory 1010, a processor 1020, and a computer program stored in the memory 1010 and capable of running on the processor 1020.
[0112] The processor 1020 and the memory 1010 can be connected through a bus or other means.
[0113] The non-transient software program and instructions required for implementing the web resource acquisition method of the above-described embodiments are stored in the memory 1010, and when executed by the processor 1020, the web resource acquisition method in the above-described embodiments is executed, for example, the method steps S110 to S160 in the above-described Figure 1 , the method steps S210 to S230 in the above-described Figure 2 , the method steps S310 to S320 in the above-described Figure 3 , the method steps S410 to S420 in the above-described Figure 4 , the method steps S510 to S530 in the above-described Figure 5 , the method steps S610 to S620 in the above-described Figure 6 , and the method steps S710 to S720 in the above-described Figure 7 .
[0114] The device embodiments described above are merely schematic, wherein the units described as separate components can or can not be physically separated, that is, can be located in one place, or can be distributed on multiple network units. According to actual needs, part or all of the modules can be selected to achieve the purpose of the present embodiment scheme.
[0115] Furthermore, one embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions that are executed by a processor or controller, for example, by a processor 1020 in the above-described web page resource acquisition device 1000 embodiment. These instructions enable the processor to execute the neural network model adjustment method described above, for example, to perform the above-described... Figure 1 Method steps S110 to S160, Figure 2 Method steps S210 to S230, Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S420 Figure 5 Method steps S510 to S530 Figure 6 Method steps S610 to S620 Figure 7 The method steps S710 to S720 are described above. Those skilled in the art will understand that all or some of the steps and systems disclosed in the above-disclosed methods can be implemented as software, firmware, hardware, or suitable combinations thereof. Some or all physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0116] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
[0117] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of apparatuses, methods, and computer program products according to various embodiments disclosed in this application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0118] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described can also be located in a single processor. In some cases, the names of the units do not limit the units themselves.
[0119] It should be noted that although several modules or units for performing actions are mentioned in the foregoing detailed description, such a division is not mandatory. Indeed, according to an embodiment of the application, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into several modules or units.
[0120] From the above description of the embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software, or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
[0121] The terminal of the embodiment can include a radio frequency (RF) circuit, a memory, an input unit, a display unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a processor, and a power supply, etc. The RF circuit can be used for receiving and sending signals in the process of information or call, especially, receiving the downlink information of the base station and processing by the processor, and sending the uplink data to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit can also communicate with the network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to global system for mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc. The memory can be used to store software programs and modules, and the processor can execute various function applications and data processing of the terminal by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the terminal (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. The input unit can be used to receive input digital or character information, and generate key signal input related to the setting and function control of the terminal. Specifically, the input unit can include a touch panel and other input devices. The touch panel, also known as a touch screen, can collect touch operations (such as using a finger, a stylus, etc. Any suitable object or accessory on or near the touch panel, or operations near the touch panel) on it or near it, and drive the corresponding connection device according to the pre-set program. Optionally, the touch panel can include a touch detection device and a touch controller two parts.The touch detection device detects a touch position and detects a signal caused by a touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts the touch information into touch coordinates, and sends the touch coordinates to the processor. The touch controller can also receive commands from the processor and execute the commands. In addition, the touch panel can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. In addition to the touch panel, the input unit can include other input devices. Specifically, the other input devices can include one or more of a physical keyboard, function keys (such as volume control keys, on / off keys, etc.), a trackball, a mouse, a joystick, etc. The display unit can be used to display input information or provided information and various menus of the terminal. The display unit can include a display panel, which can be configured in the form of a liquid crystal display (LCD), an organic light emitting diode (OLED), etc. Further, the touch panel can cover the display panel, and when the touch panel detects a touch operation thereon or in the vicinity thereof, the touch panel transmits the touch event to the processor to determine a type of the touch event, and then the processor provides a corresponding visual output on the display panel according to the type of the touch event. The touch panel and the display panel are implemented as two independent components to perform input and output functions of the terminal, but in some embodiments, the touch panel and the display panel can be integrated to perform the input and output functions of the terminal. The terminal can also include at least one sensor such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel according to the brightness of ambient light, and the proximity sensor can turn off the display panel and / or the backlight when the terminal is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and when stationary, can detect the magnitude and direction of gravity, and can be used for applications such as recognizing the posture of the terminal (such as switching between landscape and portrait screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, taps), etc. As for other sensors that can be configured in the terminal, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described here. The audio circuit, the speaker, and the microphone can provide an audio interface. The audio circuit can convert the received audio data into an electrical signal, transmit the electrical signal to the speaker, and convert the electrical signal into a sound signal output by the speaker. On the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit and converted into audio data. The audio data is output to the processor for processing, and then transmitted to another terminal via the RF circuit, or output to the memory for further processing.
[0122] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the application embrace any and all variations of the present application that fall within the scope of the general inventive concept as defined by the appended claims and their equivalents. It is intended that the application encompass all such variations as fall within the scope of the appended claims and their equivalents.
[0123] It is to be understood that the application is not limited to the precise construction herein described and as shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should only be limited by the claims appended hereto.
Claims
1. A method for obtaining a web resource, characterized by, The method comprises the following steps: When a web resource request is acquired, resource identification information is acquired from the web resource request; The resource identification information is matched with resource data stored in a local storage space to obtain a first matching result; When the first matching result meets a first preset condition, first resource data corresponding to the resource identification information is acquired from the local storage space, and download state information of the first resource data is determined; Second resource data is acquired from a remote server according to the download state information and the resource identification information; The second resource data is saved to the local storage space; Target resource data is obtained according to the first resource data and the second resource data; The resource identification information comprises a first resource loading path; the second resource data is acquired from the remote server according to the download state information and the resource identification information, which comprises the following steps: When the download state information meets a second preset condition, it is judged whether the remote server supports breakpoint resuming of the first resource data, wherein the second preset condition represents that the first resource data is in a download interruption state; When the remote server supports breakpoint resuming of the first resource data, breakpoint resuming request information is acquired, and the second resource data is acquired from the remote server according to the breakpoint resuming request information and the first resource loading path; When the remote server does not support breakpoint resuming of the first resource data, temporary files related to the first resource data in the local storage space are deleted, and the second resource data is acquired from the remote server according to the first resource loading path.
2. The method of claim 1, wherein, The target resource data is obtained according to the first resource data and the second resource data, which comprises the following steps: When the remote server supports breakpoint resuming of the first resource data, the first resource data and the second resource data are subjected to data merging processing to obtain the target resource data; When the remote server does not support breakpoint resuming of the first resource data, the first resource data is deleted, and the second resource data is determined as target resource data.
3. The method of claim 2, wherein, The second resource data comprises a second resource loading path, and after the target resource data is obtained according to the first resource data and the second resource data, the method further comprises the following steps: The second resource loading path and the first resource loading path are subjected to matching processing to obtain a second matching result; When the second matching result represents that the second resource loading path and the first resource loading path are different from each other, the second resource loading path is determined as a target resource loading path of the target resource data.
4. The method of claim 3, wherein, After the target resource data is obtained according to the first resource data and the second resource data, the method further comprises the following steps: A reference time length is acquired, the reference time length being a time length during which the local storage space stores the target resource data; When the reference time length exceeds a preset time period, new second resource data is acquired from the remote server according to the target resource loading path; The new second resource data is determined as new target resource data.
5. The method of claim 1, wherein, The method further comprises, after the matching of the resource identification information with the resource data stored in the local storage space and obtaining a first matching result: When the first matching result does not satisfy the first preset condition, obtaining the first resource data corresponding to the resource identification information from the local storage space; Determining the first resource data as the target resource data.
6. The method of claim 1, wherein, The method further comprises, after obtaining the target resource data according to the first resource data and the second resource data: Generating a network view for displaying the target resource data; Displaying the target resource data on the interface of a preset application program by using the network view.
7. A web resource acquisition apparatus characterized by comprising: The method comprises: A resource identification information obtaining module, configured to obtain resource identification information from a web resource request when the web resource request is obtained; A data matching module, configured to match the resource identification information with resource data stored in a local storage space to obtain a first matching result; A download state information obtaining module, configured to obtain first resource data corresponding to the resource identification information from the local storage space when the first matching result satisfies a preset condition, and determine download state information of the first resource data; A second resource data obtaining module, configured to obtain second resource data from a remote server according to the download state information and the resource identification information; A data storage module, configured to save the second resource data to the local storage space; A target resource data obtaining module, configured to obtain target resource data according to the first resource data and the second resource data; The resource identification information comprises a first resource loading path; the second resource data obtaining module comprises: When the download state information satisfies a second preset condition, determining whether the remote server supports breakpoint resuming of the first resource data, wherein the second preset condition represents that the first resource data is in a download interruption state; When the remote server supports breakpoint resuming of the first resource data, obtaining breakpoint resuming request information, and obtaining the second resource data from the remote server according to the breakpoint resuming request information and the first resource loading path; When the remote server does not support breakpoint resuming of the first resource data, deleting temporary files related to the first resource data in the local storage space, and sending, from the remote server, an acquisition request for the second resource data according to the first resource loading path.
8. A web resource retrieval apparatus comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the web resource obtaining method according to any one of claims 1 to 6 when executing the computer program.
9. A computer readable storage medium storing computer executable instructions for performing the web resource obtaining method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for reading webpage resources, and electronic equipment
CN105701153A
Webpage resource loading method and device, electronic equipment and storage medium
CN108228818A