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

Resource loading method and device and electronic equipment Download PDF

Info

Publication number
CN111625743B
CN111625743B CN202010437981.1A CN202010437981A CN111625743B CN 111625743 B CN111625743 B CN 111625743B CN 202010437981 A CN202010437981 A CN 202010437981A CN 111625743 B CN111625743 B CN 111625743B
Authority
CN
China
Prior art keywords
resource
client
content distribution
service server
distribution node
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.)
Active
Application number
CN202010437981.1A
Other languages
Chinese (zh)
Other versions
CN111625743A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a resource loading method, a resource loading device, electronic equipment and a storage medium. The method comprises the following steps: the method comprises the steps that a client receives a broadcast message sent by a service server, the broadcast message is sent when the service server detects that resources are uploaded for the first time, and the broadcast message carries an identifier of the resources; and sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource. The method and the device realize the preheating loading of the content distribution node to the resource, reduce the time for the content distribution node to request the resource from the source station, accelerate the first loading speed of the resource 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, a resource loading device, an electronic device, and a storage medium.
Background
In recent years, with the development of internet technology, the popularity of intelligent terminals has increased, and more users enrich their lives by browsing web pages, watching videos, engaging in social activities, and the like on intelligent terminals. In the use scenario of the intelligent terminal, in order to obtain a better experience effect, the user hopes that the shorter the response time of the resources on the mobile network is, the better. As a way, a content delivery network (Content Delivery Network, CDN) may be used to cache resources at CDN edge nodes accessed by the user network, where when the user needs to access the resources, the resources may be obtained from the nearby CDN edge nodes, without obtaining from a server, thereby implementing reduction in latency for the user. However, for the first accessed resource, the CDN edge node needs to perform the back-sourcing process, which may be caused by some scenes with poor network environments, so that the duration of the back-sourcing process is long, thereby affecting the resource loading speed and reducing the user experience.
Disclosure of Invention
In view of the above, the present application proposes a resource loading method, apparatus, electronic device, and storage medium, so as to improve the above problem.
In a first aspect, an embodiment of the present application provides a resource loading method, where the method includes: the method comprises the steps that a client receives a broadcast message sent by a service server, the broadcast message is sent when the service server detects that resources are uploaded for the first time, and the broadcast message carries an identifier of the resources; and sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource.
In a second aspect, an embodiment of the present application provides a resource loading method, where the method includes: the service server acquires a resource locator of a resource sent by the 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, a broadcast message of the first time uploading of the resource is sent to a target client, wherein the broadcast message carries the identification, so that the target client sends a resource preloading request carrying the identification 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 identification of the resource.
In a third aspect, an embodiment of the present application provides a resource loading method, where the method includes: the service server acquires a resource locator of a resource sent by the client; the service 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 of the first uploading of the resource to a target client, wherein the broadcast message carries an identifier of the resource; the client receives a broadcast message sent by the service server; and the client sends a resource preloading request carrying the identification of the resource to the corresponding content distribution node so that the content distribution node preloads the resource to the local.
In a fourth aspect, an embodiment of the present application provides a resource loading device, where the device includes: the system comprises a message receiving module, a service server and a message sending module, wherein the message receiving module is used for receiving a broadcast message sent by the service server, the broadcast message is sent when the service server detects that resources are uploaded for the first time, and the broadcast message carries an identifier of the resources; and the request sending module is used for sending a resource preloading request carrying the identification of the resource to the corresponding content distribution node by the client so that the content distribution node can preload the resource to the local.
In a fifth aspect, an embodiment of the present application provides a resource loading device, where the device includes: the acquisition module is used for acquiring the resource locator of the resource sent by the client by the service server; the generation module is used for generating an identifier corresponding to the resource based on the resource locator by the service server; and the message sending module is used for sending a broadcast message of 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, embodiments of the present application provide an electronic device comprising a memory and one or more processors; one or more programs stored in a memory and configured to be executed by 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, embodiments of the present application provide a computer readable storage medium having program code stored therein, wherein the program code, when executed by a processor, performs the method of the first aspect or the second aspect.
According to the resource loading method, the device, the electronic equipment and the storage medium, 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 identification of the resource, and then a resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node preloads the resource to the local. According to the method, the device and the system, when receiving the broadcast message sent by the service server when the first uploading of the resource is detected, the client sends the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, so that the content distribution node can preload the resource to the local, the preheating loading of the content distribution node on the resource is realized, the time for the content distribution node to request the resource from the source station back to the source station is reduced through the preheating loading, the first loading speed of the resource is accelerated, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a schematic view of an application environment provided in an embodiment of the present application.
Fig. 2 shows a method flowchart of a resource loading method according to an embodiment of the present application.
Fig. 3 is a flowchart of a method for loading resources according to another embodiment of the present application.
Fig. 4 is a flowchart of a method for loading resources according to another embodiment of the present application.
Fig. 5 shows a method flowchart of a resource loading method according to still another embodiment of the present application.
Fig. 6 shows a timing flowchart of a client requesting access to a picture from a content distribution node in the prior art according to an embodiment of the present application.
Fig. 7 shows a timing flowchart of a client requesting access to a picture from a content distribution node according to an embodiment of the present application.
Fig. 8 is a block diagram of a resource loading device according to an embodiment of the present application.
Fig. 9 is a block diagram of a resource loading device 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 for storing or carrying program code implementing a resource loading method according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying 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 the edge servers deployed in various places, a user can obtain required content nearby through load balancing, content distribution, scheduling and other functional modules of the center platform, network congestion is reduced, and user access response speed and hit rate are improved.
In recent years, with the rapid popularization of intelligent terminals, the mobile internet has become a main way for people to acquire information. More and more users search information through a search engine, and the loading speed of the information is particularly important in user experience. As a way, the content delivery network can be adopted to cache the resource in the CDN edge node accessed by the user network, when the user needs to access the resource, the resource can be obtained from the nearby CDN edge node, and the resource does not need to be obtained from the server side, so that the waiting time of the user is reduced, and the loading speed of the information can be increased. However, the inventor finds that, for the first accessed resource, the CDN edge node needs to perform the back-source processing, and in some weak network environments, the CDN edge node has the problems of long time (1-10 seconds) and unreliable quality (the back-source processing is easy to fail) due to network reasons during the back-source processing, which may cause the long time of the back-source processing, further affect the resource loading speed, and reduce the user experience.
In order to solve the problems, the inventor discovers through long-term research that a broadcast message sent by a service server can be received by a client, wherein the broadcast message is sent when the service server detects that resources are uploaded for the first time, the broadcast message carries an identifier of the resources, and then a resource preloading request carrying the identifier of the resources is sent to a corresponding content distribution node, so that the content distribution node preloads the resources to the local. Therefore, under the condition that the client receives the broadcast message sent by the service server when the first uploading of the resource is detected, the resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node can preload the resource to the local, the preheating loading of the content distribution node to the resource is realized, the time for the content distribution node to request the resource from the source station back to the source station is reduced through the preheating loading, the first loading speed of the resource is accelerated, and the user experience is improved.
For the purpose of facilitating a detailed description of the present application, an application environment in the embodiments of the present application will be described with reference to the accompanying drawings.
Referring to fig. 1, an application environment of a resource loading method provided in an embodiment of the present application is shown in fig. 1, where the application environment may be understood as a network system 10 provided in an embodiment of the present application, and the network system 10 includes: client 12, client 13, CDN source server 14, and CDN cache server 15.
The CDN source server 14 and the CDN cache server 15 may be one server (network access server), a server cluster (cloud server) formed by 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 PCs (Personal Computer, personal computers), PDAs (tablet computers), smart televisions, smart phones, smart wearable devices, or other intelligent communication devices with network connection functions.
Alternatively, the client 12 and the client 13 may be clients of an instant messaging application, a social network application, or an internet access application, and the clients may be application clients (such as a video playing application in a mobile APP) or web clients (such as a browser, a web live platform, etc.), which are not limited herein.
Alternatively, the CDN source server 14 may establish a communication connection with the client 12 and a different client 13 over a network, which may be a wireless network as one way.
In one embodiment, the user may upload the resource to the CDN source server 14 through the client 12, and the CDN source server 14 may send the resource to each CDN cache server 15 for caching, so that the client 13 may directly request the resource from the CDN cache server 15. Alternatively, if the resource is the first uploaded resource, when the client 13 requests the resource from the CDN cache server 15, the CDN cache server 15 needs to request the source from the CDN source server 14, in which manner the client 12 and the client 13 may be the same client (i.e., in which manner 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, which may be applied 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 first upload of a resource, where the broadcast message carries an identifier of the first upload resource. The resource may be a picture, a file, a page, or the like, and the type of the resource and the content form are not 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 uploading 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 an optimal 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 characterize a storage path of resources associated with the client generated by the service server, where storage paths of resources associated with different clients may be different.
As one approach, the client may receive broadcast messages 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 way the client may receive broadcast messages sent by the service server based on a TCP long connection path with the service server. The establishment principle and the establishment procedure of the TCP connection between the client and the service server may refer to the related art, and are not described herein.
Step S120: and sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource.
As a way, after the identifier of the resource is obtained, 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 the 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 can be improved.
After the client sends the resource preloading request carrying the identifier to the corresponding content distribution node, the corresponding content distribution node may be instructed to send the resource preloading request to the source station server (which may be understood as the CDN source station server described above), so that the resource corresponding to the identifier of the resource returned by the source station server may be obtained, so that the corresponding content distribution node may preload the resource to the local, thereby reducing resource obtaining or waiting time consumption in a subsequent service request process, and further improving user experience.
Alternatively, the location of the client may vary, e.g., the client may move from location a to location B, and if the distance between location a and location B is relatively large, the content distribution node corresponding to the client may vary, i.e., the content distribution nodes corresponding to clients in different locations may be different. Alternatively, the specific distance between the position a and the position B in the present embodiment may not be limited.
Optionally, during 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 ground, the network signal may be weakened, 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, the client may first detect, after receiving the broadcast message sent by the service server, whether the network environment where the client is located meets a preset condition, and optionally, if the network environment where the client is located meets the preset condition, the client may continue to send a resource preloading request carrying the identifier of the resource to the corresponding content distribution node; optionally, if the network environment of the location of the client does not meet the preset condition, the client may delay sending a resource preloading request carrying the identifier of the resource to the corresponding content distribution node, where the specific duration of the delay may be adjusted according to the actual network environment condition. Alternatively, the preset condition may be that the network signal of the network environment is greater than a specified threshold, and the specific value of the specified threshold may not be limited.
Optionally, after the client sends the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, whether a preloading request receiving success signal returned by the service server is received or not may be detected, optionally, if the preloading request receiving 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 for a period of time, so as to ensure that the preloading request can be successfully sent.
According to the resource loading method provided by the embodiment, the broadcasting message sent by the service server is received through the client, wherein the broadcasting message is sent when the service server detects that the resource is uploaded for the first time, the broadcasting message carries the identification of the resource, and then a resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node preloads the resource to the local. According to the method, the device and the system, when receiving the broadcast message sent by the service server when the first uploading of the resource is detected, the client sends the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, so that the content distribution node can preload the resource to the local, the preheating loading of the content distribution node on the resource is realized, the time for the content distribution node to request the resource from the source station back to the source station is reduced through the preheating loading, the first loading speed of the resource 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, which may be applied 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 delivery node corresponding to the client may change, for example, the content delivery node corresponding to the client is "CDN-1" at the location a, and the content delivery node corresponding to the client is "CDN-2" at the location B, and 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 a broadcast message sent by the service server at the location a, the location of the client changes from the location a to the location B within a relatively short time (for example, 5 minutes, a specific duration may not be limited), and in this way, if the client still sends a resource preloading request to the content delivery node corresponding to the location a, it may cause a transmission failure or a transmission smooth or a transmission failure due to a network signal failure or the like. 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 the location data related to the client, which is periodically read by the service server, and further obtain the current location identifier of the client from the location data, and optionally, the specific implementation technology may refer to related technology, which is not described herein.
Step S230: and taking the content distribution node corresponding to the position identifier as the corresponding content distribution node.
As one way, after the location identifier of the client is acquired, the content distribution node corresponding to the location identifier may be used as the content distribution node corresponding to the client. Alternatively, different location identifiers may correspond to different content distribution nodes, so that the content distribution node corresponding to the client may be accurately acquired according to the acquired location identifier.
Step S240: and sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource.
According to the resource loading method provided by the embodiment, the broadcasting message sent by the service server is received through the client, the position identification of the client sent by the service server is received, the content distribution node corresponding to the position identification is used as the content distribution node corresponding to the client, and then a resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node preloads the resource to the local. The accurate sending of the resource preloading request is realized, so that the accuracy and the reliability of resource loading are improved. The preheating loading of the resources by the content distribution node reduces the time for the content distribution node to request the resources from the source station, accelerates the first loading speed of the resources and improves the user experience.
Referring to fig. 4, a flowchart of a resource loading method according to another embodiment of the present application is shown, where the method may be applied to an electronic device, and includes:
step S310: the service server obtains a resource locator of the resource sent by the client.
In this embodiment, the service server may be understood as a server corresponding to the browser, and the user may access resources to the service server through the client.
Among other things, a resource locator may be understood as a uniform resource locator (Uniform Resource Locator, URL for short). As a way, after the client uploads the resource to the CDN source server for the first time, the URL returned by the CDN source server may be obtained, and optionally, the service server may receive the URL uploaded by the client, so that when an access request of the resource is received, the service server may return an identifier pointed by the access request to the corresponding client.
Step S320: an identification corresponding to the resource is generated based on the resource locator.
Optionally, after acquiring 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 the 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 the service server generates the identifier corresponding to the resource, the resource and the identifier corresponding to the resource may be stored in a mapping relationship, and optionally, if the same identifier as the identifier is detected to exist in the storage process, the resource and the same identifier may be directly stored correspondingly. If the same identifier as the identifier is not detected, 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 an associated mode, and meanwhile, 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 identification of the resource. It should be noted that the number of the target clients may be plural, 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 uploading the resource are the same client, the client can request to acquire the resource when the resource needs to be used by uploading the resource to the source station server without being stored locally, so that the memory required by the resource is reduced, and the running efficiency of the device is improved. Alternatively, in other embodiments, the target client and the client uploading the resource may not be the same client, in which way, when detecting that the resource is first uploaded, the service server may send a broadcast message of the first uploading of the resource to at least one other client.
Alternatively, the service server may determine the target client from a plurality of clients in a variety of ways. For example, as one way, the service server may select an active client from a preset number of clients, and further use the active client as a target client. The specific number 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, optionally, the specific number and format of the access frequency may be set according to the actual situation), or may be understood as a client with an online time period exceeding a preset time period (for example, a client with an online time period exceeding 3 hours in one day).
Alternatively, as another way, the service server may obtain account levels of a preset number of clients, rank the account levels of the clients, and in this way, may select the client with the top rank as the target client. For example, assume that among 1000 clients, there are level 1, level 2, level 3, level 4, level 5, and level 6, and 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.
According to the resource loading method provided by the embodiment, the service server is used for acquiring the resource locator of the resource sent by the client, then the identifier corresponding to the resource is generated based on the resource locator, and then if the resource is detected to be uploaded for the first time, the broadcast message of the first time uploading of the resource is sent 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 locally preload the resource based on the identifier of the resource, thereby reducing the time length of the resource requesting from the source station by the content distribution node, accelerating the first loading speed of the resource, and further improving the user experience.
Referring to fig. 5, a flowchart of a resource loading method according to another embodiment of the present application is shown, where the method may be applied to an electronic device, and includes:
step S410: the service server obtains a resource locator of the resource sent by the client.
Step S420: an identification corresponding to the resource is generated 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 identification of the resource. Optionally, when the service server sends a broadcast message for first uploading of the resource to the target client, the target client may be a client for first uploading of the resource to the source station server, or may be another client. Alternatively, as shown in fig. 5, if the target client is a client that uploads the resource to the source station server for the first time, the service server may send a broadcast message of the first upload of the resource to the client 12 (as shown by a dashed arrow in fig. 5), and it may be understood that in this case, the number of target clients may be multiple, that is, the service server may also send broadcast messages of the first upload of the resource to other target clients at the same time.
Step S440: and the client receives the broadcast message sent by the service server.
Step S450: and sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource.
Referring to fig. 6 and 7, the following describes an exemplary embodiment with a specific example:
in a specific application scenario, assuming that a resource is a picture, as shown in fig. 6, a timing flow chart of a client requesting access to the picture from a content distribution node in the prior art provided in the embodiment of the present application is shown. As shown in fig. 6, the client 12 may upload the picture locally to the CDN source server 14, the CDN source server 14 may return a source URL to the client 12, the client 12 may send the source URL to the service server 11, and optionally the service server 11 may replace the source URL with a CDN-URL.
In one embodiment, the client 13 may initiate a service request to the service server 11, and the service server 11 may return the service data of the CDN-URL with the picture to the client 13 in response to the service request, in which manner, the client 13 (optionally, the client 13 and the client 12 may be the same client or not the same client) may request the picture from the content distribution node 15 according to the CDN-URL. Alternatively, if the request is the first request, since the picture is stored in the CDN source server 14 and the content delivery node 15 does not cache the picture, as a way, the content delivery node 15 may send a picture source return request to the CDN source server 14, and may further receive the picture returned by the CDN source server 14. Optionally, after receiving the picture returned by the CDN source server 14, the content delivery node 15 may cache the picture and return the picture to the client 13. It is to be understood that, in the process from the initiation of the picture request by the client 13 to the receipt of the picture, since the content delivery node needs to request the CDN source server for the picture to return to the source, it may take more time due to poor network, etc., so as to slow down the picture loading speed and affect the user experience.
As a way to improve the above-described 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 alternatively, 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 URL sent by the client 12, when the source URL is converted into a CDN-URL and stored, if the resource is found to be the first uploading instant and fast, a broadcast message of the first uploading of the resource is sent to the target client (for example, the target client may be the client 13 shown in fig. 7 at this time), so that unicast (which may be understood as unidirectional broadcast herein) to other target clients is realized, and a new picture needs to be preheated.
In this way, since the picture is preheated and loaded in advance, the content delivery node can quickly return the picture returned by the CDN source server 14 to the client 13, and the picture loading speed is improved and the user experience is improved by preheating and loading the picture.
It should be noted that, in this embodiment, only the resource is taken as an example to describe, and optionally, if the resource is a file or a page of another type, the loading principle is similar to the above principle and process of loading the picture, and will not be described herein.
According to the resource loading method provided by the embodiment, the resource locator of the resource sent by the client is obtained through the service server, then the identifier corresponding to the resource is generated based on the resource locator, and then if the resource is detected to be uploaded for the first time, the broadcast message of the first time uploading of the resource is sent to the target client, so that the client can send a resource preloading request carrying the identifier of the resource to the corresponding content distribution node after receiving the broadcast message, the content distribution node can preload the resource locally, the time length of the resource requesting from the source station by the content distribution node can be reduced, the speed of the first time uploading of the resource is accelerated, and further user experience is improved.
Referring to fig. 8, in order to provide a block diagram of a resource loading device according to an embodiment of the present application, the embodiment provides a resource loading device 500, which may be operated in an electronic device, where the device 500 includes: message receiving module 510 and request transmitting module 520:
The message receiving module 510 is 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 uploaded for the first time, 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 characterizes a storage path generated by the service server and associated with the resource of the client.
As one way, the message receiving module 510 may be configured to receive, by a client, a broadcast message sent by a 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 a location identifier of the client sent by the service server; the content distribution node determining module may be configured to take a content distribution node corresponding to the location identifier as the corresponding content distribution node.
And the request sending module 520 is configured to send, by the client, a resource preloading request carrying an identifier of the resource to a corresponding content distribution node, so that the content distribution node preloads the resource to a local location.
As a way, the request sending module 520 may specifically be configured to instruct, after the client sends a resource preloading request carrying an identifier of the resource to a corresponding content distribution node, the content distribution node to send the resource preloading request to a source station server, so as to obtain a resource corresponding to the identifier of the resource returned by the source station server, so that the content distribution node may preload the resource to a local area.
According to the resource loading device provided by the embodiment, the broadcasting message sent by the service server is received through the client, wherein the broadcasting message is sent when the service server detects that the resource is uploaded for the first time, the broadcasting message carries the identification of the resource, and then a resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node preloads the resource to the local. According to the method, the device and the system, when receiving the broadcast message sent by the service server when the first uploading of the resource is detected, the client sends the resource preloading request carrying the identifier of the resource to the corresponding content distribution node, so that the content distribution node can preload the resource to the local, the preheating loading of the content distribution node on the resource is realized, the time for the content distribution node to request the resource from the source station back to the source station is reduced through the preheating loading, the first loading speed of the resource is accelerated, and the user experience is improved.
Referring to fig. 9, in order to provide a block diagram of a resource loading device according to an embodiment of the present application, the embodiment provides a resource loading device 600, which may be operated in an electronic device, where the device 600 includes: acquisition module 610, generation module 620, and messaging module 630:
an obtaining module 610, configured to obtain, by the service server, a resource locator of a 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.
And the message sending module 630 is configured to send, if the resource is detected to be uploaded for the first time, a broadcast message for the first time uploading the resource 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 carrying the identifier of the resource based on the broadcast message, so that the content distribution node preloads the resource to a local location 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.
According to the resource loading device provided by the embodiment, the resource locator of the resource sent by the client is obtained through the service server, then the identifier corresponding to the resource is generated based on the resource locator, and then if the resource is detected to be uploaded for the first time, the broadcast message of the first time uploading of the resource is sent 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, thereby reducing the time length of the resource requesting from the source station by the content distribution node, accelerating the first loading speed of the resource, and further improving the user experience.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In the several embodiments provided herein, the illustrated or discussed coupling or direct coupling or communication connection of the modules to each other may be through some interfaces, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other forms.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 10, based on the above-mentioned resource loading method and device, the embodiment of the application further provides an electronic device 100 capable of executing the above-mentioned resource loading method. The electronic device 100 includes a memory 102 and one or more (only one is shown) processors 104 coupled to each other, with communication lines connecting the memory 102 and the processors 104. 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.
Wherein the processor 104 may include one or more processing cores. The processor 104 utilizes various interfaces and lines to connect various portions of the overall electronic device 100, 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 in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 104 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 104 and may be implemented solely by a single communication chip.
The Memory 102 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). Memory 102 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 102 may include a stored program area and a stored data area, wherein the stored program 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, etc. The storage data area may also store data created by the electronic device 100 in use (e.g., phonebook, audiovisual 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 invoked by a processor to perform the methods described in the method embodiments described above.
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, computer readable storage medium 1300 includes a non-transitory computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium 700 has memory space for program code 710 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 710 may be compressed, for example, in a suitable form.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," 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 present application. In this specification, schematic representations of the above terms are not necessarily directed 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, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
In summary, according to the resource loading method, device, electronic equipment and 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, 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. According to the method and the device, when the client receives the broadcast message sent by the service server when the first uploading of the resource is detected, the resource preloading request carrying the identification of the resource is sent to the corresponding content distribution node, so that the content distribution node can preload the resource to the local, the preheating loading of the content distribution node to the resource is realized, the time for the content distribution node to request the resource from the source station is shortened through the preheating loading, the first loading speed of the resource is accelerated, and the user experience is improved.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A method of resource loading, the method comprising:
the method comprises the steps that a client receives a broadcast message sent by a service server, the broadcast message is sent when the service server detects that resources are uploaded for the first time, and the broadcast message carries an identifier of the resources;
detecting whether a network environment of a current position meets a preset condition, wherein the preset condition comprises that a network signal of the network environment is larger than a specified threshold;
and if the network environment of the current position meets the preset condition, sending a resource preloading request carrying the identification of the resource to a corresponding content distribution node so that the content distribution node preloads the resource to the local based on the identification of the resource.
2. The method of claim 1, wherein the client receiving the broadcast message sent by the service server comprises:
the client receives the broadcast message sent by the service server based on a long connection channel with the service server.
3. The method according to claim 1, wherein the method further comprises:
receiving the position identification of the client sent by the service server;
and taking the content distribution node corresponding to the position identifier as the corresponding content distribution node.
4. A method according to any of claims 1-3, wherein the identification is a target resource locator characterizing a storage path of the resource associated with the client generated by the traffic server.
5. The method according to claim 1, wherein the method further comprises:
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 resource identifier returned by the source station server.
6. A method of resource loading, the method comprising:
The service server acquires a resource locator of a resource sent by the 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, a broadcast message of the first time uploading of the resource is sent to the target client under the condition that the network environment of the current position of the target client meets a preset condition, 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, the content distribution node preloads the resource to the local based on the identifier of the resource, and the preset condition comprises that the network signal of the network environment is larger than a specified threshold.
7. The method of claim 6, wherein the method further comprises:
selecting active clients from a preset number of clients;
and taking the active client as a target client.
8. A method of resource loading, the method comprising:
the service server acquires a resource locator of a resource sent by the client;
the service 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 of the first uploading of the resource to a target client, wherein the broadcast message carries an identifier of the resource;
the client receives a broadcast message sent by the service server;
the client detects whether a network environment of a current position meets preset conditions, wherein the preset conditions comprise that a network signal of the network environment is larger than a specified threshold;
and if the network environment of the current position meets the preset condition, the client sends a resource preloading request carrying the identification of the resource to the corresponding content distribution node so that the content distribution node preloads the resource to the local.
9. A resource loading device, the device comprising:
the system comprises a message receiving module, a service server and a message sending module, wherein the message receiving module is used for receiving a broadcast message sent by the service server, the broadcast message is sent when the service server detects that resources are uploaded for the first time, and the broadcast message carries an identifier of the resources;
the request sending module is used for detecting whether the network environment of the current position meets preset conditions or not, wherein the preset conditions comprise that the network signal of the network environment is larger than a specified threshold value; and if the network environment of the current position meets the preset condition, the client sends a resource preloading request carrying the identification of the resource to the corresponding content distribution node so that the content distribution node preloads the resource to the local.
10. A resource loading device, the device comprising:
the acquisition module is used for acquiring the resource locator of the resource sent by the client by the service server;
the generation module is used for generating an identifier corresponding to the resource based on the resource locator by the service server;
and the message sending module is used for sending a broadcast message of the first uploading of the resource to the target client under the condition that the network environment of the current position of the target client meets a preset condition, 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, and the preset condition comprises that the network signal of the network environment is larger than a specified threshold.
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, characterized in that the computer readable storage medium has stored therein a program code, wherein the program code, when being 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 CN111625743A (en) 2020-09-04
CN111625743B true 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)

