CN111625743A - Resource loading method and device and electronic equipment - Google Patents

Resource loading method and device and electronic equipment Download PDF

Info

Publication number
CN111625743A
CN111625743A CN202010437981.1A CN202010437981A CN111625743A CN 111625743 A CN111625743 A CN 111625743A CN 202010437981 A CN202010437981 A CN 202010437981A CN 111625743 A CN111625743 A CN 111625743A
Authority
CN
China
Prior art keywords
resource
client
identifier
content distribution
broadcast message
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.)
Granted
Application number
CN202010437981.1A
Other languages
Chinese (zh)
Other versions
CN111625743B (en
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.)
Guangzhou Huaduo Network Technology Co Ltd
Original Assignee
Guangzhou Huaduo Network Technology 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 Guangzhou Huaduo Network Technology Co Ltd filed Critical Guangzhou Huaduo Network Technology Co Ltd
Priority to CN202010437981.1A priority Critical patent/CN111625743B/en
Publication of CN111625743A publication Critical patent/CN111625743A/en
Application granted granted Critical
Publication of CN111625743B publication Critical patent/CN111625743B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Abstract

The application discloses a resource loading method and device, electronic equipment and a storage medium. The method comprises the following steps: a client receives a broadcast message sent by a service server, wherein the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource; and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource. The method and the device realize the preheating loading of the content distribution node on the resources, reduce the time for the content distribution node to request the resources from the source station, accelerate the first loading speed of the resources and improve the user experience through the preheating loading.

Description

