WO2019214714A1 - Method, system, node, and computer storage medium for controlling video playback - Google Patents

Method, system, node, and computer storage medium for controlling video playback Download PDF

Info

Publication number
WO2019214714A1
WO2019214714A1 PCT/CN2019/086422 CN2019086422W WO2019214714A1 WO 2019214714 A1 WO2019214714 A1 WO 2019214714A1 CN 2019086422 W CN2019086422 W CN 2019086422W WO 2019214714 A1 WO2019214714 A1 WO 2019214714A1
Authority
WO
WIPO (PCT)
Prior art keywords
play
video
control policy
script
request
Prior art date
Application number
PCT/CN2019/086422
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 WO2019214714A1 publication Critical patent/WO2019214714A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64746Control signals issued by the network directed to the server or the client
    • H04N21/64753Control signals issued by the network directed to the server or the client directed to the client

Definitions

  • the present disclosure relates to the field of Content Delivery Network (CDN), and in particular, to a video playback control method, system, node, and computer storage medium.
  • CDN Content Delivery Network
  • the current mainstream video CDNs are based on anti-theft chain, improve user quality, reduce bandwidth cost, and provide different quality services according to user types (such as free users and member users), and perform policy control on CDN nodes, such as video data speed limit. Transmission, reduction of video playback rate, termination of playback, etc., are of course not limited to the above-described policy control methods.
  • the Uniform Resource Locator (URL, the Uniform Resource Locator) sent by the terminal to the CDN node contains the policy information, and the URL is decrypted on the CDN node and played according to the source station.
  • the control policy requires the execution of the corresponding play policy; the other way is that the URL sent by the terminal to the CDN node contains the policy information, the CDN node forwards the user request to the policy gateway of the source station, and the policy gateway dynamically returns the policy result, and the CDN node according to the CDN node
  • the strategy result performs the corresponding action.
  • the disadvantage of the first method is that the source station needs to inform the CDN node of the logic of the control policy. At this time, the CDN node can obtain sensitive service information, such as user identifier (ID, Identifier), user level, membership, payment, etc. Information, which has a high commercial value to the source station and is generally reluctant to leak.
  • ID user identifier
  • Information which has a high commercial value to the source station and is generally reluctant to leak.
  • the interaction between the user request and the policy gateway returning the policy result may cause the terminal to start playing longer and the user experience is affected.
  • embodiments of the present disclosure provide a video playback control method, system, node, and computer storage medium.
  • An embodiment of the present disclosure provides a video playback control method, which is applied to a CDN node.
  • the method includes:
  • the first play control policy script is obtained in advance by the CDN node;
  • the embodiment of the present disclosure further provides a CDN node, where the CDN node includes: a receiving unit, an obtaining unit, an executing unit, and an output unit;
  • the receiving unit is configured to receive a video play request from the terminal
  • the acquiring unit is configured to obtain a first play control policy script that matches the video play request received by the receiving unit; the first play control policy script is obtained in advance by the CDN node;
  • the execution unit is configured to execute the first play control policy script obtained by the acquiring unit to obtain a first play policy
  • the output unit is configured to output video data to the terminal based on the first play policy obtained by the execution unit.
  • the embodiment of the present disclosure further provides a computer storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the steps of the video playback control method in the embodiment of the present disclosure are implemented.
  • the embodiment of the present disclosure further provides a video playback control method, where the method includes:
  • the source station generates a play control policy script, and sends the play control policy script to the CDN management server;
  • the CDN management server sends the received play control policy script to all CDN nodes;
  • the embodiment of the present disclosure further provides a video playback control system, where the system includes: at least one source station, a CDN management server, and at least one CDN node;
  • the at least one source station is configured to generate a play control policy script, and send the play control policy script to the CDN management server;
  • the CDN management server is configured to send the received play control policy script to all CDN nodes;
  • the CDN node is configured to receive a video play request from the terminal, obtain a first play control policy script that matches the video play request, and execute the first play control policy script to obtain a first play policy, based on the The first playback policy outputs video data to the terminal.
  • Embodiments of the present disclosure also provide a CDN node, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement any of the embodiments of the present disclosure The steps of the video playback control method.
  • a video playback control method, system, node, and computer storage medium provided by an embodiment of the present disclosure, the method includes: receiving a video play request from a terminal; and obtaining a matched first play control policy script based on the video play request;
  • the first play control policy script is obtained in advance by the CDN node; the first play control policy script is executed to obtain a first play policy, and video data is output to the terminal based on the first play policy.
  • the play control policy script is obtained in advance through the CDN node, and the first play control policy script matching the video play request is executed, thereby obtaining a play control policy matching the video play request of the terminal, without using the CDN.
  • the node obtains sensitive information and can also implement the playback control policy specified by the source station; on the other hand, the CDN node does not need to forward the video playback request to the source station, thereby avoiding the extension of the terminal playback start time and greatly improving the user experience.
  • FIG. 1a and 1b are schematic diagrams showing an application architecture of a video playback control method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure
  • FIG. 3 is another schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure
  • FIG. 4 is a schematic diagram of a software structure of a CDN node in a video playback control method according to an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of a video playback control method according to Embodiment 2 of the present disclosure
  • FIG. 6 is a schematic structural diagram of a structure of a CDN node according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of another composition structure of a CDN node according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of still another structure of a CDN node according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of hardware components of a CDN node according to an embodiment of the present disclosure.
  • FIG. 1 is a schematic diagram of an application architecture of a video playback control method according to an embodiment of the present disclosure
  • the video playback control method application architecture includes: a play policy gateway 11, a CDN management server 12, and a CDN node. 13 and the terminal 14; wherein, between the play policy gateway 11 and the CDN management server 12, between the CDN management server 12 and the CDN node 13, and between the CDN node 13 and the terminal 14, data can be exchanged through the network.
  • the terminal 14 is arranged to request video content from the CDN node 13.
  • the play policy gateway 11 is configured to compile the play control policy script, and deliver the compiled play control policy script to the CDN management server 12.
  • the play policy gateway 11 is located on the source station side, and the source station is the server where the requested video content is located. For example, if a user requests a video content of a xx video website, the source station can be understood as a server to which the xx video website belongs.
  • the play policy gateway 11 may be located in the server where the video content is located, or may exist as a separate gateway device independently of the server where the video content is located.
  • the CDN management server 12 can simultaneously receive the play control policy scripts sent by the play policy gateways 11 of the plurality of source stations, and distribute the play control policy scripts to each CDN node, as shown in FIG. 1b.
  • the CDN management server 12 can Receiving the first play policy gateway 111 (corresponding to the source station 1 with the domain name 1.cp.com), the second play policy gateway 112 (the source station 2 corresponding to the domain name 2.cp.com), and the third play policy gateway respectively.
  • a play control policy script of 113 (corresponding to the source station 3 of the domain name 3.cp.com) distributes each play control policy script to the CDN node 1, the CDN node 2, and the CDN node 3.
  • the CDN management server 12 is configured to perform data interaction with the play policy gateway 11 to obtain a play control policy script delivered by the play policy gateway 11, and send the play control policy script to all CDN nodes 13 after review.
  • the CDN node 13 is configured to obtain a corresponding play control policy script based on the video play request of the different terminal 14, and provide a video play service to the terminal 14 based on the execution of the play control policy script.
  • FIG. 1 is only an example of a system architecture that implements an embodiment of the present disclosure.
  • the embodiment of the present disclosure is not limited to the system structure described in FIG. 1 above, and various embodiments of the present disclosure are proposed based on the system architecture.
  • Embodiments of the present disclosure provide a video playback control method applied to a CDN node.
  • 2 is a schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure; as shown in FIG. 2, the method includes:
  • Step 101 Receive a video play request from the terminal.
  • the video play request may be represented by a URL.
  • Step 102 Obtain a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node.
  • Step 103 Perform the first play control policy script to obtain a first play policy, and output video data to the terminal according to the first play policy.
  • FIG. 3 is another schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure; as shown in FIG. 3, the method further includes the step 100: obtaining a plurality of play control policy scripts; Each of the plurality of play control policy scripts is obtained by the source station corresponding to each play control policy script and forwarded by the CDN management server.
  • FIG. 4 is a schematic diagram of a software structure of a CDN node in a video playback control method according to an embodiment of the present disclosure; as shown in FIG. 4, in an existing CDN node cache service process, a script engine service is added, based on a script.
  • the engine service, the play control strategy capability open module executes the script, and specifically executes the call of the built-in parameters and functions of the script, thereby implementing the control of the video play strategy.
  • the script engine may use an open source script engine such as JScript or LUA, or may develop a script engine by itself. This embodiment does not limit the script development mode.
  • the function of executing the script implementation includes at least one of the following: HTTP header information acquisition, HTTP request URL information acquisition, HTTP return source URL setting, cache policy setting, video playback control policy setting, asynchronous message notification function library, Basic encryption and decryption libraries, basic function libraries, and more.
  • HTTP header information can be obtained by the following functions:
  • Str ngx.req.raw_header(no_request_line?); means to get the original HTTP header complete string; for example: ngx.print(ngx.req.raw_header());
  • HTTP header information can be obtained by the following functions:
  • Headers ngx.req.get_headers(max_headers?,raw?); indicates that the HTTP header information is obtained in the form of a hash table structure; for example:
  • the HTTP request URL information may be obtained by using a built-in URL to obtain a variable, for example, a URI (Uniform Resource Identifier) part of the URL: ngx.var.uri; and a parameter part of the URL: ngx.var. Args; Get access to IP: ngx.var.remote_addr.
  • a URI Uniform Resource Identifier
  • the HTTP return source URL is set to: ngx.set_source_url(source_url, timeout); where source_url indicates the source address back; timeout indicates the source timeout, in seconds.
  • the cache policy settings include, but are not limited to, whether to cache, cache KEY extraction, fragment cache, and the like.
  • the asynchronous message notification function library includes but is not limited to TCP, UDP, HTTP/HTTPS; for example, the asynchronous message notification function library includes a function including at least one of the following: ngx.socket.udp; udpsock:setpeername; udpsock:send ;udpsock:receive;udpsock:close;udpsock:settimeout;ngx.socket.stream;ngx.socket.tcp;tcpsock:connect;tcpsock:slhandshake;tcpsock:send;tcpsock:receive;tcpsock:receiveuntil;tcpsock:close;tcpsock :settimeout;tcpsock:settimeouts;tcpsock:setoption;tcpsock:setkeepalive;tcpsock:getreusedtimes;ngx.socke
  • the encryption and decryption algorithm included in the basic encryption and decryption library includes not limited to the message digest algorithm fifth version (MD5, Message-Digest Algorithm 5), the RSA encryption algorithm, and the data encryption standard (DES, Data Encryption Standard).
  • the functions included in the basic encryption and decryption library may include at least one of the following: ngx.crc32_short; ngx.crc32_long; ngx.hmac_sha1; ngx.md5; ngx.md5_bin; ngx.sha1_bin.
  • the basic function library includes but is not limited to, not limited to string processing, regular library parsing, Extensible Markup Language (XML), JS object notation (JSON, JavaScript Object Notation) parsing, linked list, queue, and the like.
  • the functions included in the basic function library may include at least one of the following: ngx.re.match; ngx.re.find; ngx.re.gmatch; ngx.re.sub; ngx.re.gsub.
  • the CDN node may update or delete the play control policy script based on configuration information forwarded from the play policy gateway (or source station) via the CDN management server.
  • the corresponding play control policy script is executed to obtain a corresponding play control policy, and the terminal is provided with a video based on the play control policy. service.
  • the obtaining, by the video play request, a matching first play control policy script includes: parsing the video play request, and obtaining source station information carried in the video play request, based on the source The station information queries a plurality of pre-obtained play control policy scripts to obtain a first play control policy script corresponding to the source station information.
  • the video play request may be represented by a URL
  • the source station information is obtained by parsing the URL
  • the domain name information of the source station is specifically obtained
  • the stored multiple play control policy scripts are searched based on the domain name information, and the obtained The first play control policy script corresponding to the domain name information.
  • the executing the first play control policy script to obtain a first play policy, and outputting video data to the terminal according to the first play policy includes: executing the first play control policy script, Parsing the video play request, obtaining a key part carried by the video play request, decrypting the key part to obtain a first play policy, and outputting video data to the terminal based on the first play policy.
  • the CDN node parses the URL that represents the video play request by performing the first play control policy script, and obtains a key part carried by the video play request, where the key part represents the service information of the corresponding terminal; in actual application, the terminal
  • the business information is encoded by a preset encoding method to form the key part in the URL.
  • the service information may include sensitive service information such as a user identifier, a user level, whether it is a member user, and whether the payment is made.
  • the CDN node obtains the key part by executing the first play control policy script, and obtains a corresponding first play policy based on the key part; the first play policy includes a speed limit bandwidth and the like. Then, the CDN node can output video data to the terminal according to the first playing policy (such as the speed limit bandwidth).
  • the method further includes: decrypting the key part to obtain a video A unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
  • the CDN node parses the URL that represents the video play request by executing the first play control policy script, and obtains a key part carried by the video play request, where the key part includes requesting video content; in actual application, the terminal applies the service.
  • the information is encoded by a preset encoding to form the key portion of the URL.
  • the CDN node obtains a unique identifier of the video content by performing a first play control policy script to parse a key part of the URL, and sets the cache identifier of the cache area of the video content.
  • the method further includes: decrypting the key part to obtain the The IP address of the video play request is verified whether the IP address is a legal IP address; when the IP address is verified as an illegal IP address, the video play request is not responded.
  • the CDN node parses the URL that represents the video play request by performing a first play control policy script, and obtains a key part carried by the video play request, where the key part includes an IP address of the terminal;
  • the play control policy script verifies the validity of the IP address; if it is determined that the IP address belongs to an illegal IP address, it does not respond to the video play request of the terminal.
  • the executing the first play control policy script includes: parsing the video play request, obtaining video content information corresponding to the video play request, and determining whether the video content exists based on the video content information. And when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
  • the CDN node parses the URL that represents the video play request by executing the first play control policy script, and obtains a key part carried by the video play request, where the key part includes requesting the video content, that is, obtaining the video content information;
  • the CDN node determines whether the video content exists according to the video content information; if not, it needs to construct a return source URL, and obtain the video content from the source station based on the return source URL.
  • the generating the return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining the video content includes: generating the script based on executing the first play control policy a primary source address and an alternate source address; determining whether to obtain video content based on the primary source address connection source station; if the video content is not obtained based on the primary source address (eg, the primary source address connection timeout) The source content is obtained by connecting the source station based on the alternate source address.
  • the play control policy script is obtained in advance through the CDN node, and the first play control policy script matching the video play request is executed, thereby obtaining a play control policy matching the video play request of the terminal, without using the CDN.
  • the node obtains sensitive information and can also implement the playback control policy specified by the source station; on the other hand, the CDN node does not need to forward the video playback request to the source station, thereby avoiding the extension of the terminal playback start time and greatly improving the user experience.
  • the embodiment of the present disclosure is deployed in a CDN node by using a play control policy script, so that the CDN node does not need to perform custom development for each source station, and only the source station needs to perform simple script development to achieve docking.
  • FIG. 5 is a schematic flowchart of a video playback control method according to Embodiment 2 of the present disclosure; as shown in FIG. 5, the method includes:
  • Step 201 The source station generates a play control policy script.
  • the source station may generate a play control policy script based on the preset script generation rule.
  • Step 202 The source station sends the play control policy script to the CDN management server.
  • Step 203 The CDN management server reviews the received play control policy script.
  • Step 204 The CDN management server sends the passed playback control policy script to all CDN nodes.
  • Step 205 The CDN node receives a video play request from the terminal.
  • Step 206 The CDN node obtains a matching first play control policy script based on the video play request, and executes the first play control policy script to obtain a first play policy.
  • Step 207 The CDN node outputs video data to the terminal according to the first play policy.
  • the video playback control method of the CDN node may be referred to the foregoing embodiment 1, and is not described in this embodiment.
  • the CDN management server reviews the play control policy script; optionally, the malicious script is injected into the audit subsystem (including not limited to bytecode security detection, sandbox simulation environment security detection). And so on), after the review, the playback control strategy script is distributed to all CDN nodes.
  • NGINX is an interpreter for LUA code written in C
  • LUAJIT is an interpreter for LUA code written in C
  • NGINX's LUA plug-in NGINX_LUA_MODULE is an example of a cache server using an NGINX server, an integrated LUAJIT (LUAJIT is an interpreter for LUA code written in C) script engine, and NGINX's LUA plug-in NGINX_LUA_MODULE.
  • the anti-theft chain and the playback speed limit function are implemented by deploying the LUA script to the CDN node.
  • Step 1 The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
  • Step 2 The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
  • Step 3 The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
  • Step 4 The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station.
  • the following is the pseudo code logic part:
  • Step 5 The CDN node executes a specific playback control policy script.
  • the specific script execution process can include:
  • the decryption algorithm obtains the QQ number and is a free user.
  • the source URL address rewriting and the source station multipath disaster recovery function are implemented.
  • Step 1 The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
  • Step 2 The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
  • Step 3 The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
  • Step 4 The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station.
  • the following is the pseudo code logic part:
  • Step 5 The CDN node executes the following playback control policy script:
  • the specific script execution process can include:
  • the QQ number and the free user are obtained, and the maximum download bandwidth is set after the user is determined to be a free user (ie, a normal user), that is, the speed limit is controlled.
  • the video content is obtained by connecting the source station based on the URL; if the primary URL connection times out after 3 seconds, the source address is connected by using the alternate source URL to obtain the video content.
  • the rules for caching the KEY are dynamically calculated for the specified domain name.
  • Step 1 The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
  • Step 2 The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
  • Step 3 The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
  • Step 4 The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station.
  • the following is the pseudo code logic part:
  • Step 5 The CDN node executes the following playback control policy script:
  • the specific script execution process can include:
  • the QQ number and the free user are obtained, and the maximum download bandwidth is set after the user is determined to be a free user (ie, a normal user), that is, the speed limit is controlled.
  • the user IP address blacklist is denied service.
  • Step 1 The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
  • Step 2 The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
  • Step 3 The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
  • Step 4 The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station.
  • the following is the pseudo code logic part:
  • Step 5 The CDN node executes the following playback control policy script:
  • the specific script execution process can include:
  • the embodiment of the present disclosure further provides a video playback control system.
  • the composition of the video playback control system can be as shown in FIG. 1a and FIG. 1b.
  • the system includes: at least one source station, a CDN management server 12, and at least one CDN. Node 13; wherein
  • the at least one source station is configured to generate a play control policy script, and send the play control policy script to the CDN management server 12;
  • the CDN management server 12 is configured to send the received play control policy script to all CDN nodes 13;
  • the CDN node 13 is configured to receive a video play request from the terminal, obtain a first play control policy script that matches the video play request, and execute the first play control policy script to obtain a first play policy, based on the The first playback policy outputs video data to the terminal.
  • Each source station may deploy a play policy gateway 11 , generate a play control policy script through the play policy gateway 11 , and send the play control policy script to the CDN management server 12 .
  • the CDN management server 12 reviews the play control policy script; optionally, the malicious script is injected into the audit subsystem (including not limited to bytecode security detection, sandbox simulation environment). Security detection and other means), after the review, the playback control strategy script is distributed to all CDN nodes.
  • the audit subsystem including not limited to bytecode security detection, sandbox simulation environment. Security detection and other means
  • the terminal 14 sends a video play request to the CDN node 13; the process of resolving the user domain name and globally redirecting until the request is directed to the CDN node is not described in the embodiment of the present disclosure.
  • the CDN node 13 is configured to parse the video play request, obtain source station information carried in the video play request, and query a plurality of play control policy scripts obtained in advance based on the source station information. And obtaining a first play control policy script corresponding to the source station information.
  • the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a first a play policy; outputting video data to the terminal based on the first play policy.
  • the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain video content.
  • a unique identifier that sets the cache identifier that is uniquely identified as a cache area of the video content.
  • the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain the The IP address of the video play request, verifying whether the IP address is a legal IP address; when verifying that the IP address is an illegal IP address, the video play request is not responded.
  • the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain video content information corresponding to the video play request, and determine based on the video content information. Whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
  • FIG. 6 is a schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 6, the CDN node includes: a receiving unit 31, an obtaining unit 32, an executing unit 33, and an output unit 34;
  • the receiving unit 31 is configured to receive a video play request from the terminal;
  • the obtaining unit 32 is configured to obtain a first play control policy script that matches the video play request received by the receiving unit 31; the first play control policy script is obtained in advance by the CDN node;
  • the executing unit 33 is configured to execute the first play control policy script obtained by the obtaining unit 32 to obtain a first play policy.
  • the output unit 34 is configured to output video data to the terminal based on the first play policy obtained by the execution unit 33.
  • the receiving unit 31 is further configured to obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is corresponding to each of the play control policy scripts. Obtained by the source station and forwarded by the CDN management server.
  • the obtaining unit 32 is configured to parse the video play request, obtain source station information carried in the video play request, and query a plurality of play control policy scripts obtained in advance based on the source station information. And obtaining the first play control policy script corresponding to the source station information.
  • the executing unit 33 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a first Play strategy.
  • the executing unit 33 is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a video.
  • a unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
  • FIG. 7 is another schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 7, the CDN node further includes a verification unit 35;
  • the executing unit 33 is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain the IP of the video play request. address;
  • the verification unit 35 is configured to verify whether the IP address is a legal IP address
  • the output unit 34 is further configured to not respond to the video play request when the verification unit 35 verifies that the IP address is an illegal IP address.
  • FIG. 8 is a schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 8, the CDN node further includes a determining unit 36;
  • the executing unit 33 is further configured to execute the first play control policy script, parse the video play request, and obtain video content information corresponding to the video play request;
  • the determining unit 36 is configured to determine whether the video content exists based on the video content information obtained by the executing unit 33;
  • the executing unit 33 is further configured to: when the determining unit 36 determines that the video content does not exist, generate a return source address based on executing the first play control policy script, connect the source station based on the return source address, and obtain Video content.
  • the acquiring unit 32, the executing unit 33, the verifying unit 35, and the determining unit 36 in the CDN node may be used by a central processing unit (CPU) in the terminal in actual applications.
  • a central processing unit CPU
  • DSP digital signal processor
  • MCU Microcontroller Unit
  • FPGA Field-Programmable Gate Array
  • the receiving unit 31 and the output unit 34 in the terminal In practical applications, it can be realized through communication modules (including: basic communication suite, operating system, communication module, standardized interface and protocol, etc.) and transceiver antennas.
  • CDN node provided by the foregoing embodiment is only illustrated by the division of each of the foregoing program modules when performing video playback control. In actual applications, the foregoing processing may be performed by different program modules according to requirements. The internal structure of the CDN node is divided into different program modules to complete all or part of the processing described above. In addition, the CDN node provided by the foregoing embodiment is the same as the embodiment of the video playback control method. For details, refer to the method embodiment, and details are not described herein again.
  • FIG. 9 is a schematic structural diagram of hardware components of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 9, including a memory 42, a processor 41, and a computer program stored on the memory 42 and operable on the processor 41, the processing
  • the device 41 is configured to: receive a video play request from the terminal; obtain a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node; Performing the first play control policy script to obtain a first play policy, and output video data to the terminal based on the first play policy.
  • the processor 41 is configured to: obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is configured by each of the play control policies
  • the source station corresponding to the script is forwarded by the CDN management server.
  • the processor 41 is configured to: parse the video play request, obtain source station information carried in the video play request, and query multiple previously obtained based on the source station information. Playing a control policy script to obtain a first play control policy script corresponding to the source station information.
  • the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining a first play policy; outputting video data to the terminal based on the first play policy.
  • the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining a unique identifier of the video content, and setting the cache identifier that is uniquely identified as a cache area of the video content.
  • the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining the IP address of the video play request, verifying whether the IP address is a legal IP address; and when verifying that the IP address is an illegal IP address, not responding to the video play request.
  • the processor 41 is configured to: execute the first play control policy script, parse the video play request, and obtain video content information corresponding to the video play request; The video content information determines whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
  • the CDN node also includes a communication interface 43; the various components of the CDN node can be coupled together by a bus system 44. It will be appreciated that bus system 44 is arranged to effect connection communication between these components.
  • the bus system 44 includes, in addition to the data bus, a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are labeled as bus system 44 in FIG.
  • memory 42 can be either volatile memory or non-volatile memory, and can include both volatile and nonvolatile memory.
  • the non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), or an Erasable Programmable Read (EPROM). Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk storage or a tape storage.
  • the volatile memory can be a random access memory (RAM) that acts as an external cache.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • SSRAM Dynamic Random Access
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM enhancement Enhanced Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Dynamic Random Access Memory
  • DRRAM Direct Memory Bus Random Access Memory
  • Processor 41 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 41 or an instruction in a form of software.
  • the processor 41 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like.
  • the processor 41 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present disclosure may be directly implemented as a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can reside in a storage medium located in memory 42, which reads the information in memory 42 and, in conjunction with its hardware, performs the steps of the foregoing method.
  • the CDN node may be configured by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), and Complex Programmable Logic Devices (CPLDs). Complex Programmable Logic Device), FPGA, general purpose processor, controller, MCU, microprocessor, or other electronic component implementation for performing the aforementioned methods.
  • ASICs Application Specific Integrated Circuits
  • DSPs Digital Signal processors
  • PLDs Programmable Logic Devices
  • CPLDs Complex Programmable Logic Device
  • FPGA field-programmable Logic Device
  • controller controller
  • MCU microprocessor
  • an embodiment of the present disclosure further provides a computer readable storage medium, such as a memory 42 including a computer program that can be executed by a processor 41 of a CDN node to perform the steps described in the foregoing methods.
  • the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
  • An embodiment of the present disclosure further provides a computer storage medium having stored thereon computer instructions, the instructions being executed by a processor to: receive a video play request from a terminal; and obtain a first play that matches the video play request Controlling a policy script; the first play control policy script is obtained in advance by the CDN node; executing the first play control policy script to obtain a first play policy, and outputting video data to the terminal based on the first play policy.
  • the instruction is executed by the processor to: obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is corresponding to each play control policy script Obtained by the source station and forwarded by the CDN management server.
  • the video playback request is parsed, the source station information carried in the video play request is obtained, and a plurality of preset play control policies are obtained based on the source station information. a script that obtains a first play control policy script corresponding to the source station information.
  • the first play control policy script when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is decrypted. a play policy; outputting video data to the terminal based on the first play policy.
  • the first play control policy script when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is decrypted to obtain a video.
  • a unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
  • the first play control policy script when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is obtained.
  • the IP address of the video play request is verified whether the IP address is a legal IP address; when the IP address is verified as an illegal IP address, the video play request is not responded.
  • the instruction is executed by the processor to: execute the first play control policy script, parse the video play request, obtain video content information corresponding to the video play request; and based on the video content information Determining whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the above-described integrated unit of the present disclosure may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product.
  • the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present disclosure.
  • the foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a RAM, a magnetic disk, or an optical disk.
  • a video playback control method, system, node, and computer storage medium provided by an embodiment of the present invention have the following beneficial effects: a playback control policy script is obtained in advance through a CDN node and a first playback control matching the video playback request is performed.
  • the policy script obtains a play control policy that matches the video play request of the terminal, and the CDN node can obtain the play control policy specified by the source station without obtaining sensitive information; on the other hand, the CDN node does not need to forward the video play request to the source. Station, to avoid the terminal playback start time is extended, greatly improving the user experience.

