A method, apparatus, and device for pre-downloading resources

By receiving resource pre-push information pushed by the cloud, analyzing and decompressing resource packages, and independently storing sub-resources, the shortcomings of resource pre-download solutions in the existing technology in terms of terminal pressure and universality are solved, and more efficient resource downloads and better user experience are achieved.

CN114553858BActive Publication Date: 2025-06-10ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210136382.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-15
Publication Date
2025-06-10
Estimated Expiration
2042-02-15

AI Technical Summary

Technical Problem

The existing resource pre-download solution has shortcomings in reducing terminal pressure and improving universality, especially when dealing with a large number of resources, such as large terminal task overhead, low download completion rate, and large network task overhead.

Method used

By receiving resource pre-push information pushed by the cloud, send a download request to the cloud to obtain the resource package, parse the resource package, decompress the sub-resource, and store it independently in the terminal local according to the correspondence between the sub-resource and the original download address.

Benefits of technology

It reduces terminal resource tasks, reduces terminal queuing time and network task overhead, and improves download completion rate and sub-resource reusability and universality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114553858B_ABST
    Figure CN114553858B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method, device, and equipment for resource pre-downloading. The solution includes: receiving resource pre-pushing information pushed by the cloud; according to the resource pre-pushing information, sending a download request to the cloud to obtain a resource package corresponding to the resource pre-pushing information; parsing the resource package containing multiple sub-resources to obtain description information; decompressing the corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information; storing the respective sub-resources independently in the local terminal according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources in the local terminal according to the correspondence between the sub-resources and the original download addresses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of Internet technologies, and in particular, to a method, an apparatus, and a device for resource pre-downloading. Background Art

[0002] With the development of computer and Internet technologies, more and more services can be performed online. For some services, there will be a sharp increase in the number of user accesses during a specific period. The download of some high-frequency resources (such as pictures, audio and video, etc.) will put great pressure on the cloud peak, and correspondingly also bring an increase in the cloud bandwidth cost. For the situation of a large number of user accesses, if the cloud limits the flow, it will cause the failure of some resource downloads, which will damage the user experience.

[0003] Therefore, in the idle state, some or all of the resources corresponding to the service are pre-downloaded to the client in advance. When the service goes online, the pre-downloaded resources can be directly retrieved from the client local, which reduces the pressure on the cloud and also improves the user's instant experience.

[0004] Currently, there are two traditional ways of resource pre-downloading: 1. The resource list of each resource that needs to be pre-downloaded in the service is sent from the cloud to the client, and after the client gets the pre-downloaded resource list, it downloads and stores them one by one. 2. The static resources are packaged into an offline resource package. After pre-downloading the offline resource package, the resources in the package are accessed by mounting the offline resource package.

[0005] Based on this, a resource pre-downloading solution that can reduce the pressure on the terminal while improving generality is needed. Summary of the Invention

[0006] One or more embodiments of this specification provide a method, an apparatus, a device, and a storage medium for resource pre-downloading to solve the following technical problem: A resource pre-downloading solution that can reduce the pressure on the terminal while improving generality is needed.

[0007] To solve the above technical problem, one or more embodiments of this specification are implemented as follows:

[0008] A method for resource pre-downloading provided by one or more embodiments of this specification includes:

[0009] Receiving resource pre-push information pushed by the cloud;

[0010] According to the resource pre-push information, sending a download request to the cloud to obtain a resource package corresponding to the resource pre-push information;

[0011] Parsing the resource package containing multiple sub-resources to obtain description information;

[0012] Extract the corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information;

[0013] Independently store each of the sub-resources locally on the terminal according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources locally on the terminal according to the corresponding relationship between the sub-resources and the original download addresses.

[0014] An apparatus for resource pre-downloading provided by one or more embodiments of this specification includes:

[0015] A receiving module, which receives resource pre-pushing information pushed by the cloud;

[0016] A downloading module, which sends a download request to the cloud according to the resource pre-pushing information to obtain a resource package corresponding to the resource pre-pushing information;

[0017] An analysis module, which analyzes the resource package containing multiple sub-resources to obtain description information;

[0018] An extraction module, which extracts the corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information;

[0019] A storage module, which independently stores each of the sub-resources locally on the terminal according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources locally on the terminal according to the corresponding relationship between the sub-resources and the original download addresses.

[0020] A device for resource pre-downloading provided by one or more embodiments of this specification includes:

[0021] At least one processor; and,

[0022] A memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can:

[0024] Receive resource pre-pushing information pushed by the cloud;