Resource loading method and device and electronic equipment
Technical Field
The present application relates to the field of internet technologies, and in particular, to a resource loading method and apparatus, an electronic device, and a storage medium.
Background
In recent years, with the development of internet technology and the increase of popularity of intelligent terminals, more and more users enrich their lives by browsing web pages, watching videos, engaging in social activities, and the like on the intelligent terminals. In a use scenario of the intelligent terminal, in order to obtain a better experience effect, a user wants to have a resource response time on a mobile network as short as possible. As one mode, a Content Delivery Network (CDN) may be used to cache a resource at a CDN edge node accessed by a user Network, and when a user needs to access the resource, the resource may be obtained from a nearby CDN edge node without obtaining from a server, so that the waiting time of the user is reduced. However, for the resource accessed for the first time, the CDN edge node needs to perform back-to-source processing, and a long time for back-to-source processing may be lengthened in some scenes with a poor network environment, so that the resource loading speed is affected, and the user experience is reduced.
Disclosure of Invention
In view of the foregoing problems, the present application provides a resource loading method, device, electronic device, and storage medium to improve the foregoing problems.
In a first aspect, an embodiment of the present application provides a resource loading method, where the method includes: a client receives a broadcast message sent by a service server, wherein the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource; and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource.
In a second aspect, an embodiment of the present application provides a resource loading method, where the method includes: a service server acquires a resource locator of a resource sent by a client; generating an identification corresponding to the resource based on the resource locator; if the resource is detected to be uploaded for the first time, sending a broadcast message for the first uploading of the resource to a target client, wherein the broadcast message carries the identifier, so that the target client sends a resource preloading request carrying the identifier of the resource to a corresponding content distribution node based on the broadcast message, and the content distribution node preloads the resource to the local based on the identifier of the resource.
In a third aspect, an embodiment of the present application provides a resource loading method, where the method includes: a service server acquires a resource locator of a resource sent by a client; the business server generates an identifier corresponding to the resource based on the resource locator; if the resource is detected to be uploaded for the first time, the service server sends a broadcast message uploaded by the resource for the first time to a target client, wherein the broadcast message carries an identifier of the resource; the client receives the broadcast message sent by the service server; and the client sends a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local.
In a fourth aspect, an embodiment of the present application provides a resource loading apparatus, where the apparatus includes: a message receiving module, configured to receive, by a client, a broadcast message sent by a service server, where the broadcast message is sent when the service server detects that a resource is first uploaded, and the broadcast message carries an identifier of the resource; and the request sending module is used for sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node by the client so as to enable the content distribution node to preload the resource to the local.
In a fifth aspect, an embodiment of the present application provides a resource loading apparatus, where the apparatus includes: the acquisition module is used for the business server to acquire the resource locator of the resource sent by the client; a generating module, configured to generate, by the service server, an identifier corresponding to the resource based on the resource locator; and the message sending module is used for sending a broadcast message for the first uploading of the resource to a target client if the resource is detected to be the first uploading, wherein the broadcast message carries the identifier, so that the target client sends a resource preloading request carrying the identifier of the resource to a corresponding content distribution node based on the broadcast message, and the content distribution node preloads the resource to the local based on the identifier of the resource.
In a sixth aspect, an embodiment of the present application provides an electronic device, including a memory and one or more processors; one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of the first aspect or the second aspect.
In a seventh aspect, this application provides a computer-readable storage medium, in which a program code is stored, where the program code is executed by a processor to perform the method according to the first aspect or the second aspect.
According to the resource loading method, the resource loading device, the electronic equipment and the storage medium provided by the embodiment of the application, the broadcast message sent by the service server is received through the client, wherein the broadcast message is sent when the service server detects that the resource is uploaded for the first time, the broadcast message carries the identifier of the resource, and then the resource preloading request carrying the identifier of the resource is sent to the corresponding content distribution node, so that the content distribution node can preload the resource to the local. Therefore, through the above mode, the client side sends the resource preloading request carrying the resource identifier to the corresponding content distribution node under the condition that the client side receives the broadcast message sent by the service server when detecting that the resource is uploaded for the first time, so that the content distribution node can preload the resource to the local, the content distribution node can preheat and load the resource, the time length of the content distribution node for requesting the resource from the source station is reduced through preheating and loading, the first-time resource loading speed is accelerated, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of an application environment provided by an embodiment of the present application.
Fig. 2 shows a flowchart of a method for loading a resource according to an embodiment of the present application.
Fig. 3 shows a flowchart of a method for loading a resource according to another embodiment of the present application.
Fig. 4 shows a flowchart of a method for loading a resource according to another embodiment of the present application.
Fig. 5 is a flowchart illustrating a method for loading a resource according to yet another embodiment of the present application.
Fig. 6 shows a flow chart of a timing sequence of a client requesting to access a picture from a content distribution node in the prior art according to an embodiment of the present application.
Fig. 7 is a flow chart illustrating a timing sequence of a client requesting access to a picture from a content distribution node according to an embodiment of the present application.
Fig. 8 shows a block diagram of a resource loading apparatus according to an embodiment of the present application.
Fig. 9 shows a block diagram of a resource loading apparatus according to another embodiment of the present application.
Fig. 10 shows a block diagram of an electronic device according to an embodiment of the present application.
Fig. 11 illustrates a storage unit according to an embodiment of the present application, configured to store or carry program code for implementing a resource loading method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
The CDN is an intelligent virtual network constructed on the basis of the existing network, and by means of edge servers deployed in various places and functional modules of load balancing, content distribution, scheduling and the like of a central platform, a user can obtain required content nearby, network congestion is reduced, and the access response speed and hit rate of the user are improved.
In recent years, with the rapid popularization of intelligent terminals, the mobile internet has become a main way for people to obtain information. More and more users search information through search engines, and the loading speed of the information is very important in user experience. As a mode, a content delivery network may be used to cache a resource in a CDN edge node accessed by a user network, and when a user needs to access the resource, the resource may be obtained from a nearby CDN edge node without obtaining from a server, which reduces the waiting time of the user, thereby accelerating the loading speed of information. However, the inventor finds that, for a resource accessed for the first time, a CDN edge node needs to perform a back-sourcing process, and in some weak network environments, the CDN edge node has problems of a long time (1-10 seconds), unreliable quality (back-sourcing process is prone to fail), and the like during back-sourcing process due to network reasons, which may cause the length of back-sourcing process to be long, thereby affecting the resource loading speed and reducing user experience.
In view of the above problems, the inventors have found through long-term research that a broadcast message sent by a service server can be received by a client, where the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource, and then a resource preloading request carrying the identifier of the resource is sent to a corresponding content distribution node, so that the content distribution node preloads the resource to the local. Therefore, through the above manner, the resource preloading request carrying the resource identifier is sent to the corresponding content distribution node by the client side when the broadcast message sent by the service server when detecting that the resource is uploaded for the first time is received, so that the content distribution node can preload the resource to the local, thereby realizing the pre-heating loading of the content distribution node on the resource, and through the pre-heating loading, the time length of the content distribution node for requesting the resource from the source station to the source is reduced, the first-time loading speed of the resource is accelerated, and the user experience is improved, so that the resource loading method, the device, the electronic device and the storage medium provided by the embodiment of the application are provided.
For the convenience of describing the scheme of the present application in detail, an application environment in the embodiment of the present application is described below with reference to the accompanying drawings.
Referring to fig. 1, an application environment schematic diagram of a resource loading method according to an embodiment of the present application is shown in fig. 1, where the application environment can be understood as a network system 10 according to an embodiment of the present application, where the network system 10 includes: client 12, client 13, CDN origin server 14, and CDN cache server 15.
The CDN origin station server 14 and the CDN cache server 15 may be one server (network access server), a server cluster (cloud server) composed of a plurality of servers, or a cloud computing center (database server). The client 12 and the client 13 may be any devices with communication and storage functions, including but not limited to a PC (Personal Computer), a PDA (tablet Personal Computer), a smart television, a smart phone, a smart wearable device, or other smart communication devices with network connection functions.
Optionally, the client 12 and the client 13 may be clients of an instant messaging application, a social network application, or an internet access application, where the client may be an application client (such as a video playing application in a mobile phone APP), or may be a web page client (such as a browser, a live webcast platform, and the like), and is not limited herein.
Alternatively, the CDN origin server 14 may establish communication connections with the client 12 and the various clients 13 over a network, which may be a wireless network, as one approach.
In one embodiment, the user may upload the resource to the CDN origin server 14 through the client 12, and the CDN origin server 14 may send the resource to each CDN cache server 15 for caching, so that the client 13 may request the resource from the CDN cache server 15 directly. Optionally, if the resource is a resource uploaded for the first time, when the client 13 requests the resource from the CDN cache server 15, the CDN cache server 15 needs to request the CDN origin server 14 for a back source, and in this way, the client 12 and the client 13 may be the same client (i.e., in this way, the client 12 may be identical to the client 13).
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, a flowchart of a resource loading method according to an embodiment of the present application is shown, where the embodiment provides a resource loading method applicable to an electronic device, and the method includes:
step S110: the client receives the broadcast message sent by the service server.
Optionally, the broadcast message in this embodiment is sent by the service server when detecting that there is a resource to be uploaded for the first time, where the broadcast message carries an identifier of the resource to be uploaded for the first time. The resource may be a picture, a file, a page, or the like, and the type and content form of the resource may not be limited in this embodiment. The identifier may be understood as a target resource locator (i.e., a CDN-URL, where the CDN is a CDN cache server corresponding to a client that uploads resources, optionally, the CDN cache server in this embodiment may be understood as a content delivery node, optionally, a CDN cache node closest to the client and/or having the best network condition may be determined according to an IP address of the client as a corresponding content delivery node), and the target resource locator may represent a storage path of resources associated with the client that is generated by the service server, where the storage paths of resources associated with different clients may be different.
As one way, the client may receive the broadcast message sent by the service server based on a long connection channel with the service server. For example, a TCP connection between the client and the service server may be pre-established, in which case the client may receive the broadcast message sent by the service server based on a TCP long connection channel with the service server. For the establishment principle and the establishment process of the TCP connection between the client and the service server, reference may be made to related technologies, which are not described herein again.
Step S120: and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource.
As a manner, after obtaining the identifier of the resource, the client may send a resource preloading request carrying the identifier to the corresponding content distribution node according to the identifier, so that the content distribution node may preload the resource to the local based on the identifier of the resource. The resource is a resource requested by the client for the first time, and the content distribution node can be prompted to load the resource in advance by sending the preloading request, so that the loading time in the resource loading process can be reduced, and the resource loading speed is increased.
After the client sends the resource preloading request carrying the identifier to the corresponding content distribution node, the client may instruct the corresponding content distribution node to send the resource preloading request to the source station server (which may be understood as the CDN source station server), so that the resource corresponding to the identifier of the resource returned by the source station server may be obtained, and thus the corresponding content distribution node may preload the resource locally, reduce resource acquisition or time consumption for waiting in a subsequent service request process, and further improve user experience.
Optionally, the location of the client may be changed, for example, the client may move from location a to location B, and if the distance between location a and location B is long, the content distribution node corresponding to the client may be changed, that is, the content distribution node corresponding to the client in different locations may be different. Optionally, the specific distance between the position a and the position B in this embodiment may not be limited.
Optionally, in the process of changing the location of the client, the network environment may also change, for example, if the location of the client moves from the ground to the underground, the network signal may weaken, and in this way, if the client sends a resource preloading request carrying the identifier of the resource to the corresponding content distribution node, the sending may fail. As a way to improve this problem, after receiving a broadcast message sent by a service server, a client may first detect whether a network environment of a location where the client is located meets a preset condition, optionally, if the network environment of the location where the client is located meets the preset condition, the client may continue to send a resource preloading request carrying an identifier of the resource to a corresponding content distribution node; optionally, if the network environment of the location does not meet the preset condition, the client may delay sending the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, where a specific duration of the delay may be adjusted according to an actual network environment condition. Optionally, the preset condition may be that the network signal of the network environment is greater than a specified threshold, and a specific value of the specified threshold may not be limited.
Optionally, after sending the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, the client may detect whether a preloading request reception success signal returned by the service server is received, and optionally, if it is detected that the preloading request reception success signal returned by the service server is not received, the client may send the resource preloading request carrying the identifier of the resource to the corresponding content distribution node again, or continuously send the resource preloading request carrying the identifier of the resource to the corresponding content distribution node within a period of time, so as to ensure that the preloading request can be successfully sent.
In the resource loading method provided by this embodiment, a broadcast message sent by a service server is received by a client, where the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource, and then a resource preloading request carrying the identifier of the resource is sent to a corresponding content distribution node, so that the content distribution node preloads the resource to the local. Therefore, through the above mode, the client side sends the resource preloading request carrying the resource identifier to the corresponding content distribution node under the condition that the client side receives the broadcast message sent by the service server when detecting that the resource is uploaded for the first time, so that the content distribution node can preload the resource to the local, the content distribution node can preheat and load the resource, the time length of the content distribution node for requesting the resource from the source station is reduced through preheating and loading, the first-time resource loading speed is accelerated, and the user experience is improved.
Referring to fig. 3, a flowchart of a resource loading method according to another embodiment of the present application is shown, where the embodiment provides a resource loading method applicable to an electronic device, and the method includes:
step S210: the client receives the broadcast message sent by the service server.
Step S220: and receiving the position identification of the client sent by the service server.
It will be appreciated that as the location of the client moves, the content distribution node corresponding to the client may change, for example, the content delivery node corresponding to the client at the location a is "CDN-1", the corresponding content delivery node at the position B is "CDN-2", optionally, the content delivery node CDN-1 and the content delivery node CDN-2 are different content delivery nodes, in this way, if the client receives the broadcast message sent by the service server at location a, and its location is changed from location a to location B within a short time (for example, 5 minutes, and the specific time may not be limited), in this way, if the client still sends a resource preloading request to the content distribution node corresponding to location a, poor transmission or transmission failure may be caused by poor network signals. As a way to improve this problem, the client in this embodiment may receive the location identifier of the client sent by the service server, and optionally, the location identifier is an identifier corresponding to the current location of the client.
The client may receive location data, which is periodically read by the service server and is related to the client, and further obtain a current location identifier of the client from the location data.
Step S230: and taking the content distribution node corresponding to the position identification as the corresponding content distribution node.
As one mode, after the location identifier of the client is obtained, the content distribution node corresponding to the location identifier may be used as the content distribution node corresponding to the client. Optionally, different location identifiers may correspond to different content distribution nodes, so that the content distribution node corresponding to the client may be accurately obtained according to the obtained location identifier.
Step S240: and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource.
In the resource loading method provided by this embodiment, the client receives the broadcast message sent by the service server, then receives the location identifier of the client sent by the service server, then uses the content distribution node corresponding to the location identifier as the content distribution node corresponding to the client, and then sends the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, so that the content distribution node preloads the resource locally. The accurate sending of the resource preloading request is realized, so that the accuracy and the reliability of the resource loading are improved. The resource is preheated and loaded by the content distribution node, so that the time for the content distribution node to request the resource from the source station is shortened, the first loading speed of the resource is accelerated, and the user experience is improved.
Referring to fig. 4, a flowchart of a resource loading method according to another embodiment of the present application is shown, where the embodiment provides a resource loading method applicable to an electronic device, and the method includes:
step S310: and the service server acquires the resource locator of the resource sent by the client.
In this embodiment, the service server may be understood as a server corresponding to a browser, and a user may access resources to the service server through a client.
The Resource Locator may be understood as a Uniform Resource Locator (URL). As a mode, after uploading a resource to a CDN origin server for the first time, a client may obtain a URL returned by the CDN origin server, and optionally, a service server may receive the URL uploaded by the client, so that when receiving an access request for the resource, the service server may return an identifier to which the access request points to the corresponding client.
Step S320: generating an identification corresponding to the resource based on the resource locator.
Optionally, after obtaining the resource locator of the resource, the service server may generate an identifier corresponding to the resource based on the resource locator, for example, the service server may replace a URL uploaded by the client with a CDN-URL, and optionally, the CDN may be understood as a CDN cache server corresponding to the client uploading the resource.
Step S330: and if the resource is detected to be uploaded for the first time, sending a broadcast message of the first uploading of the resource to a target client.
Optionally, after generating the identifier corresponding to the resource, the service server may store the resource and the identifier corresponding to the resource in a mapping relationship, and optionally, if it is detected that the identifier identical to the identifier exists in the storage process, the service server may directly store the resource and the identifier identical to the identifier correspondingly. If the identifier identical to the identifier is not detected to exist, the resource can be judged to be uploaded for the first time, in this way, the service server can store the resource and the identifier corresponding to the resource in a correlation manner, and simultaneously send a message for uploading the resource for the first time to the target client, so that the target client can send a resource preloading request carrying the identifier of the resource to the corresponding content distribution node based on the broadcast message, and further the content distribution node can preload the resource to the local based on the identifier of the resource.
Wherein, the broadcast message carries the identifier of the resource. It should be noted that the number of target clients may be multiple, and the specific number may not be limited. In some implementations, the target client and the client uploading the resource may be the same client. For example, if the target client and the client that uploads the resource are the same client, the client uploads the resource to the source station server without storing the resource locally, so that the resource can be requested to be acquired when the resource needs to be used, the memory required by the resource is reduced, and the operation efficiency of the device is improved. Optionally, in other embodiments, the target client and the client that uploads the resource may not be the same client, and in this manner, when it is detected that the resource is first uploaded, the service server may send a broadcast message that the resource is first uploaded to at least one other client.
Alternatively, the service server may determine the target client from the plurality of clients in various ways. For example, as one way, the service server may select an active client from a preset number of clients, and then take the active client as a target client. The specific value of the preset number may not be limited, and the active client may be understood as a client with a higher access frequency (for example, the access frequency is greater than 5 times/hour/day, and optionally, the specific value and format of the access frequency may be set according to actual conditions), or may be understood as a client whose online duration exceeds a preset duration within a period of time (for example, a client whose online duration exceeds 3 hours within a day).
Optionally, as another mode, the service server may obtain account levels of a preset number of clients, and rank the account levels of the clients, and in this mode, a client with a top rank may be selected as a target client. For example, it is assumed that, among 1000 clients, the corresponding client levels include level 1, level 2, level 3, level 4, level 5, and level 6, and it is assumed that level 1< level 2< level 3< level 4< level 5< level 6, where the number of clients corresponding to level 6 is 5, the number of clients corresponding to level 5 is 17, the number of clients corresponding to level 4 is 39, the number of clients corresponding to level 3 is 300, the number of clients corresponding to level 2 is 420, the number of clients corresponding to level 1 is 219, and if the clients corresponding to level 4, level 5, and level 6 are selected as target clients, the number of target clients is 61.
In the resource loading method provided by this embodiment, the service server obtains the resource locator of the resource sent by the client, then generates the identifier corresponding to the resource based on the resource locator, and then sends the broadcast message that the resource is uploaded for the first time to the target client if it is detected that the resource is uploaded for the first time, so that the target client can send the resource preloading request carrying the identifier of the resource to the corresponding content distribution node based on the broadcast message, and further the content distribution node can preload the resource to the local based on the identifier of the resource, thereby reducing the time for the content distribution node to request the resource from the source station, accelerating the speed of the first loading of the resource, and further improving the user experience.
Referring to fig. 5, a flowchart of a resource loading method according to still another embodiment of the present application is shown, where the embodiment provides a resource loading method applicable to an electronic device, and the method includes:
step S410: and the service server acquires the resource locator of the resource sent by the client.
Step S420: generating an identification corresponding to the resource based on the resource locator.
Step S430: and if the resource is detected to be uploaded for the first time, sending a broadcast message of the first uploading of the resource to a target client.
Wherein, the broadcast message carries the identifier of the resource. Optionally, when the service server sends the broadcast message of the first resource upload to the target client, the target client may be a client that uploads the resource to the source station server for the first time, or may be another client. Optionally, as shown in fig. 5, if the target client is a client that uploads resources to the source station server for the first time, the service server may send a broadcast message that the resources are uploaded for the first time to the client 12 (as shown by a dashed arrow in fig. 5).
Step S440: and the client receives the broadcast message sent by the service server.
Step S450: and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource.
Referring to fig. 6 and fig. 7, the following describes the present embodiment by way of a specific example:
in a specific application scenario, assuming that a resource is a picture, as shown in fig. 6, a flow chart of timing when a client requests to access the picture from a content distribution node in the prior art provided by the embodiment of the present application is shown. As shown in fig. 6, the client 12 may locally upload the picture to the CDN origin server 14, the CDN origin server 14 may return an origin URL to the client 12, the client 12 may send the origin URL to the service server 11, and optionally the service server 11 may replace the origin URL with a CDN-URL.
In an embodiment, the client 13 may initiate a service request to the service server 11, and the service server 11 may return service data of the CDN-URL with the picture to the client 13 in response to the service request, in which case the client 13 (optionally, the client 13 and the client 12 may be the same client, or may not be the same client) may request the picture from the content distribution node 15 according to the CDN-URL. Optionally, if the request is a first request, since the picture is stored in the CDN origin server 14 and the content delivery node 15 does not cache the picture, as a manner, the content delivery node 15 may send a picture back-to-source request to the CDN origin server 14, and further may receive the picture returned by the CDN origin server 14. Optionally, after receiving the picture returned by the CDN source station server 14, the content delivery node 15 may cache the picture and return the picture to the client 13. It is understood that, in the process from the time the client 13 initiates the picture request to the time the client receives the picture, since the content delivery node needs to request the picture back to the CDN origin server, it may take a lot of time due to poor network and other reasons, and further slow down the speed of loading the picture, which affects the user experience.
As a way to improve the above problem, as shown in fig. 7, a long connection channel between the client 13 and the service server 11 may be established in advance, and optionally, the long connection channel may be a TCP long connection channel. Optionally, through the long connection channel, after the service server 11 receives the source station URL sent by the client 12, when the source station URL is converted into a CDN-URL and stored, if it is found that the resource is first uploaded, the broadcast message that the resource is first uploaded to the target client (for example, the target client may be the client 13 shown in fig. 7) is quickly sent to the target client at the moment, and then a new picture needs to be preheated when unicasting to another target client (which may be understood as unidirectional broadcast here).
As a manner, after receiving the broadcast message sent by the service server 11, the client 13 may silently initiate a CDN-URL request to the content distribution node 15, so that the content distribution node 15 may send a request to return a picture corresponding to the CDN-URL to the CDN source station server 14 in advance, and in this manner, because the picture is preheated and loaded in advance, the content distribution node may quickly return the picture returned by the CDN source station server 14 to the client 13, and through preheating and loading the picture, the picture loading speed is increased, and user experience is improved.
It should be noted that, in this embodiment, only the resource is taken as an example for description, and optionally, if the resource is a file or a page of another type, the loading principle and the process of the resource are similar to the above-mentioned principle and process of loading the picture, and are not described herein again.
In the resource loading method provided by this embodiment, the service server obtains the resource locator of the resource sent by the client, then generates the identifier corresponding to the resource based on the resource locator, and then sends the broadcast message of the first upload of the resource to the target client if it is detected that the resource is the first upload, so that the client can send the resource preloading request carrying the identifier of the resource to the corresponding content distribution node after receiving the broadcast message, and thus the content distribution node can preload the resource locally, thereby reducing the time for the content distribution node to request the resource from the source station, accelerating the speed of the first load of the resource, and further improving the user experience.
Referring to fig. 8, a block diagram of a resource loading apparatus according to an embodiment of the present application is shown, where the embodiment provides a resource loading apparatus 500, which can be operated in an electronic device, the apparatus 500 includes: message receiving module 510 and request sending module 520:
a message receiving module 510, configured to receive, by a client, a broadcast message sent by a service server, where the broadcast message is sent when the service server detects that a resource is first uploaded, and the broadcast message carries an identifier of the resource.
Optionally, the identifier in this embodiment is a target resource locator, where the target resource locator represents a storage path of the resource, generated by the service server, and associated with the client.
As one way, the message receiving module 510 may be used for the client to receive the broadcast message sent by the service server based on a long connection channel with the service server.
Optionally, the apparatus 500 may further include a location identifier obtaining module and a content distribution node determining module, where the location identifier obtaining module may be configured to receive the location identifier of the client sent by the service server; the content distribution node determination module may be configured to regard a content distribution node corresponding to the location identifier as the corresponding content distribution node.
A request sending module 520, configured to send, by the client, a resource preloading request carrying the identifier of the resource to a corresponding content distribution node, so that the content distribution node preloads the resource to the local.
As a manner, the request sending module 520 may be specifically configured to, after the client sends a resource preloading request carrying an identifier of the resource to a corresponding content distribution node, instruct the content distribution node to send the resource preloading request to a source station server, so as to obtain the resource corresponding to the identifier of the resource, which is returned by the source station server, so that the content distribution node may preload the resource to the local.
The resource loading device provided in this embodiment receives, through a client, a broadcast message sent by a service server, where the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource, and then sends a resource preloading request carrying the identifier of the resource to a corresponding content distribution node, so that the content distribution node preloads the resource to the local. Therefore, through the above mode, the client side sends the resource preloading request carrying the resource identifier to the corresponding content distribution node under the condition that the client side receives the broadcast message sent by the service server when detecting that the resource is uploaded for the first time, so that the content distribution node can preload the resource to the local, the content distribution node can preheat and load the resource, the time length of the content distribution node for requesting the resource from the source station is reduced through preheating and loading, the first-time resource loading speed is accelerated, and the user experience is improved.
Referring to fig. 9, which is a block diagram of a resource loading apparatus according to an embodiment of the present disclosure, in this embodiment, a resource loading apparatus 600 is provided, which can be operated in an electronic device, where the apparatus 600 includes: the obtaining module 610, the generating module 620 and the message sending module 630:
the obtaining module 610 is configured to obtain, by the service server, a resource locator of the resource sent by the client.
A generating module 620, configured to generate, by the service server, an identifier corresponding to the resource based on the resource locator.
A message sending module 630, configured to send, if it is detected that the resource is first uploaded, a broadcast message that the resource is first uploaded to a target client, where the broadcast message carries the identifier, so that the target client sends, to a corresponding content distribution node, a resource preloading request that carries the identifier of the resource based on the broadcast message, and the content distribution node preloads the resource to the local based on the identifier of the resource.
Optionally, the apparatus 600 may further include a target client determining module, configured to select an active client from a preset number of clients; and taking the active client as a target client.
The resource loading device provided by this embodiment obtains, by the service server, the resource locator of the resource sent by the client, generates the identifier corresponding to the resource based on the resource locator, and then sends, if it is detected that the resource is uploaded for the first time, the broadcast message uploaded for the first time by the resource to the target client, so that the target client can send, to the corresponding content distribution node, the resource preloading request carrying the identifier of the resource based on the broadcast message, and further the content distribution node can preload the resource to the local based on the identifier of the resource, thereby reducing the time for the content distribution node to request the resource from the source station, accelerating the speed of the first loading of the resource, and further improving user experience.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or modules may be in an electrical, mechanical or other form.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules 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.
Referring to fig. 10, based on the resource loading method and apparatus, an electronic device 100 capable of executing the resource loading method is further provided in the embodiment of the present application. The electronic device 100 includes a memory 102 and one or more processors 104 (only one shown) coupled to each other, the memory 102 and the processors 104 being communicatively coupled to each other. The memory 102 stores therein a program that can execute the contents of the foregoing embodiments, and the processor 104 can execute the program stored in the memory 102.
The processor 104 may include one or more processing cores, among other things. The processor 104 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 102 and invoking data stored in the memory 102. Alternatively, the processor 104 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 104 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 104, but may be implemented by a communication chip.
The Memory 102 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 102 may be used to store instructions, programs, code sets, or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the foregoing embodiments, and the like. The data storage area may also store data created by the electronic device 100 during use (e.g., phone book, audio-video data, chat log data), and the like.
Referring to fig. 11, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 700 has stored therein program code that can be called by a processor to execute the methods described in the above-described method embodiments.
The computer-readable storage medium 700 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 1300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 700 has storage space for program code 710 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 710 may be compressed, for example, in a suitable form.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
To sum up, according to the resource loading method, the resource loading device, the electronic device, and the storage medium provided in the embodiments of the present application, a broadcast message sent by a service server is received by a client, where the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource, and then a resource preloading request carrying the identifier of the resource is sent to a corresponding content distribution node, so that the content distribution node preloads the resource to the local. The resource preloading request carrying the resource identifier is sent to the corresponding content distribution node through the client under the condition that the client receives the broadcast message sent by the service server when detecting that the resource is uploaded for the first time, so that the content distribution node can preload the resource to the local, the content distribution node can pre-heat and load the resource, the time length of the content distribution node for requesting the resource from a source station is shortened through pre-heating and loading, the first-time loading speed of the resource is accelerated, and the user experience is improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (12)

