WO2017067373A1 - Data push method and apparatus - Google Patents

Data push method and apparatus Download PDF

Info

Publication number
WO2017067373A1
WO2017067373A1 PCT/CN2016/100598 CN2016100598W WO2017067373A1 WO 2017067373 A1 WO2017067373 A1 WO 2017067373A1 CN 2016100598 W CN2016100598 W CN 2016100598W WO 2017067373 A1 WO2017067373 A1 WO 2017067373A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
service data
service request
data
user terminal
Prior art date
Application number
PCT/CN2016/100598
Other languages
French (fr)
Chinese (zh)
Inventor
许冬冬
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017067373A1 publication Critical patent/WO2017067373A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams

Definitions

  • the present invention relates to the field of network communication technologies, and in particular, to a data pushing method and apparatus.
  • CDN Content Delivery Network
  • the CDN node receives the request from the user terminal, returns the source to the source station, and stores the data accessed by the user terminal.
  • the CDN node that has stored the data directly provides the service.
  • many of the responses of the source station are redirected Uniform Resource Locators (URLs).
  • URLs Uniform Resource Locators
  • the user terminal needs to continue to access the data content according to the redirected URL. Some data may need to be more.
  • the secondary redirecting jump causes the user terminal to take a long time to obtain the target data content. In the prior art, there is a problem that the user terminal obtains data less efficiently.
  • a main object of the present invention is to provide a data push method and apparatus, which are intended to improve the efficiency of data acquisition by a user terminal.
  • the present invention provides a data push method, and the data push method includes:
  • the content distribution network CDN node Upon receiving the service request sent by the user terminal, the content distribution network CDN node determines whether the service data pointed by the service request is currently stored;
  • the CDN node acquires the non-redirected URL based on the redirected URL.
  • the CDN node stores the service data that does not carry the redirect URL as the service Requesting the pointed service data, and transmitting the service data that does not carry the redirect URL to the user terminal;
  • the CDN node When the service data pointed by the service request is currently stored, the CDN node directly sends the service data pointed by the service request to the user terminal.
  • the method before the step of the CDN node directly transmitting the service data pointed by the service request to the user terminal, the method further includes:
  • the CDN node determines whether the service data pointed to by the service request carries a redirect URL
  • the data pushing method further includes the steps of:
  • the CDN node When the service data pointed by the service request carries a redirect URL, the CDN node acquires service data that does not carry the redirect URL based on the redirect URL;
  • the CDN node updates the service data pointed by the service request by using the service data that does not carry the redirect URL, and sends the service data that does not carry the redirect URL to the user terminal.
  • the service data pointed by the service request carries an HTTP status code
  • the step of the CDN node determining whether the service data pointed by the service request carries a redirect URL includes:
  • the business data carries a redirect URL.
  • the method before the step of sending the service data pointed by the service request by the CDN node, when the type of the service data that the service request is directed to is webpage data, the method further includes:
  • the method further includes:
  • the CDN node re-encodes the service data pointed by the service request by using the coding mode of the user terminal when the coding mode used by the service data is different from the coding mode used by the user terminal. And transmitting the re-encoded service data to the user terminal.
  • the present invention further provides a data pushing device, where the data pushing device includes:
  • the first determining module is configured to determine, when the CDN node that the content distribution network is located, receives the service request sent by the user terminal, whether the CDN node currently stores the service data pointed by the service request;
  • An obtaining module configured to: when the CDN node does not currently store the service data pointed by the service request, and the service data pointed by the service request carries the redirected unified data locator URL, obtain the data based on the redirected URL Business data that does not carry a redirect URL;
  • a sending module configured to store the service data that does not carry the redirected URL as the service data pointed by the service request, and send the service data that does not carry the redirected URL to the user terminal;
  • the sending module is further configured to directly send the service data pointed by the service request to the user terminal when the CDN node currently stores the service data pointed by the service request.
  • the data pushing device further includes a second determining module, configured to determine, when the CDN node currently stores the service data pointed by the service request, whether the service data pointed by the service request carries a redirect URL ;
  • the sending module is further configured to directly send the service data pointed by the service request to the user terminal when the service data pointed by the service request does not carry the redirecting URL;
  • the obtaining module is further configured to: when the service data pointed to by the service request carries a redirect URL, obtain the service data that does not carry the redirect URL based on the redirected URL;
  • the sending module is further configured to update the service data pointed by the service request by using the service data that does not carry the redirect URL, and send the service data that does not carry the redirect URL to the user terminal.
  • the service data pointed to by the service request carries an HTTP status code
  • the second determining module is further configured to determine whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code.
  • the service data pointed to by the service request carries a redirect URL when the HTTP status code is consistent with the preset HTTP status code.
  • the data pushing apparatus further includes a third determining module, configured to determine whether the encoding mode used by the service data pointed by the service request is The coding mode adopted by the user terminal is the same;
  • the sending module is further configured to send the service data pointed by the service request to the user terminal when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
  • the sending module is further configured to: when the coding mode used by the service data pointed by the service request is different from the coding mode adopted by the user terminal, use the coding mode of the user terminal to point the service request The service data is re-encoded and the re-encoded service data is sent to the user terminal.
  • Another embodiment of the present invention provides a computer storage medium storing execution instructions for performing the method in the above embodiments.
  • the CDN node When receiving the service request of the user terminal, the CDN node obtains the service data pointed by the service request, and the service data pointed to by the service request carries the redirect URL, and obtains the redirect URL based on the redirected URL.
  • the service data of the redirected URL is not carried, and the service data that does not carry the redirected URL is stored as the service data pointed to by the service request, and the service data that does not carry the redirected URL is pointed to the service request.
  • the service data is sent to the user terminal, and when the service request is received again, the CDN node can provide the service by using the stored service data that does not carry the redirected URL, without the user terminal performing the redirecting jump. Improve the efficiency of user terminals to obtain data.
  • FIG. 1 is a schematic flow chart of a first embodiment of a data pushing method according to the present invention
  • FIG. 2 is a schematic diagram of functional modules of a first embodiment of a data push device according to the present invention.
  • the present invention provides a data push method.
  • the data push method includes:
  • Step S10 Upon receiving the service request sent by the user terminal, the content distribution network CDN node determines whether the service data pointed by the service request is currently stored.
  • the data pushing method provided in this embodiment can be applied to the Internet access.
  • the CDN node receives the webpage access request of the user terminal and does not currently store the webpage data pointed by the webpage access request
  • the webpage access is performed according to the webpage.
  • the CDN node stores the webpage data that does not carry the redirected URL as the webpage data pointed to by the webpage access request, and sends the webpage data that does not carry the redirected URL to the user terminal, which is easy to understand.
  • the CDN node can provide the service by using the stored webpage data that does not carry the redirected URL, thereby reducing response time and improving user terminal acquiring data. s efficiency.
  • the user terminal generates the corresponding URL when receiving the URL input by the user in the browser-based address bar, or the click operation triggered by the hyperlink address displayed by the browser, or the playback operation triggered by the streaming media player.
  • the service request (or the IP address) is sent to the CDN node; when receiving the service request sent by the user terminal, the CDN node determines whether the service data pointed by the service request is currently stored, according to the judgment result.
  • the corresponding operation is performed, for example, when the service data pointed by the service request is stored, the CDN node may directly send the service data pointed by the service request to the user terminal.
  • the method before step S10, the method further includes:
  • the CDN routing device receives the original service request sent by the user terminal, where the original service request carries the original URL requested by the user terminal, and the domain name corresponding to the original URL is the original domain name requested by the user terminal;
  • the routing device returns a redirect response message to the user terminal, where the domain name corresponding to the URL carried by the redirect response message includes an acceleration node selected by the CDN routing device for the user terminal (described in the first embodiment)
  • the URL carried in the service request sent by the user terminal to the CDN routing device is http://www.ZTE.com/news/a.html, wherein the content corresponding to www.ZTE.com is content provider (Content Provider) Provided by CP), and providing a content distribution acceleration service through the CDN, the CDN routing device selects an acceleration node for the user terminal according to a predetermined policy (the identifier of the acceleration node is corresponding to the identifier C1 of the CDN node in the first embodiment), Construct a new URL at http://C1.cdn.net/www.ZTE.com/news/a.html. The user terminal sends a service request to the new URL to obtain the number of pages of the corresponding page stored by the CDN node. according to.
  • a predetermined policy the identifier of the acceleration node is corresponding to the identifier C1 of the CDN node in the first embodiment
  • Construct a new URL at http://C1.cdn.net/www.ZTE.com
  • step S20 when the service data pointed by the service request is not currently stored, and the service data pointed to by the service request carries the redirected unified data locator URL, the CDN node acquires not carried based on the redirected URL. Redirect the business data of the URL;
  • the CDN node when the service data pointed by the service request is not currently stored, forwards the service request to the source station server according to the URL (or IP address) carried by the service request, to receive the The service data that the source station server responds to; when receiving the service data that is sent by the source station server, the CDN node determines whether the service data that the source station server responds carries the redirect URL, which can be understood by those skilled in the art.
  • the service data that the source station server responds carries the redirect URL
  • the CDN node directly returns the service data that the source station server responds to the user terminal
  • the user terminal will receive according to the The redirected URL carried in the service data is redirected and then accessed to obtain the target data, wherein the user terminal may even need to be redirected multiple times during the process of continuing to access. Obviously, this is contrary to the original intention of the CDN.
  • the CDN node when the service data pointed by the service request (that is, the service data that the source station server responds based on the service request) carries the redirect URL, And the CDN node continues to determine whether the service data that is responded to by the source station server corresponding to the redirect URL is carried according to the redirected URL redirection, when receiving the service data of the source station server corresponding to the redirect URL. If there is a redirect URL, if yes, continue the redirect, otherwise go to step S30.
  • Step S30 the CDN node stores the service data that does not carry the redirected URL as the service data pointed by the service request, and sends the service data that does not carry the redirected URL to the user terminal;
  • the service data that does not carry the redirected URL is stored as the service data pointed to by the service request, for the CDN node.
  • the service data providing service that does not carry the redirected URL is directly used; and when the service data that does not carry the redirected URL is stored, the CDN node also performs the Carry redirect URL
  • the service data is sent to the user terminal as the service data pointed by the service request for presentation to the user.
  • the CDN node may further send the service data that does not carry the redirected URL to the user terminal before or after storing the service data that does not carry the redirected URL.
  • Step S40 When currently storing the service data pointed by the service request, the CDN node directly sends the service data pointed by the service request to the user terminal.
  • the CDN node stores the service data in order to receive the service request for the stored service data again, and directly provides the service with the stored service data to achieve the purpose of network acceleration. Therefore, in this embodiment, When the service data pointed by the service request is currently stored, the CDN node directly sends the service data pointed by the service request to the user terminal for presentation to the user.
  • the CDN node may also delete the stored service data when the service request for the stored service data is not received within a preset time period.
  • the preset time period may be set according to actual needs.
  • the preset time period is preferably set to 24 hours in the embodiment, and those skilled in the art may understand that the user is not accessed by periodically deleting for a long time.
  • the business data can improve the utilization of the storage space of the CDN node.
  • the CDN node when the CDN node receives the service request of the user terminal, if the service data pointed by the service request is not currently stored, and the service data pointed by the service request carries the redirect URL, The redirecting URL obtains the service data that does not carry the redirected URL, and stores the service data that does not carry the redirected URL as the service data pointed to by the service request, and the service data that does not carry the redirected URL.
  • the service data that is directed to the service request is sent to the user terminal, and when the service request is received again, the CDN node can provide the service by using the stored service data that does not carry the redirect URL, without the user terminal. Perform redirected jumps to improve the efficiency of user terminals to obtain data.
  • the method further includes:
  • the CDN node determines whether the service data pointed to by the service request carries a redirect URL
  • the data pushing method further includes the steps of:
  • the CDN node When the service data pointed by the service request carries a redirect URL, the CDN node acquires service data that does not carry the redirect URL based on the redirect URL;
  • the CDN node updates the service data pointed by the service request by using the service data that does not carry the redirected URL, and sends the service data that does not carry the redirected URL to the user terminal.
  • the service data stored by the CDN node may be historically acquired based on the prior art, and may exist with a redirect URL. Therefore, in this embodiment, to ensure the CDN.
  • the node can effectively provide an acceleration service.
  • the CDN node first determines whether the service data pointed by the service request carries a redirect URL; if the service request points When the service data does not carry the redirected URL, the CDN node directly sends the service data pointed by the service request to the user terminal, so that the user terminal presents the user data to the user; if the service data pointed by the service request carries When there is a redirect URL, the CDN node obtains the service data that does not carry the redirected URL based on the redirected URL, and the CDN node obtains the service data that does not carry the redirected URL based on the redirected URL.
  • the first embodiment is not described here; when the service data that does not carry the redirected URL is obtained, the CDN node is not carried.
  • URL oriented service data updating service data point to the service request, and service data carries no redirect URL is transmitted to the user terminal, for their presentation to a user.
  • the service data pointed by the service request carries an HTTP status code
  • the CDN node determines the service.
  • the steps of the service data pointed to by the request carrying the redirect URL include:
  • the business data carries a redirect URL.
  • the HTTP Status Code is a 3-digit code used to indicate the HTTP response status of the server. It is defined by the RFC 2616 specification and obtained RFC2518, RFC 2817, RFC 2295, RFC 2774, and RFC 4918. Specification extension. Specifically, the HTTP status code includes a message class status code of 1 header, a success class status code of 2 headers, a redirect class status code of 3 headers, a request error class status code of 4 headers, and a server of 5 prefixes.
  • Error class status code for example, the common HTTP status code "404" indicates that the request failed, the requested resource was not found on the server, and "404" is widely used when the server does not want to reveal exactly why the request was rejected or no other suitable The response is available.
  • the CDN node determines whether the service data pointed by the service request carries a redirect URL based on the redirect header status code of the 3-word header. Specifically, the CDN node preferably passes the HTTP status code “301”. Or “302" to determine, that is, the preset HTTP status code is set to "301" or "302” in this embodiment. Wherein, 301" indicates that the requested resource has been permanently moved to the new location, and the new permanent URL is returned in the Location field of the response; “302" indicates that the requested resource temporarily responds from a different URL, and the temporary URL is The response is returned in the Location field.
  • the HTTP status code carried by the service data pointed by the service request that is extracted by the CDN node is “301” or “302”, it is determined that the service data pointed by the service request carries a redirect URL;
  • the HTTP status code carried by the service data pointed by the service request extracted by the CDN node is not “301” and is not “302”, the service pointed to by the service request is determined.
  • the transaction data does not carry a redirect URL.
  • a fourth embodiment of the data pushing method of the present invention when the type of the service data pointed by the service request is webpage data, the CDN node sends the Before the step of describing the business data pointed to by the business request, the method further includes:
  • the small computer storage letter “A” is 1100001
  • the Xiaowang computer storage letter “A” is 11000010
  • the two sides will misunderstand when exchanging information.
  • Xiao Zhang sent 1100001 to Xiao Wang.
  • Xiao Wang does not think that 1100001 is the letter "A”. It may be considered as the letter "X”. That is to say, Xiao Zhang and Xiao Wang's computers use different encoding methods.
  • the type of the service data pointed to by the service request is webpage data
  • the coding mode adopted by the user terminal is the same as the coding mode used by the service data pointed by the service request.
  • the user terminal can normally present the service data pointed by the service request to the user, and ensure that the displayed webpage does not appear garbled.
  • the CDN node further includes:
  • the CDN node re-encodes the service data pointed by the service request by using the coding mode of the user terminal when the coding mode used by the service data is different from the coding mode used by the user terminal. And transmitting the re-encoded service data to the user terminal.
  • the CDN node uses the coding mode of the user terminal to request the service pointed by the service request.
  • the data is re-encoded, and the re-encoded service data is available for the user terminal to be parsed normally, and the webpage content is presented to the user.
  • the CDN node may separately use the multiple common coding modes to The service data carrying the redirected URL is re-encoded, and the re-encoded service data is separately stored to further improve the efficiency of the user terminal to obtain data.
  • the present invention further provides a data pushing device.
  • the data pushing device includes:
  • the first determining module 10 is configured to determine, when the CDN node that the content distribution network is located, receives the service request sent by the user terminal, whether the CDN node currently stores the service data pointed by the service request;
  • the data pushing device provided in this embodiment can be applied to Internet access, for example,
  • the data pushing device provided by the embodiment is built in the CDN node, and the CDN node receives the webpage access request of the user terminal, and does not currently store the webpage data pointed by the webpage access request, according to the webpage access request.
  • the source station server returns the webpage data pointed to by the webpage access request, and obtains webpage data that does not carry the redirected URL based on the redirected URL when the webpage data that the source station server responds with the redirecting URL;
  • the CDN node stores the webpage data that does not carry the redirected URL as the webpage data pointed to by the webpage access request, and sends the webpage data that does not carry the redirected URL to the user terminal, which is easy to understand
  • the CDN node can provide the service by using the stored webpage data that does not carry the redirected URL, thereby reducing the response time and improving the efficiency of the user terminal acquiring data. .
  • the user terminal generates the corresponding URL when receiving the URL input by the user in the browser-based address bar, or the click operation triggered by the hyperlink address displayed by the browser, or the playback operation triggered by the streaming media player.
  • the service request of the (or IP address) is sent to the CDN node where the first determining module 10 is located; the first determining module 10 determines the CDN when receiving the service request sent by the user terminal based on the CDN node. Whether the node currently stores the service data pointed by the service request, so as to perform a corresponding operation according to the determination result, for example, when the service data pointed by the service request is stored, the service data pointed by the service request may be directly sent. To the user terminal.
  • the first determining module 10 determines whether the CDN node currently stores the service data pointed by the service request, the first determining module 10 further includes:
  • the CDN routing device receives the original service request sent by the user terminal, where the original service request carries the original URL requested by the user terminal, and the domain name corresponding to the original URL is the original domain name requested by the user terminal;
  • the routing device returns a redirect response message to the user terminal, where the domain name corresponding to the URL carried by the redirect response message includes an acceleration node selected by the CDN routing device for the user terminal (described in the first embodiment)
  • the URL carried in the service request sent by the user terminal to the CDN routing device is http://www.ZTE.com/news/a.html, wherein the content corresponding to www.ZTE.com is CP (Content Provider, content)
  • the provider provides, and provides a content distribution acceleration service through the CDN, and the CDN routing device selects an acceleration node for the user terminal according to a predetermined policy (the identifier of the acceleration node is corresponding to the identifier C1 of the CDN node in the first embodiment), constructing a new
  • the URL is http://C1.cdn.net/www.ZTE.com/news/a.html.
  • the user terminal sends a service request to the new URL to obtain page data of a corresponding page stored by the CDN node.
  • the obtaining module 20 is configured to: when the CDN node does not currently store the service data pointed by the service request, and the service data pointed by the service request carries the redirected unified data locator URL, based on the redirect URL Obtaining business data that does not carry a redirect URL;
  • the obtaining module 20 forwards the service request to the source station server according to the URL (or IP address) carried by the service request, Receiving the service data of the source station server response; when the CDN node receives the service data of the source station server response, the obtaining module 20 determines whether the service data that the source station server responds carries Oriented URL, as can be understood by those skilled in the art, when the service data that the source station server responds carries the redirected URL, if the service data responded to by the source station server is directly returned to the user terminal, The user terminal will re-access according to the redirected URL carried in the received service data, and then obtain the target data, wherein the user terminal may even need to be redirected multiple times during the process of continuing to access.
  • the service data pointed by the service request (that is, the service data that the source station server responds based on the service request) carries the redirect URL
  • the obtaining module 20 based on the redirected URL redirection, continues to determine whether the service data responded by the source station server corresponding to the redirected URL is received when receiving the service data of the source station server corresponding to the redirected URL. If the redirected URL is carried, the redirect is continued. Otherwise, the obtained service data that does not carry the redirected URL is pushed to the sending module 30 for processing.
  • the sending module 30 is configured to store the service data that does not carry the redirect URL as the service data pointed by the service request, and send the service data that does not carry the redirect URL. Sent to the user terminal;
  • the sending module 30 when the service data that does not carry the redirected URL is obtained, stores the service data that does not carry the redirected URL as the service data pointed to by the service request, to receive the service again.
  • the service data providing service that does not carry the redirected URL is directly used; and when the service data that does not carry the redirected URL is stored, the sending module 30 further sends the redirected URL.
  • the service data is sent to the user terminal as the service data pointed to by the service request for presentation to the user.
  • the sending module 30 may further send the service data that does not carry the redirected URL to the user terminal before or after storing the service data that does not carry the redirected URL.
  • the sending module 30 is further configured to directly send the service data pointed by the service request to the user terminal when the CDN node currently stores the service data pointed by the service request.
  • the CDN node stores the service data in order to receive the service request for the stored service data again, and directly provides the service with the stored service data to achieve the purpose of network acceleration. Therefore, in this embodiment, When the service data pointed by the service request is currently stored, the sending module 30 directly sends the service data pointed by the service request to the user terminal for presentation to the user.
  • the data pushing apparatus further includes a deleting module, configured to delete the stored service data when the CDN node does not receive a service request for the stored service data within a preset time period.
  • the preset time period may be set according to actual needs.
  • the preset time period is preferably set to 24 hours in the embodiment, and those skilled in the art may understand that the user is not accessed by periodically deleting for a long time.
  • the business data can improve the utilization of the storage space of the CDN node.
  • the data pushing device provided in this embodiment is built in the CDN to receive the operation, and when the CDN node receives the service request of the user terminal, if the service request is not currently stored, The service data, and the service data that the service request is directed to carry the redirect URL, the service data that does not carry the redirect URL is obtained based on the redirected URL, and the service data that does not carry the redirect URL is stored as The service data pointed to by the service request, and the service data not carrying the redirect URL is sent to the user terminal as the service data pointed by the service request, and when the service request is received again, the CDN node is The stored service data that does not carry the redirected URL can be used to provide a service, and the user terminal does not need to perform a redirect jump, thereby improving the efficiency of the user terminal to obtain data.
  • the data pushing device further includes a second determining module, configured to be currently stored in the CDN node.
  • a second determining module configured to be currently stored in the CDN node.
  • the sending module 30 is further configured to: when the service data pointed by the service request does not carry the redirecting URL, directly send the service data pointed by the service request to the user terminal;
  • the obtaining module 20 is further configured to: when the service data pointed to by the service request carries the redirecting URL, obtain the service data that does not carry the redirected URL based on the redirected URL;
  • the sending module 30 is further configured to update the service data pointed by the service request by using the service data that does not carry the redirect URL, and send the service data that does not carry the redirect URL to the user terminal.
  • the service data stored by the CDN node may be historically acquired based on the prior art, and may exist with a redirect URL. Therefore, in this embodiment, to ensure the CDN.
  • the node can effectively provide the acceleration service.
  • the second determining module first determines whether the service data pointed by the service request carries a redirect URL; if the service request points When the service data does not carry the redirected URL, the sending module 30 directly sends the service data pointed by the service request to the user terminal, so that the user terminal presents the user data to the user;
  • the obtaining module 20 obtains the service data that does not carry the redirected URL based on the redirected URL, where the obtaining module 20 obtains the non-portable based on the redirected URL.
  • the sending module 30 updates the service data that does not carry the redirected URL.
  • the service data pointed to by the service request, and the service data not carrying the redirect URL is sent to the user terminal for presentation to the user.
  • the obtaining module 20 determines whether the service data that the source station server responds carries the redirect URL by calling the second determining module.
  • the service data pointed by the service request carries an HTTP status code
  • the second determining module further sets Determining whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code, where the service status is directed to the service data when the HTTP status code is consistent with the preset HTTP status code. Carry a redirect URL.
  • the HTTP Status Code is a 3-digit code used to indicate the HTTP response status of the server. It is defined by the RFC 2616 specification and obtained RFC2518, RFC 2817, RFC 2295, RFC 2774, and RFC 4918. Specification extension. Specifically, the HTTP status code includes a message class status code of 1 header, a success class status code of 2 headers, a redirect class status code of 3 headers, a request error class status code of 4 headers, and a server of 5 prefixes.
  • Error class status code for example, the common HTTP status code "404" indicates that the request failed, the requested resource was not found on the server, and "404" is widely used when the server does not want to reveal exactly why the request was rejected or no other suitable The response is available.
  • the second determining module determines, according to the redirecting class status code of the 3-word header, whether the service data pointed by the service request carries a redirecting URL. Specifically, the second determining module preferably passes the HTTP state.
  • the code “301" or “302” is judged, that is, the preset HTTP status code is set to "301" or "302” in this embodiment. Where 301" indicates that the requested resource has been forever Moved to the new location for a long time, and the new permanent URL is returned in the Location field of the response; "302" indicates that the requested resource temporarily responds from a different URL, and the temporary URL is returned in the Location field of the response.
  • the HTTP status code carried by the service data pointed by the service request by the second determining module is “301” or “302”, it is determined that the service data pointed by the service request carries a redirect URL;
  • the service data pointed to by the service request does not carry the redirected URL when the HTTP status code carried by the service data that is sent by the CDN node is not "301" and is not "302".
  • a fourth embodiment of the data pushing and loading device of the present invention is provided.
  • the data pushing device when the type of the service data pointed by the service request is webpage data, the data pushing device And a third determining module, configured to determine whether the encoding mode used by the service data pointed by the service request is the same as the encoding mode adopted by the user terminal;
  • the sending module is further configured to send the service data pointed by the service request to the user terminal when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
  • the small computer storage letter “A” is 1100001
  • the Xiaowang computer storage letter “A” is 11000010
  • the two sides will misunderstand when exchanging information.
  • Xiao Zhang sent 1100001 to Xiao Wang.
  • Xiao Wang does not think that 1100001 is the letter "A”. It may be considered as the letter "X”. That is to say, Xiao Zhang and Xiao Wang's computers use different encoding methods.
  • the user terminal can normally perform the same manner only when the coding mode adopted by the user terminal is the same as the coding mode used by the service data pointed by the service request.
  • the business data pointed to by the service request is presented to the user to ensure that the displayed webpage is not garbled.
  • the service request sent by the user terminal to the CDN node includes an encoding mode adopted by the user terminal
  • the third determining module may parse the service data pointed by the service request.
  • the third determining module may perform the determination.
  • the sending module 30 is further configured to use the user terminal when the encoding mode used by the service data pointed by the service request is different from the encoding mode adopted by the user terminal.
  • the encoding mode re-encodes the service data pointed by the service request, and sends the re-encoded service data to the user terminal.
  • the sending module 30 uses the coding mode of the user terminal to point to the service request.
  • the service data is re-encoded, and the re-encoded service data is available for the user terminal to be parsed normally, and the webpage content is presented to the user.
  • the sending module 30 may also adopt a plurality of commonly used ones.
  • the encoding method re-encodes the service data that does not carry the redirected URL, and separately stores the re-encoded service data, so as to further improve the efficiency of the user terminal to obtain data.
  • Embodiments of the present invention also provide a storage medium.
  • an execution instruction is stored in the storage medium, and the execution instruction is used to execute the foregoing method.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a data push method and apparatus provided by an embodiment of the present invention have the following beneficial effects: when a service request of a user terminal is received by a CDN node, if the service data pointed by the service request is not currently stored, The service data pointed to by the service request carries the redirected URL, and the service data that does not carry the redirected URL is obtained based on the redirected URL, and the service data that does not carry the redirected URL is stored as the service pointed by the service request.
  • the CDN node may use the stored The service data providing service that does not carry the redirected URL does not require the user terminal to perform a redirect jump, thereby improving the efficiency of the user terminal to obtain data.

