CN111726387A - Resource acquisition method and device - Google Patents

Resource acquisition method and device Download PDF

Info

Publication number
CN111726387A
CN111726387A CN201910223760.1A CN201910223760A CN111726387A CN 111726387 A CN111726387 A CN 111726387A CN 201910223760 A CN201910223760 A CN 201910223760A CN 111726387 A CN111726387 A CN 111726387A
Authority
CN
China
Prior art keywords
resource
server
request
cache
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910223760.1A
Other languages
Chinese (zh)
Inventor
蒲平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910223760.1A priority Critical patent/CN111726387A/en
Publication of CN111726387A publication Critical patent/CN111726387A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a resource acquisition method and a resource acquisition device, wherein the method comprises the steps that a first server receives resource acquisition requests respectively sent by at least two pieces of terminal equipment, wherein the resources requested by the resource acquisition requests are the same; the first server sends a resource caching request to a second server so as to acquire a first part of the resource from the second server, wherein the first part is all or part of the resource, the resource caching request is obtained according to a first resource acquisition request, and the first resource acquisition request is one of resource acquisition requests respectively sent by at least two terminal devices; the first server sends the resource to the at least two terminal devices. When the resources are acquired based on the CDN system, the embodiments of the present application may effectively reduce a load of a resource server of the CP/SP system and/or an upper-layer cache service of the cache server when at least two terminal devices concurrently send a resource acquisition request to the cache server of the CDN system.

Description