1. A method for resource loading, the method comprising:
a client receives a broadcast message sent by a service server, wherein the broadcast message is sent when the service server detects that a resource is uploaded for the first time, and the broadcast message carries an identifier of the resource;
and sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local based on the identifier of the resource.
2. The method of claim 1, wherein the client receives a broadcast message sent by a service server, and comprises:
and the client receives the broadcast message sent by the service server based on the long connecting channel between the client and the service server.
3. The method of claim 1, further comprising:
receiving the position identification of the client sent by the service server;
and taking the content distribution node corresponding to the position identification as the corresponding content distribution node.
4. A method according to any of claims 1-3, wherein the identifier is a target resource locator characterizing a storage path generated by the traffic server for the resource associated with the client.
5. The method of claim 1, further comprising:
and the client instructs the content distribution node to send the resource preloading request to a source station server so as to acquire the resource corresponding to the identifier of the resource returned by the source station server.
6. A method for resource loading, the method comprising:
a service server acquires a resource locator of a resource sent by a client;
generating an identification corresponding to the resource based on the resource locator;
if the resource is detected to be uploaded for the first time, sending a broadcast message for the first uploading of the resource to a target client, wherein the broadcast message carries the identifier, so that the target client sends a resource preloading request carrying the identifier of the resource to a corresponding content distribution node based on the broadcast message, and the content distribution node preloads the resource to the local based on the identifier of the resource.
7. The method of claim 6, further comprising:
selecting active clients from a preset number of clients;
and taking the active client as a target client.
8. A method for resource loading, the method comprising:
a service server acquires a resource locator of a resource sent by a client;
the business server generates an identifier corresponding to the resource based on the resource locator;
if the resource is detected to be uploaded for the first time, the service server sends a broadcast message uploaded by the resource for the first time to a target client, wherein the broadcast message carries an identifier of the resource;
the client receives the broadcast message sent by the service server;
and the client sends a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node can preload the resource to the local.
9. An apparatus for resource loading, the apparatus comprising:
a message receiving module, configured to receive, by a client, a broadcast message sent by a service server, where the broadcast message is sent when the service server detects that a resource is first uploaded, and the broadcast message carries an identifier of the resource;
and the request sending module is used for sending a resource preloading request carrying the identifier of the resource to a corresponding content distribution node by the client so as to enable the content distribution node to preload the resource to the local.
10. An apparatus for resource loading, the apparatus comprising:
the acquisition module is used for the business server to acquire the resource locator of the resource sent by the client;
a generating module, configured to generate, by the service server, an identifier corresponding to the resource based on the resource locator;
and the message sending module is used for sending a broadcast message for the first uploading of the resource to a target client if the resource is detected to be the first uploading, wherein the broadcast message carries the identifier, so that the target client sends a resource preloading request carrying the identifier of the resource to a corresponding content distribution node based on the broadcast message, and the content distribution node preloads the resource to the local based on the identifier of the resource.
11. An electronic device comprising one or more processors and memory;
one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods of any of claims 1-5 or claims 6-7.
12. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-5 or claims 6-7.
CN202010437981.1A 2020-05-21 2020-05-21 Resource loading method and device and electronic equipment Active CN111625743B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010437981.1A CN111625743B (en) 2020-05-21 2020-05-21 Resource loading method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010437981.1A CN111625743B (en) 2020-05-21 2020-05-21 Resource loading method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111625743A true CN111625743A (en) 2020-09-04
CN111625743B CN111625743B (en) 2023-05-23