Landscapes

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

Abstract

Disclosed is a data push method. The data push method comprises: when receiving a service request sent by a user terminal, a content delivery network (CDN) node determines whether service data pointed by the service request is stored at present or not; when the service data pointed by the service request is not stored at present, and the service data pointed by the service request carries a redirected uniform resource locator (URL), the CDN node acquires, based on the redirected URL, service data that does not carry the redirected URL; the CDN node stores the service data that does not carry the redirected URL as the service data pointed by the service request, and sends the service data that does not carry the redirected URL to the user terminal; and when the service data pointed by the service request is stored at present, the CDN node directly sends the service data pointed by the service request to the user terminal. Also disclosed is a data push apparatus. The present invention is capable of improving the data acquisition efficiency of a user terminal.

Description

数据推送方法及装置Data pushing method and device 技术领域Technical field
本发明涉及网络通信技术领域,尤其涉及一种数据推送方法及装置。The present invention relates to the field of network communication technologies, and in particular, to a data pushing method and apparatus.
背景技术Background technique
目前,以内容分发网络(Content Delivery Network,简称为CDN)为主的网络加速技术已应用于国内外各大运营商。以CDN为例,通过在网络各处设置CDN节点以在现有互联网的基础上构成一层智能虚拟网络,CDN节点接收到用户终端的请求后向源站回源,存储用户终端访问的数据,其他用户终端继续访问该数据时,由已经存储数据的CDN节点直接提供服务。然而,源站的响应有很多是重定向统一资源定位符(Uniform Resource Locator,简称为URL),CDN节点存储重定向URL后,用户终端需要根据重定向URL继续访问数据内容,有些数据甚至需要多次重定向跳转,导致用户终端需要较长时间才能获取到目标数据内容,现有技术中,存在用户终端获取数据效率较低的问题。At present, the network acceleration technology based on the Content Delivery Network (CDN) has been applied to major operators at home and abroad. Taking CDN as an example, by setting up a CDN node throughout the network to form a layer of intelligent virtual network on the basis of the existing Internet, the CDN node receives the request from the user terminal, returns the source to the source station, and stores the data accessed by the user terminal. When other user terminals continue to access the data, the CDN node that has stored the data directly provides the service. However, many of the responses of the source station are redirected Uniform Resource Locators (URLs). After the CDN node stores the redirected URL, the user terminal needs to continue to access the data content according to the redirected URL. Some data may need to be more. The secondary redirecting jump causes the user terminal to take a long time to obtain the target data content. In the prior art, there is a problem that the user terminal obtains data less efficiently.
发明内容Summary of the invention
本发明的主要目的在于提供一种数据推送方法及装置,旨在提高用户终端获取数据的效率。A main object of the present invention is to provide a data push method and apparatus, which are intended to improve the efficiency of data acquisition by a user terminal.
为实现上述目的,本发明提供一种数据推送方法,所述数据推送方法包括:To achieve the above objective, the present invention provides a data push method, and the data push method includes:
在接收到用户终端发送的业务请求时,内容分发网络CDN节点判断当前是否存储有所述业务请求指向的业务数据;Upon receiving the service request sent by the user terminal, the content distribution network CDN node determines whether the service data pointed by the service request is currently stored;
在当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;When the service data pointed to by the service request is not currently stored, and the service data pointed by the service request carries the redirected unified data locator URL, the CDN node acquires the non-redirected URL based on the redirected URL. Business data;
所述CDN节点将所述未携带重定向URL的业务数据存储为所述业务 请求指向的业务数据,并将所述未携带重定向URL的业务数据发送至所述用户终端;The CDN node stores the service data that does not carry the redirect URL as the service Requesting the pointed service data, and transmitting the service data that does not carry the redirect URL to the user terminal;
在当前存储有所述业务请求指向的业务数据时,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端。When the service data pointed by the service request is currently stored, the CDN node directly sends the service data pointed by the service request to the user terminal.
优选地,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端的步骤之前,还包括:Preferably, before the step of the CDN node directly transmitting the service data pointed by the service request to the user terminal, the method further includes:
在当前存储有所述业务请求指向的业务数据时,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL;When the service data pointed by the service request is currently stored, the CDN node determines whether the service data pointed to by the service request carries a redirect URL;
在所述业务请求指向的业务数据未携带有重定向URL时,执行所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端的步骤;And performing, when the service data pointed to by the service request does not carry the redirecting URL, the step of the CDN node directly sending the service data pointed by the service request to the user terminal;
所述判断所述业务请求指向的业务数据是否携带有重定向URL的步骤之后,所述数据推送方法还包括步骤:After the step of determining whether the service data pointed to by the service request carries a redirect URL, the data pushing method further includes the steps of:
在所述业务请求指向的业务数据携带有重定向URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;When the service data pointed by the service request carries a redirect URL, the CDN node acquires service data that does not carry the redirect URL based on the redirect URL;
所述CDN节点采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端The CDN node updates the service data pointed by the service request by using the service data that does not carry the redirect URL, and sends the service data that does not carry the redirect URL to the user terminal.
优选地,所述业务请求指向的业务数据携带有HTTP状态码,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL的步骤包括:Preferably, the service data pointed by the service request carries an HTTP status code, and the step of the CDN node determining whether the service data pointed by the service request carries a redirect URL includes:
所述CDN节点判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。Determining, by the CDN node, whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code, where the service request is directed when the HTTP status code is consistent with a preset HTTP status code The business data carries a redirect URL.
优选地,当所述业务请求指向的业务数据的类型为网页数据时,所述CDN节点发送所述业务请求指向的业务数据的步骤之前,还包括: Preferably, before the step of sending the service data pointed by the service request by the CDN node, when the type of the service data that the service request is directed to is webpage data, the method further includes:
所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;Determining, by the CDN node, whether the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal;
在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,执行所述CDN节点发送所述业务请求指向的业务数据的步骤。And performing the step of transmitting, by the CDN node, the service data pointed by the service request, when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
优选地,所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同的步骤之后,还包括:Preferably, after the step of determining, by the CDN node, that the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal, the method further includes:
在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,所述CDN节点采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。The CDN node re-encodes the service data pointed by the service request by using the coding mode of the user terminal when the coding mode used by the service data is different from the coding mode used by the user terminal. And transmitting the re-encoded service data to the user terminal.
此外,为实现上述目的,本发明还提供了一种数据推送装置,所述数据推送装置包括:In addition, in order to achieve the above object, the present invention further provides a data pushing device, where the data pushing device includes:
第一判断模块,设置为当其所在内容分发网络CDN节点接收到用户终端发送的业务请求时,判断所述CDN节点当前是否存储有所述业务请求指向的业务数据;The first determining module is configured to determine, when the CDN node that the content distribution network is located, receives the service request sent by the user terminal, whether the CDN node currently stores the service data pointed by the service request;
获取模块,设置为在所述CDN节点当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,基于所述重定向URL获取未携带重定向URL的业务数据;An obtaining module, configured to: when the CDN node does not currently store the service data pointed by the service request, and the service data pointed by the service request carries the redirected unified data locator URL, obtain the data based on the redirected URL Business data that does not carry a redirect URL;
发送模块,设置为将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,并将所述未携带重定向URL的业务数据发送至所述用户终端;a sending module, configured to store the service data that does not carry the redirected URL as the service data pointed by the service request, and send the service data that does not carry the redirected URL to the user terminal;
所述发送模块还设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,直接将所述业务请求指向的业务数据发送至所述用户终端。 The sending module is further configured to directly send the service data pointed by the service request to the user terminal when the CDN node currently stores the service data pointed by the service request.
优选地,所述数据推送装置还包括第二判断模块,设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,判断所述业务请求指向的业务数据是否携带有重定向URL;Preferably, the data pushing device further includes a second determining module, configured to determine, when the CDN node currently stores the service data pointed by the service request, whether the service data pointed by the service request carries a redirect URL ;
所述发送模块还设置为在所述业务请求指向的业务数据未携带有重定向URL时,直接将所述业务请求指向的业务数据发送至所述用户终端;The sending module is further configured to directly send the service data pointed by the service request to the user terminal when the service data pointed by the service request does not carry the redirecting URL;
所述获取模块还设置为在所述业务请求指向的业务数据携带有重定向URL时,基于所述重定向URL获取未携带重定向URL的业务数据;The obtaining module is further configured to: when the service data pointed to by the service request carries a redirect URL, obtain the service data that does not carry the redirect URL based on the redirected URL;
所述发送模块还设置为采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端。The sending module is further configured to update the service data pointed by the service request by using the service data that does not carry the redirect URL, and send the service data that does not carry the redirect URL to the user terminal.
优选地,所述业务请求指向的业务数据携带有HTTP状态码,所述第二判断模块还设置为判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。Preferably, the service data pointed to by the service request carries an HTTP status code, and the second determining module is further configured to determine whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code. The service data pointed to by the service request carries a redirect URL when the HTTP status code is consistent with the preset HTTP status code.
优选地,当所述业务请求指向的业务数据的类型为网页数据时,所述数据推送装置还包括第三判断模块,设置为判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;Preferably, when the type of the service data pointed to by the service request is webpage data, the data pushing apparatus further includes a third determining module, configured to determine whether the encoding mode used by the service data pointed by the service request is The coding mode adopted by the user terminal is the same;
所述发送模块还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,将所述业务请求指向的业务数据发送至所述用户终端。The sending module is further configured to send the service data pointed by the service request to the user terminal when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
优选地,所述发送模块还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。Preferably, the sending module is further configured to: when the coding mode used by the service data pointed by the service request is different from the coding mode adopted by the user terminal, use the coding mode of the user terminal to point the service request The service data is re-encoded and the re-encoded service data is sent to the user terminal.
本发明另一实施例提供了一种计算机存储介质,所述计算机存储介质存储有执行指令,所述执行指令用于执行上述实施例中的方法。 Another embodiment of the present invention provides a computer storage medium storing execution instructions for performing the method in the above embodiments.
本发明通过CDN节点在接收到用户终端的业务请求时,若当前未存储所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带重定向URL,则基于所述重定向URL获取未携带重定向URL的业务数据,并将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,以及将所述未携带重定向URL的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,当再次接收到所述业务请求时,所述CDN节点即可用存储的所述未携带重定向URL的业务数据提供服务,无需用户终端进行重定向跳转,提高用户终端获取数据的效率。When receiving the service request of the user terminal, the CDN node obtains the service data pointed by the service request, and the service data pointed to by the service request carries the redirect URL, and obtains the redirect URL based on the redirected URL. The service data of the redirected URL is not carried, and the service data that does not carry the redirected URL is stored as the service data pointed to by the service request, and the service data that does not carry the redirected URL is pointed to the service request. The service data is sent to the user terminal, and when the service request is received again, the CDN node can provide the service by using the stored service data that does not carry the redirected URL, without the user terminal performing the redirecting jump. Improve the efficiency of user terminals to obtain data.
附图说明DRAWINGS
图1为本发明数据推送方法第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of a data pushing method according to the present invention;
图2为本发明数据推送装置第一实施例的功能模块示意图。2 is a schematic diagram of functional modules of a first embodiment of a data push device according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种数据推送方法,参照图1,在本发明数据推送方法的第一实施例中,所述数据推送方法包括:The present invention provides a data push method. Referring to FIG. 1, in a first embodiment of the data push method of the present invention, the data push method includes:
步骤S10,在接收到用户终端发送的业务请求时,内容分发网络CDN节点判断当前是否存储有所述业务请求指向的业务数据;Step S10: Upon receiving the service request sent by the user terminal, the content distribution network CDN node determines whether the service data pointed by the service request is currently stored.
本实施例提供的数据推送方法可以应用于互联网访问中,例如,CDN节点在接收到用户终端的网页访问请求,且当前未存储有所述网页访问请求指向的网页数据时,根据所述网页访问请求向源站服务器回源所述网页访问请求指向的网页数据,并在所述源站服务器响应的网页数据携带重定向URL时,基于所述重定向URL获取未携带重定向URL的网页数据; 所述CDN节点将所述未携带重定向URL的网页数据作为所述网页访问请求指向的网页数据存储,并将所述未携带重定向URL的网页数据发送至所述用户终端,容易理解的是,当存储的所述未携带重定向URL的网页数据再次被访问时,所述CDN节点即可用存储的所述未携带重定向URL的网页数据提供服务,减小响应时间,提高用户终端获取数据的效率。The data pushing method provided in this embodiment can be applied to the Internet access. For example, when the CDN node receives the webpage access request of the user terminal and does not currently store the webpage data pointed by the webpage access request, the webpage access is performed according to the webpage. Retrieving the webpage data pointed to by the webpage access request to the source station server, and acquiring the webpage data that does not carry the redirected URL based on the redirected URL when the webpage data that the source station server responds with the redirecting URL; The CDN node stores the webpage data that does not carry the redirected URL as the webpage data pointed to by the webpage access request, and sends the webpage data that does not carry the redirected URL to the user terminal, which is easy to understand. When the stored webpage data that does not carry the redirected URL is accessed again, the CDN node can provide the service by using the stored webpage data that does not carry the redirected URL, thereby reducing response time and improving user terminal acquiring data. s efficiency.
可选地,用户终端在接收到用户基于浏览器的地址栏输入的URL,或者基于浏览器显示的超链接地址触发的点击操作,或者基于流媒体播放器触发的播放操作时,生成携带相应URL(或者IP地址)的业务请求发送至所述CDN节点;所述CDN节点在接收到所述用户终端发送的业务请求时,判断当前是否存储有所述业务请求指向的业务数据,以根据判断结果执行相应的操作,例如,在存储有所述业务请求指向的业务数据时,所述CDN节点即可直接将所述业务请求指向的业务数据发送至所述用户终端。Optionally, the user terminal generates the corresponding URL when receiving the URL input by the user in the browser-based address bar, or the click operation triggered by the hyperlink address displayed by the browser, or the playback operation triggered by the streaming media player. The service request (or the IP address) is sent to the CDN node; when receiving the service request sent by the user terminal, the CDN node determines whether the service data pointed by the service request is currently stored, according to the judgment result. The corresponding operation is performed, for example, when the service data pointed by the service request is stored, the CDN node may directly send the service data pointed by the service request to the user terminal.
在其他实施例中,上述步骤S10之前,还包括:In other embodiments, before step S10, the method further includes:
CDN路由设备接收所述用户终端发送的原始业务请求,所述原始业务请求携带有所述用户终端请求的原始URL,所述原始URL对应的域名为所述用户终端请求的原始域名;所述CDN路由设备向所述用户终端返回重定向响应消息,所述重定向响应消息携带的URL对应的域名中包括所述CDN路由设备为所述用户终端选择的加速节点(第一实施例中所述的CDN节点)的标识,以供所述用户终端向所述CDN节点发送业务请求,由所述CDN节点提供加速服务。The CDN routing device receives the original service request sent by the user terminal, where the original service request carries the original URL requested by the user terminal, and the domain name corresponding to the original URL is the original domain name requested by the user terminal; The routing device returns a redirect response message to the user terminal, where the domain name corresponding to the URL carried by the redirect response message includes an acceleration node selected by the CDN routing device for the user terminal (described in the first embodiment) An identifier of the CDN node for the user terminal to send a service request to the CDN node, and the CDN node provides an acceleration service.
例如,用户终端向CDN路由设备发送的业务请求中携带的URL为http://www.ZTE.com/news/a.html,其中,www.ZTE.com对应的内容由内容提供商(Content Provider,简称为CP)提供,并且通过CDN提供内容分发加速服务,CDN路由设备根据预定策略为用户终端选择一个加速节点(加速节点的标识为对应第一实施例中所述CDN节点的标识C1),构造新的URL为http://C1.cdn.net/www.ZTE.com/news/a.html。用户终端向所述新的URL发送业务请求即可获取到所述CDN节点存储的相应页面的页面数 据。For example, the URL carried in the service request sent by the user terminal to the CDN routing device is http://www.ZTE.com/news/a.html, wherein the content corresponding to www.ZTE.com is content provider (Content Provider) Provided by CP), and providing a content distribution acceleration service through the CDN, the CDN routing device selects an acceleration node for the user terminal according to a predetermined policy (the identifier of the acceleration node is corresponding to the identifier C1 of the CDN node in the first embodiment), Construct a new URL at http://C1.cdn.net/www.ZTE.com/news/a.html. The user terminal sends a service request to the new URL to obtain the number of pages of the corresponding page stored by the CDN node. according to.
步骤S20,在当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;In step S20, when the service data pointed by the service request is not currently stored, and the service data pointed to by the service request carries the redirected unified data locator URL, the CDN node acquires not carried based on the redirected URL. Redirect the business data of the URL;
本实施例中,在当前未存储有所述业务请求指向的业务数据时,所述CDN节点根据所述业务请求携带的URL(或者IP地址)向源站服务器转发所述业务请求,以接收所述源站服务器响应的业务数据;在接收到所述源站服务器响应的业务数据时,所述CDN节点判断所述源站服务器响应的业务数据是否携带有重定向URL,本领域技术人员可以理解的是,在所述源站服务器响应的业务数据携带有重定向URL时,若所述CDN节点直接将所述源站服务器响应的业务数据返回至所述用户终端,所述用户终端将根据接收的业务数据中携带的重定向URL重定向后继续访问,以获取目标数据,其中,所述用户终端在继续访问的过程中甚至还可能需要多次重定向。显然,这与CDN的初衷是有悖的,因此,在本实施例中,当所述业务请求指向的业务数据(即源站服务器基于所述业务请求响应的业务数据)携带有重定向URL时,所述CDN节点基于所述重定向URL重定向,在接收到所述重定向URL对应的源站服务器响应的业务数据时,继续判断重定向URL对应的源站服务器所响应的业务数据是否携带有重定向URL,是则继续重定向,否则转入步骤S30。In this embodiment, when the service data pointed by the service request is not currently stored, the CDN node forwards the service request to the source station server according to the URL (or IP address) carried by the service request, to receive the The service data that the source station server responds to; when receiving the service data that is sent by the source station server, the CDN node determines whether the service data that the source station server responds carries the redirect URL, which can be understood by those skilled in the art. When the service data that the source station server responds carries the redirect URL, if the CDN node directly returns the service data that the source station server responds to the user terminal, the user terminal will receive according to the The redirected URL carried in the service data is redirected and then accessed to obtain the target data, wherein the user terminal may even need to be redirected multiple times during the process of continuing to access. Obviously, this is contrary to the original intention of the CDN. Therefore, in the embodiment, when the service data pointed by the service request (that is, the service data that the source station server responds based on the service request) carries the redirect URL, And the CDN node continues to determine whether the service data that is responded to by the source station server corresponding to the redirect URL is carried according to the redirected URL redirection, when receiving the service data of the source station server corresponding to the redirect URL. If there is a redirect URL, if yes, continue the redirect, otherwise go to step S30.
步骤S30,所述CDN节点将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,并将所述未携带重定向URL的业务数据发送至所述用户终端;Step S30, the CDN node stores the service data that does not carry the redirected URL as the service data pointed by the service request, and sends the service data that does not carry the redirected URL to the user terminal;
本实施例中,所述CDN节点在获取到未携带重定向URL的业务数据时,将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,以供所述CDN节点再次接收到所述业务请求时,直接使用存储的所述未携带重定向URL的业务数据提供服务;在存储所述未携带重定向URL的业务数据的同时,所述CDN节点还将所述未携带重定向URL 的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,供其呈现给用户。在其他实施例中,所述CDN节点还可以在存储所述未携带重定向URL的业务数据之前或者之后发送所述未携带重定向URL的业务数据至所述用户终端。In this embodiment, when the CDN node obtains the service data that does not carry the redirected URL, the service data that does not carry the redirected URL is stored as the service data pointed to by the service request, for the CDN node. When the service request is received again, the service data providing service that does not carry the redirected URL is directly used; and when the service data that does not carry the redirected URL is stored, the CDN node also performs the Carry redirect URL The service data is sent to the user terminal as the service data pointed by the service request for presentation to the user. In other embodiments, the CDN node may further send the service data that does not carry the redirected URL to the user terminal before or after storing the service data that does not carry the redirected URL.
步骤S40,在当前存储有所述业务请求指向的业务数据时,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端。Step S40: When currently storing the service data pointed by the service request, the CDN node directly sends the service data pointed by the service request to the user terminal.
容易理解的是,CDN节点存储业务数据的目的在于再次接收到指向存储的业务数据的业务请求时,直接用存储的所述业务数据提供服务,以达到网络加速的目的,因此,本实施例中,在当前存储有所述业务请求指向的业务数据时,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端,供其呈现给用户。It is easy to understand that the CDN node stores the service data in order to receive the service request for the stored service data again, and directly provides the service with the stored service data to achieve the purpose of network acceleration. Therefore, in this embodiment, When the service data pointed by the service request is currently stored, the CDN node directly sends the service data pointed by the service request to the user terminal for presentation to the user.
在其他实施例中,所述CDN节点还可以在预设时间段内未接收到指向存储的业务数据的业务请求时,删除存储的所述业务数据。In other embodiments, the CDN node may also delete the stored service data when the service request for the stored service data is not received within a preset time period.
其中,所述预设时间段可按实际需要进行设置,例如,本实施例优选将所述预设时间段设置为24小时,本领域技术人员可以理解的是,通过定期删除长时间未被访问的业务数据,能够提升CDN节点存储空间的利用率。The preset time period may be set according to actual needs. For example, the preset time period is preferably set to 24 hours in the embodiment, and those skilled in the art may understand that the user is not accessed by periodically deleting for a long time. The business data can improve the utilization of the storage space of the CDN node.
本实施例提出的数据推送方法,CDN节点在接收到用户终端的业务请求时,若当前未存储所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带重定向URL,则基于所述重定向URL获取未携带重定向URL的业务数据,并将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,以及将所述未携带重定向URL的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,当再次接收到所述业务请求时,所述CDN节点即可用存储的所述未携带重定向URL的业务数据提供服务,无需用户终端进行重定向跳转,提高用户终端获取数据的效率。 In the data push method of the embodiment, when the CDN node receives the service request of the user terminal, if the service data pointed by the service request is not currently stored, and the service data pointed by the service request carries the redirect URL, The redirecting URL obtains the service data that does not carry the redirected URL, and stores the service data that does not carry the redirected URL as the service data pointed to by the service request, and the service data that does not carry the redirected URL. The service data that is directed to the service request is sent to the user terminal, and when the service request is received again, the CDN node can provide the service by using the stored service data that does not carry the redirect URL, without the user terminal. Perform redirected jumps to improve the efficiency of user terminals to obtain data.
可选地,基于第一实施例,提出本发明数据推送方法的第二实施例,在本实施例中,上述步骤S40之前,还包括:Optionally, based on the first embodiment, a second embodiment of the data pushing method of the present invention is proposed. In the embodiment, before the step S40, the method further includes:
在当前存储有所述业务请求指向的业务数据时,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL;When the service data pointed by the service request is currently stored, the CDN node determines whether the service data pointed to by the service request carries a redirect URL;
在所述业务请求指向的业务数据未携带有重定向URL时,执行上述步骤S40;When the service data pointed to by the service request does not carry a redirect URL, perform the above step S40;
所述判断所述业务请求指向的业务数据是否携带有重定向URL的步骤之后,所述数据推送方法还包括步骤:After the step of determining whether the service data pointed to by the service request carries a redirect URL, the data pushing method further includes the steps of:
在所述业务请求指向的业务数据携带有重定向URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;When the service data pointed by the service request carries a redirect URL, the CDN node acquires service data that does not carry the redirect URL based on the redirect URL;
所述CDN节点采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端。The CDN node updates the service data pointed by the service request by using the service data that does not carry the redirected URL, and sends the service data that does not carry the redirected URL to the user terminal.
需要说明的是,在实际应用中,所述CDN节点存储的业务数据可能是历史基于现有技术获取的,可能存在携带重定向URL的情况,因此,在本实施例中,为确保所述CDN节点能够有效的提供加速服务,在当前存储有所述业务请求指向的业务数据时,所述CDN节点首先判断所述业务请求指向的业务数据是否携带有重定向URL;若所述业务请求指向的业务数据未携带有重定向URL时,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端,供用户终端将其呈现给用户;若所述业务请求指向的业务数据携带有重定向URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据,其中,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据具体可参照第一实施例,此处不再赘述;在获取到未携带重定向URL的业务数据时,所述CDN节点采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端,供其呈现给用户。 It should be noted that, in actual applications, the service data stored by the CDN node may be historically acquired based on the prior art, and may exist with a redirect URL. Therefore, in this embodiment, to ensure the CDN. The node can effectively provide an acceleration service. When the service data pointed by the service request is currently stored, the CDN node first determines whether the service data pointed by the service request carries a redirect URL; if the service request points When the service data does not carry the redirected URL, the CDN node directly sends the service data pointed by the service request to the user terminal, so that the user terminal presents the user data to the user; if the service data pointed by the service request carries When there is a redirect URL, the CDN node obtains the service data that does not carry the redirected URL based on the redirected URL, and the CDN node obtains the service data that does not carry the redirected URL based on the redirected URL. The first embodiment is not described here; when the service data that does not carry the redirected URL is obtained, the CDN node is not carried. URL oriented service data updating service data point to the service request, and service data carries no redirect URL is transmitted to the user terminal, for their presentation to a user.
可选地,基于第二实施例,提出本发明数据推送方法的第三实施例,在本实施例中,所述业务请求指向的业务数据携带有HTTP状态码,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL的步骤包括:Optionally, based on the second embodiment, a third embodiment of the data pushing method of the present invention is proposed. In this embodiment, the service data pointed by the service request carries an HTTP status code, and the CDN node determines the service. The steps of the service data pointed to by the request carrying the redirect URL include:
所述CDN节点判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。Determining, by the CDN node, whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code, where the service request is directed when the HTTP status code is consistent with a preset HTTP status code The business data carries a redirect URL.
需要说明的是,HTTP状态码(HTTP Status Code)是用以表示服务器HTTP响应状态的3位数字代码,它由RFC 2616规范定义,并得到RFC2518、RFC 2817、RFC 2295、RFC 2774以及RFC 4918等规范扩展。具体的,HTTP状态码包括1字头的消息类状态码、2字头的成功类状态码、3字头的重定向类状态码、4字头的请求错误类状态码以及5字头的服务器错误类状态码,例如,常见的HTTP状态码“404”表示请求失败,请求得到的资源未在服务器上发现,“404”被广泛应用于当服务器不想揭示到底为何请求被拒绝或者没有其他适合的响应可用的情况下。It should be noted that the HTTP Status Code is a 3-digit code used to indicate the HTTP response status of the server. It is defined by the RFC 2616 specification and obtained RFC2518, RFC 2817, RFC 2295, RFC 2774, and RFC 4918. Specification extension. Specifically, the HTTP status code includes a message class status code of 1 header, a success class status code of 2 headers, a redirect class status code of 3 headers, a request error class status code of 4 headers, and a server of 5 prefixes. Error class status code, for example, the common HTTP status code "404" indicates that the request failed, the requested resource was not found on the server, and "404" is widely used when the server does not want to reveal exactly why the request was rejected or no other suitable The response is available.
本实施例中,所述CDN节点基于3字头的重定向类状态码判断所述业务请求指向的业务数据是否携带有重定向URL,具体的,所述CDN节点优选通过HTTP状态码“301”或“302”进行判断,即本实施例将所述预设HTTP状态码设为“301”或“302”。其中,301”表示被请求的资源已永久移动到新位置,且新的永久性的URL在响应的Location字段中返回;“302”表示请求的资源临时从不同的URL响应,且临时的URL在响应的Location字段中返回。In this embodiment, the CDN node determines whether the service data pointed by the service request carries a redirect URL based on the redirect header status code of the 3-word header. Specifically, the CDN node preferably passes the HTTP status code “301”. Or "302" to determine, that is, the preset HTTP status code is set to "301" or "302" in this embodiment. Wherein, 301" indicates that the requested resource has been permanently moved to the new location, and the new permanent URL is returned in the Location field of the response; "302" indicates that the requested resource temporarily responds from a different URL, and the temporary URL is The response is returned in the Location field.
例如,当所述CDN节点提取的所述业务请求指向的业务数据携带的HTTP状态码为“301”或“302”时,确定所述业务请求指向的业务数据携带有重定向URL;当所述CDN节点提取的所述业务请求指向的业务数据携带的HTTP状态码不为“301”且不为“302”时,确定所述业务请求指向的业 务数据未携带有重定向URL。For example, when the HTTP status code carried by the service data pointed by the service request that is extracted by the CDN node is “301” or “302”, it is determined that the service data pointed by the service request carries a redirect URL; When the HTTP status code carried by the service data pointed by the service request extracted by the CDN node is not “301” and is not “302”, the service pointed to by the service request is determined. The transaction data does not carry a redirect URL.
可选地,基于第一实施例,提出本发明数据推送方法的第四实施例,在本实施例中,当所述业务请求指向的业务数据的类型为网页数据时,所述CDN节点发送所述业务请求指向的业务数据的步骤之前,还包括:Optionally, based on the first embodiment, a fourth embodiment of the data pushing method of the present invention is provided. In this embodiment, when the type of the service data pointed by the service request is webpage data, the CDN node sends the Before the step of describing the business data pointed to by the business request, the method further includes:
所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;Determining, by the CDN node, whether the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal;
在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,执行所述CDN节点发送所述业务请求指向的业务数据的步骤。And performing the step of transmitting, by the CDN node, the service data pointed by the service request, when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
需要说明的是,在互联网中,存在多种类型的数据,例如,网页数据、音频数据以及视频数据等。我们在显示器上看见的文字、图片等信息在电脑里面其实并不是我们看见的样子,即使你知道所有信息都存储在硬盘里,把它拆开也看不见里面有任何东西,只有些盘片。假设,你用显微镜把盘片放大,会看见盘片表面凹凸不平,凸起的地方被磁化,凹的地方是没有被磁化;凸起的地方代表数字1,凹的地方代表数字0。硬盘只能用0和1来表示所有文字、图片等信息。那么字母“A”在硬盘上是如何存储的呢?可能小张电脑存储字母“A”是1100001,而小王电脑存储字母“A”是11000010,这样双方交换信息时就会误解。比如小张把1100001发送给小王,小王并不认为1100001是字母”A”,可能认为这是字母”X”,也就是说,小张和小王的电脑使用了不同的编码方式。本领域技术人员可以理解的是,当所述业务请求指向的业务数据的类型为网页数据时,只有所述用户终端采用的编码方式与所述业务请求指向的业务数据采用的编码方式相同时,所述用户终端才能正常的将所述业务请求指向的业务数据呈现给用户,确保显示的网页不出现乱码。It should be noted that in the Internet, there are various types of data, such as web page data, audio data, and video data. The text, pictures and other information that we see on the monitor are not what we see in the computer. Even if you know that all the information is stored on the hard disk, you can't see anything inside, just some discs. Suppose, if you magnify the disc with a microscope, you will see that the surface of the disc is uneven, the raised area is magnetized, and the concave area is not magnetized; the raised area represents the number 1, and the concave part represents the number 0. The hard disk can only use 0 and 1 to represent all text, pictures and other information. So how is the letter "A" stored on the hard disk? It is possible that the small computer storage letter "A" is 1100001, and the Xiaowang computer storage letter "A" is 11000010, so that the two sides will misunderstand when exchanging information. For example, Xiao Zhang sent 1100001 to Xiao Wang. Xiao Wang does not think that 1100001 is the letter "A". It may be considered as the letter "X". That is to say, Xiao Zhang and Xiao Wang's computers use different encoding methods. It can be understood by those skilled in the art that when the type of the service data pointed to by the service request is webpage data, only when the coding mode adopted by the user terminal is the same as the coding mode used by the service data pointed by the service request, The user terminal can normally present the service data pointed by the service request to the user, and ensure that the displayed webpage does not appear garbled.
本实施例中,所述用户终端向所述CDN节点发送的所述业务请求包括所述用户终端采用的编码方式,同时,所述CDN节点可以通过解析出 所述业务请求指向的业务数据中的“charset=xxx”字段,确定所述业务请求指向的业务数据所采用的编码方式,其中的“xxx”部分就是所述业务请求指向的业务数据采用的编码,常用的编码包括GB2312,GBK,UTF-8,ISO8859-1等。在确定所述用户终端采用的编码方式以及确定所述业务请求指向的业务数据采用的编码方式之后,即可进行判断。In this embodiment, the service request sent by the user terminal to the CDN node includes an encoding mode adopted by the user terminal, and the CDN node may be parsed by The "charset=xxx" field in the service data pointed to by the service request determines the coding mode used by the service data pointed by the service request, where the "xxx" part is the code used by the service data pointed by the service request. Commonly used codes include GB2312, GBK, UTF-8, ISO8859-1 and so on. After determining the coding mode adopted by the user terminal and determining the coding mode used by the service data pointed by the service request, the determination may be performed.
可选地,为确保网页能够正常显示,所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同的步骤之后,还包括:Optionally, after the step of determining, by the CDN node, that the coding mode used by the service data to be used by the service request is the same as the coding mode adopted by the user terminal, the CDN node further includes:
在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,所述CDN节点采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。The CDN node re-encodes the service data pointed by the service request by using the coding mode of the user terminal when the coding mode used by the service data is different from the coding mode used by the user terminal. And transmitting the re-encoded service data to the user terminal.
容易理解的是,在所述用户终端采用的编码方式与所述业务请求指向的业务数据采用的编码方式不同时,所述CDN节点采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,重编码后的业务数据即可供所述用户终端正常解析,将网页内容呈现给用户。It is easy to understand that when the coding mode adopted by the user terminal is different from the coding mode used by the service data pointed by the service request, the CDN node uses the coding mode of the user terminal to request the service pointed by the service request. The data is re-encoded, and the re-encoded service data is available for the user terminal to be parsed normally, and the webpage content is presented to the user.
本领域技术人员可以理解的是,在其他实施例中,所述CDN节点在从源站服务器获取到未携带重定向URL的业务数据之后,还可以分别采用多种常用的编码方式对所述未携带重定向URL的业务数据进行重编码,并分别存储重编码后的业务数据,以进一步提升用户终端获取数据的效率。It can be understood by those skilled in the art that, in other embodiments, after the CDN node obtains the service data that does not carry the redirected URL from the source station server, the CDN node may separately use the multiple common coding modes to The service data carrying the redirected URL is re-encoded, and the re-encoded service data is separately stored to further improve the efficiency of the user terminal to obtain data.
可选地,本发明还提供一种数据推送装置,参照图2,在本发明数据推送装置的第一实施例中,所述数据推送装置包括:Optionally, the present invention further provides a data pushing device. Referring to FIG. 2, in the first embodiment of the data pushing device of the present invention, the data pushing device includes:
第一判断模块10,设置为当其所在内容分发网络CDN节点接收到用户终端发送的业务请求时,判断所述CDN节点当前是否存储有所述业务请求指向的业务数据;The first determining module 10 is configured to determine, when the CDN node that the content distribution network is located, receives the service request sent by the user terminal, whether the CDN node currently stores the service data pointed by the service request;
本实施例提供的数据推送装置可以应用于互联网访问中,例如,本实 施例提供的数据推送装置内置于CDN节点运行,所述CDN节点在接收到用户终端的网页访问请求,且当前未存储有所述网页访问请求指向的网页数据时,根据所述网页访问请求向源站服务器回源所述网页访问请求指向的网页数据,并在所述源站服务器响应的网页数据携带重定向URL时,基于所述重定向URL获取未携带重定向URL的网页数据;所述CDN节点将所述未携带重定向URL的网页数据作为所述网页访问请求指向的网页数据存储,并将所述未携带重定向URL的网页数据发送至所述用户终端,容易理解的是,当存储的所述未携带重定向URL的网页数据再次被访问时,所述CDN节点即可用存储的所述未携带重定向URL的网页数据提供服务,减小响应时间,提高用户终端获取数据的效率。The data pushing device provided in this embodiment can be applied to Internet access, for example, The data pushing device provided by the embodiment is built in the CDN node, and the CDN node receives the webpage access request of the user terminal, and does not currently store the webpage data pointed by the webpage access request, according to the webpage access request. The source station server returns the webpage data pointed to by the webpage access request, and obtains webpage data that does not carry the redirected URL based on the redirected URL when the webpage data that the source station server responds with the redirecting URL; The CDN node stores the webpage data that does not carry the redirected URL as the webpage data pointed to by the webpage access request, and sends the webpage data that does not carry the redirected URL to the user terminal, which is easy to understand When the stored webpage data that does not carry the redirected URL is accessed again, the CDN node can provide the service by using the stored webpage data that does not carry the redirected URL, thereby reducing the response time and improving the efficiency of the user terminal acquiring data. .
可选地,用户终端在接收到用户基于浏览器的地址栏输入的URL,或者基于浏览器显示的超链接地址触发的点击操作,或者基于流媒体播放器触发的播放操作时,生成携带相应URL(或者IP地址)的业务请求发送至第一判断模块10所在的CDN节点;所述第一判断模块10在基于所述CDN节点在接收到所述用户终端发送的业务请求时,判断所述CDN节点当前是否存储有所述业务请求指向的业务数据,以根据判断结果执行相应的操作,例如,在存储有所述业务请求指向的业务数据时,可直接将所述业务请求指向的业务数据发送至所述用户终端。Optionally, the user terminal generates the corresponding URL when receiving the URL input by the user in the browser-based address bar, or the click operation triggered by the hyperlink address displayed by the browser, or the playback operation triggered by the streaming media player. The service request of the (or IP address) is sent to the CDN node where the first determining module 10 is located; the first determining module 10 determines the CDN when receiving the service request sent by the user terminal based on the CDN node. Whether the node currently stores the service data pointed by the service request, so as to perform a corresponding operation according to the determination result, for example, when the service data pointed by the service request is stored, the service data pointed by the service request may be directly sent. To the user terminal.
在其他实施例中,所述第一判断模块10判断所述CDN节点当前是否存储有所述业务请求指向的业务数据之前,还包括:In other embodiments, before the first determining module 10 determines whether the CDN node currently stores the service data pointed by the service request, the first determining module 10 further includes:
CDN路由设备接收所述用户终端发送的原始业务请求,所述原始业务请求携带有所述用户终端请求的原始URL,所述原始URL对应的域名为所述用户终端请求的原始域名;所述CDN路由设备向所述用户终端返回重定向响应消息,所述重定向响应消息携带的URL对应的域名中包括所述CDN路由设备为所述用户终端选择的加速节点(第一实施例中所述的CDN节点)的标识,以供所述用户终端向所述CDN节点发送业务请求,由所述CDN节点提供加速服务。 The CDN routing device receives the original service request sent by the user terminal, where the original service request carries the original URL requested by the user terminal, and the domain name corresponding to the original URL is the original domain name requested by the user terminal; The routing device returns a redirect response message to the user terminal, where the domain name corresponding to the URL carried by the redirect response message includes an acceleration node selected by the CDN routing device for the user terminal (described in the first embodiment) An identifier of the CDN node for the user terminal to send a service request to the CDN node, and the CDN node provides an acceleration service.
例如,用户终端向CDN路由设备发送的业务请求中携带的URL为http://www.ZTE.com/news/a.html,其中,www.ZTE.com对应的内容由CP(Content Provider,内容提供商)提供,并且通过CDN提供内容分发加速服务,CDN路由设备根据预定策略为用户终端选择一个加速节点(加速节点的标识为对应第一实施例中所述CDN节点的标识C1),构造新的URL为http://C1.cdn.net/www.ZTE.com/news/a.html。用户终端向所述新的URL发送业务请求即可获取到所述CDN节点存储的相应页面的页面数据。For example, the URL carried in the service request sent by the user terminal to the CDN routing device is http://www.ZTE.com/news/a.html, wherein the content corresponding to www.ZTE.com is CP (Content Provider, content) The provider provides, and provides a content distribution acceleration service through the CDN, and the CDN routing device selects an acceleration node for the user terminal according to a predetermined policy (the identifier of the acceleration node is corresponding to the identifier C1 of the CDN node in the first embodiment), constructing a new The URL is http://C1.cdn.net/www.ZTE.com/news/a.html. The user terminal sends a service request to the new URL to obtain page data of a corresponding page stored by the CDN node.
获取模块20,设置为在所述CDN节点当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,基于所述重定向URL获取未携带重定向URL的业务数据;The obtaining module 20 is configured to: when the CDN node does not currently store the service data pointed by the service request, and the service data pointed by the service request carries the redirected unified data locator URL, based on the redirect URL Obtaining business data that does not carry a redirect URL;
本实施例中,在所述CDN节点当前未存储有所述业务请求指向的业务数据时,获取模块20根据所述业务请求携带的URL(或者IP地址)向源站服务器转发所述业务请求,以接收所述源站服务器响应的业务数据;在基于所述CDN节点接收到所述源站服务器响应的业务数据时,所述获取模块20判断所述源站服务器响应的业务数据是否携带有重定向URL,本领域技术人员可以理解的是,在所述源站服务器响应的业务数据携带有重定向URL时,若直接将所述源站服务器响应的业务数据返回至所述用户终端,所述用户终端将根据接收的业务数据中携带的重定向URL重定向后继续访问,以获取目标数据,其中,所述用户终端在继续访问的过程中甚至还可能需要多次重定向。显然,这与CDN的初衷是有悖的,因此,在本实施例中,当所述业务请求指向的业务数据(即源站服务器基于所述业务请求响应的业务数据)携带有重定向URL时,所述获取模块20基于所述重定向URL重定向,在接收到所述重定向URL对应的源站服务器响应的业务数据时,继续判断重定向URL对应的源站服务器所响应的业务数据是否携带有重定向URL,是则继续重定向,否则将获取的未携带有重定向URL的业务数据推送至发送模块30进行处理。In this embodiment, when the CDN node does not currently store the service data pointed by the service request, the obtaining module 20 forwards the service request to the source station server according to the URL (or IP address) carried by the service request, Receiving the service data of the source station server response; when the CDN node receives the service data of the source station server response, the obtaining module 20 determines whether the service data that the source station server responds carries Oriented URL, as can be understood by those skilled in the art, when the service data that the source station server responds carries the redirected URL, if the service data responded to by the source station server is directly returned to the user terminal, The user terminal will re-access according to the redirected URL carried in the received service data, and then obtain the target data, wherein the user terminal may even need to be redirected multiple times during the process of continuing to access. Obviously, this is contrary to the original intention of the CDN. Therefore, in the embodiment, when the service data pointed by the service request (that is, the service data that the source station server responds based on the service request) carries the redirect URL, The obtaining module 20, based on the redirected URL redirection, continues to determine whether the service data responded by the source station server corresponding to the redirected URL is received when receiving the service data of the source station server corresponding to the redirected URL. If the redirected URL is carried, the redirect is continued. Otherwise, the obtained service data that does not carry the redirected URL is pushed to the sending module 30 for processing.
发送模块30,设置为将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,并将所述未携带重定向URL的业务数据发 送至所述用户终端;The sending module 30 is configured to store the service data that does not carry the redirect URL as the service data pointed by the service request, and send the service data that does not carry the redirect URL. Sent to the user terminal;
本实施例中,在获取到未携带重定向URL的业务数据时,发送模块30将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,供再次接收到所述业务请求时,直接使用存储的所述未携带重定向URL的业务数据提供服务;在存储所述未携带重定向URL的业务数据的同时,所述发送模块30还将所述未携带重定向URL的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,供其呈现给用户。在其他实施例中,所述发送模块30还可以在存储所述未携带重定向URL的业务数据之前或者之后发送所述未携带重定向URL的业务数据至所述用户终端。In this embodiment, when the service data that does not carry the redirected URL is obtained, the sending module 30 stores the service data that does not carry the redirected URL as the service data pointed to by the service request, to receive the service again. When the request is made, the service data providing service that does not carry the redirected URL is directly used; and when the service data that does not carry the redirected URL is stored, the sending module 30 further sends the redirected URL. The service data is sent to the user terminal as the service data pointed to by the service request for presentation to the user. In other embodiments, the sending module 30 may further send the service data that does not carry the redirected URL to the user terminal before or after storing the service data that does not carry the redirected URL.
所述发送模块30还设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,直接将所述业务请求指向的业务数据发送至所述用户终端。The sending module 30 is further configured to directly send the service data pointed by the service request to the user terminal when the CDN node currently stores the service data pointed by the service request.
容易理解的是,CDN节点存储业务数据的目的在于再次接收到指向存储的业务数据的业务请求时,直接用存储的所述业务数据提供服务,以达到网络加速的目的,因此,本实施例中,在当前存储有所述业务请求指向的业务数据时,所述发送模块30直接将所述业务请求指向的业务数据发送至所述用户终端,供其呈现给用户。It is easy to understand that the CDN node stores the service data in order to receive the service request for the stored service data again, and directly provides the service with the stored service data to achieve the purpose of network acceleration. Therefore, in this embodiment, When the service data pointed by the service request is currently stored, the sending module 30 directly sends the service data pointed by the service request to the user terminal for presentation to the user.
在其他实施例中,所述数据推送装置还包括删除模块,设置为当所述CDN节点在预设时间段内未接收到指向存储的业务数据的业务请求时,删除存储的所述业务数据。In other embodiments, the data pushing apparatus further includes a deleting module, configured to delete the stored service data when the CDN node does not receive a service request for the stored service data within a preset time period.
其中,所述预设时间段可按实际需要进行设置,例如,本实施例优选将所述预设时间段设置为24小时,本领域技术人员可以理解的是,通过定期删除长时间未被访问的业务数据,能够提升CDN节点存储空间的利用率。The preset time period may be set according to actual needs. For example, the preset time period is preferably set to 24 hours in the embodiment, and those skilled in the art may understand that the user is not accessed by periodically deleting for a long time. The business data can improve the utilization of the storage space of the CDN node.
本实施例提出的数据推送装置,内置于CDN接收到运行,所述CDN节点在接收到用户终端的业务请求时,若当前未存储所述业务请求指向的 业务数据,且所述业务请求指向的业务数据携带重定向URL,则基于所述重定向URL获取未携带重定向URL的业务数据,并将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,以及将所述未携带重定向URL的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,当再次接收到所述业务请求时,所述CDN节点即可用存储的所述未携带重定向URL的业务数据提供服务,无需用户终端进行重定向跳转,提高用户终端获取数据的效率。The data pushing device provided in this embodiment is built in the CDN to receive the operation, and when the CDN node receives the service request of the user terminal, if the service request is not currently stored, The service data, and the service data that the service request is directed to carry the redirect URL, the service data that does not carry the redirect URL is obtained based on the redirected URL, and the service data that does not carry the redirect URL is stored as The service data pointed to by the service request, and the service data not carrying the redirect URL is sent to the user terminal as the service data pointed by the service request, and when the service request is received again, the CDN node is The stored service data that does not carry the redirected URL can be used to provide a service, and the user terminal does not need to perform a redirect jump, thereby improving the efficiency of the user terminal to obtain data.
可选地,基于第一实施例,提出本发明数据推送装置的第二实施例,在本实施例中,所述数据推送装置还包括第二判断模块,设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,判断所述业务请求指向的业务数据是否携带有重定向URL;Optionally, based on the first embodiment, a second embodiment of the data pushing device of the present invention is provided. In this embodiment, the data pushing device further includes a second determining module, configured to be currently stored in the CDN node. When the service data pointed to by the service request is determined, it is determined whether the service data pointed by the service request carries a redirect URL;
所述发送模块30还设置为在所述业务请求指向的业务数据未携带有重定向URL时,直接将所述业务请求指向的业务数据发送至所述用户终端;The sending module 30 is further configured to: when the service data pointed by the service request does not carry the redirecting URL, directly send the service data pointed by the service request to the user terminal;
所述获取模块20还设置为在所述业务请求指向的业务数据携带有重定向URL时,基于所述重定向URL获取未携带重定向URL的业务数据;The obtaining module 20 is further configured to: when the service data pointed to by the service request carries the redirecting URL, obtain the service data that does not carry the redirected URL based on the redirected URL;
所述发送模块30还设置为采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端。The sending module 30 is further configured to update the service data pointed by the service request by using the service data that does not carry the redirect URL, and send the service data that does not carry the redirect URL to the user terminal.
需要说明的是,在实际应用中,所述CDN节点存储的业务数据可能是历史基于现有技术获取的,可能存在携带重定向URL的情况,因此,在本实施例中,为确保所述CDN节点能够有效的提供加速服务,在当前存储有所述业务请求指向的业务数据时,第二判断模块首先判断所述业务请求指向的业务数据是否携带有重定向URL;若所述业务请求指向的业务数据未携带有重定向URL时,所述发送模块30直接将所述业务请求指向的业务数据发送至所述用户终端,供用户终端将其呈现给用户;若所述业 务请求指向的业务数据携带有重定向URL时,所述获取模块20基于所述重定向URL获取未携带重定向URL的业务数据,其中,所述获取模块20基于所述重定向URL获取未携带重定向URL的业务数据具体可参照第一实施例,此处不再赘述;在获取到未携带重定向URL的业务数据时,所述发送模块30采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端,供其呈现给用户。It should be noted that, in actual applications, the service data stored by the CDN node may be historically acquired based on the prior art, and may exist with a redirect URL. Therefore, in this embodiment, to ensure the CDN. The node can effectively provide the acceleration service. When the service data pointed by the service request is currently stored, the second determining module first determines whether the service data pointed by the service request carries a redirect URL; if the service request points When the service data does not carry the redirected URL, the sending module 30 directly sends the service data pointed by the service request to the user terminal, so that the user terminal presents the user data to the user; The obtaining module 20 obtains the service data that does not carry the redirected URL based on the redirected URL, where the obtaining module 20 obtains the non-portable based on the redirected URL. For the service data of the redirected URL, reference may be made to the first embodiment, and details are not described herein. When the service data that does not carry the redirected URL is obtained, the sending module 30 updates the service data that does not carry the redirected URL. The service data pointed to by the service request, and the service data not carrying the redirect URL is sent to the user terminal for presentation to the user.
此外,在本实施例中,所述获取模块20判断所述源站服务器响应的业务数据是否携带有重定向URL通过调用所述第二判断模块实现。In addition, in this embodiment, the obtaining module 20 determines whether the service data that the source station server responds carries the redirect URL by calling the second determining module.
可选地,基于第二实施例,提出本发明数据推送装置的第三实施例,在本实施例中,所述业务请求指向的业务数据携带有HTTP状态码,所述第二判断模块还设置为判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。Optionally, based on the second embodiment, a third embodiment of the data pushing apparatus of the present invention is proposed. In this embodiment, the service data pointed by the service request carries an HTTP status code, and the second determining module further sets Determining whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code, where the service status is directed to the service data when the HTTP status code is consistent with the preset HTTP status code. Carry a redirect URL.
需要说明的是,HTTP状态码(HTTP Status Code)是用以表示服务器HTTP响应状态的3位数字代码,它由RFC 2616规范定义,并得到RFC2518、RFC 2817、RFC 2295、RFC 2774以及RFC 4918等规范扩展。具体的,HTTP状态码包括1字头的消息类状态码、2字头的成功类状态码、3字头的重定向类状态码、4字头的请求错误类状态码以及5字头的服务器错误类状态码,例如,常见的HTTP状态码“404”表示请求失败,请求得到的资源未在服务器上发现,“404”被广泛应用于当服务器不想揭示到底为何请求被拒绝或者没有其他适合的响应可用的情况下。It should be noted that the HTTP Status Code is a 3-digit code used to indicate the HTTP response status of the server. It is defined by the RFC 2616 specification and obtained RFC2518, RFC 2817, RFC 2295, RFC 2774, and RFC 4918. Specification extension. Specifically, the HTTP status code includes a message class status code of 1 header, a success class status code of 2 headers, a redirect class status code of 3 headers, a request error class status code of 4 headers, and a server of 5 prefixes. Error class status code, for example, the common HTTP status code "404" indicates that the request failed, the requested resource was not found on the server, and "404" is widely used when the server does not want to reveal exactly why the request was rejected or no other suitable The response is available.
本实施例中,所述第二判断模块基于3字头的重定向类状态码判断所述业务请求指向的业务数据是否携带有重定向URL,具体的,所述第二判断模块优选通过HTTP状态码“301”或“302”进行判断,即本实施例将所述预设HTTP状态码设为“301”或“302”。其中,301”表示被请求的资源已永 久移动到新位置,且新的永久性的URL在响应的Location字段中返回;“302”表示请求的资源临时从不同的URL响应,且临时的URL在响应的Location字段中返回。In this embodiment, the second determining module determines, according to the redirecting class status code of the 3-word header, whether the service data pointed by the service request carries a redirecting URL. Specifically, the second determining module preferably passes the HTTP state. The code "301" or "302" is judged, that is, the preset HTTP status code is set to "301" or "302" in this embodiment. Where 301" indicates that the requested resource has been forever Moved to the new location for a long time, and the new permanent URL is returned in the Location field of the response; "302" indicates that the requested resource temporarily responds from a different URL, and the temporary URL is returned in the Location field of the response.
例如,当所述第二判断模块提取的所述业务请求指向的业务数据携带的HTTP状态码为“301”或“302”时,确定所述业务请求指向的业务数据携带有重定向URL;当所述CDN节点提取的所述业务请求指向的业务数据携带的HTTP状态码不为“301”且不为“302”时,确定所述业务请求指向的业务数据未携带有重定向URL。For example, when the HTTP status code carried by the service data pointed by the service request by the second determining module is “301” or “302”, it is determined that the service data pointed by the service request carries a redirect URL; The service data pointed to by the service request does not carry the redirected URL when the HTTP status code carried by the service data that is sent by the CDN node is not "301" and is not "302".
可选地,基于第一实施例,提出本发明数据推送装装置的第四实施例,在本实施例中,当所述业务请求指向的业务数据的类型为网页数据时,所述数据推送装置还包括第三判断模块,设置为判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;Optionally, based on the first embodiment, a fourth embodiment of the data pushing and loading device of the present invention is provided. In this embodiment, when the type of the service data pointed by the service request is webpage data, the data pushing device And a third determining module, configured to determine whether the encoding mode used by the service data pointed by the service request is the same as the encoding mode adopted by the user terminal;
所述发送模块还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,将所述业务请求指向的业务数据发送至所述用户终端。The sending module is further configured to send the service data pointed by the service request to the user terminal when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
需要说明的是,在互联网中,存在多种类型的数据,例如,网页数据、音频数据以及视频数据等。我们在显示器上看见的文字、图片等信息在电脑里面其实并不是我们看见的样子,即使你知道所有信息都存储在硬盘里,把它拆开也看不见里面有任何东西,只有些盘片。假设,你用显微镜把盘片放大,会看见盘片表面凹凸不平,凸起的地方被磁化,凹的地方是没有被磁化;凸起的地方代表数字1,凹的地方代表数字0。硬盘只能用0和1来表示所有文字、图片等信息。那么字母“A”在硬盘上是如何存储的呢?可能小张电脑存储字母“A”是1100001,而小王电脑存储字母“A”是11000010,这样双方交换信息时就会误解。比如小张把1100001发送给小王,小王并不认为1100001是字母”A”,可能认为这是字母”X”,也就是说,小张和小王的电脑使用了不同的编码方式。本领域技术人员可以理解的是, 当所述业务请求指向的业务数据的类型为网页数据时,只有所述用户终端采用的编码方式与所述业务请求指向的业务数据采用的编码方式相同时,所述用户终端才能正常的将所述业务请求指向的业务数据呈现给用户,确保显示的网页不出现乱码。It should be noted that in the Internet, there are various types of data, such as web page data, audio data, and video data. The text, pictures and other information that we see on the monitor are not what we see in the computer. Even if you know that all the information is stored on the hard disk, you can't see anything inside, just some discs. Suppose, if you magnify the disc with a microscope, you will see that the surface of the disc is uneven, the raised area is magnetized, and the concave area is not magnetized; the raised area represents the number 1, and the concave part represents the number 0. The hard disk can only use 0 and 1 to represent all text, pictures and other information. So how is the letter "A" stored on the hard disk? It is possible that the small computer storage letter "A" is 1100001, and the Xiaowang computer storage letter "A" is 11000010, so that the two sides will misunderstand when exchanging information. For example, Xiao Zhang sent 1100001 to Xiao Wang. Xiao Wang does not think that 1100001 is the letter "A". It may be considered as the letter "X". That is to say, Xiao Zhang and Xiao Wang's computers use different encoding methods. Those skilled in the art can understand that When the type of the service data pointed to by the service request is webpage data, the user terminal can normally perform the same manner only when the coding mode adopted by the user terminal is the same as the coding mode used by the service data pointed by the service request. The business data pointed to by the service request is presented to the user to ensure that the displayed webpage is not garbled.
本实施例中,所述用户终端向所述CDN节点发送的所述业务请求包括所述用户终端采用的编码方式,同时,所述第三判断模块可以通过解析出所述业务请求指向的业务数据中的“charset=xxx”字段,确定所述业务请求指向的业务数据所采用的编码方式,其中的“xxx”部分就是所述业务请求指向的业务数据采用的编码,常用的编码包括GB2312,GBK,UTF-8,ISO8859-1等。在确定所述用户终端采用的编码方式以及确定所述业务请求指向的业务数据采用的编码方式之后,所述第三判断模块即可进行判断。In this embodiment, the service request sent by the user terminal to the CDN node includes an encoding mode adopted by the user terminal, and the third determining module may parse the service data pointed by the service request. The "charset=xxx" field determines the coding mode used by the service data pointed to by the service request, wherein the "xxx" part is the code used by the service data pointed by the service request, and the commonly used codes include GB2312, GBK. , UTF-8, ISO8859-1 and so on. After determining the coding mode adopted by the user terminal and determining the coding mode used by the service data pointed by the service request, the third determining module may perform the determination.
可选地,为确保网页能够正常显示,所述发送模块30还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。Optionally, in order to ensure that the webpage can be displayed normally, the sending module 30 is further configured to use the user terminal when the encoding mode used by the service data pointed by the service request is different from the encoding mode adopted by the user terminal. The encoding mode re-encodes the service data pointed by the service request, and sends the re-encoded service data to the user terminal.
容易理解的是,在所述用户终端采用的编码方式与所述业务请求指向的业务数据采用的编码方式不同时,所述发送模块30采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,重编码后的业务数据即可供所述用户终端正常解析,将网页内容呈现给用户。It is easy to understand that when the coding mode adopted by the user terminal is different from the coding mode used by the service data pointed by the service request, the sending module 30 uses the coding mode of the user terminal to point to the service request. The service data is re-encoded, and the re-encoded service data is available for the user terminal to be parsed normally, and the webpage content is presented to the user.
本领域技术人员可以理解的是,在其他实施例中,在所述获取模块20从源站服务器获取到未携带重定向URL的业务数据之后,所述发送模块30还可以分别采用多种常用的编码方式对所述未携带重定向URL的业务数据进行重编码,并分别存储重编码后的业务数据,以进一步提升用户终端获取数据的效率。It can be understood by those skilled in the art that, in other embodiments, after the obtaining module 20 obtains the service data that does not carry the redirected URL from the source station server, the sending module 30 may also adopt a plurality of commonly used ones. The encoding method re-encodes the service data that does not carry the redirected URL, and separately stores the re-encoded service data, so as to further improve the efficiency of the user terminal to obtain data.
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质中存储有执行指令,该执行指令用于执行上述的方法。 Embodiments of the present invention also provide a storage medium. Optionally, in this embodiment, an execution instruction is stored in the storage medium, and the execution instruction is used to execute the foregoing method.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in the embodiment, the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM). A variety of media that can store program code, such as a hard disk, a disk, or an optical disk.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.
工业实用性Industrial applicability
如上所述,本发明实施例提供的一种数据推送方法及装置具有以下有益效果:通过CDN节点在接收到用户终端的业务请求时,若当前未存储所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带重定向URL,则基于所述重定向URL获取未携带重定向URL的业务数据,并将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,以及将所述未携带重定向URL的业务数据作为所述业务请求指向的业务数据发送至所述用户终端,当再次接收到所述业务请求时,所述CDN节点即可用存储的所述未携带重定向URL的业务数据提供服务,无需用户终端进行重定向跳转,提高用户终端获取数据的效率。 As described above, a data push method and apparatus provided by an embodiment of the present invention have the following beneficial effects: when a service request of a user terminal is received by a CDN node, if the service data pointed by the service request is not currently stored, The service data pointed to by the service request carries the redirected URL, and the service data that does not carry the redirected URL is obtained based on the redirected URL, and the service data that does not carry the redirected URL is stored as the service pointed by the service request. Data, and transmitting the service data not carrying the redirect URL as the service data pointed by the service request to the user terminal, when the service request is received again, the CDN node may use the stored The service data providing service that does not carry the redirected URL does not require the user terminal to perform a redirect jump, thereby improving the efficiency of the user terminal to obtain data.