Abstract

Embodiments of the present disclosure disclose a method, a system, a node, and a computer storage medium for controlling video playback. The method for controlling video playback can be applied to a content distribution network (CDN) node. The method comprises: receiving a video playback request from a terminal; obtaining a first playback control strategy script matching the video playback request; wherein the first playback control strategy script is obtained by the CDN node in advance; executing the first playback control strategy script, so as to obtain a first playback strategy, and outputting video data to the terminal on the basis of the first playback strategy.

Description

一种视频播放控制方法、系统、节点和计算机存储介质Video playback control method, system, node and computer storage medium 技术领域Technical field
本公开涉及内容分发网络(CDN,Content Delivery Network)领域,具体涉及一种视频播放控制方法、系统、节点和计算机存储介质。The present disclosure relates to the field of Content Delivery Network (CDN), and in particular, to a video playback control method, system, node, and computer storage medium.
背景技术Background technique
当前主流视频CDN出于防盗链、提升用户质量、降低带宽成本、按用户类型(例如免费用户、会员用户)提供不同质量服务的考虑,会在CDN节点进行策略控制,策略控制例如视频数据限速传输、降低视频播放码率、终止播放等等,当然不限于上述列举的策略控制方式。The current mainstream video CDNs are based on anti-theft chain, improve user quality, reduce bandwidth cost, and provide different quality services according to user types (such as free users and member users), and perform policy control on CDN nodes, such as video data speed limit. Transmission, reduction of video playback rate, termination of playback, etc., are of course not limited to the above-described policy control methods.
为实现策略控制通常有两种方式:一种方式是终端发给CDN节点的统一资源定位符(URL,Uniform Resource Locator)中包含策略信息,在CDN节点上对URL进行解密并按照源站的播放控制策略要求执行相应的播放策略;另一种方式是终端发给CDN节点的URL中包含策略信息,CDN节点将用户请求转发给源站的策略网关,由策略网关动态返回策略结果,CDN节点根据策略结果执行相应的动作。There are usually two ways to implement policy control: one way is that the Uniform Resource Locator (URL, the Uniform Resource Locator) sent by the terminal to the CDN node contains the policy information, and the URL is decrypted on the CDN node and played according to the source station. The control policy requires the execution of the corresponding play policy; the other way is that the URL sent by the terminal to the CDN node contains the policy information, the CDN node forwards the user request to the policy gateway of the source station, and the policy gateway dynamically returns the policy result, and the CDN node according to the CDN node The strategy result performs the corresponding action.
第一种方式的缺点在于:源站需要将控制策略的逻辑告知CDN节点,此时CDN节点能获取到敏感业务信息,例如用户标识(ID,Identifier)、用户级别、是否会员、是否付费等敏感信息,这些信息对源站具有较高商业价值一般不愿外泄。第二种方式由于用户请求的转发、策略网关返回策略结果的交互过程会导致终端播放启动时间延长,用户体验受到影响。The disadvantage of the first method is that the source station needs to inform the CDN node of the logic of the control policy. At this time, the CDN node can obtain sensitive service information, such as user identifier (ID, Identifier), user level, membership, payment, etc. Information, which has a high commercial value to the source station and is generally reluctant to leak. In the second method, the interaction between the user request and the policy gateway returning the policy result may cause the terminal to start playing longer and the user experience is affected.
发明内容Summary of the invention
为解决现有存在的技术问题,本公开实施例提供一种视频播放控制方法、系统、节点和计算机存储介质。To solve the existing technical problems, embodiments of the present disclosure provide a video playback control method, system, node, and computer storage medium.
为达到上述目的,本公开实施例的技术方案是这样实现的:In order to achieve the above object, the technical solution of the embodiment of the present disclosure is implemented as follows:
本公开实施例提供了一种视频播放控制方法,应用于CDN节点;所述方法包括:An embodiment of the present disclosure provides a video playback control method, which is applied to a CDN node. The method includes:
接收到来自终端的视频播放请求;Receiving a video play request from the terminal;
获得与所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;Obtaining a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node;
执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。Performing the first play control policy script to obtain a first play policy, and output video data to the terminal based on the first play policy.
本公开实施例还提供了一种CDN节点,所述CDN节点包括:接收单元、获取单元、执行单元和输出单元;其中,The embodiment of the present disclosure further provides a CDN node, where the CDN node includes: a receiving unit, an obtaining unit, an executing unit, and an output unit;
所述接收单元,设置为接收到来自终端的视频播放请求;The receiving unit is configured to receive a video play request from the terminal;
所述获取单元,设置为获得与所述接收单元接收的所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;The acquiring unit is configured to obtain a first play control policy script that matches the video play request received by the receiving unit; the first play control policy script is obtained in advance by the CDN node;
所述执行单元,设置为执行所述获取单元获得的所述第一播放控制策略脚本获得第一播放策略;The execution unit is configured to execute the first play control policy script obtained by the acquiring unit to obtain a first play policy;
所述输出单元,设置为基于所述执行单元获得的所述第一播放策略向所述终端输出视频数据。The output unit is configured to output video data to the terminal based on the first play policy obtained by the execution unit.
本公开实施例还提供了一种计算机存储介质,其上存储有计算机指令,该指令被处理器执行时实现本公开实施例所述视频播放控制方法的步骤。The embodiment of the present disclosure further provides a computer storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the steps of the video playback control method in the embodiment of the present disclosure are implemented.
本公开实施例还提供了一种视频播放控制方法,所述方法包括:The embodiment of the present disclosure further provides a video playback control method, where the method includes:
源站生成播放控制策略脚本,将所述播放控制策略脚本发送至CDN管理服务器;The source station generates a play control policy script, and sends the play control policy script to the CDN management server;
所述CDN管理服务器将接收到的播放控制策略脚本发送至所有CDN节点;The CDN management server sends the received play control policy script to all CDN nodes;
所述CDN节点接收到来自终端的视频播放请求,获得与所述视频播放请求匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播 放策略,基于所述第一播放策略向所述终端输出视频数据。Receiving, by the CDN node, a video play request from the terminal, obtaining a first play control policy script that matches the video play request, and executing the first play control policy script to obtain a first play policy, based on the first play The policy outputs video data to the terminal.
本公开实施例还提供了一种视频播放控制系统,所述系统包括:至少一个源站、CDN管理服务器和至少一个CDN节点;其中,The embodiment of the present disclosure further provides a video playback control system, where the system includes: at least one source station, a CDN management server, and at least one CDN node;
所述至少一个源站,设置为生成播放控制策略脚本,将所述播放控制策略脚本发送至所述CDN管理服务器;The at least one source station is configured to generate a play control policy script, and send the play control policy script to the CDN management server;
所述CDN管理服务器,设置为将接收到的播放控制策略脚本发送至所有CDN节点;The CDN management server is configured to send the received play control policy script to all CDN nodes;
所述CDN节点,设置为接收到来自终端的视频播放请求,获得与所述视频播放请求匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。The CDN node is configured to receive a video play request from the terminal, obtain a first play control policy script that matches the video play request, and execute the first play control policy script to obtain a first play policy, based on the The first playback policy outputs video data to the terminal.
本公开实施例还提供了一种CDN节点,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现本公开任一实施例所述视频播放控制方法的步骤。Embodiments of the present disclosure also provide a CDN node, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the program to implement any of the embodiments of the present disclosure The steps of the video playback control method.
本公开实施例提供的视频播放控制方法、系统、节点和计算机存储介质,所述方法包括:接收到来自终端的视频播放请求;基于所述视频播放请求获得匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。采用本公开实施例的技术方案,通过CDN节点预先获得播放控制策略脚本并执行与视频播放请求匹配的第一播放控制策略脚本,从而获得与终端的视频播放请求相匹配的播放控制策略,无需CDN节点获得敏感的信息也可实现源站所指定的播放控制策略;另一方面也无需CDN节点转发视频播放请求给源站,避免终端播放启动时间延长,大大提升了用户的体验。A video playback control method, system, node, and computer storage medium provided by an embodiment of the present disclosure, the method includes: receiving a video play request from a terminal; and obtaining a matched first play control policy script based on the video play request; The first play control policy script is obtained in advance by the CDN node; the first play control policy script is executed to obtain a first play policy, and video data is output to the terminal based on the first play policy. With the technical solution of the embodiment of the present disclosure, the play control policy script is obtained in advance through the CDN node, and the first play control policy script matching the video play request is executed, thereby obtaining a play control policy matching the video play request of the terminal, without using the CDN. The node obtains sensitive information and can also implement the playback control policy specified by the source station; on the other hand, the CDN node does not need to forward the video playback request to the source station, thereby avoiding the extension of the terminal playback start time and greatly improving the user experience.
附图说明DRAWINGS
图1a和图1b分别为本公开实施例的视频播放控制方法的应用架构示意图;1a and 1b are schematic diagrams showing an application architecture of a video playback control method according to an embodiment of the present disclosure;
图2为本公开实施例一的视频播放控制方法的一种流程示意图;2 is a schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure;
图3为本公开实施例一的视频播放控制方法的另一种流程示意图;FIG. 3 is another schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure;
图4为本公开实施例的视频播放控制方法中CDN节点的软件结构示意图;4 is a schematic diagram of a software structure of a CDN node in a video playback control method according to an embodiment of the present disclosure;
图5为本公开实施例二的视频播放控制方法的流程示意图;FIG. 5 is a schematic flowchart of a video playback control method according to Embodiment 2 of the present disclosure;
图6为本公开实施例的CDN节点的一种组成结构示意图;FIG. 6 is a schematic structural diagram of a structure of a CDN node according to an embodiment of the present disclosure;
图7为本公开实施例的CDN节点的另一种组成结构示意图;FIG. 7 is a schematic diagram of another composition structure of a CDN node according to an embodiment of the present disclosure;
图8为本公开实施例的CDN节点的又一种组成结构示意图;FIG. 8 is a schematic structural diagram of still another structure of a CDN node according to an embodiment of the present disclosure;
图9为本公开实施例的CDN节点的硬件组成结构示意图。FIG. 9 is a schematic structural diagram of hardware components of a CDN node according to an embodiment of the present disclosure.
具体实施方式detailed description
下面结合附图及具体实施例对本公开作进一步详细的说明。The present disclosure will be further described in detail below in conjunction with the drawings and specific embodiments.
图1a和图1b分别为本公开实施例的视频播放控制方法的应用架构示意图;如图1a所示,所述视频播放控制方法应用的架构包括:播放策略网关11、CDN管理服务器12、CDN节点13和终端14;其中,播放策略网关11与CDN管理服务器12之间、CDN管理服务器12与CDN节点13之间、CDN节点13和终端14之间可通过网络进行数据交互。FIG. 1 is a schematic diagram of an application architecture of a video playback control method according to an embodiment of the present disclosure; as shown in FIG. 1a, the video playback control method application architecture includes: a play policy gateway 11, a CDN management server 12, and a CDN node. 13 and the terminal 14; wherein, between the play policy gateway 11 and the CDN management server 12, between the CDN management server 12 and the CDN node 13, and between the CDN node 13 and the terminal 14, data can be exchanged through the network.
其中,终端14设置为向CDN节点13请求视频内容。播放策略网关11设置为编译播放控制策略脚本,向CDN管理服务器12下发编译过的播放控制策略脚本。播放策略网关11位于源站侧,源站为请求的视频内容所在服务器。例如,用户请求xx视频网站的一视频内容,则源站可以理解为xx视频网站所属服务器。其中,播放策略网关11可位于视频内容所在服务器内,也可独立于视频内容所在服务器、作为一个单独的网关设备存在。CDN管理服务器12可同时接收多个源站的播放策略网关11下发的播放控制策略脚本,并将播放控制策略脚本分发到每个CDN节点,如图1b所示,例如,CDN管理服务器12可分别接收到第一播放策略网关111(对应域名为1.cp.com的源站1)、第二播放策略网关112(对应域名为2.cp.com的源站2)和第三播放策略网关113(对应域名为3.cp.com的源站3)的播放控制策略脚本,将每个播放控制策略脚本分发到CDN节点1、CDN节点2和CDN节点3。Among them, the terminal 14 is arranged to request video content from the CDN node 13. The play policy gateway 11 is configured to compile the play control policy script, and deliver the compiled play control policy script to the CDN management server 12. The play policy gateway 11 is located on the source station side, and the source station is the server where the requested video content is located. For example, if a user requests a video content of a xx video website, the source station can be understood as a server to which the xx video website belongs. The play policy gateway 11 may be located in the server where the video content is located, or may exist as a separate gateway device independently of the server where the video content is located. The CDN management server 12 can simultaneously receive the play control policy scripts sent by the play policy gateways 11 of the plurality of source stations, and distribute the play control policy scripts to each CDN node, as shown in FIG. 1b. For example, the CDN management server 12 can Receiving the first play policy gateway 111 (corresponding to the source station 1 with the domain name 1.cp.com), the second play policy gateway 112 (the source station 2 corresponding to the domain name 2.cp.com), and the third play policy gateway respectively. A play control policy script of 113 (corresponding to the source station 3 of the domain name 3.cp.com) distributes each play control policy script to the CDN node 1, the CDN node 2, and the CDN node 3.
CDN管理服务器12设置为与播放策略网关11进行数据交互,获得播放策略网关11下发的播放控制策略脚本,通过审查后将播放控制策略脚本发送给所有的CDN节点13。CDN节点13设置为基于不同终端14的视频播放请求获得对应的播放控制策略脚本,基于该播放控制策略脚本的执行向终端14提供视频播放服务。The CDN management server 12 is configured to perform data interaction with the play policy gateway 11 to obtain a play control policy script delivered by the play policy gateway 11, and send the play control policy script to all CDN nodes 13 after review. The CDN node 13 is configured to obtain a corresponding play control policy script based on the video play request of the different terminal 14, and provide a video play service to the terminal 14 based on the execution of the play control policy script.
上述图1的例子只是实现本公开实施例的一个系统架构实例,本公开实施例并不限于上述图1所述的系统结构,基于该系统架构,提出本公开各个实施例。The above-mentioned example of FIG. 1 is only an example of a system architecture that implements an embodiment of the present disclosure. The embodiment of the present disclosure is not limited to the system structure described in FIG. 1 above, and various embodiments of the present disclosure are proposed based on the system architecture.
实施例一Embodiment 1
本公开实施例提供了一种视频播放控制方法,应用于CDN节点中。图2为本公开实施例一的视频播放控制方法的一种流程示意图;如图2所示,所述方法包括:Embodiments of the present disclosure provide a video playback control method applied to a CDN node. 2 is a schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure; as shown in FIG. 2, the method includes:
步骤101:接收到来自终端的视频播放请求。可选地,所述视频播放请求可通过URL表示。Step 101: Receive a video play request from the terminal. Optionally, the video play request may be represented by a URL.
步骤102:获得与所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得。Step 102: Obtain a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node.
步骤103:执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。Step 103: Perform the first play control policy script to obtain a first play policy, and output video data to the terminal according to the first play policy.
作为一种实施方式,图3为本公开实施例一的视频播放控制方法的另一种流程示意图;如图3所示,所述方法还包括步骤100:获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应的源站发出的、经CDN管理服务器转发而获得。FIG. 3 is another schematic flowchart of a video playback control method according to Embodiment 1 of the present disclosure; as shown in FIG. 3, the method further includes the step 100: obtaining a plurality of play control policy scripts; Each of the plurality of play control policy scripts is obtained by the source station corresponding to each play control policy script and forwarded by the CDN management server.
本公开实施例中,图4为本公开实施例的视频播放控制方法中CDN节点的软件结构示意图;如图4所示,在现有的CDN节点缓存服务进程中,增加脚本引擎服务,基于脚本引擎服务,播放控制策略能力开放模块执行脚本,具体执行脚本内置参数及函数的调用,从而实现视频播放策略的控制。其中,脚本引擎可采用例如JScript、LUA等开源脚本引擎,也可以自行开发脚本引擎, 本实施例对脚本开发方式不进行限定。In the embodiment of the present disclosure, FIG. 4 is a schematic diagram of a software structure of a CDN node in a video playback control method according to an embodiment of the present disclosure; as shown in FIG. 4, in an existing CDN node cache service process, a script engine service is added, based on a script. The engine service, the play control strategy capability open module executes the script, and specifically executes the call of the built-in parameters and functions of the script, thereby implementing the control of the video play strategy. The script engine may use an open source script engine such as JScript or LUA, or may develop a script engine by itself. This embodiment does not limit the script development mode.
本公开实施例中,执行脚本实现的功能包括以下至少之一:HTTP头信息获取、HTTP请求URL信息获取、HTTP回源URL设置、缓存策略设置、视频播放控制策略设置、异步消息通知函数库、基本加解密库、基本函数库等等。In the embodiment of the present disclosure, the function of executing the script implementation includes at least one of the following: HTTP header information acquisition, HTTP request URL information acquisition, HTTP return source URL setting, cache policy setting, video playback control policy setting, asynchronous message notification function library, Basic encryption and decryption libraries, basic function libraries, and more.
其中,HTTP头信息获取可通过以下函数实现:Among them, HTTP header information can be obtained by the following functions:
str=ngx.req.raw_header(no_request_line?);表示获取原始HTTP头完整字符串;例如:ngx.print(ngx.req.raw_header());Str=ngx.req.raw_header(no_request_line?); means to get the original HTTP header complete string; for example: ngx.print(ngx.req.raw_header());
或者,HTTP头信息获取可通过以下函数实现:Alternatively, HTTP header information can be obtained by the following functions:
headers=ngx.req.get_headers(max_headers?,raw?);表示以哈希表结构形式获取HTTP头信息;例如:Headers=ngx.req.get_headers(max_headers?,raw?); indicates that the HTTP header information is obtained in the form of a hash table structure; for example:
Figure PCTCN2019086422-appb-000001
Figure PCTCN2019086422-appb-000001
其中,HTTP请求URL信息获取可通过内置获取URL的变量,例如包括:获取URL的统一资源标识符(URI,Uniform Resource Identifier)部分:ngx.var.uri;获取URL的参数部分:ngx.var.args;获取访问IP:ngx.var.remote_addr。The HTTP request URL information may be obtained by using a built-in URL to obtain a variable, for example, a URI (Uniform Resource Identifier) part of the URL: ngx.var.uri; and a parameter part of the URL: ngx.var. Args; Get access to IP: ngx.var.remote_addr.
其中,HTTP回源URL设置:ngx.set_source_url(source_url,timeout);其中,source_url表示回源地址;timeout表示回源超时,单位为秒。The HTTP return source URL is set to: ngx.set_source_url(source_url, timeout); where source_url indicates the source address back; timeout indicates the source timeout, in seconds.
其中,视频播放控制策略设置中包括的视频播放控制策略至少包括:终止播放:ok,err=ngx.eof()、播放时长(单位为秒,如果该参数为-1,可表示完整播放)控制:ngx.var.playtime、限速控制:ngx.var.limit_rate(表示最大带宽)。The video playback control policy included in the video playback control policy setting includes at least: terminating playback: ok, err=ngx.eof(), playing duration (in seconds, if the parameter is -1, indicating complete playback) control : ngx.var.playtime, speed limit control: ngx.var.limit_rate (represents the maximum bandwidth).
其中,缓存策略设置,包括但不限于是否缓存、缓存KEY提取,分片缓存等。The cache policy settings include, but are not limited to, whether to cache, cache KEY extraction, fragment cache, and the like.
其中,异步消息通知函数库,包括但不限于TCP、UDP、HTTP/HTTPS;例如,异步消息通知函数库包括的函数可包括以下至少之一:ngx.socket.udp; udpsock:setpeername;udpsock:send;udpsock:receive;udpsock:close;udpsock:settimeout;ngx.socket.stream;ngx.socket.tcp;tcpsock:connect;tcpsock:sslhandshake;tcpsock:send;tcpsock:receive;tcpsock:receiveuntil;tcpsock:close;tcpsock:settimeout;tcpsock:settimeouts;tcpsock:setoption;tcpsock:setkeepalive;tcpsock:getreusedtimes;ngx.socket.connect。The asynchronous message notification function library includes but is not limited to TCP, UDP, HTTP/HTTPS; for example, the asynchronous message notification function library includes a function including at least one of the following: ngx.socket.udp; udpsock:setpeername; udpsock:send ;udpsock:receive;udpsock:close;udpsock:settimeout;ngx.socket.stream;ngx.socket.tcp;tcpsock:connect;tcpsock:sslhandshake;tcpsock:send;tcpsock:receive;tcpsock:receiveuntil;tcpsock:close;tcpsock :settimeout;tcpsock:settimeouts;tcpsock:setoption;tcpsock:setkeepalive;tcpsock:getreusedtimes;ngx.socket.connect.
其中,基本加解密库包括的加解密算法包括不限于消息摘要算法第五版(MD5,Message-Digest Algorithm 5)、RSA加密算法、数据加密标准(DES,Data Encryption Standard)。例如,基本加解密库包括的函数可包括以下至少之一:ngx.crc32_short;ngx.crc32_long;ngx.hmac_sha1;ngx.md5;ngx.md5_bin;ngx.sha1_bin。The encryption and decryption algorithm included in the basic encryption and decryption library includes not limited to the message digest algorithm fifth version (MD5, Message-Digest Algorithm 5), the RSA encryption algorithm, and the data encryption standard (DES, Data Encryption Standard). For example, the functions included in the basic encryption and decryption library may include at least one of the following: ngx.crc32_short; ngx.crc32_long; ngx.hmac_sha1; ngx.md5; ngx.md5_bin; ngx.sha1_bin.
其中,基本函数库包括但不限于不限于字符串处理、正则库解析、可扩展标记语言(XML,Extensible Markup Language)、JS对象标记(JSON,JavaScript Object Notation)解析、链表、队列等。例如,基本函数库包括的函数可包括以下至少之一:ngx.re.match;ngx.re.find;ngx.re.gmatch;ngx.re.sub;ngx.re.gsub。The basic function library includes but is not limited to, not limited to string processing, regular library parsing, Extensible Markup Language (XML), JS object notation (JSON, JavaScript Object Notation) parsing, linked list, queue, and the like. For example, the functions included in the basic function library may include at least one of the following: ngx.re.match; ngx.re.find; ngx.re.gmatch; ngx.re.sub; ngx.re.gsub.
本公开实施例中,CDN节点可基于来自播放策略网关(或源站)、经CDN管理服务器转发的配置信息对播放控制策略脚本进行更新或删除。In an embodiment of the present disclosure, the CDN node may update or delete the play control policy script based on configuration information forwarded from the play policy gateway (or source station) via the CDN management server.
基于上述播放控制策略脚本的功能,本公开实施例中,在接收到终端的视频播放请求后,通过执行相应的播放控制策略脚本,以获得相应的播放控制策略,基于播放控制策略对终端提供视频服务。Based on the function of the foregoing play control policy script, in the embodiment of the present disclosure, after receiving the video play request of the terminal, the corresponding play control policy script is executed to obtain a corresponding play control policy, and the terminal is provided with a video based on the play control policy. service.
作为一种实施方式,所述基于所述视频播放请求获得匹配的第一播放控制策略脚本,包括:解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的第一播放控制策略脚本。As an implementation manner, the obtaining, by the video play request, a matching first play control policy script includes: parsing the video play request, and obtaining source station information carried in the video play request, based on the source The station information queries a plurality of pre-obtained play control policy scripts to obtain a first play control policy script corresponding to the source station information.
可选地,视频播放请求可通过URL表示,则通过解析URL,获得源站信息,具体可获得源站的域名信息,基于所述域名信息查找存储的多个播放控制策略脚本,获得与所述域名信息对应的第一播放控制策略脚本。Optionally, the video play request may be represented by a URL, and the source station information is obtained by parsing the URL, and the domain name information of the source station is specifically obtained, and the stored multiple play control policy scripts are searched based on the domain name information, and the obtained The first play control policy script corresponding to the domain name information.
作为一种实施方式,所述执行所述第一播放控制策略脚本获得第一播放策 略,基于所述第一播放策略向所述终端输出视频数据,包括:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略;基于所述第一播放策略向所述终端输出视频数据。As an implementation manner, the executing the first play control policy script to obtain a first play policy, and outputting video data to the terminal according to the first play policy, includes: executing the first play control policy script, Parsing the video play request, obtaining a key part carried by the video play request, decrypting the key part to obtain a first play policy, and outputting video data to the terminal based on the first play policy.
可选地,CDN节点通过执行第一播放控制策略脚本,对表征视频播放请求的URL进行解析,获得视频播放请求携带的关键部分,所述关键部分表征对应终端的业务信息;实际应用中,终端将业务信息通过预设编码方式编码后形成URL中的所述关键部分。其中,所述业务信息可包括用户标识、用户级别、是否为会员用户、是否付费等敏感业务信息。则CDN节点可通过执行第一播放控制策略脚本获得所述关键部分,进而基于所述关键部分获得对应的第一播放策略;所述第一播放策略包括限速带宽等。则CDN节点可按照第一播放策略(如限速带宽)向终端输出视频数据。Optionally, the CDN node parses the URL that represents the video play request by performing the first play control policy script, and obtains a key part carried by the video play request, where the key part represents the service information of the corresponding terminal; in actual application, the terminal The business information is encoded by a preset encoding method to form the key part in the URL. The service information may include sensitive service information such as a user identifier, a user level, whether it is a member user, and whether the payment is made. The CDN node obtains the key part by executing the first play control policy script, and obtains a corresponding first play policy based on the key part; the first play policy includes a speed limit bandwidth and the like. Then, the CDN node can output video data to the terminal according to the first playing policy (such as the speed limit bandwidth).
作为一种实施方式,所述执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分之后,所述方法还包括:解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。As an implementation manner, after the performing the first play control policy script, parsing the video play request, and obtaining a key part carried by the video play request, the method further includes: decrypting the key part to obtain a video A unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
可选地,CDN节点通过执行第一播放控制策略脚本,对表征视频播放请求的URL进行解析,获得视频播放请求携带的关键部分,所述关键部分包括请求视频内容;实际应用中,终端将业务信息通过预设编码方式编码后形成URL中的所述关键部分。则CDN节点通过执行第一播放控制策略脚本解析URL的关键部分,获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。Optionally, the CDN node parses the URL that represents the video play request by executing the first play control policy script, and obtains a key part carried by the video play request, where the key part includes requesting video content; in actual application, the terminal applies the service. The information is encoded by a preset encoding to form the key portion of the URL. Then, the CDN node obtains a unique identifier of the video content by performing a first play control policy script to parse a key part of the URL, and sets the cache identifier of the cache area of the video content.
作为一种实施方式,所述执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分之后,所述方法还包括:解密所述关键部分获得所述视频播放请求的IP地址,验证所述IP地址是否为合法IP地址;当验证所述IP地址为非法IP地址时,不响应所述视频播放请求。As an implementation manner, after the performing the first play control policy script, parsing the video play request, and obtaining the key part carried by the video play request, the method further includes: decrypting the key part to obtain the The IP address of the video play request is verified whether the IP address is a legal IP address; when the IP address is verified as an illegal IP address, the video play request is not responded.
可选地,CDN节点通过执行第一播放控制策略脚本,对表征视频播放请求 的URL进行解析,获得视频播放请求携带的关键部分,所述关键部分包括终端的IP地址;基于执行所述第一播放控制策略脚本对所述IP地址的合法性进行校验;若判定所述IP地址属于非法IP地址,则不响应终端的视频播放请求。Optionally, the CDN node parses the URL that represents the video play request by performing a first play control policy script, and obtains a key part carried by the video play request, where the key part includes an IP address of the terminal; The play control policy script verifies the validity of the IP address; if it is determined that the IP address belongs to an illegal IP address, it does not respond to the video play request of the terminal.
作为一种实施方式,所述执行所述第一播放控制策略脚本,包括:解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;基于所述视频内容信息判断视频内容是否存在;当所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。As an implementation manner, the executing the first play control policy script includes: parsing the video play request, obtaining video content information corresponding to the video play request, and determining whether the video content exists based on the video content information. And when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
可选地,CDN节点通过执行第一播放控制策略脚本,对表征视频播放请求的URL进行解析,获得视频播放请求携带的关键部分,所述关键部分包括请求视频内容,也即获得视频内容信息;CDN节点基于视频内容信息判断自身是否存在该视频内容;若不存在,则需要构造回源URL,基于回源URL从源站获得视频内容。Optionally, the CDN node parses the URL that represents the video play request by executing the first play control policy script, and obtains a key part carried by the video play request, where the key part includes requesting the video content, that is, obtaining the video content information; The CDN node determines whether the video content exists according to the video content information; if not, it needs to construct a return source URL, and obtain the video content from the source station based on the return source URL.
作为一种实施方式,所述基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容,包括:基于执行所述第一播放控制策略脚本生成主回源地址和备用回源地址;基于所述主回源地址连接源站,判断是否获得视频内容;若基于所述主回源地址未获得视频内容(例如主回源地址连接超时),则基于备用回源地址连接源站获得视频内容。As an implementation manner, the generating the return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining the video content, includes: generating the script based on executing the first play control policy a primary source address and an alternate source address; determining whether to obtain video content based on the primary source address connection source station; if the video content is not obtained based on the primary source address (eg, the primary source address connection timeout) The source content is obtained by connecting the source station based on the alternate source address.
采用本公开实施例的技术方案,通过CDN节点预先获得播放控制策略脚本并执行与视频播放请求匹配的第一播放控制策略脚本,从而获得与终端的视频播放请求相匹配的播放控制策略,无需CDN节点获得敏感的信息也可实现源站所指定的播放控制策略;另一方面也无需CDN节点转发视频播放请求给源站,避免终端播放启动时间延长,大大提升了用户的体验。另外,对于CDN系统通常会为众多的源站做缓存加速服务,一般从几百个到几万个不等。一般来说对于防盗链、播放控制策略、同一视频内容识别、是否缓存和缓存时长、回源地址设置及容灾方面都有个性化诉求,如果CDN系统对每个源站都按照其要求进行定制开发,势必会导致响应慢,工作量大,成本高,系统升级频繁。 而本公开实施例通过播放控制策略脚本部署在CDN节点中,使CDN节点无需对每个源站做定制开发,仅需要源站进行简单的脚本开发便可实现对接。With the technical solution of the embodiment of the present disclosure, the play control policy script is obtained in advance through the CDN node, and the first play control policy script matching the video play request is executed, thereby obtaining a play control policy matching the video play request of the terminal, without using the CDN. The node obtains sensitive information and can also implement the playback control policy specified by the source station; on the other hand, the CDN node does not need to forward the video playback request to the source station, thereby avoiding the extension of the terminal playback start time and greatly improving the user experience. In addition, for CDN systems, there are usually cache acceleration services for many source stations, ranging from a few hundred to tens of thousands. In general, there are personalized appeals for anti-theft chain, playback control strategy, same video content identification, cache and cache time, return source address setting and disaster tolerance. If the CDN system customizes each source station according to its requirements. Development will inevitably lead to slow response, large workload, high cost and frequent system upgrades. However, the embodiment of the present disclosure is deployed in a CDN node by using a play control policy script, so that the CDN node does not need to perform custom development for each source station, and only the source station needs to perform simple script development to achieve docking.
实施例二Embodiment 2
本公开实施例还提供了一种视频播放控制方法。图5为本公开实施例二的视频播放控制方法的流程示意图;如图5所示,所述方法包括:The embodiment of the present disclosure further provides a video playback control method. FIG. 5 is a schematic flowchart of a video playback control method according to Embodiment 2 of the present disclosure; as shown in FIG. 5, the method includes:
步骤201:源站生成播放控制策略脚本。其中,源站可基于预设脚本生成规则生成播放控制策略脚本。Step 201: The source station generates a play control policy script. The source station may generate a play control policy script based on the preset script generation rule.
步骤202:源站将所述播放控制策略脚本发送至CDN管理服务器。Step 202: The source station sends the play control policy script to the CDN management server.
步骤203:CDN管理服务器对接收到的播放控制策略脚本进行审查。Step 203: The CDN management server reviews the received play control policy script.
步骤204:CDN管理服务器将审查通过后的播放控制策略脚本发送至所有CDN节点。Step 204: The CDN management server sends the passed playback control policy script to all CDN nodes.
步骤205:CDN节点接收到来自终端的视频播放请求。Step 205: The CDN node receives a video play request from the terminal.
步骤206:CDN节点基于所述视频播放请求获得匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播放策略。Step 206: The CDN node obtains a matching first play control policy script based on the video play request, and executes the first play control policy script to obtain a first play policy.
步骤207:CDN节点基于所述第一播放策略向所述终端输出视频数据。Step 207: The CDN node outputs video data to the terminal according to the first play policy.
本公开实施例中,CDN节点的视频播放控制方法可参照前述实施例一中所述,本实施例中不再赘述。In the embodiment of the present disclosure, the video playback control method of the CDN node may be referred to the foregoing embodiment 1, and is not described in this embodiment.
本实施例中,CDN管理服务器接收到播放控制策略脚本后,对播放控制策略脚本进行审查;可选支持恶意脚本非常注入审核子系统(包括不限于字节码安全检测、沙箱模拟环境安全检测等手段),通过审查后将播放控制策略脚本分发给所有CDN节点。In this embodiment, after receiving the play control policy script, the CDN management server reviews the play control policy script; optionally, the malicious script is injected into the audit subsystem (including not limited to bytecode security detection, sandbox simulation environment security detection). And so on), after the review, the playback control strategy script is distributed to all CDN nodes.
以下以缓存服务器采用NGINX服务器、整合LUAJIT(LUAJIT为采用C语言编写的LUA代码的解释器)脚本引擎和NGINX的LUA插件NGINX_LUA_MODULE为例加以实现说明。The following is an example of a cache server using an NGINX server, an integrated LUAJIT (LUAJIT is an interpreter for LUA code written in C) script engine, and NGINX's LUA plug-in NGINX_LUA_MODULE.
具体实施例一Specific embodiment 1
通过部署LUA脚本到CDN节点上,实现防盗链及播放限速功能。The anti-theft chain and the playback speed limit function are implemented by deploying the LUA script to the CDN node.
步骤1:video.qq.com域名的播放策略网关将编译后的播放控制策略脚本分 发给CDN管理服务器。Step 1: The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
步骤2:CDN管理服务器向与之连接的每个CDN节点分发video.qq.com域名和对应的播放控制策略脚本。Step 2: The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
步骤3:终端向CDN节点发起视频播放请求,该视频播放请求可通过以下URL表示:http://202.102.11.12/video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。Step 3: The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
步骤4:CDN节点解析URL请求,发现请求的源站域名为video.qq.com,则执行video.qq.com源站下发的播放控制策略脚本,以下为伪代码逻辑部分:Step 4: The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station. The following is the pseudo code logic part:
Figure PCTCN2019086422-appb-000002
Figure PCTCN2019086422-appb-000002
步骤5:CDN节点执行具体播放控制策略脚本。Step 5: The CDN node executes a specific playback control policy script.
具体的脚本执行过程可包括:The specific script execution process can include:
1)解析URL中的问号部分,即为关键(KEY)部分:iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。1) Parse the question mark part of the URL, which is the key (KEY) part: iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
2)根据解密算法解密获得QQ号、是否为免费用户。2) According to the decryption algorithm, the decryption algorithm obtains the QQ number and is a free user.
3)进行视频播放,在确定为免费用户(即普通用户)后设置最大下载带宽, 即控制限速播放。3) Perform video playback, set the maximum download bandwidth after determining to be a free user (ie, a normal user), that is, control the speed limit playback.
4)向视频播放策略网关异步HTTP上报本次视频播放请求情况,包括URL、视频是否完整播放、限速带宽等参数。4) Reporting the video playback request to the video playback policy gateway asynchronously, including the URL, whether the video is completely played, and the speed limit bandwidth.
具体实施例二Specific embodiment 2
通过部署LUA脚本到CDN节点上,实现回源URL地址改写及源站多路容灾功能。By deploying the LUA script to the CDN node, the source URL address rewriting and the source station multipath disaster recovery function are implemented.
步骤1:video.qq.com域名的播放策略网关将编译后的播放控制策略脚本分发给CDN管理服务器。Step 1: The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
步骤2:CDN管理服务器向与之连接的每个CDN节点分发video.qq.com域名和对应的播放控制策略脚本。Step 2: The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
步骤3:终端向CDN节点发起视频播放请求,该视频播放请求可通过以下URL表示:http://202.102.11.12/video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。Step 3: The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
步骤4:CDN节点解析URL请求,发现请求的源站域名为video.qq.com,则执行video.qq.com源站下发的播放控制策略脚本,以下为伪代码逻辑部分:Step 4: The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station. The following is the pseudo code logic part:
Figure PCTCN2019086422-appb-000003
Figure PCTCN2019086422-appb-000003
Figure PCTCN2019086422-appb-000004
Figure PCTCN2019086422-appb-000004
步骤5:CDN节点执行以下播放控制策略脚本:Step 5: The CDN node executes the following playback control policy script:
Figure PCTCN2019086422-appb-000005
Figure PCTCN2019086422-appb-000005
具体的脚本执行过程可包括:The specific script execution process can include:
1)解析URL中的问号部分,即为关键(KEY)部分:iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。1) Parse the question mark part of the URL, which is the key (KEY) part: iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
2)根据解密算法解密获得QQ号、免费用户,在确定为免费用户(即普通用户)后设置最大下载带宽,即控制限速播放。2) According to the decryption algorithm, the QQ number and the free user are obtained, and the maximum download bandwidth is set after the user is determined to be a free user (ie, a normal user), that is, the speed limit is controlled.
3)获得视频内容,当视频内容不存在时,根据执行的脚本构造回源主URL:http://source.video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy;3) Obtain the video content. When the video content does not exist, construct the return source main URL according to the executed script: http://source.video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy;
构造备用回源URL:http://sourcebackup.video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。Construct an alternate source URL: http://sourcebackup.video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
基于URL连接源站,获得视频内容;若主URL连接超时3秒后,则采用 备用回源URL连接源站,获得视频内容。The video content is obtained by connecting the source station based on the URL; if the primary URL connection times out after 3 seconds, the source address is connected by using the alternate source URL to obtain the video content.
4)进行视频完整播放、设置最大下载带宽。4) Perform full video playback and set the maximum download bandwidth.
5)向视频播放策略网关异步HTTP上报本次视频播放请求情况,包括URL、视频完整播放、限速带宽等参数。5) Reporting the video playback request to the video playback policy gateway asynchronously, including parameters such as URL, video complete playback, and speed limit bandwidth.
具体实施例三Concrete embodiment 3
通过部署LUA脚本到CDN节点上,对指定域名动态计算缓存KEY的规则。By deploying the LUA script to the CDN node, the rules for caching the KEY are dynamically calculated for the specified domain name.
步骤1:video.qq.com域名的播放策略网关将编译后的播放控制策略脚本分发给CDN管理服务器。Step 1: The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
步骤2:CDN管理服务器向与之连接的每个CDN节点分发video.qq.com域名和对应的播放控制策略脚本。Step 2: The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
步骤3:终端向CDN节点发起视频播放请求,该视频播放请求可通过以下URL表示:http://202.102.11.12/video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。Step 3: The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
步骤4:CDN节点解析URL请求,发现请求的源站域名为video.qq.com,则执行video.qq.com源站下发的播放控制策略脚本,以下为伪代码逻辑部分:Step 4: The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station. The following is the pseudo code logic part:
Figure PCTCN2019086422-appb-000006
Figure PCTCN2019086422-appb-000006
Figure PCTCN2019086422-appb-000007
Figure PCTCN2019086422-appb-000007
步骤5:CDN节点执行以下播放控制策略脚本:Step 5: The CDN node executes the following playback control policy script:
Figure PCTCN2019086422-appb-000008
Figure PCTCN2019086422-appb-000008
具体的脚本执行过程可包括:The specific script execution process can include:
1)解析URL中的问号部分,即为关键(KEY)部分:iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。1) Parse the question mark part of the URL, which is the key (KEY) part: iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
2)根据解密算法解密获得QQ号、免费用户,在确定为免费用户(即普通用户)后设置最大下载带宽,即控制限速播放。2) According to the decryption algorithm, the QQ number and the free user are obtained, and the maximum download bandwidth is set after the user is determined to be a free user (ie, a normal user), that is, the speed limit is controlled.
3)根据解密算法解密获得视频内容的唯一ID,设置视频内容的唯一ID为缓存标识。3) Decrypt the obtained unique ID of the video content according to the decryption algorithm, and set the unique ID of the video content to be the cache identifier.
4)进行视频播放,在确定为免费用户(即普通用户)后设置最大下载带宽,即控制限速播放。4) Perform video playback, set the maximum download bandwidth after determining to be a free user (ie, a normal user), that is, control the speed limit playback.
5)向视频播放策略网关异步HTTP上报本次视频播放请求情况,包括URL、视频完整播放、限速带宽等参数。5) Reporting the video playback request to the video playback policy gateway asynchronously, including parameters such as URL, video complete playback, and speed limit bandwidth.
具体实施例四Concrete embodiment 4
通过部署LUA脚本到CDN节点上,对用户IP地址黑名单实现拒绝服务。By deploying the LUA script to the CDN node, the user IP address blacklist is denied service.
步骤1:video.qq.com域名的播放策略网关将编译后的播放控制策略脚本分发给CDN管理服务器。Step 1: The play policy gateway of the video.qq.com domain name distributes the compiled play control policy script to the CDN management server.
步骤2:CDN管理服务器向与之连接的每个CDN节点分发video.qq.com域 名和对应的播放控制策略脚本。Step 2: The CDN management server distributes the video.qq.com domain name and the corresponding playback control policy script to each CDN node connected to it.
步骤3:终端向CDN节点发起视频播放请求,该视频播放请求可通过以下URL表示:http://202.102.11.12/video.qq.com/1.mp4?iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。Step 3: The terminal initiates a video play request to the CDN node, and the video play request can be represented by the following URL: http://202.102.11.12/video.qq.com/1.mp4? iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
步骤4:CDN节点解析URL请求,发现请求的源站域名为video.qq.com,则执行video.qq.com源站下发的播放控制策略脚本,以下为伪代码逻辑部分:Step 4: The CDN node parses the URL request and finds that the source domain name of the request is video.qq.com, and then executes the play control policy script delivered by the video.qq.com source station. The following is the pseudo code logic part:
Figure PCTCN2019086422-appb-000009
Figure PCTCN2019086422-appb-000009
步骤5:CDN节点执行以下播放控制策略脚本:Step 5: The CDN node executes the following playback control policy script:
if ngx.var.remote_addr=="10.2.20.110"thenIf ngx.var.remote_addr=="10.2.20.110"then
  ngx.eof()Ngx.eof()