[0025] Send a download request to the cloud according to the resource pre-pushing information to obtain a resource package corresponding to the resource pre-pushing information;

[0026] Analyze the resource package containing multiple sub-resources to obtain description information;

[0027] Extract the corresponding sub - resources from the resource package according to the offset positions of the respective sub - resources included in the described information;

[0028] Store each of the sub - resources independently in the local terminal according to the original download addresses of the respective sub - resources included in the described information, so as to access the stored sub - resources in the local terminal according to the corresponding relationship between the sub - resources and the original download addresses.

[0029] A non - volatile computer storage medium provided by one or more embodiments of this specification stores computer - executable instructions, and the computer - executable instructions are set as:

[0030] Receive the resource pre - push information pushed by the cloud;

[0031] According to the resource pre - push information, send a download request to the cloud to obtain the resource package corresponding to the resource pre - push information;

[0032] Parse the resource package containing multiple sub - resources to obtain the description information;

[0033] Extract the corresponding sub - resources from the resource package according to the offset positions of the respective sub - resources included in the described information;

[0034] Store each of the sub - resources independently in the local terminal according to the original download addresses of the respective sub - resources included in the described information, so as to access the stored sub - resources in the local terminal according to the corresponding relationship between the sub - resources and the original download addresses.

[0035] The above - mentioned at least one technical solution adopted by one or more embodiments of this specification can achieve the following beneficial effects:

[0036] Compared with Method 1, the solution in this application does not need to download the resource volume one by one, reduces the terminal resource tasks, thereby reducing the terminal queuing time, increases the execution probability of resource download, and improves the download completion rate. And because the number of terminal download tasks is reduced, especially when there are a lot of pre - pushed resources, only one network request is needed, reducing the network task overhead between the terminal and the cloud. The resource package in the solution of this application can adopt the form of a compressed package (for example, compress each sub - resource in different ways such as gzip or zstd), effectively reducing the traffic consumed by pre - pushed resources and reducing the terminal pressure.

[0037] Compared with method 2, although the pre-downloaded sub-resources are pre-packaged into a resource package in a custom format, when the download is completed, the sub-resources are stored separately and independently according to the corresponding relationship between the sub-resources in the resource package and the original download address. The relationship between the sub-resources and the resource package is decoupled, and the sub-resources can be read without package mounting, achieving a package-free directory (no longer a hierarchical directory with strong correlations, but a directory that is independent of each other). While improving the download completion rate and reducing the network task overhead of the terminal and the cloud, it can remove the strong coupling relationship between the sub-resources and the resource package, and improve the reusability and versatility of the sub-resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0039] Figure 1 A flowchart of a method for pre-downloading resources provided in one or more embodiments of this specification;

[0040] Figure 2 An overall schematic diagram of resource pre-downloading in an application scenario provided by one or more embodiments of this specification;

[0041] Figure 3 Schematic diagrams of a terminal and a cloud for pre-downloading resources in an application scenario provided by one or more embodiments of this specification;

[0042] Figure 4 A schematic diagram of a custom format of a resource package in an application scenario provided by one or more embodiments of this specification;

[0043] Figure 5 A schematic diagram of the structure of each sub-resource in a resource package in a traditional solution provided in one or more embodiments of this specification;

[0044] Figure 6 A schematic diagram of the structure of each sub-resource in the resource package of this solution provided for one or more embodiments of this specification;

[0045] Figure 7 A schematic diagram of the structure of a resource pre-download device provided in one or more embodiments of this specification;

[0046] Figure 8 A schematic diagram of the structure of a resource pre-download device provided in one or more embodiments of this specification. Specific implementation manners

[0047] The embodiments of the present specification provide a method, an apparatus, a device and a storage medium for pre-downloading resources.

[0048] In order to enable those skilled in the art to better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the present specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0049] In order to explain the solution provided by the present application, the solution mentioned in the background art will be described in detail first.

[0050] For Mode 1, the cloud sends the resource address list of each resource to be pre-downloaded (for example, including the address of Resource 1, the address of Resource 2... the address of Resource N, etc.) and related information to the terminal. The terminal initiates a network request according to the resource address list and downloads the corresponding resources from the resource server (for example, the main station or the Content Delivery Network (CDN)). The downloaded resources are subjected to integrity verification. If the verification is successful, they are stored locally according to the storage path and can be directly retrieved from the local cache when in use.

[0051] However, Mode 1 still has the following deficiencies:

[0052] 1. After the client obtains the list of pre-downloaded resources, it needs to download and store each resource one by one. When the number of resources is large, the overhead of terminal tasks is relatively high. For example, when there are 500 pre-pushed resources, 500 threads need to be opened and 500 network requests need to be initiated, resulting in a relatively high overhead of terminal tasks in terms of CPU and power consumption. 2. The more resources need to be sent down, the longer the terminal queuing time will be, and the probability of some resources being executed will decrease, resulting in a relatively low completion rate of the pre-download task. 3. Usually, the pre-pushed resources often include some relatively large resources. Downloading through the original resource address is almost without any traffic-saving processing, resulting in a relatively large traffic consumption on the terminal. 4. A large number of download tasks may cause other unpredictable risks on the terminal, such as network channels being blocked, crashes caused by concurrency, excessive power consumption, etc. 5. For some pre-pushed resources, they are in special forms such as chunk in the cloud. If the terminal network does not support chunk download, such resources cannot support pre-pushing. 6. For some pictures processed by cloud scaling and returned to the terminal, the digest information (such as the MD5 information obtained by the MD5 Message-Digest Algorithm (MD5)) may not be idempotent, thus affecting the integrity check. 7. Resource secondary processing is not supported.

[0053] For Method 2, compared with Method 1, it has made certain improvements. First, the cloud determines the resources that need to be pre-pushed, then divides and stores them according to the network addresses of each resource for packaging, and then sends the address of the offline resource package to the terminal. The terminal initiates a network request based on this address to obtain the offline resource package. Perform an integrity check on the offline resource package. After passing, decompress it as a whole package, and each decompressed resource is under the directory of the corresponding offline package. When using, first match and mount the resource package according to the address and version information of the offline resource package, and then calculate its local sub-path under the decompressed package directory according to the network address when accessing the resource for use.

[0054] Method 2 can solve some of the deficiencies in Method 1. For example, it can solve Problem 1 and Problem 2 in Method 1, reduce the overhead of terminal tasks, and improve the completion rate. However, in addition to the problems not solved in Method 1, it also has some new deficiencies:

[0055] 1. As a whole, the offline resource package needs to be mounted first to find the corresponding offline package address, and then calculate the corresponding resource cache address based on the offline package address, resulting in package mounting overhead. 2. The access to resources is strongly coupled with the offline resource package, and the resources in the package are difficult to be globally reused. 3. When resources are updated, the entire package needs to be updated, resulting in waste of traffic and high cost. 4. It is difficult to perform secondary processing on the resources in the offline resource package, such as transcoding images. 5. It is mainly for front-end application scenarios and is not suitable for native application scenarios.

[0056] Based on this, the present application proposes a resource pre-downloading scheme, where Figure 1 is a schematic flowchart of a resource pre-downloading method provided by one or more embodiments of this specification. This method can be applied to different business fields, such as the Internet finance business field, the e-commerce business field, the instant messaging business field, the game business field, the official business field, etc. This process can be executed by computing devices in the corresponding fields, and some input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.

[0057] Figure 1 The process in

[0058] S102: Receive the resource pre-push information pushed by the cloud.