Resource acquisition method and device
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a resource acquisition method and device.
Background
A Content Distribution Network (CDN) system is an infrastructure of a current network, and when a resource requested by a terminal device is cached in the CDN system, the terminal device may quickly acquire various resources (e.g., a web page, a picture, a file, a video, etc.) in the network through the CDN system without accessing a resource server in a Content Provider/Service Provider (CP/SP).
When a plurality of terminals request the same resource to the cache server of the CDN system in parallel, if the resource is not cached in the cache server, the access load of the upper-level cache server of the cache server or the resource server of the CP/SP system may be relatively large, and even the upper-level cache server of the cache server or the resource server of the CP/SP may be disabled.
Therefore, how to reduce the access load of the upper-layer cache server of the cache server or the resource server of the CP/SP when a plurality of terminals request the same resource to the cache server of the CDN system in parallel is an urgent technical problem to be solved.
Disclosure of Invention
The embodiment of the application provides a resource obtaining method, which effectively reduces the load of a resource server of a CP/SP system and/or an upper-layer cache service of the cache server when at least two terminal devices send resource obtaining requests to the cache server of a CDN system in parallel.
In a first aspect, an embodiment of the present application provides a resource obtaining method, including: the method comprises the steps that a first server receives resource acquisition requests sent by at least two pieces of terminal equipment respectively, wherein the resources requested by the resource acquisition requests are the same; the first server sends a resource caching request to a second server so as to acquire a first part of the resource from the second server, wherein the first part is all or part of the resource, the resource caching request is obtained according to a first resource acquisition request, and the first resource acquisition request is one of resource acquisition requests respectively sent by the at least two terminal devices; and the first server sends the resource to the at least two terminal devices.
The first server in the scheme can be a cache server in a Content Delivery Network (CDN) system, and the second server can be a resource server in a content provider/service provider (CP/SP) system; or, the first server in this scheme may be a first cache server in a content delivery network CDN system, the second server may be a second cache server in the CDN system, and the second cache server is an upper-layer cache server of the first cache server.
In this scheme, when at least two terminal devices request the same resource from the first server in parallel, the resource caching request sent by the first server to the second server is acquired according to one of the resource acquisition requests, that is, the first server requests the second server to cache the resource only once. Therefore, the resource acquisition method of the embodiment can effectively reduce the load of the second server when at least two terminal devices send the resource acquisition request to the first server in parallel. That is, when acquiring resources based on the CDN system, the resource acquisition method according to the present solution may effectively reduce a load of a resource server of the CP/SP system and/or an upper-layer cache service of the cache server when at least two terminal devices concurrently send a resource acquisition request to the cache server of the CDN system.
With reference to the first aspect, in a possible implementation manner of the first aspect, before the sending, by the first server, the resource caching request to the second server, the method further includes: and the first server determines that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same.
In the scheme, before the first server sends the resource caching request to the second server, the first server determines that the resources requested by the resource obtaining requests sent by the at least two terminal devices respectively are the same, so that all the terminals can obtain the requested resources.
With reference to the first aspect, in a possible implementation manner of the first aspect, before the sending, by the first server, the resource caching request to the second server, the method further includes: the first server determines the information of the resource according to the first resource acquisition request; the first server sending the resource caching request to the second server, including: and the first server sends the resource caching request to the second server according to the information of the resource.
In the scheme, the specific implementation before the first server sends the resource cache request to the second server is provided.
With reference to the first aspect, in a possible implementation manner of the first aspect, the number of the resource caching requests is 1, and the first part is all of the resources, and the sending, by the first server, the resource caching request to the second server according to the information of the resources includes: the first server determines that all the resources are not cached in the first server according to the information of the resources; and the first server forwards the first resource obtaining request to the second server, wherein the first resource obtaining request is the resource caching request.
In the scheme, after all the resources are determined not to be cached in the first server, the first resource acquisition request is forwarded to the second server, and the resource acquisition method is low in complexity and easy to implement.
With reference to the first aspect, in a possible implementation manner of the first aspect, the sending, by the first server, the resource caching request to the second server according to the information of the resource includes: the first server dividing the resource into at least two sub-resources; the first server acquires at least one resource cache request according to the at least two sub-resources and the information of the resources, wherein each resource cache request is used for requesting one of the at least two sub-resources; the first server sends at least one resource caching request to the second server.
According to the scheme, the resource requested by the terminal equipment is divided into at least two sub-resources, and when part of the sub-resources of the resource are cached in the cache server, the size of the resource which is requested to be cached from the first server to the second server can be reduced, so that the load of the second server is further reduced.
With reference to the first aspect, in a possible implementation manner of the first aspect, the acquiring, by the first server, the information of the resource includes an identifier corresponding to the resource, and the acquiring, by the first server, at least one resource cache request according to the at least two sub-resources and the information of the resource includes: for any first sub-resource in the at least two sub-resources, the first server determines whether the first server caches the first sub-resource; and if not, the first server acquires a resource cache request corresponding to the first sub-resource according to the first sub-resource and the identifier corresponding to the resource.
According to the scheme, only the resource cache request corresponding to the uncached sub-resource in the first server can be generated, so that the load of the second server is further reduced.
With reference to the first aspect, in a possible implementation manner of the first aspect, the dividing the resource into at least two sub-resources includes: the first server obtains at least two byte ranges according to a preset byte number, each byte range indicates one of the at least two sub-resources, and the byte number included in the byte range of the at least two byte ranges is smaller than or equal to the preset byte number.
The present solution provides a specific implementation of the division of the resource into at least two sub-resources.
With reference to the first aspect, in a possible implementation manner of the first aspect, when the information of the resource includes a total byte range indicating the resource, and the total byte range includes a start byte and a stop byte, the obtaining at least two byte ranges according to a preset byte number includes: and the first server divides the total byte range indicating the resources into the at least two byte ranges according to the preset byte number.
The method and the device have the advantages that when the resource requested by the terminal device is a part of resource, the first server divides the resource into at least two sub-resources.
With reference to the first aspect, in a possible implementation manner of the first aspect, the dividing the resource into at least two sub-resources includes: the first server determining that the first server caches the portion of the resource; the first server divides the resource into at least two sub-resources according to the portion of the resource cached by the first server.
The present solution provides another specific implementation of dividing the resource into at least two sub-resources.
With reference to the first aspect, in a possible implementation manner of the first aspect, when the number of resource caching requests is N and N is greater than 1, the sending, by the first server, at least one resource caching request to the second server includes: the first server determines to acquire the sub-resource of the resource requested by the (n-1) th resource cache request; the first server sends an nth resource caching request to the second server, the last byte of the sub-resource of the resource requested by the nth-1 resource caching request is the mth byte of the resource, the first byte of the sub-resource of the resource requested by the nth resource caching request is the m +1 byte of the resource, N is 1, … N, and m is an integer greater than 1.
In the scheme, when the other resource acquisition requests received by the first server have the resource acquisition requests of other requested resources which are the same as the resource part, the probability of requesting the resource server for caching the same part of the resource and other resources for multiple times can be reduced when the terminal equipment requests the resource, and the load of the second server is further reduced.
With reference to the first aspect, in a possible implementation manner of the first aspect, before the dividing, by the first server, the resource into at least two sub-resources, the method further includes:
the first server determines that there are resource acquisition requests of other requested resources, which are partially the same as the resources, in other received resource acquisition requests, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
The scheme can ensure the effectiveness of dividing the resource requested by the terminal equipment into at least two sub-resources for reducing the load of the second server.
In a second aspect, an embodiment of the present application provides a resource obtaining apparatus, including:
the terminal equipment comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving resource acquisition requests respectively sent by at least two pieces of terminal equipment, and the resources requested by the resource acquisition requests are the same; a sending module, configured to send a resource cache request to a second server, so as to obtain a first part of the resource from the second server, where the first part is all or part of the resource, the resource cache request is obtained according to a first resource obtaining request, and the first resource obtaining request is one of resource obtaining requests sent by the at least two terminal devices, respectively; the sending module is further configured to send the resource to the at least two terminal devices.
The first server in the scheme can be a cache server in a Content Delivery Network (CDN) system, and the second server can be a resource server in a content provider/service provider (CP/SP) system; or, the first server in this scheme may be a first cache server in a content delivery network CDN system, the second server may be a second cache server in the CDN system, and the second cache server is an upper-layer cache server of the first cache server.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the apparatus further includes a processing module; the processing module is configured to determine that the resources requested by the resource obtaining requests respectively sent by the at least two terminal devices are the same before the sending module sends the resource caching request to the second server.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the processing module is further configured to determine information of the resource according to the first resource obtaining request before the sending module sends the resource caching request to the second server; the sending module is further configured to send the resource caching request to the second server according to the information of the resource.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the number of resource cache requests is 1, and the first portion is all of the resources; the processing module is further configured to determine, according to the information of the resource, that all of the resource is not cached in the resource obtaining apparatus; the sending module is further configured to forward the first resource obtaining request to the second server, where the first resource obtaining request is the resource cache request.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the processing module is further configured to: dividing the resource into at least two sub-resources, and obtaining at least one resource cache request according to the at least two sub-resources and the information of the resource, wherein each resource cache request is used for requesting one of the at least two sub-resources; the sending module is further configured to send at least one resource caching request to the second server.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the information of the resource includes an identifier corresponding to the resource, and the processing module is specifically configured to: for any first sub-resource in the at least two sub-resources, determining whether the first server caches the first sub-resource; and if not, acquiring a resource cache request corresponding to the first sub-resource according to the first sub-resource and the identifier corresponding to the resource.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the processing module is specifically configured to:
and acquiring at least two byte ranges according to a preset byte number, wherein each byte range indicates one of the at least two sub-resources, and the byte number included in the byte range of the at least two byte ranges is less than or equal to the preset byte number.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, in a case that the information of the resource includes a total byte range indicating the resource, and the total byte range includes a start byte and a stop byte, the processing module is specifically configured to: and dividing the total byte range indicating the resources into the at least two byte ranges according to the preset byte number.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the processing module is specifically configured to: determining that the first server caches the portion of the resource; dividing the resource into at least two sub-resources according to the portion of the resource cached by the first server.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, when the number of resource cache requests is N and N is greater than 1, the processing module is further configured to: determining to obtain the sub-resources of the resources requested by the (n-1) th resource cache request; the sending module is further configured to send an nth resource cache request to the second server, where a last byte of a sub-resource of the resource requested by the nth-1 resource cache request is an mth byte of the resource, a first byte of the sub-resource of the resource requested by the nth resource cache request is an m +1 th byte of the resource, N is 1, … N, and m is an integer greater than 1.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
With reference to the second aspect, in a possible implementation manner of the second aspect, the processing module is further configured to determine that, before dividing the resource into at least two sub-resources, there are resource acquisition requests, in other received resource acquisition requests, that other requested resources are partially the same as the resource, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
The beneficial effects of this scheme refer to the technical effect that the scheme corresponds to the first aspect.
In a third aspect, an embodiment of the present application provides a server, which is configured to implement the method for acquiring a resource in the first aspect and any possible implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored; the computer program, when executed, implements the method for resource acquisition in the first aspect and any one of the possible implementations of the first aspect.
In this application, when at least two terminal devices request the same resource to the first server in parallel, the resource caching request sent by the first server to the second server is obtained according to one of the resource obtaining requests, that is, the first server requests the second server to cache the resource only once. Therefore, the resource acquisition method of the embodiment can effectively reduce the load of the second server when at least two terminal devices send the resource acquisition request to the first server in parallel. That is, when acquiring resources based on the CDN system, the resource acquisition method according to the present solution may effectively reduce a load of a resource server of the CP/SP system and/or an upper-layer cache service of the cache server when at least two terminal devices concurrently send a resource acquisition request to the cache server of the CDN system.
Drawings
FIG. 1 is a diagram of a system architecture of the prior art;
FIG. 2 is a system architecture diagram provided in accordance with an embodiment of the present application;
fig. 3 is a signaling interaction diagram of a resource acquisition method according to an embodiment of the present application;
fig. 4 is a signaling interaction diagram of a resource acquisition method according to another embodiment of the present application;
fig. 5 is a signaling interaction diagram of a resource acquisition method according to another embodiment of the present application;
fig. 6 is a first schematic structural diagram of a resource acquisition device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a resource acquisition apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple. The terms "first," "second," and the like in this application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
To facilitate understanding of the present application, elements that will be introduced in the description of the present application are first introduced here:
a CDN system: in order to form a layer of intelligent virtual network system on the basis of the existing internet by placing cache servers at various places of the internet, resources stored in resource servers of a CP/SP system can be cached in cache servers of a CDN system. The CDN system redirects the user's request to the cache server closest to the user in real time according to the network traffic and the comprehensive information such as the connection, load condition, distance to the user, response time and the like of each cache server, so that the user can obtain the required resources cached on the cache server nearby, the problem of crowded Internet is solved, and the response speed of user access is improved.
The CDN system may include multiple layers of cache servers, each layer of cache server includes at least one cache server, each layer of cache server may directly communicate with a next-layer cache server (or terminal device) and a previous-layer cache server (or resource server of the CP/SP system), and an uppermost-layer or highest-layer cache server in the CDN system may directly communicate with a resource server of the CP/SP system; the resource servers of the CP/SP system may be considered to be hierarchically higher than any cache server in the CDN system. Furthermore, for a certain resource, it may be cached in a cache server at a higher level of the CDN system, but not in a cache server at a lower level of the CDN system.
Next, a resource acquisition method based on a CDN system in the prior art is described with reference to fig. 1. Fig. 1 is a system architecture diagram of the prior art. Referring to fig. 1, the system architecture includes a terminal device, a CDN system, an operation platform, and a CP/SP system.
In the prior art, a method for a terminal device to obtain resources through a CDN system is as follows:
(1) before the CP/SP issues a new Resource, a management user sends a Uniform Resource Locator (URL for short) of the new Resource to a central cache server of the CDN system through a terminal device of an operation platform.
(2) And the central cache server of the CDN system downloads the new resource from the resource server of the CP/SP system according to the URL of the new resource and caches the downloaded new resource.
(3) After the central cache server (which may be the highest-level cache server) of the CDN system obtains the new resource, the central cache server pushes the new resource to all other cache servers in the CDN system through the internal distribution system, so as to ensure that all cache servers in the CDN system locally cache the new resource.
(4) When a plurality of terminal devices initiate requests for the new resources, the requests are directly sent to a cache server in the CDN system, the cache server sends the new resources cached locally to the plurality of terminal devices, and the resource server of the CP/SP system is not accessed any more, or the upper-layer cache server of the cache server is not accessed any more under the condition that the cache server has the upper-layer cache server.
According to the resource obtaining method, the cache server sends the new resource cached locally to the terminal equipment, so that the user quantity of the resource server accessing the CP/SP system and the user quantity of the upper-layer cache server accessing the cache server are greatly reduced, namely, the load of the resource server and the upper-layer cache server of the CP/SP system is effectively reduced. However, it is necessary to ensure that resources requested by a plurality of terminal devices have been cached to each cache server in the CDN system. If the resource requested by the plurality of terminal devices is not cached in the cache server directly communicating with the plurality of terminal devices, the cache server may forward the request for obtaining the resource to the resource server of the CP/SP system for multiple times, or in a case where the cache server has an upper-level cache server, the terminal device forwards the request for obtaining the new resource to the upper-level cache server of the cache server for multiple times, and the upper-level cache server of the cache server forwards the request for obtaining the resource to the resource server of the CP/SP system for multiple times, so that the load of the upper-level cache server of the cache server and/or the resource server of the CP/SP system is relatively large.
Based on the above problems, a resource acquisition method according to an embodiment of the present application is provided.
The technical solution in the present application is explained below with reference to the drawings.
The terminal device related to the embodiment of the application can be a device which comprises a wireless transceiving function and/or can be matched with a network device to provide communication service for a user. In particular, a terminal may refer to a User Equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a User terminal device, a wireless communication device, a User agent, or a User Equipment. For example, the terminal may be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with a wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G network or a network after 5G, and the like, which is not limited in this embodiment of the application.
Various objects such as various messages or information or devices or network elements or systems or devices or actions or operations or flows or concepts may be named in the present application, but these specific names do not constitute limitations on the related objects, and the named names may vary with factors such as scenes, contexts, or usage habits, and understanding of technical meaning of the related objects should be mainly determined by functions and technical effects embodied/performed in the technical solutions.
Fig. 2 is a system architecture diagram provided in an embodiment of the present application, and referring to fig. 2, the system architecture includes a plurality of terminal devices, a CDN system, and a CP/SP system.
The following describes the resource acquisition method in detail by using a specific embodiment in conjunction with the system architecture shown in fig. 2.
Fig. 3 is a signaling interaction diagram of a resource obtaining method according to an embodiment of the present application, and referring to fig. 3, the method according to the embodiment includes:
step S301, at least two terminal devices respectively send resource acquisition requests to a first server, wherein the resources requested by the resource acquisition requests are the same;
specifically, the first server in this embodiment may be a cache server in the CDN system shown in fig. 2, and the first server is a cache server directly communicating with the at least two terminal devices.
In some scenarios, at least two terminal devices may send resource acquisition requests requesting the same resource to the first server in parallel. The resource requested by at least two terminal devices may be a complete resource or a partial resource. The complete resource refers to all of a certain webpage or picture or file or video, and the partial resource refers to part of a certain webpage or picture or file or video. For example, when the resources requested by the at least two terminal devices are all of an application, the resources requested by the at least two terminal devices are a complete resource; in the case that the resources requested by the at least two terminal devices are part of an application, the resources requested by the at least two terminal devices are part of the resources.
Step S302, the first server sends a resource caching request to the second server to obtain a first part of the resource from the second server, where the first part is all or part of the resource, the resource caching request is obtained according to a first resource obtaining request, and the first resource obtaining request is one of resource obtaining requests sent by at least two terminal devices respectively. The resource cache request may also be referred to as a resource request.
Specifically, the resource in this embodiment is a resource requested by at least two terminals.
The second server in this embodiment may be a server directly communicating with the first server, or may be a server indirectly communicating with the first server. In the architecture shown in fig. 2, the second server may be a resource server of the CP/SP system, or may be any upper-level cache server of the first server. For example: the first server is a cache server of the highest level in the CDN system and can communicate with a resource server of the CP/SP system, and the second server can be the resource server of the CP/SP system; and under the condition that the first server is a cache server which is not the highest level in the CDN system and cannot communicate with the resource server of the CP/SP system, the second server is any upper-layer cache server of the first server and can also be the resource server of the CP/SP system.
The first server receives resource acquisition requests respectively sent by at least two pieces of terminal equipment, and determines that resources requested by the resource acquisition requests respectively sent by the at least two pieces of terminal equipment are the same.
After determining that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same, the first server sends a resource cache request to the second server so as to acquire a first part of the resource from the second server, wherein the first part is all or part of the resource. The resource caching request is obtained according to a first resource obtaining request, and the first resource obtaining request is one of resource obtaining requests respectively sent by at least two terminal devices. Optionally, the first resource obtaining request may be a resource obtaining request received first in resource obtaining requests respectively sent by at least two terminal devices.
That is to say, after receiving the resource acquisition requests respectively sent by the at least two terminal devices, the first server sends a resource caching request to the second server according to one of the resource acquisition requests. That is, the first server does not request the second server to cache the same resource for multiple times according to the received resource acquisition requests, but requests the second server to cache the resource once according to one of the resource acquisition requests. Therefore, the resource acquisition method of the embodiment can effectively reduce the load of the second server when at least two terminal devices send the resource acquisition request to the first server in parallel; that is, under the system architecture shown in fig. 2, the resource obtaining method of this embodiment may effectively reduce the load of the resource server of the CP/SP system and/or the upper-layer cache service of the cache server when at least two terminal devices send resource obtaining requests to the cache server of the CDN system in parallel.
For the first portion to be all or part of the resource:
in the first case, the first part is all of the resource, and in this case, before the first server sends the resource caching request to the second server, the method further includes: the first server determines that all of the resource is not cached in the first server. Here, all of the resources not cached in the first server may have two meanings as follows: one meaning is: the whole content of the resource is not cached in the first server, and the other meaning is that: a portion of the content of the resource is cached at the first server and another portion of the content of the resource is cached at the first server. That is, when a part of the content of the resource is cached in the first server, the second server may be requested to cache the entire resource.
In a second case, the first part is a part of the resource, and before the first server sends the resource caching request to the second server, the method further includes: the first server determines that a first portion of the resource is not cached in the first server and that portions of the resource other than the first portion are cached. In this case, the first server requests the second server only to cache the portion of the resource that is not cached in the first server.
Step S303, the second server sends the first part of the resource to the first server according to the resource caching request.
Specifically, after receiving the resource caching request, the second server sends the first part of the resource stored in the second server to the first server.
Wherein the first portion of the resource may have been stored in the second server prior to the second server receiving the resource cache request.
In addition, if the second server is a server directly communicating with the first server and the first part of the resource is acquired from a third server after the second server receives the resource caching request, under the architecture shown in fig. 2, the third server is a resource server of the CP/SP system or the third server is any upper-layer caching server of the second server in the CDN system. At this time, the third server may be a server directly communicating with the second server, and may also be a server indirectly communicating with the second server.
Accordingly, after receiving the resource caching request, the second server may obtain the first part of the first resource from the third server as follows: the second server sends a resource caching request to the third server to obtain a second part of the first resource from the third server, wherein the second part is all or part of the first part. And under the condition that the second part is the whole of the first part, the second server forwards the resource cache request received from the first server to the third server, under the condition that the second part is the part of the first part, the resource cache request sent to the third server by the second server is used for requesting the second part of the first resource, and the content requested by the resource cache request sent to the third server by the second server is different from the content requested by the resource cache request received from the first server by the second server.
For all or part of the first part of the resource, the second part may refer to the aforementioned description that the first part is all or part of the resource, and is not described herein again.
In short, when the first part of the resource is acquired, the highest-level server among the servers capable of receiving the resource caching request is a server capable of ensuring that the first server can acquire the first part of the first resource. The content requested by the resource caching request received by each server capable of receiving the resource caching request can be the same or different.
Step S304, the first server sends the resource to at least two terminal devices.
Specifically, the first server sends the resource to at least two terminal devices after acquiring the first part of the resource from the second server. It is understood that, when the first portion of the resource is the portion of the resource, the first server obtains all of the resource after obtaining the first portion of the resource from the second server and adding the portion, except the first portion of the resource, cached by the first server, and sends the resource to the second server.
In the method of this embodiment, when at least two terminal devices request the same resource from the first server in parallel, the resource caching request sent by the first server to the second server is obtained according to one of the resource obtaining requests, that is, the first server requests the second server to cache the resource only once. Therefore, the resource acquisition method of the embodiment can effectively reduce the load of the second server when at least two terminal devices send the resource acquisition request to the first server in parallel. That is, when acquiring resources based on the CDN system, the resource acquisition method of this embodiment may effectively reduce a load of a resource server of the CP/SP system and/or an upper-layer cache service of the cache server when at least two terminal devices concurrently send a resource acquisition request to the cache server of the CDN system.
The following takes the first server as a cache server of the CDN system and the second server as a resource server of the CP/SP system as an example, and adopts the embodiments shown in fig. 4 and 5 to describe in detail the resource obtaining method in the embodiment shown in fig. 3.
Fig. 4 is a signaling interaction diagram of a resource acquisition method according to another embodiment of the present application. Referring to fig. 4, the method of the present embodiment includes:
step S401, at least two terminal devices respectively send resource obtaining requests to the cache server, where the resources requested by the resource obtaining requests are the same.
Specifically, the specific implementation of this embodiment refers to step S301 in the embodiment shown in fig. 3, and is not described herein again.
Step S402, the cache server determines that the resources requested by the resource obtaining requests respectively sent by the at least two terminal devices are the same, and determines the information of the resource according to a first resource obtaining request, where the first resource obtaining request is one of the resource obtaining requests respectively sent by the at least two terminal devices.
Specifically, the resource in this embodiment is a resource requested by at least two terminals in step S401.
The cache server receives the resource acquisition requests respectively sent by the at least two terminal devices, and determines that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same. After determining that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same, the cache server determines the information of the resource according to one first resource acquisition request.
The information of the resource may include an identifier corresponding to the resource. When the resource is a complete resource, the identifier corresponding to the resource may be the identifier of the resource; when the resource is a partial resource, the identifier corresponding to the resource may be an identifier of a complete resource corresponding to the resource, where the resource is a part of the complete resource corresponding to the resource.
When the resource is a partial resource, the information of the resource may further include a byte range indicating the resource. When the resource is a partial resource, the resource acquisition requests sent by the at least two terminals may be Range requests.
The form of the byte Range indicating the resource in the resource information included in the resource acquisition request (Range request) is explained below by way of several examples.
The header format of the Range request is as follows: in Range, bytes is 10-, which means that the resource requested by the terminal device is the data from the 10 th byte of a certain complete resource to the last byte of the complete resource. In this case, the byte range indicating the resource is the 10 th byte and later. Since the total byte number of the complete resource corresponding to the resource is unknown, in this format, the cache server can only obtain the start byte indicating the byte range of the resource, and cannot obtain the end byte indicating the byte range of the resource.
The header format of the Range request is as follows: the bytes is 40-100, which means that the resource requested by the terminal device is data between the 40 th byte and the 100 th byte of a certain complete resource. At this time, the byte range indicating the resource is from the 40 th byte to the 100 th byte, that is, under the format, the cache server can obtain the start byte indicating the byte range of the resource and also can obtain the end byte indicating the byte range of the resource.
Step S403, the cache server determines that all the resources are not cached in the cache server according to the information of the resources.
Specifically, the cache server determines, according to an identifier corresponding to the resource included in the information of the resource, that the cache server does not cache the complete resource indicated by the identifier, and accordingly, does not cache the resource. Or, the cache server determines, according to the identifier corresponding to the resource and the byte range indicating the resource, that the cache server does not cache all data in the byte range of the complete resource indicated by the identifier, that is, determines that the cache server does not cache all the resource.
The meaning of "all of the resource is not cached in the cache server" in this embodiment is the same as the meaning of "all of the resource is not cached in the cache server" in the embodiment shown in fig. 3, and details are not described here.
Step S404, the cache server forwards a first resource obtaining request to the resource server, where the first resource obtaining request is a resource cache request.
Specifically, after determining that all the resources are not cached, the cache server forwards the first resource acquisition request to the resource server, where the first resource acquisition request is a resource cache request, and the number of the resource cache requests is 1.
It will be appreciated that in the case where the cache server is not in direct communication with the resource server, the cache server will forward the first resource acquisition request layer by layer to the highest level cache server that is capable of communicating directly with the resource server, which in turn forwards the first resource acquisition request to the resource server.
Step S405, the resource server sends the resource to the cache server.
Specifically, after receiving the resource caching request, the resource server obtains the resource stored in the resource server according to the resource caching request, and sends the resource to the caching server.
Step S406, the cache server sends the resource to at least two terminal devices.
Specifically, after receiving the resource, the cache server sends the resource to the at least two terminal devices.
In the method of this embodiment, when at least two terminal devices request the same resource to the cache server of the CDN system in parallel, the resource cache request sent by the cache server to the resource server is according to one of the resource acquisition requests, that is, the cache server requests the resource server to cache the resource only once. Therefore, the resource obtaining method of this embodiment may effectively reduce the load of the resource server of the CP/SP system when at least two terminal devices send the resource obtaining request to the cache server of the CDN system in parallel.
In order to further reduce the load of the resource server with respect to the embodiment shown in fig. 4, another resource acquisition method is proposed in the embodiment of the present application, and is described in detail below with reference to fig. 5. Fig. 5 is a signaling interaction diagram of a resource acquisition method according to another embodiment of the present application. Referring to fig. 5, the method of the present embodiment includes:
step S501, at least two terminal devices respectively send resource obtaining requests to a cache server, where resources requested by the resource obtaining requests are the same.
Specifically, the specific implementation of this embodiment refers to step S301 in the embodiment shown in fig. 3, and is not described herein again.
Step S502, the cache server determines that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same, and determines the information of the resource according to a first resource acquisition request, where the first resource acquisition request is one of the resource acquisition requests respectively sent by the at least two terminal devices.
Specifically, the specific implementation of this embodiment refers to step S402 in the embodiment shown in fig. 4, and details are not repeated here.
Step S503, the cache server determines that there are other resource acquisition requests, which are the same as the resource part, for the requested other resources in the received other resource acquisition requests, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
Specifically, the resource in this embodiment is a resource requested by at least two terminals in step S501.
The cache server may also receive other resource acquisition requests sent by other terminal devices in parallel, and the cache server may determine whether there is a resource acquisition request for which other requested resources are the same as the resource part in the other cache requests, and if so, the cache server determines that there is a resource acquisition request for which other requested resources are the same as the resource part in the other received resource acquisition requests.
Wherein step S503 is optional.
Step S504, the cache server divides the resource into at least two sub-resources.
Specifically, in the first embodiment, the cache server divides the resource into at least two sub-resources, including: the cache server obtains at least two byte ranges according to the preset byte number, each byte range indicates one of the at least two sub-resources, and the byte number included in the byte range in each byte range is smaller than or equal to the preset byte number.
When the resource is a complete resource, the cache server obtains at least two byte ranges according to the preset byte number. Exemplarily, the following steps are carried out: the preset number of bytes is 2 mbytes, then the 1 st byte range of the at least two byte ranges is from the 1 st byte to the 2 × 1024 × 1024 bytes, the 1 st byte to the 2 × 1024 × 1024 bytes indicate the 1 st sub-resource of the at least two sub-resources, the 2 nd byte range is from the (2 × 1024 × 1024+1) th byte to the 4 × 1024 × 1024+1) th byte, the (2 × 1024 × 1024+1) th byte to the 4 × 1024 × 1024 byte indicate the 2 nd sub-resource of the at least two sub-resources, and so on, to obtain a plurality of byte ranges.
In the case that the resource is a partial resource, the information of the resource includes a byte range indicating the resource, and the byte range includes a start byte or a stop byte, the method of obtaining at least two sub-byte ranges is the same as the method of obtaining at least two byte ranges when the resource is a complete resource, and details thereof are not repeated here.
When the resource is a partial resource, the information of the resource includes a total byte range indicating the resource, and the total byte range includes a start byte and a stop byte, acquiring at least two byte ranges according to a preset byte number, including: the cache server divides the total byte range indicating the resource into at least two sub-byte ranges according to a preset number of bytes.
Illustratively, the total bytes indicating the resource range from 10 th byte to 4 x 1024 bytes, the preset number of bytes is 1024 x 1024 bytes, the 10 th byte to the (1024 × 1024-11) th byte are a1 st byte range of the at least two byte ranges, the (1024 × 1024-10) th byte to the (2 × 1024 × 1024-11) th byte range of the at least two byte ranges, the (2 × 1024-10) th byte to the (3 × 1024 × 1024-11) th byte are a 3 rd byte range of the at least two byte ranges, the (3 × 1024 × 1024-10) th byte to the (4 × 1024 × 1024-11) th byte are a 4 th byte range of the at least two byte ranges, and the (4 × 1024 × 1024-10) th byte to the (4 × 1024 × 1024) th byte are a 5 th byte range of the at least two byte ranges. The above-mentioned 5-byte range indicates one sub-resource of the resource, respectively, i.e. the resource is divided into 5 sub-resources.
In a second embodiment, the cache server divides the resource into at least two sub-resources, including: the cache server determines the part of the cache server cached with the resource; the cache server divides the resource into at least two sub-resources according to the portion of the resource cached in the cache server.
Illustratively, the resource is a complete resource, the cache service determines that bytes 1 to b of the resource are cached, and bytes after the byte b are not cached, then the data between the bytes 1 to b (including the bytes 1 and b) is one of at least two sub-resources, and the data of bytes b +1 and b +1 are another of the at least two sub-resources.
If the implementation that the cache server divides the resource into at least two sub-resources is the second implementation, step S503 may not exist.
Step S505, the cache server obtains at least one resource cache request according to the at least two sub-resources and the information of the resource, where each resource cache request is used to request one of the at least two sub-resources.
Specifically, when the cache server divides the resource into at least two sub-resources in the first manner described above, and when the information of the resource includes the identifier corresponding to the resource, the cache server obtains at least one resource cache request according to the at least two sub-resources and the information of the resource, including:
a1, for any first sub-resource in at least two sub-resources, the cache server determines whether the first sub-resource is cached in the cache server.
Specifically, in the case that the first byte range of the at least two byte ranges indicates the first sub-resource, the cache server determines whether the data in the first byte range (i.e., the first sub-resource) is cached in the cache server according to the first byte range.
a2, if not, obtaining the resource cache request corresponding to the first sub-resource according to the first sub-resource and the identifier of the resource.
Specifically, if the first sub-resource is not cached in the cache server, the cache server generates a resource cache request corresponding to the first sub-resource according to the first byte range and the identifier corresponding to the resource. And the resource cache request corresponding to the first sub-resource is used for requesting the first sub-resource.
It is understood that, for each of the at least two sub-resources, the operations a 1-a 2 are performed, and at least one resource cache request is finally obtained.
In this embodiment, "the cache server divides the resource into at least two sub-resources, and the cache server obtains at least one resource cache request according to the at least two sub-resources and the information of the resource," when a part of the resource is cached in the cache server, the size of the resource that the cache server requests the resource server for caching may be reduced when the terminal device requests the resource, so as to further reduce the load of the resource server.
Step S506, the cache server sends at least one resource cache request to the resource server to obtain a first part of the resource from the resource server, where the first part is all or part of the resource.
Under the condition that the cache server is not in direct communication with the resource server, the cache server forwards at least one resource cache request to the highest-level cache server capable of being in direct communication with the resource server layer by layer, and the highest-level cache server forwards at least one resource cache request to the resource server.
Specifically, the cache server sends at least one resource cache request to the resource server, which can be implemented in the following ways, but is not limited to the following implementation manners:
the first embodiment: when the number of the resource cache requests is N and N is greater than 1, the cache server sends at least one resource cache request to the resource server, and the method comprises the following steps:
b1, the cache server determines to acquire the sub-resource of the resource requested by the n-1 th resource cache request;
b2, the cache server sends an nth resource cache request to the resource server, the last byte of the sub-resource requested by the (N-1) th resource cache request is the mth byte of the resource, the first byte of the sub-resource requested by the nth resource cache request is the (m +1) th byte of the resource, N is 1, … N, and m is an integer greater than 1.
That is, the nth resource caching request is sent after the caching server determines to acquire the sub-resource of the resource requested to be cached by the nth-1 resource caching request.
The scheme is suitable for the situation that the resource is a complete resource and is also suitable for the situation that the resource is a partial resource.
When the resource is a complete resource, because the total byte number of the resource cannot be acquired, after the cache server sends the nth resource cache request to the resource server, if the cache server does not receive the sub-resource of the resource requested by the nth resource cache request, or the cache server only receives the part of the sub-resource of the resource requested by the nth resource cache request, it indicates that the nth resource cache request is the last resource acquisition request, and the byte range may not be continuously acquired according to the preset bytes and the resource cache request may be generated.
When the other resource acquisition requests received by the cache server have the resource acquisition requests of other requested resources which are the same as the resource part, the implementation method can reduce the probability of requesting the resource server for caching the same part of the resources and other resources for multiple times when the terminal equipment requests the resources, and further reduce the load of the resource server. For example, for some super-heat resources (e.g., hot-spot APPs put on shelves, hot videos put on shelves, etc.), when a large number of users access different parts of the super-heat resources at the same time, the number of users accessing the CP/SP resource server can be effectively reduced, that is, the load of the CP/SP resource server is effectively reduced, and the distribution capability of the CDN system is improved.
Illustratively, the resource is the 1 st byte to the 40 th byte of the complete resource corresponding to the resource, and there are other resources to obtain other resources for the request as the 21 st byte to the 60 th byte of the complete resource; the default byte is 20, and for the resource, it indicates that the 1 st byte to the 40 th byte of the resource are divided into two byte ranges: bytes 1 to 20, bytes 21 to 40; the 21 st byte to the 60 th byte indicating the other resources are divided into two byte ranges corresponding to the other resources: bytes 21 to 40, and bytes 41 to 60. For the resource, after determining that the sub-resources indicated by the 1 st byte to the 20 th byte of the complete resource are not cached, the cache server generates a1 st resource acquisition request for requesting the sub-resources indicated by the 1 st byte to the 20 th byte of the complete resource, sends the 1 st resource acquisition request to the resource server, after receiving the 1 st resource acquisition request, the resource server sends the sub-resources indicated by the 1 st byte to the 20 th byte of the complete resource to the cache server, and the cache server receives the sub-resources indicated by the 1 st byte to the 20 th byte of the complete resource. Meanwhile, for the other resources, after determining that the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource are not cached, the cache server generates a1 st resource acquisition request for requesting the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource, sends the 1 st resource acquisition request to the resource server, after receiving the 1 st resource acquisition request, the resource server sends the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource to the cache server, and the cache server receives the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource. At this time, for the resource, after the cache server receives the sub-resources indicated by the 1 st byte to the 20 th byte of the complete resource, when determining whether the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource are cached, the cache server caches the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource, and therefore, for the resource, it is not necessary to send a resource acquisition request for requesting the sub-resources indicated by the 21 st byte to the 40 th byte of the complete resource to the resource server again.
The second embodiment: when the number of the resource cache requests is N and N is larger than 1, the cache server sends the N resource acquisition requests to the resource server in parallel after the N resource acquisition requests are all acquired, or immediately sends the (N +1) th resource acquisition request after the nth resource acquisition request is sent; the last byte of the sub-resource requested to be cached by the N-1 th resource caching request is the mth byte of the resource, the first byte of the sub-resource requested to be cached by the nth resource caching request is the m +1 th byte of the resource, N is 1, … N, and m is an integer greater than 1.
The resource that is suitable for the request in this embodiment is a partial resource, the information of the resource includes the byte range indicating the resource, and the byte range includes the start byte and the end byte, so the number N of the byte ranges into which the byte range indicating the resource is divided can be known at this time.
This embodiment may improve the efficiency of the cache server to cache the resource, thereby also improving the efficiency of the at least two terminals to obtain the resource in step S501.
Third embodiment: when the number of the resource caching requests is N and N is greater than 1 and the number of the sub-resources of the resource divided is L, after the cache server determines that the L-1 th sub-resource is not cached in the cache server, the cache server generates an N-1 th resource obtaining request corresponding to the L-1 th sub-resource, and then sends the N-1 th resource obtaining request to the resource server; then the cache server determines whether the first sub-resource is cached in the cache server, if not, an nth resource acquisition request corresponding to the first sub-resource is generated, and then the nth resource acquisition request is sent to the resource server; and repeating the steps until the Nth resource acquisition request is acquired, and sending the Nth resource acquisition request to the cache server. The l-1 th sub-resource is the sub-resource requested to be cached by the n-1 th resource cache request, the last byte of the l-1 th sub-resource is the m-th byte of the resource, and the first byte of the l-1 th sub-resource is the m +1 th byte of the resource; wherein L is 1, … L, N is 1, … N, m is an integer more than 1, and L is more than or equal to N.
The resource that is suitable for the request in this embodiment is a partial resource, the information of the resource includes the byte range indicating the resource, and the byte range includes the start byte and the end byte, so the number N of the byte ranges into which the byte range indicating the resource is divided can be known at this time.
This embodiment may improve the efficiency of the cache server to cache the resource, thereby also improving the efficiency of the at least two terminals to obtain the resource in step S501.
Step S507, the resource server sends the first part of the resource to the cache server, where the first part is all or part of the resource.
Specifically, the specific implementation of this step refers to the specific implementation of step S303 in the embodiment shown in fig. 3, and is not described here again.
Step S508, the cache server sends the resource to at least two terminals.
Specifically, the specific implementation of this step refers to the specific implementation of step S304 in the embodiment shown in fig. 3, and is not described here again.
The method of this embodiment can further reduce the load of the resource server when at least two terminal devices request the same resource from the cache server of the CDN system in parallel.
The resource acquisition method in the present embodiment is described above with reference to fig. 3 to 5, and the resource acquisition device in the present embodiment is described below with reference to fig. 6 to 8.
Fig. 6 is a schematic structural diagram of a resource obtaining apparatus according to an embodiment of the present application, and referring to fig. 6, the apparatus of the embodiment includes: a receiving module 61 and a transmitting module 62.
A receiving module 61, configured to receive resource obtaining requests sent by at least two terminal devices, where resources requested by the resource obtaining requests are the same; a sending module 62, configured to send a resource cache request to a second server, so as to obtain a first part of the resource from the second server, where the first part is all or part of the resource, the resource cache request is obtained by the resource obtaining apparatus according to a first resource obtaining request, and the first resource obtaining request is one of resource obtaining requests sent by the at least two terminal devices, respectively; the sending module 62 is further configured to send the resource to the at least two terminal devices.
The first server in the scheme can be a cache server in a Content Delivery Network (CDN) system, and the second server can be a resource server in a content provider/service provider (CP/SP) system; or, the first server in this scheme may be a first cache server in a content delivery network CDN system, the second server may be a second cache server in the CDN system, and the second cache server is an upper-layer cache server of the first cache server.
It should be understood that the resource obtaining device in the embodiment of the present application may correspond to the first server in the embodiment of the method in the present application, and operations and/or functions of the modules in the resource obtaining device in the embodiment of the present application are respectively for implementing corresponding processes of the methods corresponding to the first server in the embodiment of the method, and are not described herein again for brevity.
Fig. 7 is a schematic structural diagram of a resource obtaining apparatus according to an embodiment of the present application, and referring to fig. 7, the present embodiment further includes, on the basis of the resource obtaining apparatus shown in fig. 6: a processing module 63.
The processing module 63 is configured to determine that the resources requested by the resource obtaining requests respectively sent by the at least two terminal devices are the same before the sending module 62 sends the resource caching request to the second server.
Optionally, the processing module 63 is configured to determine the information of the resource according to the first resource obtaining request before the sending module sends the resource caching request to the second server; the sending module 62 is further configured to send the resource caching request to the second server according to the information of the resource.
Optionally, the number of resource cache requests is 1, and the first portion is all of the resources; the processing module 63 is further configured to determine, according to the information of the resource, that all the resources are not cached in the resource obtaining apparatus; the sending module 62 is further configured to forward the first resource obtaining request to the second server, where the first resource obtaining request is the resource caching request.
Optionally, the processing module 63 is further configured to divide the resource into at least two sub-resources, and obtain at least one resource cache request according to the at least two sub-resources and the information of the resource, where each resource cache request is used to request one of the at least two sub-resources; the sending module 62 is further configured to send at least one resource caching request to the second server.
Optionally, the information of the resource includes an identifier corresponding to the resource, and the processing module 63 is specifically configured to: for any first sub-resource in the at least two sub-resources, determining whether the first server caches the first sub-resource; and if not, acquiring a resource cache request corresponding to the first sub-resource according to the first sub-resource and the identifier corresponding to the resource.
Optionally, the processing module 63 is specifically configured to: and acquiring at least two byte ranges according to a preset byte number, wherein each byte range indicates one of the at least two sub-resources, and the byte number included in the byte range of the at least two byte ranges is less than or equal to the preset byte number.
Optionally, when the information of the resource includes a total byte range indicating the resource, and the total byte range includes a start byte and a stop byte, the processing module 63 is specifically configured to: and dividing the total byte range indicating the resources into the at least two byte ranges according to the preset byte number.
Optionally, the processing module 63 is specifically configured to: determining that the first server caches the portion of the resource; dividing the resource into at least two sub-resources according to the portion of the resource cached by the first server.
Optionally, when the number of resource cache requests is N and N is greater than 1, the processing module 63 is further configured to: determining to obtain the sub-resources of the resources requested by the (n-1) th resource cache request; the sending module 62 is further configured to send an nth resource cache request to the second server, where a last byte of a sub-resource of the resource requested by the nth-1 resource cache request is an mth byte of the resource, a first byte of the sub-resource of the resource requested by the nth resource cache request is an m +1 th byte of the resource, N is 1, … N, and m is an integer greater than 1.
Optionally, the processing module 63 is further configured to determine, before dividing the resource into at least two sub-resources, that there is a resource acquisition request in which other requested resources are partially the same as the resource in the received other resource acquisition requests, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
It should be understood that the resource obtaining device in the embodiment of the present application may correspond to the first server in the embodiment of the method in the present application, and operations and/or functions of the modules in the resource obtaining device in the embodiment of the present application are respectively for implementing corresponding processes of the methods corresponding to the first server in the embodiment of the method, and are not described herein again for brevity.
It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation. Each functional module in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Fig. 8 is a schematic structural diagram of a server according to an embodiment of the present application. As shown in fig. 8, the server 800 described in this embodiment may be the first server (or a component that may be used for the first server) mentioned in the foregoing method embodiments. The server 800 may be configured to implement the method corresponding to the first server described in the above method embodiment, and refer to the description in the above method embodiment specifically.
The server 800 may comprise one or more processors 801, where the processors 801 may also be referred to as processing units and may implement certain control or processing functions. The processor 801 may be a general purpose processor, a special purpose processor, or the like. For example, a baseband processor, or a central processor. The baseband processor may be used to process communication protocols and communication data, and the central processor may be used to control the server 800, execute software programs, and process data of the software programs.
In an alternative design, processor 801 may also have stored instructions 803 or data (e.g., intermediate data). The instructions 803 may be executed by the processor, so that the server 800 executes the method corresponding to the first server described in the above method embodiment.
In yet another possible design, server 800 may include circuitry that may perform the functions of transmitting or receiving or communicating in the foregoing method embodiments.
Optionally, the server 800 may include one or more memories 802, on which instructions 804 may be stored, the instructions being executable on the processor to cause the server 800 to perform the methods described in the above method embodiments.
Optionally, the memory may also store data. The processor and the memory may be provided separately or may be integrated together.
Optionally, the server 800 may further include a transceiver 805. The processor 801 may be referred to as a processing unit and controls the server 800 to implement the method in the above method embodiment. The transceiver 805 may be referred to as a transceiver unit, a transceiver, a transceiving circuit, a transceiver, or the like, and is used for implementing transceiving functions of a server.
For the specific implementation process of the transceiver 805 and the processor 801, reference may be made to the description of the foregoing embodiments, and details are not described herein.
The processor 801 and transceiver 805 described herein may be implemented on an Integrated Circuit (IC), an analog IC, a Radio Frequency Integrated Circuit (RFIC), a mixed signal IC, an Application Specific Integrated Circuit (ASIC), a Printed Circuit Board (PCB), an electronic device, or the like. The processor and transceiver may also be fabricated using various 1C process technologies, such as Complementary Metal Oxide Semiconductor (CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (PMOS), Bipolar Junction Transistor (BJT), bipolar CMOS (bicmos), silicon germanium (SiGe), gallium arsenide (GaAs), and the like.
It should be understood that the processor mentioned in the embodiments of the present Application may be a Central Processing Unit (CPU), and may also be other general purpose processors, Digital Signal Processors (DSP), Application Specific Integrated Circuits (ASIC), Field Programmable Gate Arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory referred to in the embodiments of the application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double data rate Synchronous Dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous link SDRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) is integrated in the processor.
It should be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
An embodiment of the present application provides a computer-readable storage medium, on which instructions are stored, and when executed, the instructions perform a method corresponding to the first server in the foregoing method embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