Claims (10)

  1. 一种数据推送方法,所述数据推送方法包括:A data pushing method, the data pushing method includes:
    在接收到用户终端发送的业务请求时,内容分发网络CDN节点判断当前是否存储有所述业务请求指向的业务数据;Upon receiving the service request sent by the user terminal, the content distribution network CDN node determines whether the service data pointed by the service request is currently stored;
    在当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;When the service data pointed to by the service request is not currently stored, and the service data pointed by the service request carries the redirected unified data locator URL, the CDN node acquires the non-redirected URL based on the redirected URL. Business data;
    所述CDN节点将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,并将所述未携带重定向URL的业务数据发送至所述用户终端;The CDN node stores the service data that does not carry the redirected URL as the service data pointed to by the service request, and sends the service data that does not carry the redirected URL to the user terminal;
    在当前存储有所述业务请求指向的业务数据时,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端。When the service data pointed by the service request is currently stored, the CDN node directly sends the service data pointed by the service request to the user terminal.
  2. 如权利要求1所述的数据推送方法,其中,所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端的步骤之前,还包括:The data push method of claim 1, wherein the step of the CDN node directly transmitting the service data pointed by the service request to the user terminal further comprises:
    在当前存储有所述业务请求指向的业务数据时,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL;When the service data pointed by the service request is currently stored, the CDN node determines whether the service data pointed to by the service request carries a redirect URL;
    在所述业务请求指向的业务数据未携带有重定向URL时,执行所述CDN节点直接将所述业务请求指向的业务数据发送至所述用户终端的步骤;And performing, when the service data pointed to by the service request does not carry the redirecting URL, the step of the CDN node directly sending the service data pointed by the service request to the user terminal;
    所述判断所述业务请求指向的业务数据是否携带有重定向URL的步骤之后,所述数据推送方法还包括步骤:After the step of determining whether the service data pointed to by the service request carries a redirect URL, the data pushing method further includes the steps of:
    在所述业务请求指向的业务数据携带有重定向URL时,所述CDN节点基于所述重定向URL获取未携带重定向URL的业务数据;When the service data pointed by the service request carries a redirect URL, the CDN node acquires service data that does not carry the redirect URL based on the redirect URL;
    所述CDN节点采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述 用户终端The CDN node updates the service data pointed by the service request by using the service data that does not carry the redirect URL, and sends the service data that does not carry the redirect URL to the User terminal
  3. 如权利要求2所述的数据推送方法,其中,所述业务请求指向的业务数据携带有HTTP状态码,所述CDN节点判断所述业务请求指向的业务数据是否携带有重定向URL的步骤包括:The data push method of claim 2, wherein the service data pointed by the service request carries an HTTP status code, and the step of the CDN node determining whether the service data pointed to by the service request carries a redirect URL comprises:
    所述CDN节点判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。Determining, by the CDN node, whether the HTTP status code carried by the service data pointed by the service request is consistent with a preset HTTP status code, where the service request is directed when the HTTP status code is consistent with a preset HTTP status code The business data carries a redirect URL.
  4. 如权利要求1所述的数据推送方法,其中,当所述业务请求指向的业务数据的类型为网页数据时,所述CDN节点发送所述业务请求指向的业务数据的步骤之前,还包括:The data pushing method of claim 1, wherein, before the step of transmitting, by the CDN node, the service data pointed by the service request, the method further includes:
    所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;Determining, by the CDN node, whether the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal;
    在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,执行所述CDN节点发送所述业务请求指向的业务数据的步骤。And performing the step of transmitting, by the CDN node, the service data pointed by the service request, when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
  5. 如权利要求4所述的数据推送方法,其中,所述CDN节点判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同的步骤之后,还包括:The data pushing method according to claim 4, wherein the step of determining, by the CDN node, whether the encoding mode used by the service data pointed by the service request is the same as the encoding mode adopted by the user terminal, the method further includes:
    在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,所述CDN节点采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。 The CDN node re-encodes the service data pointed by the service request by using the coding mode of the user terminal when the coding mode used by the service data is different from the coding mode used by the user terminal. And transmitting the re-encoded service data to the user terminal.
  6. 一种数据推送装置,所述数据推送装置包括:A data pushing device, the data pushing device comprising:
    第一判断模块,设置为当其所在内容分发网络CDN节点接收到用户终端发送的业务请求时,判断所述CDN节点当前是否存储有所述业务请求指向的业务数据;The first determining module is configured to determine, when the CDN node that the content distribution network is located, receives the service request sent by the user terminal, whether the CDN node currently stores the service data pointed by the service request;
    获取模块,设置为在所述CDN节点当前未存储有所述业务请求指向的业务数据,且所述业务请求指向的业务数据携带有重定向统一数据定位符URL时,基于所述重定向URL获取未携带重定向URL的业务数据;An obtaining module, configured to: when the CDN node does not currently store the service data pointed by the service request, and the service data pointed by the service request carries the redirected unified data locator URL, obtain the data based on the redirected URL Business data that does not carry a redirect URL;
    发送模块,设置为将所述未携带重定向URL的业务数据存储为所述业务请求指向的业务数据,并将所述未携带重定向URL的业务数据发送至所述用户终端;a sending module, configured to store the service data that does not carry the redirected URL as the service data pointed by the service request, and send the service data that does not carry the redirected URL to the user terminal;
    所述发送模块还设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,直接将所述业务请求指向的业务数据发送至所述用户终端。The sending module is further configured to directly send the service data pointed by the service request to the user terminal when the CDN node currently stores the service data pointed by the service request.
  7. 如权利要求6所述的数据推送装置,其中,所述数据推送装置还包括第二判断模块,设置为在所述CDN节点当前存储有所述业务请求指向的业务数据时,判断所述业务请求指向的业务数据是否携带有重定向URL;The data pushing device of claim 6, wherein the data pushing device further comprises a second determining module, configured to determine the service request when the CDN node currently stores the service data pointed by the service request Whether the pointed service data carries a redirect URL;
    所述发送模块还设置为在所述业务请求指向的业务数据未携带有重定向URL时,直接将所述业务请求指向的业务数据发送至所述用户终端;The sending module is further configured to directly send the service data pointed by the service request to the user terminal when the service data pointed by the service request does not carry the redirecting URL;
    所述获取模块还设置为在所述业务请求指向的业务数据携带有重定向URL时,基于所述重定向URL获取未携带重定向URL的业务数据; The obtaining module is further configured to: when the service data pointed to by the service request carries a redirect URL, obtain the service data that does not carry the redirect URL based on the redirected URL;
    所述发送模块还设置为采用未携带重定向URL的业务数据更新所述业务请求指向的业务数据,并将未携带重定向URL的业务数据发送至所述用户终端。The sending module is further configured to update the service data pointed by the service request by using the service data that does not carry the redirect URL, and send the service data that does not carry the redirect URL to the user terminal.
  8. 如权利要求7所述的数据推送装置,其中,所述业务请求指向的业务数据携带有HTTP状态码,所述第二判断模块还设置为判断所述业务请求指向的业务数据所携带的HTTP状态码是否与预设HTTP状态码一致,其中,当所述HTTP状态码与预设HTTP状态码一致时,所述业务请求指向的业务数据携带有重定向URL。The data pushing apparatus according to claim 7, wherein the service data pointed by the service request carries an HTTP status code, and the second determining module is further configured to determine an HTTP status carried by the service data pointed by the service request. Whether the code is consistent with the preset HTTP status code, where the service data pointed to by the service request carries a redirect URL when the HTTP status code is consistent with the preset HTTP status code.
  9. 如权利要求6所述的数据推送装置,其中,当所述业务请求指向的业务数据的类型为网页数据时,所述数据推送装置还包括第三判断模块,设置为判断所述业务请求指向的业务数据所采用的编码方式是否与所述用户终端采用的编码方式相同;The data pushing apparatus according to claim 6, wherein when the type of the service data pointed by the service request is webpage data, the data pushing apparatus further includes a third determining module configured to determine that the service request is directed Whether the coding mode used by the service data is the same as the coding mode adopted by the user terminal;
    所述发送模块还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式相同时,将所述业务请求指向的业务数据发送至所述用户终端。The sending module is further configured to send the service data pointed by the service request to the user terminal when the coding mode used by the service data pointed by the service request is the same as the coding mode adopted by the user terminal.
  10. 如权利要求9所述的数据推送装置,其中,所述发送模块还设置为在所述业务请求指向的业务数据所采用的编码方式与所述用户终端采用的编码方式不同时,采用所述用户终端的编码方式对所述业务请求指向的业务数据进行重编码,并将重编码后的业务数据发送至所述用户终端。 The data pushing apparatus according to claim 9, wherein the transmitting module is further configured to adopt the user when the encoding mode adopted by the service data pointed by the service request is different from the encoding mode adopted by the user terminal. The coding mode of the terminal re-encodes the service data pointed by the service request, and sends the re-encoded service data to the user terminal.