[0059] Figure 2 is an overall schematic diagram of resource pre-downloading in an application scenario provided by one or more embodiments of this specification, Figure 3 is a separate schematic diagram of the terminal and the cloud for resource pre-downloading in an application scenario provided by one or more embodiments of this specification. The following, by combining Figure 2 with Figure 3 and taking the process in the application scenario shown by it, Figure 1 the process shown in Figure 3 will be explained in detail. Among them, the cloud includes a configuration platform, a push server, and a resource server, etc. The three are usually independently set or belong to the same scenario (for example, set in the same server cluster). Through manual input or a service interface, a pre-push start instruction for the service is sent to the configuration platform. The configuration platform packages the resource information to be pre-pushed to generate a corresponding resource package, and the resource package at least includes the meta information corresponding to each resource, the resource compression package, the signature information, etc. The configuration platform uploads the generated resource package to the resource server, and the resource server stores it and sends the resource pre-push information to the terminal through the push server (the pre-push information usually includes information related to the resource package, so the resource package information in

[0060] S104: Send a download request to the cloud according to the pre-pushed resource information to obtain the resource package corresponding to the pre-pushed resource information.

[0061] After receiving the resource pre-push message, the terminal verifies it to determine whether it is valid (for example, verifying the format of the pre-push message, the integrity of the included content, etc.). If the verification passes, a pre-push task is established and the pre-push task is persistently stored locally, or, after establishing the pre-push task and persisting it, its validity is verified again. The persistently stored task information is added to the download task queue after being scattered or at other download trigger times, and waits in line for download. For example, when the user downloads a task related to the business through the terminal, the pre-push task is started, a network download is initiated, and the resource package is downloaded and obtained from the resource server in the cloud.

[0062] Figure 4 It is a schematic diagram of the custom format of the resource package in an application scenario provided by one or more embodiments of this specification; it should be noted that the resource package is in a custom format in this solution, which is different from the traditional offline resource package (for example, the offline resource package in Method 2 above).

[0063] Specifically, the resource package includes a signature file signature, a meta file meta, an instruction file manifest, and a resource file resource. Among them, the signature file mainly records the signature information of the resource package to prevent the resource package from being tampered with and causing resource errors. The meta file mainly records the corresponding service extension information and the first digest information corresponding to each sub-resource included in the resource package (the digest information is mainly used to verify the integrity of the sub-resource, which can be MD5 information, referred to as the first digest information here, mainly to distinguish it from other digest information that appears later). The instruction file is mainly used to record the original download address of each sub-resource and its offset position in the resource package, and the offset position is used to represent the position of each sub-resource in the resource package. The resource file is mainly used to carry the compressed file corresponding to each sub-resource.

[0064] S106: Parse the resource package containing multiple sub-resources to obtain the description information.

[0065] The format of the resource package is custom. The cloud can pre-carry the format information in the resource pre-push information and send it to the terminal, or the resource package received by the terminal carries the format information to facilitate the terminal to parse the resource package.

[0066] Among the description information obtained by parsing the resource package, it at least includes the information carried in the indication file. The indication file is used to record the original download address of each sub-resource and its offset position in the resource package, so that each sub-resource can be obtained from the resource package and its original download address can be obtained for subsequent storage of the sub-resources. Of course, the description information may also include the information carried in the meta-file and the signature file, which is not limited here.

[0067] S108: Unzip the corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information.

[0068] Figure 5 and Figure 6 are respectively the structural schematic diagrams of the traditional solution provided by one or more embodiments of this specification and the sub-resources in the resource package of this solution; the offline resource package in the traditional method 2 is as Figure 5 shown, which is strictly stored and packaged by directory division according to their respective original download addresses. For example, the img folder is a sub-folder of the afs folder. If you want to obtain Figure 5 the 1850687772-e7e5f.png file shown in, you need to mount the resource package in advance. When parsing and accessing this file, calculate the local sub-path in the unpacked package directory according to the original download address (such as Figure 5 the path of the zos folder - gltf-asset folder - mars-cli folder - NPSBQAARSPRG folder shown) to use.

[0069] However, the resource package in this application is as Figure 6 shown. Each sub-resource is no longer divided by directory according to the original download address, but is in the same position. At this time, the origin can be set first. For example, the first sub-resource under the resources folder shown in Figure 6 is used as the origin, and the distance between other sub-resources and this origin is used as the offset position. Thus, the corresponding sub-resource can be unzipped from the resource package through this offset position.

[0070] S110: Independently store each of the sub-resources in the terminal local according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources in the terminal local according to the corresponding relationship between the sub-resources and the original download addresses.

[0071] For the sub-resource storage in method 2, the sub-resources are divided into directories according to the original download addresses of the sub-resources to achieve storage, and the sub-resources and offline resource packages are strongly coupled. The solution in this application is to store the sub-resources separately and independently, which has achieved a certain degree of decoupling. At this time, the sub-resources cannot be accessed through the directory, but can be accessed through the corresponding relationship between the sub-resources and the original download addresses.

[0072] Compared with the shortcomings of method 1, the solution in this application does not need to download resources one by one, which reduces the terminal resource tasks and thus reduces the terminal queuing time, increases the probability of executing resource downloads, and improves the download completion rate. And because the number of terminal download tasks is reduced, especially when there are many pre-pushed resources (for example, when it reaches 500), only one network request is required, reducing the network task overhead of the terminal and the cloud. The resource package in the solution of this application can be compressed (for example, each sub-resource is compressed in different ways such as gzip or zstd) to effectively reduce the traffic consumed by pre-pushing resources.

[0073] Compared with the shortcomings of method 2, although the pre-downloaded sub-resources are pre-packaged into a resource package in a custom format, when the download is completed, each sub-resource is stored separately and independently when it is decompressed according to the corresponding relationship between each sub-resource in the resource package and the original download address, and the relationship between the sub-resource and the resource package is decoupled. The sub-resource can be read without package mounting, and a package-free directory is achieved (no longer a hierarchical directory with strong correlations between each item, but a directory that is independent of each other). While improving the download completion rate and reducing the network task overhead of the terminal and the cloud, the strong coupling relationship between the sub-resource and the resource package can be removed, and the reusability of the sub-resource can be improved. And when the resources are updated, due to the independent storage between the sub-resources, it is only necessary to package the updated resources into an updated resource package containing only the updated resources and pre-download them independently, without updating the entire package, reducing the update cost.

[0074] based on Figure 1 This specification also provides some specific implementation plans and extension plans of the method, which will be described below.

[0075] In one or more embodiments of the present specification, in the traditional solution, after the terminal obtains the offline resource package, it performs integrity check on the downloaded resource. If successful, it is stored locally according to the storage path, and if the check fails, it is returned. At this time, for some images that have been scaled and processed in the cloud, when they are returned to the terminal, the summary information (for example, the MD5 information obtained by the MD5 message digest algorithm (MD5 message-digest algorithm, MD5)) may be non-idempotent, thereby affecting the integrity check.

[0076] Based on this, when the cloud obtains the pre-pushed sub-resources, it synchronously records the first digest information at the time of acquisition in the local cloud. When packaging all sub-resources to generate a resource package, the first digest information of the sub-resources is mapped and stored in the meta-file as part of the description information, facilitating integrity verification after decompression by the terminal. The first digest information here is unique, and there is no situation where the digest information is not idempotent due to inconsistent scaling rules as in traditional solutions. Moreover, the signature of the generated resource package is stored in the signature file to prevent the resource package from being illegally tampered with.

[0077] When the terminal obtains the resource package, it decompresses to obtain each sub-resource and obtains the corresponding second digest information according to the sub-resource. By comparing the second digest information with the first digest information carried in the resource package, the integrity of the sub-resource is verified. If the comparison result is consistent, the integrity verification is passed, and the sub-resource is written into the unified cache of the terminal, and the integrity verification of the next sub-resource is performed. If the comparison result is inconsistent, it directly jumps to the next sub-resource for integrity verification. By specifying the unique digest information for each sub-resource when the cloud generates the resource package from the sub-resources, there will no longer be a problem that the first digest information of some sub-resources is not idempotent due to different cloud scaling rules on the terminal, solving such resource integrity verification problems.

[0078] In one or more embodiments of this specification, in the traditional way, secondary processing of sub-resources is not supported (generally speaking, decompressing a sub-resource is called the first processing of it, and secondary processing refers to further processing of the decompressed sub-resource). During the process of generating the resource package, secondary processing is performed on the sub-resources. For example, transcoding, compressing, etc. are performed on image sub-resources. The cloud places the processing information or restoration information of the secondary processing in the description information. In this way, after the terminal obtains the resource package, it judges whether the sub-resource has undergone secondary processing according to the description information. If it is confirmed that secondary processing has been performed, the sub-resource can be restored according to the description information and then independently stored locally on the terminal. Compared with the traditional solution, it can perform secondary processing on the sub-resources in the resource package or restore the sub-resources after secondary processing, improving the versatility and scalability of the resource package.

[0079] In one or more embodiments of this specification, the original download address can be a network address, i.e., a URL address. As mentioned above, the custom resource package format can be used to decouple the association relationship between each entry included in the URL address, thereby generating a resource package.

[0080] Before determining the URL address directory in the cloud, the cloud first determines the resource network address directory of a specified online activity that has not yet started. For example, a large promotion activity launched by an e-commerce platform within a specific time period, and based on this resource network address directory, obtains each sub-resource, thereby generating a resource package. After the specified online activity starts, determine the URL addresses of the sub-resources required to generate the activity page of the online activity within the client. For example, sub-resources such as audio, pictures, and videos required in the activity page. If the corresponding sub-resource is found locally on the terminal according to this URL address, it means that the pre-download is successful, and the sub-resource can be directly read locally on the terminal to generate the activity page.

[0081] In one or more embodiments of this specification, in the traditional solution, when some pre-pushed resources are in a special format such as chunk in the cloud, if the terminal network does not support chunk download, such resources cannot support pre-pushing.

[0082] Based on this, when the cloud obtains multiple chunk resources, it takes them as multiple sub-resources respectively, and then packages them according to the custom format or the specified general protocol described above, thereby obtaining a resource package. Of course, the resource package can also include other resources besides chunk resources. At this time, when the terminal downloads the resource package, it can be used normally without supporting a specific chunk protocol.

[0083] In one or more embodiments of this specification, as mentioned above, when updating the resource package, there is no need to update the entire package. The cloud only needs to generate an update package for the updated resources. The update package has the same custom format as the resource package described above, and sends the corresponding update information to the terminal. The terminal initiates a download task to obtain the update package.

[0084] Parse the update package to obtain the description information of the updated resources. Through the description information, the content of the updated resources can be known. For example, the format of the updated resources, the functions played in the activity page of the business, etc. In this way, the correlation index between the updated resources and the stored sub-resources can be obtained. The correlation index can be obtained based on the similarity of the functions played by the two in the activity page, the similarity of the formats, the correlation degree of the URL addresses, etc. The correlation index is positively correlated with the similarity and the correlation degree. After determining the specified sub-resource with the highest correlation index, determine the storage location of the specified sub-resource, and store the updated resources in a location closer to the specified sub-resource. In this way, it can be ensured that when generating the activity page, the updated resources can be found more conveniently, especially when the updated resources are alternative resources of the previously stored sub-resources, making the replacement process faster and more accurate.

[0085] Based on the same idea, one or more embodiments of this specification also provide the corresponding apparatuses and devices for the above methods, such as Figure 7 , Figure 8 as shown.

[0086] Figure 7 The following is a schematic structural diagram of an apparatus for resource pre-download provided by one or more embodiments of this specification. The apparatus includes:

[0087] A receiving module 702, configured to receive resource pre-push information pushed by the cloud;

[0088] A downloading module 704, configured to send a download request to the cloud according to the resource pre-push information to obtain a resource package corresponding to the resource pre-push information;

[0089] An analysis module 706, configured to analyze the resource package including multiple sub-resources to obtain description information;

[0090] An extraction module 708, configured to extract corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information;

[0091] A storage module 710, configured to independently store each of the sub-resources locally in the terminal according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources locally in the terminal according to the correspondence between the sub-resources and the original download addresses.

[0092] Optionally, the storage module 710 obtains first digest information corresponding to the sub-resource in the description information;

[0093] Extracts a digest of the extracted sub-resource to obtain second digest information corresponding to the sub-resource;

[0094] Performs integrity verification on the sub-resource according to the first digest information and the second digest information;

[0095] If the integrity verification is passed, the sub-resource is written into the unified cache of the terminal, and integrity verification is performed on the next sub-resource.

[0096] Optionally, the storage module 710 determines whether the sub-resource has been processed twice in the resource package;

[0097] If so, the sub-resource is restored accordingly according to the description information and then independently stored locally in the terminal.

[0098] Optionally, the original download address is a network address;

[0099] The apparatus further includes:

[0100] A decoupling module 712, and the cloud determines a resource network address directory;

[0101] Obtain the multiple sub-resources according to the resource network address directory;

[0102] Decouple the association relationships between the entries included in the resource network address directory in a custom format, and package the multiple sub-resources according to the decoupling result to obtain the resource package including the description information for pre-downloading by the terminal.

[0103] Optionally, for the decoupling module 712, the cloud determines a resource network address directory of a specified online activity that has not started yet;

[0104] The storage module 710 determines an original download address of the sub-resources required to generate an activity page of the specified online activity after the specified online activity starts;

[0105] Query whether there is a corresponding sub-resource in the local terminal according to the original download address;

[0106] If so, directly read the sub-resource in the local terminal of the terminal for generating the activity page.

[0107] Optionally, it further includes:

[0108] A chunk resource module 714, and the cloud obtains multiple chunk resources as the multiple sub-resources;

[0109] Package the multiple sub-resources in a custom format or a specified general protocol to obtain the resource package for pre-downloading by the terminal that does not support the chunk protocol.

[0110] Optionally, it further includes:

[0111] An update module 716 receives update information for the resource package sent by the cloud, and obtains an update package carrying updated resources according to the update information;

[0112] Parse the update package to obtain the description information corresponding to the updated resources;

[0113] Determine a specified sub-resource with the highest association index with the updated resources among the stored sub-resources according to the description information corresponding to the updated resources;

[0114] Determine the storage location of the specified sub-resource, and store the updated resources according to the storage location.

[0115] Optionally, the resource package includes a signature file, a meta file, an indication file, and a resource file;

[0116] The signature file is used to record the signature information of the resource package; the meta file is used to record the corresponding service extension information and the first digest information corresponding to the sub-resources; the display file is used to record the original download addresses of the sub-resources and the offset positions in the resource package; the resource file is used to carry the compressed file corresponding to the sub-resource.

[0117] Figure 8 The following is a schematic structural diagram of a device for resource pre-download provided by one or more embodiments of this specification. The device includes:

[0118] At least one processor; and,

[0119] A memory communicatively connected to the at least one processor; wherein,

[0120] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to:

[0121] Receive the resource pre-push information pushed by the cloud;

[0122] According to the resource pre-push information, send a download request to the cloud to obtain the resource package corresponding to the resource pre-push information;

[0123] Parse the resource package containing multiple sub-resources to obtain description information;

[0124] According to the offset positions of the respective sub-resources included in the description information, decompress the corresponding sub-resources from the resource package;

[0125] According to the original download addresses of the respective sub-resources included in the description information, independently store the respective sub-resources locally on the terminal, so as to access the stored sub-resources locally on the terminal according to the correspondence between the sub-resources and the original download addresses.

[0126] Based on the same idea, one or more embodiments of this specification also provide a non-volatile computer storage medium corresponding to the above method, storing computer-executable instructions, and the computer-executable instructions are set as:

[0127] Receive the resource pre-push information pushed by the cloud;

[0128] According to the resource pre-push information, send a download request to the cloud to obtain the resource package corresponding to the resource pre-push information;

[0129] Parse the resource package containing multiple sub-resources to obtain description information;

[0130] Extract the corresponding sub-resources from the resource package according to the offset positions of the respective sub-resources included in the description information;

[0131] Independently store each of the sub-resources locally on the terminal according to the original download addresses of the respective sub-resources included in the description information, so as to access the stored sub-resources locally on the terminal according to the correspondence between the sub-resources and the original download addresses.

[0132] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many method flow improvements today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compilers used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not just one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into an integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0133] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.

