US Patent No. 10,462,258

RESOURCE DOWNLOAD METHOD, ELECTRONIC DEVICE, AND APPARATUS


Patent No. 10,462,258
Issue Date October 29, 2019
Title Resource Download Method, Electronic Device, And Apparatus
Inventorship Tao Zhou, Wuhan (CN)
Assignee HUAWEI TECHNOLOGIES CO., LTD., Shenzhen (CN)

Claim of US Patent No. 10,462,258

1. A resource download method applied to an electronic device, the method comprising:initiating, by the electronic device, a first request to a server;
receiving, by the electronic device from the server, a packet responsive to the first request, the packet comprising an entity data part corresponding to the first request;
writing, by the electronic device using a cache service module of the electronic device, a resource to be downloaded into a first storage area of the electronic device when the entity data part of the packet includes the resource to be downloaded;
writing, by the electronic device to a download record database of a download manager in the electronic device, first identification information corresponding to the packet;
querying, by the download manager, the cache service module for identification information that matches the first identification information;
when the download manager finds, in the cache service module, the identification information that matches the first identification information:
reading, by the download manager, the resource to be downloaded from the first storage area; and
storing, by the electronic device, the resource to be downloaded into a second storage area of the electronic device; and
after writing the first identification information to the download record database and when the download manager fails to find, in the cache service module, the identification information that matches the first identification information:
determining, from the first identification information, a uniform resource locator (URL) of the resource to be downloaded; and
sending, by the download manager to the server according to the URL, a second request that requests the server to return the resource to be downloaded to the download manager.