PCT/CN2016/100598 2015-10-23 2016-09-28 Data push method and apparatus WO2017067373A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510698072.2A CN106612311A (en) 2015-10-23 2015-10-23 Data push method and device
CN201510698072.2 2015-10-23

Publications (1)

Publication Number Publication Date
WO2017067373A1 true WO2017067373A1 (en) 2017-04-27

Family

ID=58556739

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/100598 WO2017067373A1 (en) 2015-10-23 2016-09-28 Data push method and apparatus

Country Status (2)

Country Link
CN (1) CN106612311A (en)
WO (1) WO2017067373A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871489A (en) * 2019-03-06 2019-06-11 网宿科技股份有限公司 Resource retrieval method and intelligent identifying system in a kind of intelligent identifying system
CN112333290B (en) * 2021-01-05 2021-04-06 腾讯科技(深圳)有限公司 Data access control method, device, storage medium and content distribution network system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197843A (en) * 2007-11-13 2008-06-11 华为技术有限公司 Page reorientation method and wireless application protocol gateway
CN101854375A (en) * 2009-03-31 2010-10-06 华为软件技术有限公司 Redirecting method and device
EP2355446A2 (en) * 2010-02-02 2011-08-10 Swisscom AG Accessing services in a communication network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102668518B (en) * 2011-12-02 2013-10-02 华为技术有限公司 Content distribution network routing method, system, and user terminal
CN103051976B (en) * 2013-01-22 2016-02-10 中兴通讯股份有限公司 A kind of CDN distributes HLS content and method, system and equipment
CN104468817B (en) * 2014-12-22 2016-08-24 北京奇虎科技有限公司 Implementation method and device, server, the client of resource is downloaded by CDN

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197843A (en) * 2007-11-13 2008-06-11 华为技术有限公司 Page reorientation method and wireless application protocol gateway
CN101854375A (en) * 2009-03-31 2010-10-06 华为软件技术有限公司 Redirecting method and device
EP2355446A2 (en) * 2010-02-02 2011-08-10 Swisscom AG Accessing services in a communication network