[0134] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0135] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0136] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, the embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0137] This specification is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices produce means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0138] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0140] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0141] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0142] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media and can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices, or any other non-transitory medium that can be used to store information accessible by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media, such as modulated data signals and carrier waves.

[0143] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0144] This specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0145] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the apparatus, device, and non-volatile computer storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.

[0146] The above description has been made of specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0147] The above is only one or more embodiments of the present specification and is not intended to limit the present specification. For those skilled in the art, various changes and modifications can be made to one or more embodiments of the present specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present specification shall be included within the scope of the claims of the present specification.

Claims

1. A method for pre-downloading resources, including: Receiving resource pre-push information pushed by the cloud; According to the resource pre-push information, sending a download request to the cloud to obtain a resource package corresponding to the resource pre-push information; Parsing the resource package containing multiple sub-resources to obtain description information; According to the offset positions of the respective sub-resources included in the description information, decompressing the corresponding sub-resources from the resource package; According to the original download addresses of the respective sub-resources included in the description information, storing the respective sub-resources independently in the local terminal, so as to access the stored sub-resources in the local terminal according to the correspondence between the sub-resources and the original download addresses.

2. The method according to claim 1, wherein storing the respective sub-resources independently in the local terminal specifically includes: Obtaining first digest information corresponding to the sub-resource in the description information; Performing digest extraction on the decompressed sub-resource to obtain second digest information corresponding to the sub-resource; Performing integrity verification on the sub-resource according to the first digest information and the second digest information; If the integrity verification is passed, writing the sub-resource into the unified cache of the terminal and performing integrity verification on the next sub-resource.