endEnd
具体的脚本执行过程可包括:The specific script execution process can include:
1)解析URL中的问号部分,即为关键(KEY)部分:iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy。1) Parse the question mark part of the URL, which is the key (KEY) part: iVBORw0KggoAAAANSUhEUgAAAAEAAAAkCAYAAABIdFAMAAAAGXRFWHRTb2Z0d2Fy.
2)获得终端请求的IP地址,根据执行脚本判断该IP地址是否属于非法IP, 如果是非法IP则禁止终端访问,即不响应终端的视频播放请求。2) Obtain the IP address requested by the terminal, and determine whether the IP address belongs to an illegal IP according to the execution script. If it is an illegal IP, the terminal access is prohibited, that is, the video playback request of the terminal is not responded.
3)拒绝终端访问。3) Deny access to the terminal.
实施例三Embodiment 3
本公开实施例还提供了一种视频播放控制系统,所述视频播放控制系统的组成可参照图1a和图1b所示,所述系统包括:至少一个源站、CDN管理服务器12和至少一个CDN节点13;其中,The embodiment of the present disclosure further provides a video playback control system. The composition of the video playback control system can be as shown in FIG. 1a and FIG. 1b. The system includes: at least one source station, a CDN management server 12, and at least one CDN. Node 13; wherein
所述至少一个源站,设置为生成播放控制策略脚本,将所述播放控制策略脚本发送至所述CDN管理服务器12;The at least one source station is configured to generate a play control policy script, and send the play control policy script to the CDN management server 12;
所述CDN管理服务器12,设置为将接收到的播放控制策略脚本发送至所有CDN节点13;The CDN management server 12 is configured to send the received play control policy script to all CDN nodes 13;
所述CDN节点13,设置为接收到来自终端的视频播放请求,获得与所述视频播放请求匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。The CDN node 13 is configured to receive a video play request from the terminal, obtain a first play control policy script that matches the video play request, and execute the first play control policy script to obtain a first play policy, based on the The first playback policy outputs video data to the terminal.
其中,每个源站可部署播放策略网关11,通过播放策略网关11生成播放控制策略脚本,将所述播放控制策略脚本发送至所述CDN管理服务器12。Each source station may deploy a play policy gateway 11 , generate a play control policy script through the play policy gateway 11 , and send the play control policy script to the CDN management server 12 .
本公开实施例中,CDN管理服务器12接收到播放控制策略脚本后,对播放控制策略脚本进行审查;可选支持恶意脚本非常注入审核子系统(包括不限于字节码安全检测、沙箱模拟环境安全检测等手段),通过审查后将播放控制策略脚本分发给所有CDN节点。In the embodiment of the present disclosure, after receiving the play control policy script, the CDN management server 12 reviews the play control policy script; optionally, the malicious script is injected into the audit subsystem (including not limited to bytecode security detection, sandbox simulation environment). Security detection and other means), after the review, the playback control strategy script is distributed to all CDN nodes.
本公开实施例中,终端14向所述CDN节点13发送视频播放请求;其中的用户域名解析,全局重定向直到请求引导到CDN节点的过程在本公开实施例中不再描述。In the embodiment of the present disclosure, the terminal 14 sends a video play request to the CDN node 13; the process of resolving the user domain name and globally redirecting until the request is directed to the CDN node is not described in the embodiment of the present disclosure.
本公开实施例中,所述CDN节点13,设置为解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的第一播放控制策略脚本。In the embodiment of the present disclosure, the CDN node 13 is configured to parse the video play request, obtain source station information carried in the video play request, and query a plurality of play control policy scripts obtained in advance based on the source station information. And obtaining a first play control policy script corresponding to the source station information.
作为一种实施方式,所述CDN节点13,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解 密所述关键部分获得第一播放策略;基于所述第一播放策略向所述终端输出视频数据。As an implementation manner, the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a first a play policy; outputting video data to the terminal based on the first play policy.
在一实施例中,所述CDN节点13,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。In an embodiment, the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain video content. A unique identifier that sets the cache identifier that is uniquely identified as a cache area of the video content.
在一实施例中,所述CDN节点13,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得所述视频播放请求的IP地址,验证所述IP地址是否为合法IP地址;当验证所述IP地址为非法IP地址时,不响应所述视频播放请求。In an embodiment, the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain the The IP address of the video play request, verifying whether the IP address is a legal IP address; when verifying that the IP address is an illegal IP address, the video play request is not responded.
在一实施例中,所述CDN节点13,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;基于所述视频内容信息判断视频内容是否存在;当所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。In an embodiment, the CDN node 13 is configured to execute the first play control policy script, parse the video play request, obtain video content information corresponding to the video play request, and determine based on the video content information. Whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
实施例四Embodiment 4
本公开实施例还提供了一种CDN节点。图6为本公开实施例的CDN节点的一种组成结构示意图;如图6所示,所述CDN节点包括:接收单元31、获取单元32、执行单元33和输出单元34;其中,The embodiment of the present disclosure also provides a CDN node. FIG. 6 is a schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 6, the CDN node includes: a receiving unit 31, an obtaining unit 32, an executing unit 33, and an output unit 34;
所述接收单元31,设置为接收到来自终端的视频播放请求;The receiving unit 31 is configured to receive a video play request from the terminal;
所述获取单元32,设置为获得与所述接收单元31接收的所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;The obtaining unit 32 is configured to obtain a first play control policy script that matches the video play request received by the receiving unit 31; the first play control policy script is obtained in advance by the CDN node;
所述执行单元33,设置为执行所述获取单元32获得的所述第一播放控制策略脚本获得第一播放策略;The executing unit 33 is configured to execute the first play control policy script obtained by the obtaining unit 32 to obtain a first play policy.
所述输出单元34,设置为基于所述执行单元33获得的所述第一播放策略向所述终端输出视频数据。The output unit 34 is configured to output video data to the terminal based on the first play policy obtained by the execution unit 33.
在一实施例中,所述接收单元31,还设置为获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应d源站发出的、经CDN管理服务器转发而获得。In an embodiment, the receiving unit 31 is further configured to obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is corresponding to each of the play control policy scripts. Obtained by the source station and forwarded by the CDN management server.
在一实施例中,所述获取单元32,设置为解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的所述第一播放控制策略脚本。In an embodiment, the obtaining unit 32 is configured to parse the video play request, obtain source station information carried in the video play request, and query a plurality of play control policy scripts obtained in advance based on the source station information. And obtaining the first play control policy script corresponding to the source station information.
在一实施例中,所述执行单元33,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略。In an embodiment, the executing unit 33 is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a first Play strategy.
在一实施例中,所述执行单元33,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。In an embodiment, the executing unit 33 is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain a video. A unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
在一实施例中,图7为本公开实施例的CDN节点的另一种组成结构示意图;如图7所示,所述CDN节点还包括验证单元35;In an embodiment, FIG. 7 is another schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 7, the CDN node further includes a verification unit 35;
所述执行单元33,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得所述视频播放请求的IP地址;The executing unit 33 is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain the IP of the video play request. address;
所述验证单元35,设置为验证所述IP地址是否为合法IP地址;The verification unit 35 is configured to verify whether the IP address is a legal IP address;
所述输出单元34,还设置为当所述验证单元35验证所述IP地址为非法IP地址时,不响应所述视频播放请求。The output unit 34 is further configured to not respond to the video play request when the verification unit 35 verifies that the IP address is an illegal IP address.
在一实施例中,图8为本公开实施例的CDN节点的又一种组成结构示意图;如图8所示,所述CDN节点还包括判断单元36;In an embodiment, FIG. 8 is a schematic structural diagram of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 8, the CDN node further includes a determining unit 36;
所述执行单元33,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;The executing unit 33 is further configured to execute the first play control policy script, parse the video play request, and obtain video content information corresponding to the video play request;
所述判断单元36,设置为基于所述执行单元33获得的所述视频内容信息判断视频内容是否存在;The determining unit 36 is configured to determine whether the video content exists based on the video content information obtained by the executing unit 33;
所述执行单元33,还设置为当所述判断单元36判定所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。The executing unit 33 is further configured to: when the determining unit 36 determines that the video content does not exist, generate a return source address based on executing the first play control policy script, connect the source station based on the return source address, and obtain Video content.
本公开实施例中,所述CDN节点中的获取单元32、执行单元33、验证单元35和判断单元36,在实际应用中均可由所述终端中的中央处理器(CPU,Central Processing Unit)、数字信号处理器(DSP,Digital Signal Processor)、微控制单元(MCU,Microcontroller Unit)或可编程门阵列(FPGA,Field-Programmable Gate Array)实现;所述终端中的接收单元31和输出单元34,在实际应用中可通过通信模组(包含:基础通信套件、操作系统、通信模块、标准化接口和协议等)及收发天线实现。In the embodiment of the present disclosure, the acquiring unit 32, the executing unit 33, the verifying unit 35, and the determining unit 36 in the CDN node may be used by a central processing unit (CPU) in the terminal in actual applications. a digital signal processor (DSP), a Microcontroller Unit (MCU), or a Field-Programmable Gate Array (FPGA); the receiving unit 31 and the output unit 34 in the terminal, In practical applications, it can be realized through communication modules (including: basic communication suite, operating system, communication module, standardized interface and protocol, etc.) and transceiver antennas.
需要说明的是:上述实施例提供的CDN节点在进行视频播放控制时,仅以上述各程序模块的划分进行举例说明,实际应用中,可以根据需要而将上述处理分配由不同的程序模块完成,即将CDN节点的内部结构划分成不同的程序模块,以完成以上描述的全部或者部分处理。另外,上述实施例提供的CDN节点与视频播放控制方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that the CDN node provided by the foregoing embodiment is only illustrated by the division of each of the foregoing program modules when performing video playback control. In actual applications, the foregoing processing may be performed by different program modules according to requirements. The internal structure of the CDN node is divided into different program modules to complete all or part of the processing described above. In addition, the CDN node provided by the foregoing embodiment is the same as the embodiment of the video playback control method. For details, refer to the method embodiment, and details are not described herein again.
实施例五Embodiment 5
本公开实施例还提供了一种CDN节点。图9为本公开实施例的CDN节点的硬件组成结构示意图;如图9所示,包括存储器42、处理器41及存储在存储器42上并可在处理器41上运行的计算机程序,所述处理器41执行所述程序时实现:接收到来自终端的视频播放请求;获得与所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。The embodiment of the present disclosure also provides a CDN node. FIG. 9 is a schematic structural diagram of hardware components of a CDN node according to an embodiment of the present disclosure; as shown in FIG. 9, including a memory 42, a processor 41, and a computer program stored on the memory 42 and operable on the processor 41, the processing The device 41 is configured to: receive a video play request from the terminal; obtain a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node; Performing the first play control policy script to obtain a first play policy, and output video data to the terminal based on the first play policy.
在一实施例中,所述处理器41执行所述程序时实现:获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应的源站发出的、经CDN管理服务器转发而获得。In an embodiment, the processor 41 is configured to: obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is configured by each of the play control policies The source station corresponding to the script is forwarded by the CDN management server.
在一实施例中,所述处理器41执行所述程序时实现:解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的第一播放控制策略脚本。In an embodiment, the processor 41 is configured to: parse the video play request, obtain source station information carried in the video play request, and query multiple previously obtained based on the source station information. Playing a control policy script to obtain a first play control policy script corresponding to the source station information.
在一实施例中,所述处理器41执行所述程序时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略;基于所述第一播放策略向所述终端输出视频数据。In an embodiment, the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining a first play policy; outputting video data to the terminal based on the first play policy.
在一实施例中,所述处理器41执行所述程序时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。In an embodiment, the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining a unique identifier of the video content, and setting the cache identifier that is uniquely identified as a cache area of the video content.
在一实施例中,所述处理器41执行所述程序时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得所述视频播放请求的IP地址,验证所述IP地址是否为合法IP地址;当验证所述IP地址为非法IP地址时,不响应所述视频播放请求。In an embodiment, the processor 41 is configured to: execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key Partially obtaining the IP address of the video play request, verifying whether the IP address is a legal IP address; and when verifying that the IP address is an illegal IP address, not responding to the video play request.
在一实施例中,所述处理器41执行所述程序时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;基于所述视频内容信息判断视频内容是否存在;当所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。In an embodiment, the processor 41 is configured to: execute the first play control policy script, parse the video play request, and obtain video content information corresponding to the video play request; The video content information determines whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
可以理解,CDN节点还包括通信接口43;CDN节点中的各个组件可通过总线系统44耦合在一起。可理解,总线系统44设置为实现这些组件之间的连接通信。总线系统44除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图9中将各种总线都标为总线系统44。It will be appreciated that the CDN node also includes a communication interface 43; the various components of the CDN node can be coupled together by a bus system 44. It will be appreciated that bus system 44 is arranged to effect connection communication between these components. The bus system 44 includes, in addition to the data bus, a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are labeled as bus system 44 in FIG.
可以理解,存储器42可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM, Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本公开实施例描述的存储器42旨在包括但不限于这些和任意其它适合类型的存储器。It will be appreciated that memory 42 can be either volatile memory or non-volatile memory, and can include both volatile and nonvolatile memory. The non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), or an Erasable Programmable Read (EPROM). Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk storage or a tape storage. The volatile memory can be a random access memory (RAM) that acts as an external cache. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access (SSRAM). DRAM (Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), enhancement Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory Bus Random Access Memory (DRRAM) ). The memory 42 described in the embodiments of the present disclosure is intended to include, but is not limited to, these and any other suitable types of memory.
上述本公开实施例揭示的方法可以应用于处理器41中,或者由处理器41实现。处理器41可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器41中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器41可以是通用处理器、DSP,或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器41可以实现或者执行本公开实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本公开实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件 模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器42,处理器41读取存储器42中的信息,结合其硬件完成前述方法的步骤。The method disclosed in the above embodiments of the present disclosure may be applied to the processor 41 or implemented by the processor 41. Processor 41 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 41 or an instruction in a form of software. The processor 41 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like. The processor 41 can implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present disclosure. A general purpose processor can be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiments of the present disclosure may be directly implemented as a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor. The software module can reside in a storage medium located in memory 42, which reads the information in memory 42 and, in conjunction with its hardware, performs the steps of the foregoing method.
在示例性实施例中,CDN节点可以被一个或多个应用专用集成电路(ASIC,Application Specific Integrated Circuit)、DSP、可编程逻辑器件(PLD,Programmable Logic Device)、复杂可编程逻辑器件(CPLD,Complex Programmable Logic Device)、FPGA、通用处理器、控制器、MCU、微处理器(Microprocessor)、或其他电子元件实现,用于执行前述方法。In an exemplary embodiment, the CDN node may be configured by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), and Complex Programmable Logic Devices (CPLDs). Complex Programmable Logic Device), FPGA, general purpose processor, controller, MCU, microprocessor, or other electronic component implementation for performing the aforementioned methods.
实施例六Embodiment 6
在示例性实施例中,本公开实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器42,上述计算机程序可由CDN节点的处理器41执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。In an exemplary embodiment, an embodiment of the present disclosure further provides a computer readable storage medium, such as a memory 42 including a computer program that can be executed by a processor 41 of a CDN node to perform the steps described in the foregoing methods. The computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
本公开实施例还提供了一种计算机存储介质,其上存储有计算机指令,该指令被处理器执行时实现:接收到来自终端的视频播放请求;获得与所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。An embodiment of the present disclosure further provides a computer storage medium having stored thereon computer instructions, the instructions being executed by a processor to: receive a video play request from a terminal; and obtain a first play that matches the video play request Controlling a policy script; the first play control policy script is obtained in advance by the CDN node; executing the first play control policy script to obtain a first play policy, and outputting video data to the terminal based on the first play policy.
在一实施例中,该指令被处理器执行时实现:获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应的源站发出的、经CDN管理服务器转发而获得。In an embodiment, the instruction is executed by the processor to: obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is corresponding to each play control policy script Obtained by the source station and forwarded by the CDN management server.
在一实施例中,该指令被处理器执行时实现:解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的第一播放控制策略脚本。In an embodiment, when the instruction is executed by the processor, the video playback request is parsed, the source station information carried in the video play request is obtained, and a plurality of preset play control policies are obtained based on the source station information. a script that obtains a first play control policy script corresponding to the source station information.
在一实施例中,该指令被处理器执行时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略;基于所述第一播放策略向所述终端输出视频 数据。In an embodiment, when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is decrypted. a play policy; outputting video data to the terminal based on the first play policy.
在一实施例中,该指令被处理器执行时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。In an embodiment, when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is decrypted to obtain a video. A unique identifier of the content, the cache identifier of the cache area of the video content is set to be uniquely identified.
在一实施例中,该指令被处理器执行时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得所述视频播放请求的IP地址,验证所述IP地址是否为合法IP地址;当验证所述IP地址为非法IP地址时,不响应所述视频播放请求。In an embodiment, when the instruction is executed by the processor, the first play control policy script is executed, the video play request is parsed, a key part carried by the video play request is obtained, and the key part is obtained. The IP address of the video play request is verified whether the IP address is a legal IP address; when the IP address is verified as an illegal IP address, the video play request is not responded.
在一实施例中,该指令被处理器执行时实现:执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;基于所述视频内容信息判断视频内容是否存在;当所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。In an embodiment, the instruction is executed by the processor to: execute the first play control policy script, parse the video play request, obtain video content information corresponding to the video play request; and based on the video content information Determining whether the video content exists; when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本公开各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一 个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a removable storage device, a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
或者,本公开上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本公开各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, the above-described integrated unit of the present disclosure may be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a standalone product. Based on such understanding, the technical solution of the embodiments of the present disclosure may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present disclosure. The foregoing storage medium includes various media that can store program codes, such as a mobile storage device, a ROM, a RAM, a magnetic disk, or an optical disk.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。The above is only the specific embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope of the disclosure. It should be covered within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be determined by the scope of the claims.
工业实用性Industrial applicability
如上所述,本发明实施例提供的一种视频播放控制方法、系统、节点和计算机存储介质具有以下有益效果:通过CDN节点预先获得播放控制策略脚本并执行与视频播放请求匹配的第一播放控制策略脚本,从而获得与终端的视频播放请求相匹配的播放控制策略,无需CDN节点获得敏感的信息也可实现源站所指定的播放控制策略;另一方面也无需CDN节点转发视频播放请求给源站,避免终端播放启动时间延长,大大提升了用户的体验。As described above, a video playback control method, system, node, and computer storage medium provided by an embodiment of the present invention have the following beneficial effects: a playback control policy script is obtained in advance through a CDN node and a first playback control matching the video playback request is performed. The policy script obtains a play control policy that matches the video play request of the terminal, and the CDN node can obtain the play control policy specified by the source station without obtaining sensitive information; on the other hand, the CDN node does not need to forward the video play request to the source. Station, to avoid the terminal playback start time is extended, greatly improving the user experience.