Family

ID=72271110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010437981.1A Active CN111625743B (en) 2020-05-21 2020-05-21 Resource loading method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111625743B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286592A (en) * 2020-10-29 2021-01-29 平安普惠企业管理有限公司 Resource data loading method and device, storage medium and computer equipment
CN113179328A (en) * 2021-05-19 2021-07-27 上海七牛信息技术有限公司 Resource distribution method and system for PCDN (Primary Contourlet distribution) network
CN114760487A (en) * 2022-03-18 2022-07-15 阿里巴巴(中国)有限公司 Live broadcasting method and device
CN115277851A (en) * 2022-06-22 2022-11-01 聚好看科技股份有限公司 Service request processing method and system
CN115277687A (en) * 2021-04-30 2022-11-01 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717231A (en) * 2014-12-18 2015-06-17 北京蓝汛通信技术有限责任公司 Pre-distribution processing method and device of content distribution network
US20170150197A1 (en) * 2015-11-20 2017-05-25 Nady International Limited Multimedia content sharing and distribution
CN108540816A (en) * 2018-03-28 2018-09-14 腾讯科技(深圳)有限公司 A kind of live video acquisition methods, device and storage medium
CN108540566A (en) * 2018-04-18 2018-09-14 暴风集团股份有限公司 file uploading method, device, system and client and server
CN108804514A (en) * 2018-04-25 2018-11-13 网宿科技股份有限公司 A kind of webpage loading method, server and webpage loading system
US10291738B1 (en) * 2016-01-21 2019-05-14 Instart Logic, Inc. Speculative prefetch of resources across page loads

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717231A (en) * 2014-12-18 2015-06-17 北京蓝汛通信技术有限责任公司 Pre-distribution processing method and device of content distribution network
US20170150197A1 (en) * 2015-11-20 2017-05-25 Nady International Limited Multimedia content sharing and distribution
US10291738B1 (en) * 2016-01-21 2019-05-14 Instart Logic, Inc. Speculative prefetch of resources across page loads
CN108540816A (en) * 2018-03-28 2018-09-14 腾讯科技(深圳)有限公司 A kind of live video acquisition methods, device and storage medium
CN108540566A (en) * 2018-04-18 2018-09-14 暴风集团股份有限公司 file uploading method, device, system and client and server
CN108804514A (en) * 2018-04-25 2018-11-13 网宿科技股份有限公司 A kind of webpage loading method, server and webpage loading system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈茜: "移动内容分发的关键问题研究" *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286592A (en) * 2020-10-29 2021-01-29 平安普惠企业管理有限公司 Resource data loading method and device, storage medium and computer equipment
CN115277687A (en) * 2021-04-30 2022-11-01 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device, and storage medium
CN115277687B (en) * 2021-04-30 2024-02-23 北京小米移动软件有限公司 Resource data acquisition method, resource data acquisition device and storage medium
CN113179328A (en) * 2021-05-19 2021-07-27 上海七牛信息技术有限公司 Resource distribution method and system for PCDN (Primary Contourlet distribution) network
CN114760487A (en) * 2022-03-18 2022-07-15 阿里巴巴(中国)有限公司 Live broadcasting method and device
CN115277851A (en) * 2022-06-22 2022-11-01 聚好看科技股份有限公司 Service request processing method and system
CN115277851B (en) * 2022-06-22 2023-06-06 聚好看科技股份有限公司 Service request processing method and system