3. The method according to claim 1, wherein storing the respective sub-resources independently in the local terminal specifically includes: Judging whether the sub-resource has been processed twice in the resource package; If so, restoring the sub-resource accordingly according to the description information and then storing it independently in the local terminal.

4. The method according to claim 1, wherein the original download address is a network address; Before receiving the resource pre-push information pushed by the cloud, the method further includes: The cloud determines a resource network address directory; According to the resource network address directory, obtaining the multiple sub-resources; Decoupling the association relationships between the entries included in the resource network address directory in a custom format, and packaging the multiple sub-resources according to the decoupled result to obtain the resource package containing the description information for the terminal to pre-download.

5. The method according to claim 4, wherein the cloud determines the resource network address directory specifically includes: The cloud determines the resource network address directory of a specified online activity that has not yet started; The accessing the stored sub-resources in the local terminal according to the correspondence between the sub-resources and the original download addresses specifically includes: After the specified online activity starts, determining the original download addresses of the sub-resources required to generate the activity page of the specified online activity; Querying in the local terminal whether there are corresponding sub-resources according to the original download address; If so, directly reading the sub-resource in the local terminal for generating the activity page.

6. The method according to claim 1, before receiving the resource pre-push information pushed by the cloud, the method further includes: The cloud obtains multiple chunk resources as the multiple sub-resources; Pack the multiple sub-resources according to a custom format or a specified general protocol to obtain the resource package, so that the terminal that does not support the chunk protocol can pre-download.