Claims (19)

  1. 一种视频播放控制方法,应用于内容分发网络CDN节点;所述方法包括:A video playback control method is applied to a content distribution network CDN node; the method includes:
    接收到来自终端的视频播放请求;Receiving a video play request from the terminal;
    获得与所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;Obtaining a first play control policy script that matches the video play request; the first play control policy script is obtained in advance by the CDN node;
    执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。Performing the first play control policy script to obtain a first play policy, and output video data to the terminal based on the first play policy.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应的源站发出的、经CDN管理服务器转发而获得。The method of claim 1, wherein the method further comprises: obtaining a plurality of play control policy scripts; each of the plurality of play control policy scripts by the each play control policy script Obtained by the corresponding source station and forwarded by the CDN management server.
  3. 根据权利要求1或2所述的方法,其中,所述获得与所述视频播放请求匹配的第一播放控制策略脚本,包括:The method of claim 1 or 2, wherein the obtaining a first play control policy script that matches the video play request comprises:
    解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的所述第一播放控制策略脚本。Parsing the video play request, obtaining the source station information carried in the video play request, querying a plurality of play control policy scripts obtained in advance based on the source station information, and obtaining the first corresponding to the source station information Play control strategy script.
  4. 根据权利要求1所述的方法,其中,所述执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据,包括:The method of claim 1, wherein the executing the first play control policy script to obtain a first play policy, and outputting video data to the terminal based on the first play policy comprises:
    执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略;Performing the first play control policy script, parsing the video play request, obtaining a key part carried by the video play request, and decrypting the key part to obtain a first play policy;
    基于所述第一播放策略向所述终端输出视频数据。Outputting video data to the terminal based on the first play policy.
  5. 根据权利要求4所述的方法,其中,所述执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分之后,所述方法还包括:解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。The method according to claim 4, wherein after the performing the first play control policy script, parsing the video play request, and obtaining a key part carried by the video play request, the method further comprises: decrypting the The key part obtains a unique identifier of the video content, and sets the cache identifier that is uniquely identified as a cache area of the video content.
  6. 根据权利要求4所述的方法,其中,所述执行所述第一播放控制策略脚 本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分之后,所述方法还包括:解密所述关键部分获得所述视频播放请求的IP地址,验证所述IP地址是否为合法IP地址;The method according to claim 4, wherein after the performing the first play control policy script, parsing the video play request, and obtaining a key part carried by the video play request, the method further comprises: decrypting the The key part obtains the IP address of the video play request, and verifies whether the IP address is a legal IP address;
    当验证所述IP地址为非法IP地址时,不响应所述视频播放请求。When the IP address is verified as an illegal IP address, the video play request is not responded.
  7. 根据权利要求4所述的方法,其中,所述执行所述第一播放控制策略脚本,包括:解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;基于所述视频内容信息判断视频内容是否存在;The method of claim 4, wherein the executing the first play control policy script comprises: parsing the video play request, obtaining video content information corresponding to the video play request; and based on the video content information Determine whether the video content exists;
    当所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。And when the video content does not exist, generating a return source address based on executing the first play control policy script, connecting the source station based on the return source address, and obtaining video content.
  8. 一种CDN节点,所述CDN节点包括:接收单元、获取单元、执行单元和输出单元;其中,A CDN node, the CDN node includes: a receiving unit, an obtaining unit, an executing unit, and an output unit; wherein
    所述接收单元,设置为接收到来自终端的视频播放请求;The receiving unit is configured to receive a video play request from the terminal;
    所述获取单元,设置为获得与所述接收单元接收的所述视频播放请求匹配的第一播放控制策略脚本;所述第一播放控制策略脚本由所述CDN节点预先获得;The acquiring unit is configured to obtain a first play control policy script that matches the video play request received by the receiving unit; the first play control policy script is obtained in advance by the CDN node;
    所述执行单元,设置为执行所述获取单元获得的所述第一播放控制策略脚本获得第一播放策略;The execution unit is configured to execute the first play control policy script obtained by the acquiring unit to obtain a first play policy;
    所述输出单元,设置为基于所述执行单元获得的所述第一播放策略向所述终端输出视频数据。The output unit is configured to output video data to the terminal based on the first play policy obtained by the execution unit.
  9. 根据权利要求8所述的CDN节点,其中,所述接收单元,还设置为获得多个播放控制策略脚本;所述多个播放控制策略脚本中的每个播放控制策略脚本由所述每个播放控制策略脚本对应的源站发出的、经CDN管理服务器转发而获得。The CDN node according to claim 8, wherein the receiving unit is further configured to obtain a plurality of play control policy scripts; each of the plurality of play control policy scripts is played by each of the plurality of play control policy scripts The control source script corresponds to the source station and is obtained by forwarding through the CDN management server.
  10. 根据权利要求8或9所述的CDN节点,其中,所述获取单元,设置为解析所述视频播放请求,获得所述视频播放请求中携带的源站信息,基于所述源站信息查询预先获得的多个播放控制策略脚本,获得与所述源站信息对应的所述第一播放控制策略脚本。The CDN node according to claim 8 or 9, wherein the obtaining unit is configured to parse the video play request, obtain source station information carried in the video play request, and obtain a pre-acquisition based on the source station information query. The plurality of play control policy scripts obtain the first play control policy script corresponding to the source station information.
  11. 根据权利要求8所述的CDN节点,其中,所述执行单元,设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得第一播放策略。The CDN node according to claim 8, wherein the execution unit is configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the The key part gets the first play strategy.
  12. 根据权利要求11所述的CDN节点,其中,所述执行单元,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得视频内容的唯一标识,设置所述唯一标识为所述视频内容的缓存区域的缓存标识。The CDN node according to claim 11, wherein the execution unit is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the The key part obtains a unique identifier of the video content, and sets the cache identifier that is uniquely identified as a cache area of the video content.
  13. 根据权利要求11所述的CDN节点,其中,所述CDN节点还包括验证单元;The CDN node according to claim 11, wherein said CDN node further comprises a verification unit;
    所述执行单元,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求携带的关键部分,解密所述关键部分获得所述视频播放请求的IP地址;The execution unit is further configured to execute the first play control policy script, parse the video play request, obtain a key part carried by the video play request, and decrypt the key part to obtain an IP address of the video play request. ;
    所述验证单元,设置为验证所述IP地址是否为合法IP地址;The verification unit is configured to verify whether the IP address is a legal IP address;
    所述输出单元,还设置为当所述验证单元验证所述IP地址为非法IP地址时,不响应所述视频播放请求。The output unit is further configured to not respond to the video play request when the verification unit verifies that the IP address is an illegal IP address.
  14. 根据权利要求11所述的CDN节点,其中,所述CDN节点还包括判断单元;The CDN node according to claim 11, wherein said CDN node further comprises a judging unit;
    所述执行单元,还设置为执行所述第一播放控制策略脚本,解析所述视频播放请求,获得所述视频播放请求对应的视频内容信息;The execution unit is further configured to execute the first play control policy script, parse the video play request, and obtain video content information corresponding to the video play request;
    所述判断单元,设置为基于所述执行单元获得的所述视频内容信息判断视频内容是否存在;The determining unit is configured to determine whether the video content exists based on the video content information obtained by the executing unit;
    所述执行单元,还设置为当所述判断单元判定所述视频内容不存在时,基于执行所述第一播放控制策略脚本生成回源地址,基于所述回源地址连接源站并获得视频内容。The execution unit is further configured to: when the determining unit determines that the video content does not exist, generate a return source address based on executing the first play control policy script, connect the source station based on the return source address, and obtain video content .
  15. 一种计算机存储介质,其上存储有计算机指令,该指令被处理器执行时实现权利要求1至7任一项所述方法的步骤。A computer storage medium having stored thereon computer instructions for performing the steps of the method of any one of claims 1 to 7 when executed by a processor.
  16. 一种CDN节点,包括存储器、处理器及存储在存储器上并可在处理 器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至7任一项所述方法的步骤。A CDN node comprising a memory, a processor, and a computer program stored on the memory and operative on a processor, the processor executing the program to implement the steps of the method of any one of claims 1 to 7.
  17. 一种视频播放控制方法,所述方法包括:A video playback control method, the method comprising:
    源站生成播放控制策略脚本,将所述播放控制策略脚本发送至CDN管理服务器;The source station generates a play control policy script, and sends the play control policy script to the CDN management server;
    所述CDN管理服务器将接收到的播放控制策略脚本发送至所有CDN节点;The CDN management server sends the received play control policy script to all CDN nodes;
    所述CDN节点接收到来自终端的视频播放请求,获得与所述视频播放请求匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。Receiving, by the CDN node, a video play request from the terminal, obtaining a first play control policy script that matches the video play request, and executing the first play control policy script to obtain a first play policy, based on the first play The policy outputs video data to the terminal.
  18. 一种视频播放控制系统,所述系统包括:至少一个源站、CDN管理服务器和至少一个CDN节点;其中,A video playback control system, the system comprising: at least one source station, a CDN management server, and at least one CDN node; wherein
    所述至少一个源站,设置为生成播放控制策略脚本,将所述播放控制策略脚本发送至所述CDN管理服务器;The at least one source station is configured to generate a play control policy script, and send the play control policy script to the CDN management server;
    所述CDN管理服务器,设置为将接收到的播放控制策略脚本发送至所有CDN节点;The CDN management server is configured to send the received play control policy script to all CDN nodes;
    所述CDN节点,设置为接收到来自终端的视频播放请求,获得与所述视频播放请求匹配的第一播放控制策略脚本,执行所述第一播放控制策略脚本获得第一播放策略,基于所述第一播放策略向所述终端输出视频数据。The CDN node is configured to receive a video play request from the terminal, obtain a first play control policy script that matches the video play request, and execute the first play control policy script to obtain a first play policy, based on the The first playback policy outputs video data to the terminal.
  19. 一种计算机存储介质,其上存储有计算机指令,该指令被处理器执行时实现权利要求17所述方法的步骤。A computer storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method of claim 17.