Families Citing this family (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
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
CN114760487B (en) * 2022-03-18 2024-07-23 阿里巴巴(中国)有限公司 Live broadcast method and device
CN115277851B (en) * 2022-06-22 2023-06-06 聚好看科技股份有限公司 Service request processing method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108540566A (en) * 2018-04-18 2018-09-14 暴风集团股份有限公司 file uploading method, device, system and client and server

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104717231B (en) * 2014-12-18 2019-01-25 北京蓝汛通信技术有限责任公司 The pre- distribution processing method and device of content distributing 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
CN108540816B (en) * 2018-03-28 2020-03-17 腾讯科技(深圳)有限公司 Live video acquisition method and device and storage medium
CN108804514A (en) * 2018-04-25 2018-11-13 网宿科技股份有限公司 A kind of webpage loading method, server and webpage loading system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108540566A (en) * 2018-04-18 2018-09-14 暴风集团股份有限公司 file uploading method, device, system and client and server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈茜.移动内容分发的关键问题研究.《中国博士学位论文全文数据库信息科技辑》.2020,(第第4期期),全文. *

Also Published As

Publication number Publication date
CN111625743A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN111625743B (en) Resource loading method and device and electronic equipment
US20210067578A1 (en) Streaming media segments
CN109600437B (en) Downloading method of streaming media resource and cache server
WO2021237433A1 (en) Message pushing method and apparatus, and electronic device and computer-readable medium
US20150227496A1 (en) Method and system for microblog resource sharing
CN110022482B (en) Video playing starting method, video service system and storage medium
EP3734927A1 (en) Content service implementation method and device, and content delivery network node
CN109788301B (en) Live broadcast method, terminal equipment, live broadcast system and computer readable storage medium of streaming media
CN104509060B (en) The method and device of transmission of flow media data
CN111083536B (en) Method and device for adjusting video code rate
WO2015106692A1 (en) Webpage pushing method, client, server, and system
CN102111426A (en) Method, system and device for implementing point-to-point technology
CN105763960A (en) Method and apparatus for network video playing
US11240335B2 (en) System and methods thereof for delivery of popular content using a multimedia broadcast multicast service
CN110022329B (en) File transmission method and device, computer readable storage medium and computer equipment
CN112311874B (en) Media data processing method and device, storage medium and electronic equipment
WO2015035957A1 (en) Video resource obtaining method, backend server, video client, and system
CN111541555A (en) Group chat optimization method and related product
US20160029050A1 (en) Hybrid Stream Delivery
CN111787340A (en) Network live broadcast system and method
CN103826139A (en) CDN system, watching server and streaming media data transmission method
US20240259467A1 (en) Assisted delivery service for networks
CN107645475B (en) File resource distribution system and method in heterogeneous network
KR20150025249A (en) Method for content routing based on batching and apparatus performing the method
US20150326686A1 (en) Method, Apparatus and System for Processing User Generated Content

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

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

EE01 Entry into force of recordation of patent licensing contract
GR01 Patent grant
GR01 Patent grant