Also Published As

Publication number Publication date
CN106612311A (en) 2017-05-03

Similar Documents

Publication Publication Date Title
CN107025234B (en) Information pushing method and cache server
US9888089B2 (en) Client side cache management
US8321503B2 (en) Context-specific network resource addressing model for distributed services
US8892680B2 (en) System and method for caching content elements with dynamic URLs
KR102166589B1 (en) Method and apparatus for realizing communication between web page and native application, and electronic device
US20140280859A1 (en) Sharing control system and method for network resources download information
US8484373B2 (en) System and method for redirecting a request for a non-canonical web page
US10757163B2 (en) Persisting user preferences in an intermediate network device
US8949952B2 (en) Multi-stack subscriber sign on
US8817983B2 (en) Streaming video to cellular phones
CN103944994A (en) Distributed resource obtaining method and device
JP7331073B2 (en) Enhanced online privacy
WO2012034518A1 (en) Method and system for providing message including universal resource locator
US20090019151A1 (en) Method for media discovery
US9058399B2 (en) System and method for providing network resource identifier shortening service to computing devices
US20170041422A1 (en) Method and system for retrieving a content manifest in a network
CN101378407B (en) Method, system and equipment for pushing information
WO2017067373A1 (en) Data push method and apparatus
CN112069386B (en) Request processing method, device, system, terminal and server
CN102904935B (en) Downloading method, downloading device and downloading system based on home gateway
CN106919595B (en) Cookie mapping method and device and electronic equipment
CN113285920B (en) Service access method, device, equipment and storage medium
CN106790176B (en) Method and system for accessing network
WO2014169497A1 (en) Method and server for pushing media file
KR102193481B1 (en) Proxy server, method of reconfigurating of web page using the same

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16856806

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16856806

Country of ref document: EP

Kind code of ref document: A1