Claims (20)

1. A resource acquisition method, comprising:
the method comprises the steps that a first server receives resource acquisition requests sent by at least two pieces of terminal equipment respectively, wherein the resources requested by the resource acquisition requests are the same;
the first server sends a resource caching request to a second server so as to acquire a first part of the resource from the second server, wherein the first part is all or part of the resource, the resource caching request is obtained according to a first resource acquisition request, and the first resource acquisition request is one of resource acquisition requests respectively sent by the at least two terminal devices;
and the first server sends the resource to the at least two terminal devices.
2. The method of claim 1, prior to the first server sending the resource cache request to the second server, further comprising:
and the first server determines that the resources requested by the resource acquisition requests respectively sent by the at least two terminal devices are the same.
3. The method of claim 1 or 2, before the first server sends the resource cache request to the second server, further comprising:
the first server determines the information of the resource according to the first resource acquisition request;
the first server sending the resource caching request to the second server, including:
and the first server sends the resource caching request to the second server according to the information of the resource.
4. The method of claim 3, wherein the number of the resource caching requests is 1, and the first portion is all of the resource, and the sending, by the first server, the resource caching request to the second server according to the information about the resource comprises:
the first server determines that all the resources are not cached in the first server according to the information of the resources;
and the first server forwards the first resource obtaining request to the second server, wherein the first resource obtaining request is the resource caching request.
5. The method of claim 3, wherein the sending, by the first server, the resource caching request to the second server according to the information about the resource comprises:
the first server dividing the resource into at least two sub-resources;
the first server acquires at least one resource cache request according to the at least two sub-resources and the information of the resources, wherein each resource cache request is used for requesting one of the at least two sub-resources;
the first server sends at least one resource caching request to the second server.
6. The method according to claim 5, wherein the information about the resource includes an identifier corresponding to the resource, and the obtaining, by the first server, at least one resource cache request according to the at least two sub-resources and the information about the resource includes:
for any first sub-resource in the at least two sub-resources, the first server determines whether the first server caches the first sub-resource;
and if not, the first server acquires a resource cache request corresponding to the first sub-resource according to the first sub-resource and the identifier corresponding to the resource.
7. The method of claim 5 or 6, wherein the dividing the resource into at least two sub-resources comprises:
the first server obtains at least two byte ranges according to a preset byte number, each byte range indicates one of the at least two sub-resources, and the byte number included in the byte range of the at least two byte ranges is smaller than or equal to the preset byte number.
8. The method of claim 7, wherein in the case that the information of the resource includes a total byte range indicating the resource and the total byte range includes a start byte and a stop byte, the obtaining at least two byte ranges according to a preset byte number comprises:
and the first server divides the total byte range indicating the resources into the at least two byte ranges according to the preset byte number.
9. The method of claim 5, wherein the dividing the resource into at least two sub-resources comprises:
the first server determining that the first server caches the portion of the resource;
the first server divides the resource into at least two sub-resources according to the portion of the resource cached by the first server.
10. The method according to any one of claims 5 to 8, wherein when the number of the resource cache requests is N and N is greater than 1, the sending, by the first server, at least one of the resource cache requests to the second server includes:
the first server determines to acquire the sub-resource of the resource requested by the (n-1) th resource cache request;
the first server sends an nth resource caching request to the second server, the last byte of the sub-resource of the resource requested by the nth-1 resource caching request is the mth byte of the resource, the first byte of the sub-resource of the resource requested by the nth resource caching request is the m +1 byte of the resource, N is 1, … N, and m is an integer greater than 1.
11. The method according to any one of claims 5 to 8, wherein before the first server divides the resource into at least two sub-resources, the method further comprises:
the first server determines that there are resource acquisition requests of other requested resources, which are partially the same as the resources, in other received resource acquisition requests, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
12. The method according to any one of claims 1 to 11, wherein the first server is a cache server in a Content Delivery Network (CDN) system, and the second server is a resource server in a content provider/service provider (CP/SP) system; alternatively, the first and second electrodes may be,
the first server is a first cache server in a Content Delivery Network (CDN) system, the second server is a second cache server in the CDN system, and the second cache server is an upper-layer cache server of the first cache server.
13. A resource acquisition apparatus, comprising:
the terminal equipment comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving resource acquisition requests respectively sent by at least two pieces of terminal equipment, and the resources requested by the resource acquisition requests are the same;
a sending module, configured to send a resource cache request to a second server, so as to obtain a first part of the resource from the second server, where the first part is all or part of the resource, the resource cache request is obtained according to a first resource obtaining request, and the first resource obtaining request is one of resource obtaining requests sent by the at least two terminal devices, respectively;
the sending module is further configured to send the resource to the at least two terminal devices.
14. The apparatus of claim 13, further comprising a processing module;
the processing module is configured to determine that the resources requested by the resource obtaining requests respectively sent by the at least two terminal devices are the same before the sending module sends the resource caching request to the second server.
15. The apparatus of claim 13 or 14, further comprising a processing module;
the processing module is used for determining the information of the resource according to the first resource acquisition request before the sending module sends the resource caching request to the second server;
the sending module is further configured to send the resource caching request to the second server according to the information of the resource.
16. The apparatus of claim 15, wherein the number of resource cache requests is 1, and the first portion is all of the resource;
the processing module is further configured to determine, according to the information of the resource, that all of the resource is not cached in the resource obtaining apparatus;
the sending module is further configured to forward the first resource obtaining request to the second server, where the first resource obtaining request is the resource cache request.
17. The apparatus of claim 15, wherein the processing module is further configured to: dividing the resource into at least two sub-resources, and obtaining at least one resource cache request according to the at least two sub-resources and the information of the resource, wherein each resource cache request is used for requesting one of the at least two sub-resources;
the sending module is further configured to send at least one resource caching request to the second server.
18. The apparatus of claim 17, wherein the processing module is further configured to determine, before dividing the resource into at least two sub-resources, that there is a resource acquisition request with the requested other resource partially identical to the resource in the received other resource acquisition requests, where the other resource acquisition requests are resource acquisition requests other than the resource acquisition requests respectively sent by the at least two terminal devices.
19. A server for implementing the resource acquisition method according to any one of claims 1 to 12.
20. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program; the computer program, when executed, implementing a method as claimed in any one of claims 1 to 12.
CN201910223760.1A 2019-03-22 2019-03-22 Resource acquisition method and device Pending CN111726387A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910223760.1A CN111726387A (en) 2019-03-22 2019-03-22 Resource acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910223760.1A CN111726387A (en) 2019-03-22 2019-03-22 Resource acquisition method and device