PCT/CN2019/086422 2018-05-11 2019-05-10 Method, system, node, and computer storage medium for controlling video playback WO2019214714A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810449646.6 2018-05-11
CN201810449646.6A CN108769743B (en) 2018-05-11 2018-05-11 Video playing control method, system, node and computer storage medium

Publications (1)

Publication Number Publication Date
WO2019214714A1 true WO2019214714A1 (en) 2019-11-14

Family

ID=64010133

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/086422 WO2019214714A1 (en) 2018-05-11 2019-05-10 Method, system, node, and computer storage medium for controlling video playback

Country Status (2)

Country Link
CN (1) CN108769743B (en)
WO (1) WO2019214714A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210040333A (en) * 2020-06-29 2021-04-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Request processing method, apparatus, device and computer storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2463329B (en) 2008-09-10 2013-02-20 Echostar Advanced Technologies L L C Set-top box emulation system
CN108769743B (en) * 2018-05-11 2020-11-06 中兴通讯股份有限公司 Video playing control method, system, node and computer storage medium
CN112153095A (en) * 2019-06-28 2020-12-29 北京金山云网络技术有限公司 CDN function module operation method, operation device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120215779A1 (en) * 2011-02-23 2012-08-23 Level 3 Communications, Llc Analytics management
CN102695081A (en) * 2012-06-13 2012-09-26 百视通网络电视技术发展有限责任公司 Video resource scheduling method based on Internet television and television terminal
CN103179433A (en) * 2011-12-26 2013-06-26 中国移动通信集团上海有限公司 System, method and service node for providing video contents
CN103747286A (en) * 2014-01-03 2014-04-23 上海聚力传媒技术有限公司 Method and equipment for providing videos
CN107547909A (en) * 2016-06-24 2018-01-05 腾讯科技(深圳)有限公司 The online control method for playing back of media file, device and system
CN107948684A (en) * 2017-11-20 2018-04-20 广州虎牙信息科技有限公司 Direct broadcasting room video playing control method, device and server
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2463329B (en) * 2008-09-10 2013-02-20 Echostar Advanced Technologies L L C Set-top box emulation system
US20110078327A1 (en) * 2009-09-30 2011-03-31 Prime Networks (Hong Kong) Limited Content delivery utilizing multiple content delivery networks
CN103533397B (en) * 2013-09-29 2017-03-15 浙江省公众信息产业有限公司 Program content delivery method and device
CN104580274B (en) * 2013-10-12 2018-06-19 中国电信股份有限公司 Content method of replacing and system, node in content distributing network
CN105871800A (en) * 2015-12-07 2016-08-17 乐视云计算有限公司 Pull stream control method, device and system
CN105915945A (en) * 2015-12-08 2016-08-31 乐视云计算有限公司 Content distribution method used for CDN platform and scheduling proxy server thereof
CN106028064A (en) * 2016-06-24 2016-10-12 武汉斗鱼网络科技有限公司 Live broadcasting video streaming playing address authorization verification method and system
CN106162209B (en) * 2016-06-30 2019-10-18 中国科学院计算技术研究所 A kind of content distributing network live broadcast system and method based on SDN technology
CN106162233B (en) * 2016-07-08 2019-12-31 合一网络技术(北京)有限公司 Code rate recommendation method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120215779A1 (en) * 2011-02-23 2012-08-23 Level 3 Communications, Llc Analytics management
CN103179433A (en) * 2011-12-26 2013-06-26 中国移动通信集团上海有限公司 System, method and service node for providing video contents
CN102695081A (en) * 2012-06-13 2012-09-26 百视通网络电视技术发展有限责任公司 Video resource scheduling method based on Internet television and television terminal
CN103747286A (en) * 2014-01-03 2014-04-23 上海聚力传媒技术有限公司 Method and equipment for providing videos
CN107547909A (en) * 2016-06-24 2018-01-05 腾讯科技(深圳)有限公司 The online control method for playing back of media file, device and system
CN107948684A (en) * 2017-11-20 2018-04-20 广州虎牙信息科技有限公司 Direct broadcasting room video playing control method, device and server
CN108769743A (en) * 2018-05-11 2018-11-06 中兴通讯股份有限公司 A kind of video playing control method, system, node and computer storage media

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210040333A (en) * 2020-06-29 2021-04-13 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Request processing method, apparatus, device and computer storage medium
EP3872630A3 (en) * 2020-06-29 2021-11-17 Beijing Baidu Netcom Science And Technology Co. Ltd. Request processing method and apparatus, electronic device, and computer storage medium
US11689630B2 (en) 2020-06-29 2023-06-27 Beijing Baidu Netcom Science And Technology Co., Ltd. Request processing method and apparatus, electronic device, and computer storage medium
KR102572013B1 (en) * 2020-06-29 2023-08-29 베이징 바이두 넷컴 사이언스 앤 테크놀로지 코., 엘티디. Request processing method, apparatus, device and computer storage medium