7. The method according to claim 1, after storing each of the sub-resources independently in the terminal local, the method further includes: Receiving update information for the resource package sent by the cloud, and obtaining an update package carrying updated resources according to the update information; Parsing the update package to obtain description information corresponding to the updated resources; According to the description information corresponding to the updated resources, determining a specified sub-resource with the highest association index with the updated resources among the stored sub-resources; Determining the storage location of the specified sub-resource, and storing the updated resources according to the storage location.

8. The method according to any one of claims 1 to 7, the resource package includes a signature file, a meta file, an indication file, and a resource file; The signature file is used to record the signature information of the resource package; the meta file is used to record the corresponding service extension information and the first summary information corresponding to the sub-resources; the indication file is used to record the original download addresses of the sub-resources and the offset positions in the resource package; the resource file is used to carry the compressed file corresponding to the sub-resource.

9. A device for resource pre-downloading, including: A receiving module, which receives resource pre-pushing information pushed by the cloud; A downloading module, which sends a download request to the cloud according to the resource pre-pushing information to obtain a resource package corresponding to the resource pre-pushing information; An analyzing module, which analyzes the resource package containing multiple sub-resources to obtain description information; An extracting module, which extracts the corresponding sub-resources from the resource package according to the offset positions of the sub-resources included in the description information; A storing module, which stores each of the sub-resources independently in the terminal local according to the original download addresses of the sub-resources included in the description information, so as to access the stored sub-resources in the terminal local according to the correspondence between the sub-resources and the original download addresses.