Publications (1)

Publication Number Publication Date
CN111726387A true CN111726387A (en) 2020-09-29

Family

ID=72563631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910223760.1A Pending CN111726387A (en) 2019-03-22 2019-03-22 Resource acquisition method and device

Country Status (1)

Country Link
CN (1) CN111726387A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101998682A (en) * 2009-08-27 2011-03-30 中兴通讯股份有限公司 Device and method for acquiring service content by personal network equipment and related device thereof
CN104185036A (en) * 2014-09-10 2014-12-03 北京奇艺世纪科技有限公司 Video file source returning method and device
CN105872587A (en) * 2015-11-25 2016-08-17 乐视云计算有限公司 Video request processing method and device
CN105978936A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 CDN server and data caching method thereof
CN108234639A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 A kind of data access method and device based on content distributing network CDN

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101998682A (en) * 2009-08-27 2011-03-30 中兴通讯股份有限公司 Device and method for acquiring service content by personal network equipment and related device thereof
CN104185036A (en) * 2014-09-10 2014-12-03 北京奇艺世纪科技有限公司 Video file source returning method and device
CN105872587A (en) * 2015-11-25 2016-08-17 乐视云计算有限公司 Video request processing method and device
CN105978936A (en) * 2016-04-25 2016-09-28 乐视控股(北京)有限公司 CDN server and data caching method thereof
CN108234639A (en) * 2017-12-29 2018-06-29 北京奇虎科技有限公司 A kind of data access method and device based on content distributing network CDN