Also Published As

Publication number Publication date
CN108769743A (en) 2018-11-06
CN108769743B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
US11501533B2 (en) Media authentication using distributed ledger
WO2019214714A1 (en) Method, system, node, and computer storage medium for controlling video playback
US10650119B2 (en) Multimedia data processing method, apparatus, system, and storage medium
WO2017129016A1 (en) Resource access method, apparatus and system
US20200285457A1 (en) Asset update service
CN110096894B (en) Data anonymous sharing system and method based on block chain
CN111030963B (en) Document tracking method, gateway equipment and server
US11626998B2 (en) Validated payload execution
CN109981680B (en) Access control implementation method and device, computer equipment and storage medium
AU2020333658B2 (en) Identity data object creation and management
CN111970109B (en) Data transmission method and system
CN113709530B (en) Resource downloading method, system, electronic equipment and storage medium
RU2454708C2 (en) Method of realising status monitoring mechanism in communication session between server and client system
US20170270561A1 (en) Method, terminal and server for monitoring advertisement exhibition
US11709969B2 (en) Protecting data integrity in a content distribution network
JP2022534677A (en) Protecting online applications and web pages that use blockchain
JP2023525576A (en) Scope of control of authentication keys for software updates
CN112804563B (en) Media file playing method and device and storage medium
US20230244797A1 (en) Data processing method and apparatus, electronic device, and medium
CN110855656A (en) Plug-in flow proxy method, device and system capable of realizing application server protection
CN110912941A (en) Transmission processing method and device for multicast data
EP4252384B1 (en) Methods, devices and system related to a distributed ledger and user identity attribute
JP4089309B2 (en) Object use management system, information processing apparatus or method for using or providing object, and computer program
KR101815145B1 (en) Certificate sharing method between cross domain
WO2024078108A1 (en) Blockchain-based data processing method and apparatus, electronic device, computer-readable storage medium, and computer program product

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: 19799479

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 15.04.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19799479

Country of ref document: EP

Kind code of ref document: A1