10. The device according to claim 9, the storing module obtains the first summary information corresponding to the sub-resource in the description information; Performing summary extraction on the decompressed sub-resource to obtain the second summary information corresponding to the sub-resource; Performing integrity verification on the sub-resource according to the first summary information and the second summary information; If the integrity verification is passed, writing the sub-resource into the unified cache of the terminal, and performing integrity verification on the next sub-resource.

11. The device according to claim 9, the storing module determines whether the sub-resource has been processed twice in the resource package; If so, restoring the sub-resource accordingly according to the description information and then storing it independently in the terminal local.

12. The device according to claim 9, the original download address is a network address; The device further includes: A decoupling module, the cloud determines the resource network address directory; Obtain the multiple sub-resources according to the resource network address directory; Decouple the association relationships between the entries included in the resource network address directory in a custom format, and package the multiple sub-resources according to the decoupling result to obtain the resource package including the description information, so as to enable the terminal to pre-download.

13. The device according to claim 12, wherein the decoupling module, the cloud determines the resource network address directory of a specified online activity that has not yet started; The storage module, after the specified online activity starts, determines the original download addresses of the sub-resources required to generate the activity page of the specified online activity; Query whether there are corresponding sub-resources locally on the terminal according to the original download addresses; If so, directly read the sub-resources locally on the terminal for generating the activity page.

14. The device according to claim 9, further including: The chunk resource module, the cloud obtains a plurality of chunk resources as the multiple sub-resources; Package the multiple sub-resources in a custom format or a specified general protocol to obtain the resource package, so as to enable the terminal that does not support the chunk protocol to pre-download.

15. The device according to claim 9, further including: The update module, receives the update information for the resource package sent by the cloud, and obtains an update package carrying updated resources according to the update information; Parse the update package to obtain the description information corresponding to the updated resources; According to the description information corresponding to the updated resources, determine the specified sub-resource with the highest association index with the updated resources among the stored sub-resources; Determine the storage location of the specified sub-resource, and store the updated resources according to the storage location.

16. The device according to any one of claims 9 to 15, wherein the resource package includes a signature file, a meta file, an indication file, and a resource file; The signature file is used to record the signature information of the resource package; the meta file is used to record the corresponding service extension information and the first summary information corresponding to the sub-resources; the indication file is used to record the original download addresses of the sub-resources and the offset positions in the resource package; the resource file is used to carry the compressed file corresponding to the sub-resources.

17. A device for resource pre-downloading, including: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can: Receive resource pre-push information pushed by the cloud; According to the resource pre-push information, send a download request to the cloud to obtain the resource package corresponding to the resource pre-push information; Parse the resource package including multiple sub-resources to obtain description information; According to the respective offset positions of the sub-resources included in the description information, decompress the corresponding sub-resources from the resource package; According to the original download addresses of the respective sub-resources included in the described description information, store the respective sub-resources independently locally on the terminal, so as to access the stored sub-resources locally on the terminal according to the correspondence between the sub-resources and the original download addresses.

Citation Information

Patent Citations

  • Traffic exchange method and system based on mobile terminal

    CN104581818A

  • Resource file downloading method and device, computer equipment and storage medium

    CN109634925A

  • Webpage resource acquisition method and device, electronic equipment and storage medium

    CN111314426A