Similar Documents

Publication Publication Date Title
CN108696895B (en) Resource acquisition method, device and system
US8175584B2 (en) System and method to facilitate downloading data at a mobile wireless device
CN104836821B (en) A kind of network accelerating method based on router device, device and equipment
CN111800744B (en) Communication method and device
CN112566072B (en) NF-based communication method, device and storage medium
CN102394880B (en) Method and device for processing jump response in content delivery network
US9479607B2 (en) Content caching and delivering system with traffic of repetitively requested content reduced
US8903972B2 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN110022329B (en) File transmission method and device, computer readable storage medium and computer equipment
CN102006568A (en) Method, equipment and system for providing portrait service
US9900368B2 (en) Method for optimising downloading of data
US20200288385A1 (en) Access control method and device, and computer-readable medium
CN114095869A (en) Method, device and system for scheduling multi-access edge computing nodes for terminal
US20140282788A1 (en) System for controlling video distribution in response to a request on reduced video data traffic and a method therefor
WO2012019391A1 (en) System and method for obtaining detail information of number
US20160088076A1 (en) Method, device and system for obtaining mobile network data resources
CN111726387A (en) Resource acquisition method and device
CN111262779A (en) Method, device, server and system for acquiring data in instant messaging
CN112968939B (en) Mobile terminal resource loading method and device
US20150288734A1 (en) Adaptive leveraging of network information
KR101000109B1 (en) Apparatus for providing message search service and method thereof
CN110677489B (en) Media resource processing method, device, system and storage medium
CN103379157A (en) Method, device, equipment and system for transmitting information
CN110431804B (en) Content deployment method and distribution controller
CN110913008A (en) Data transmission method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200929