Also Published As

Publication number Publication date
CN111625743B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN111625743B (en) Resource loading method and device and electronic equipment
CN107566786B (en) Method and device for acquiring monitoring video and terminal equipment
KR101652676B1 (en) System and apparatus for power efficient delivery of social network updates to a receiver device in a broadcast network
US20150227496A1 (en) Method and system for microblog resource sharing
JP2015513144A (en) Collaborative loading of web pages based on shared meta information
US9479607B2 (en) Content caching and delivering system with traffic of repetitively requested content reduced
US9386099B2 (en) Local caching device, system and method for providing content caching service
CN102111426A (en) Method, system and device for implementing point-to-point technology
CN109788301B (en) Live broadcast method, terminal equipment, live broadcast system and computer readable storage medium of streaming media
CN110022329B (en) File transmission method and device, computer readable storage medium and computer equipment
US10917493B2 (en) Dynamic edge cache content management
CN110620828A (en) File pushing method, system, device, electronic equipment and medium
CN103826139A (en) CDN system, watching server and streaming media data transmission method
CN109067916B (en) Online multimedia file downloading method and device and electronic equipment
CN111541555A (en) Group chat optimization method and related product
CN112311874A (en) Media data processing method and device, storage medium and electronic equipment
US11509961B2 (en) Automatic rating of crowd-stream caller video
US20170171339A1 (en) Advertisement data transmission method, electrnoic device and system
CN107645475B (en) File resource distribution system and method in heterogeneous network
US20230239347A1 (en) Assisted delivery service for networks
CN105991716A (en) System and method of information sharing
CN104469428A (en) Instantaneous transmission method and device for videos and texts
WO2017185632A1 (en) Data transmission method and electronic device
US20150326686A1 (en) Method, Apparatus and System for Processing User Generated Content
CN112384910A (en) Wireless device, computer server node and method thereof

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
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200904

Assignee: GUANGZHOU CUBESILI INFORMATION TECHNOLOGY Co.,Ltd.

Assignor: GUANGZHOU HUADUO NETWORK TECHNOLOGY Co.,Ltd.

Contract record no.: X2021440000031

Denomination of invention: Resource loading method, device and electronic equipment

License type: Common License

Record date: 20210125

GR01 Patent grant
GR01 Patent grant