WO2016206283A1 - 一种视频流量引导方法、装置及一种电子设备 - Google Patents

一种视频流量引导方法、装置及一种电子设备 Download PDF

Info

Publication number
WO2016206283A1
WO2016206283A1 PCT/CN2015/094270 CN2015094270W WO2016206283A1 WO 2016206283 A1 WO2016206283 A1 WO 2016206283A1 CN 2015094270 W CN2015094270 W CN 2015094270W WO 2016206283 A1 WO2016206283 A1 WO 2016206283A1
Authority
WO
WIPO (PCT)
Prior art keywords
initialization function
video
url
proxy server
original
Prior art date
Application number
PCT/CN2015/094270
Other languages
English (en)
French (fr)
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 网宿科技股份有限公司
Priority to US15/508,658 priority Critical patent/US20170280207A1/en
Priority to EP15896168.0A priority patent/EP3188493B1/en
Publication of WO2016206283A1 publication Critical patent/WO2016206283A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/81Monomedia components thereof
    • H04N21/8166Monomedia components thereof involving executable data, e.g. software
    • H04N21/818OS software

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a video traffic guiding method and apparatus, and an electronic device.
  • the existing method of guiding traffic to a specified proxy server is generally implemented by the process steps shown in FIG. 1. Assume that a picture is requested, and the URL corresponding to the picture is http://hostnameA.com/icon.jpg The flow of the request for the picture needs to be directed to the designated proxy server.
  • the IP address of the specified proxy server is 127.0.2.1
  • the method for traffic guidance includes: constructing a URL; initializing a corresponding function by using a URL; and initiating obtaining a picture Requesting; determining whether the system sets the proxy, if yes, directly connecting to the specified proxy server, and receiving the image data returned by the specified proxy server; if not, directly connecting to the server with the host name hostnameA, and receiving the host The image data returned by the server named hostnameA.
  • the video request process in the UIWebView control cannot perform the step of judging whether the system sets the proxy, that is, the traffic guidance method cannot be used according to the above traffic guidance method, so the existing traffic guidance method is not applicable to the video traffic in the UIWebView. guide.
  • an object of the present invention is to provide a video traffic guidance method and apparatus, and an electronic device, which are mainly used to solve the problem that the traffic generated by playing video in UIWebView cannot be guided in the prior art. The problem.
  • the present invention provides a video traffic guidance method, the method comprising the steps of: constructing an initialization function of a new video URL, parameters and return values of the initialization function of the new video URL and original Initializing the function consistently; hijacking the original initialization function to execute the initialization function of the new video URL when the system calls the original initialization function to request the corresponding video, so that the target address in the modified URL is the designated proxy server address, and further Direct video traffic to the specified proxy server.
  • the step of hijacking the original initialization function includes: exchanging an initialization function of the new video URL and an actual code address of the original initialization function, to execute when the system calls the original initialization function to request a corresponding video.
  • the initialization function of the new video URL includes: exchanging an initialization function of the new video URL and an actual code address of the original initialization function, to execute when the system calls the original initialization function to request a corresponding video.
  • the initialization function of the new video URL is an initialization method of the AVOrlAsset class.
  • the performing an initialization function of the new video URL thereby guiding video traffic to a designated proxy service
  • the original initialization function requests a corresponding video to direct video traffic to the designated proxy server.
  • determining whether the access method of the URL parameter in the original initialization function is http or https, if not, Then directly calling back the original initialization function to request a corresponding video; if so, performing a step of determining whether the host name of the URL parameter in the original initialization function is the same as the host name of the specified proxy server.
  • the present invention further provides a video traffic guiding apparatus, comprising: a function constructing module, an initialization function for constructing a new video URL, and parameters and return values of an initialization function of the new video URL.
  • the traffic guidance module is configured to hijack the original initialization function to execute an initialization function of the new video URL when the system calls the original initialization function to request a corresponding video, so as to modify the target in the URL
  • the address is the specified proxy server address, which in turn directs video traffic to the designated proxy server.
  • the traffic guiding module is configured to: hijack the original initialization function: exchange an initial function of the new video URL with an actual code address of the original initialization function, to request the system to call the original initialization function.
  • the initialization function of the new video URL is executed.
  • the initialization function of the new video URL is an initialization method of the AVOrlAsset class.
  • the traffic guidance module performs an initialization function of the new video URL, and then directing video traffic to the designated proxy server, including: determining whether a host name of the URL parameter in the original initialization function is related to the specified proxy server The host names are the same, if they are the same, the original initialization function is directly called back to request the corresponding video to direct the video traffic to the designated proxy server; if not, the host name of the URL parameter is modified to the specified The host name of the proxy server extracts the host name and path of the URL parameter before the modification as the path of the modified URL parameter, and then calls back the original initialization function to request the corresponding video to direct the video traffic to the designated proxy server.
  • the traffic guiding module is further configured to determine, according to a step of determining whether a host name of the URL parameter in the original initialization function is the same as a host name of the specified proxy server, determining how to access the URL parameter in the original initialization function. Whether it is http or https, if not, directly callback the original initialization function to request the corresponding video; if yes, perform the step of determining whether the host name of the URL parameter in the original initialization function is the same as the host name of the specified proxy server .
  • the present invention also provides an electronic device, wherein the system of the electronic device is The IOS system, the electronic device having the video traffic directing device of any of the above, for directing traffic to the received video request.
  • the electronic device is a smart phone or a tablet.
  • a video traffic guiding method and apparatus and an electronic device of the present invention by constructing an initialization function of a new video URL, exchanging an original initialization function and an address of an initialization function of a new video URL, hijacking the original initialization
  • the function that is, when the system calls the original initialization function to request the corresponding video, the initialization function of the new video URL is executed, and then the video traffic is directed to the designated proxy server, and the traffic guidance for the video request of the IOS UIWebView control is implemented. .
  • FIG. 1 shows a flow chart of an example of flow guidance in the prior art.
  • FIG. 2 is a schematic flow chart of a video traffic guiding method according to the present invention in a specific embodiment.
  • FIG. 3 is a schematic flowchart showing a video traffic guiding method according to an embodiment of the present invention.
  • FIG. 4 is a block diagram showing a video traffic steering device of the present invention in a specific embodiment.
  • FIG. 5 is a schematic diagram showing the application of an electronic device and a server in a specific embodiment of the present invention.
  • FIG. 2 a flow chart of a video traffic guiding method according to the present invention is shown in a specific embodiment.
  • the method is preferably applied to a UIWebView control of an IOS system, the method comprising the following steps:
  • S11 construct an initialization function of a new video URL, where the parameters and return values of the initialization function of the new video URL are consistent with the original initialization function;
  • a new initialization method hookInitWithURL is constructed.
  • the parameters and return values of the method are consistent with the original initialization method InitWithURL in the AVUrlAsset class.
  • FIG. 3 is a schematic flowchart of a video traffic guiding method in a UIWebView according to another embodiment of the present invention.
  • the method includes:
  • step S21 construct an initialization function of a new video URL, where the parameters and return values of the initialization function of the new video URL are consistent with the original initialization function; and the step S21 is the same as step S11 in the embodiment shown in FIG. 2.
  • the step of hijacking the original initialization function of step S12 in the embodiment shown in FIG. 2 preferably includes:
  • step S12 in the embodiment shown in FIG. 2 when the system calls the original initialization function to request the corresponding video, the initialization function of the new video URL is executed, and the step of guiding the video traffic to the designated proxy server is specifically performed.
  • step S23 It is determined whether the access mode of the URL parameter in the original initialization function is http or https. If yes, step S24 is performed; if not, step S25 is performed, that is, in this embodiment, only the access mode is http or https. Guide the video traffic.
  • step S24 It is determined whether the host name of the URL parameter in the original initialization function is the same as the host name of the specified proxy server; if they are the same, step S25 is performed; if not, step S26 is performed.
  • S26 Modify the host name of the URL parameter to the host name of the specified proxy server, extract the host name and path of the URL parameter before the modification as the path of the modified URL parameter, and then call back the original initialization function request correspondingly.
  • Video to direct video traffic to the designated proxy server.
  • determining whether the access method of the URL parameter in the original initialization function is http or https, if not, Then directly calling back the original initialization function to request a corresponding video; if so, performing a step of determining whether the host name of the URL parameter in the original initialization function is the same as the host name of the specified proxy server.
  • the IOS system initializes the AVOrlAsset object by initializing it.
  • the hijacking of the function executing the newly constructed initialization function, performs the following steps:
  • the host name in the URL is modified to 127.0.0.1:8123, and the path is modified to hostnameA.com/ Video.
  • the present invention mainly describes the video traffic guidance of the IOS system, and those skilled in the art should understand that, based on the similar inventive concept, the adaptive parameters can be modified for other systems such as the android system, and the video guidance can also be achieved. Purpose, and it should fall within the scope of protection of the present invention.
  • FIG. 4 is a block diagram showing a video traffic guiding device of the present invention in a specific embodiment.
  • the video traffic directing device is preferably applied to an electronic device equipped with an IOS system, and the video traffic directing device 1 includes a function constructing module 11 and a traffic directing module 12.
  • the function constructing module 11 is configured to construct an initialization function of a new video URL, and the parameters and return values of the initialization function of the new video URL are consistent with the original initialization function;
  • the traffic guidance module 12 is configured to hijack the original initialization function to perform an initialization function of the new video URL when the system calls the original initialization function to request a corresponding video, so that the target address in the modified URL is referred to
  • the proxy server address is set to direct video traffic to the designated proxy server.
  • the traffic guidance module 12 is configured to hijack the original initialization function, including: an initial function for exchanging the new video URL and an actual code address of the original initialization function, in the system
  • the initialization function of the new video URL is executed when the original initialization function is called to request a corresponding video.
  • the traffic guidance module 12 performs an initialization function of the new video URL, and further directing video traffic to the designated proxy server, including: determining a host name of the URL parameter in the original initialization function Whether it is the same as the host name of the specified proxy server, if the same, directly callback the original initialization function to request a corresponding video to direct video traffic to the designated proxy server; if not, the URL parameter is The host name is modified to the host name of the specified proxy server, the host name and path of the URL parameter before the modification are extracted as the path of the modified URL parameter, and the original initialization function is called back to request the corresponding video to guide the video traffic. To the specified proxy server.
  • the traffic guiding module 12 is further configured to determine the original initialization before performing the step of determining whether the host name of the URL parameter in the original initialization function is the same as the host name of the specified proxy server. Whether the access method of the URL parameter in the function is http or https, if not, directly calling back the original initialization function to request a corresponding video; if yes, performing a determination on whether the host name of the URL parameter in the original initialization function is associated with the specified proxy The same steps as the server's hostname.
  • the application principle and technical features of the video traffic guiding device 1 correspond to the video traffic guiding methods shown in FIG. 2 and FIG. 3, so the specific example description is not described herein.
  • FIG. 5 is a schematic diagram showing an application of an electronic device and a server in a specific embodiment of the present invention.
  • the electronic device 2 system is preferably an IOS system, the electronic device having a video traffic guiding device 21 for guiding the received video request traffic to the server 3, and the server 3 is transmitting the received electronic device 2 When the video request is made, the corresponding video is returned to the electronic device 2.
  • the structure and application principle of the video traffic guiding device 21 are the same as those of the video traffic guiding device 1 shown in FIG.
  • the electronic device is a smartphone or a tablet.
  • a video traffic guiding method and apparatus and an electronic device of the present invention by constructing an initialization function of a new video URL, exchange the original initialization function and the address of the initialization function of the new video URL, hijacking the original
  • the initialization function that is, when the system calls the original initialization function to request the corresponding video, the initialization function of the new video URL is executed, and then the video traffic is directed to the designated proxy server, and the video request flow for the IOS UIWebView control is implemented. guide. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has high industrial utilization value.

Abstract

本发明的一种视频流量引导方法、装置及一种电子设备,通过构造一新视频URL的初始化函数,交换原始初始化函数以及新视频URL的初始化函数的地址,劫持所述原始初始化函数,即在系统调用所述原始初始化函数清求相应的视频时,执行所述新初始化函数,使得修改URL中的目标地址为指定代理服务器地址,进而将视频流最引导至指定代理服务器,实现了对于IOS的UIWebView控件的视频请求的流量引导。

Description

一种视频流量引导方法、装置及一种电子设备 技术领域
本发明涉及通信技术领域,特别是涉及一种视频流量引导方法、装置及一种电子设备。
背景技术
现有的将流量引导至一指定的代理服务器的方法一般是通过如图1所示的流程步骤来实现,假设请求一图片,图片所对应的URL为http://hostnameA.com/icon.jpg,需要将所述图片的请求的流量引导至指定代理服务器,例如所述指定代理服务器的IP地址为127.0.2.1,则流量引导的方法包括:构造URL;利用URL初始化相应的函数;发起获取图片请求;判断系统是否设置代理,若是,则直接连接到所述指定的代理服务器,并接收所述指定代理服务器返回的图片数据;若否,则直接连接到主机名为hostnameA的服务器,并接收主机名为hostnameA的服务器返回的图片数据。
然而,UIWebView控件中的视频请求过程,不能执行判断系统是否设置代理的步骤,即不能根据以上的流量引导方法对其进行流量引导,所以现有的流量引导方法不适用于UIWebView中的视频流量的引导。
发明内容
鉴于以上所述现有技术的缺点,本发明的目的在于提供一种视频流量引导方法、装置及一种电子设备,主要用于解决现有技术中不能对在UIWebView中播放视频产生的流量进行引导的问题。
为实现上述目的及其他相关目的,本发明提供一种视频流量引导方法,所述方法包括如下步骤:构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指定代理服务器地址,进而将视频流量引导至指定代理服务器。
可选的,所述劫持所述原始初始化函数的步骤包括:交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。
可选的,所述新视频URL的初始化函数为AVUrlAsset类的初始化方法。
可选的,所述执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务 器的步骤包括:判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同,如果相同,则直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器;如果不相同,则将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
可选的,在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
为实现上述目的及其他相关目的,本发明还提供一种视频流量引导装置,包括:函数构造模块,用于构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;流量引导模块,用于劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指定代理服务器地址,进而将视频流量引导至指定代理服务器。
可选的,所述流量引导模块用于劫持所述原始初始化函数包括:用于交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。
可选的,所述新视频URL的初始化函数为AVUrlAsset类的初始化方法。
可选的,所述流量引导模块执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器包括:判断所述原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同,如果相同,则直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器;如果不相同,则将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
可选的,所述流量引导模块,还用以在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
为实现上述目的及其他相关目的,本发明还提供一种电子设备,所述电子设备的系统为 IOS系统,所述电子设备具有如上任一项所述的视频流量引导装置,以对接收的视频请求进行流量的引导。
可选的,所述电子设备为智能手机或平板电脑。
如上所述,本发明的一种视频流量引导方法、装置及一种电子设备,通过构造一新视频URL的初始化函数,交换原始初始化函数以及新视频URL的初始化函数的地址,劫持所述原始初始化函数,即在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器,实现了对于IOS的UIWebView控件的视频请求的流量引导。
附图说明
图1显示为现有技术中流量引导的一示例的流程示意图。
图2显示为本发明的视频流量引导方法在一具体实施例中的流程示意图。
图3显示为本发明的视频流量引导方法在一具体实施例中的流程示意图。
图4显示为本发明的视频流量引导装置在一具体实施例中的模块示意图。
图5显示为本发明的一种电子设备以及一种服务器在一具体实施例中的应用示意图。
元件标号说明
1、21                视频流量引导装置
11                   函数构造模块
12                   流量引导模块
2                    电子设备
3                    服务器
S11~S12、S21~S26   步骤
具体实施方式
以下通过特定的具体实例说明本发明的实施方式,本领域技术人员可由本说明书所揭露的内容轻易地了解本发明的其他优点与功效。本发明还可以通过另外不同的具体实施方式加以实施或应用,本说明书中的各项细节也可以基于不同观点与应用,在没有背离本发明的精神下进行各种修饰或改变。需说明的是,在不冲突的情况下,以下实施例及实施例中的特征可以相互组合。
需要说明的是,以下实施例中所提供的图示仅以示意方式说明本发明的基本构想,遂图 示中仅显示与本发明中有关的组件而非按照实际实施时的组件数目、形状及尺寸绘制,其实际实施时各组件的型态、数量及比例可为一种随意的改变,且其组件布局型态也可能更为复杂。
请参阅图2,显示为本发明的视频流量引导方法在一具体实施例中的流程示意图。所述方法优选应用于IOS系统的UIWebView控件中,所述方法包括如下步骤:
S11:构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;
例如在新定义的AVUrlAsset类中构造新的初始化方法hookInitWithURL,该方法的参数与返回值保持与AVUrlAsset类中原来的初始化方法InitWithURL一致。
S12:劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指定代理服务器地址,进而将视频流量引导至指定代理服务器。即iOS系统在使用UIWebView控件播放视频链接之前,会调用AVUrlAsset类中的InitWithUrl进行初始化,此时我们构造的新方法hookInitWithURL将会被调用,而原初始化方法则不会调用,从而可以将视频流量引导至指定代理服务器。
进一步的,请参阅图3,显示为本发明的UIWebView中视频流量引导方法在另一具体实施例中的流程示意图,所述方法包括:
S21:构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;且所述步骤S21与图2所示实施例中的步骤S11相同。
且图2所示实施例中所述步骤S12的劫持所述原始初始化函数的步骤优选包括:
S22:交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。即分别取得新构造初始化方法和原初始化方法的实际代码地址,替换完后调用hookInitWithURL则会执行InitWithURL的实现,而调用InitWithURL则会执行hookInitWithURL的实现。
且图2所示实施例中所述的步骤S12的在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器的步骤具体包括:
S23:判断原始初始化函数中URL参数的访问方式是否为http或https,若是,则执行步骤S24;若否,则执行步骤S25,即本实施例中,优选只对访问方式为http或https的访问进行视频流量的引导。
S24:判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同;如果相同,则执行步骤S25;如果不同,则执行步骤S26。
S25:直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
S26:将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
且进一步的,在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
例如,在一具体应用中,假设视频请求的URL是:http://hostnameA.com/video,指定代理服务器的地址是:127.0.0.1:8123,则IOS系统在初始化AVUrlAsset对象时,通过对初始化函数的劫持,执行新构造的初始化函数,即执行以下步骤:
由于所述URL的访问方式为http,所以继续判断所述URL参数的主机名是否与所述指定代理服务器的主机名相同。
本应用实例中,所述URL参数的主机名与所述指定代理服务器的主机名不相同,则将所述URL中的主机名修改为127.0.0.1:8123,且将路径修改为hostnameA.com/video。形成新的URL:http://127.0.0.1:8123/hostnameA.com/video,且以修改后的URL作为参数,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器127.0.0.1:8123。
本发明主要对IOS系统的视频流量引导进行说明,本领域技术人员应该理解,在基于类似的发明构思的基础上,对于android系统等其他系统进行适应性的参数的修改,亦可达到视频引导的目的,且其应属于本发明所保护的范围。
请参阅图4,显示为本发明的视频流量引导装置在一具体实施例中的模块示意图。所述视频流量引导装置优选为应用在搭载IOS系统的电子设备中,所述视频流量引导装置1包括函数构造模块11以及流量引导模块12。
所述函数构造模块11用于构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;
所述流量引导模块12用于劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指 定代理服务器地址,进而将视频流量引导至指定代理服务器。
进一步的,于另一具体实施例中,所述流量引导模块12用于劫持所述原始初始化函数包括:用于交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。
进一步的,于另一具体实施例中,所述流量引导模块12执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器包括:判断所述原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同,如果相同,则直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器;如果不相同,则将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
进一步的,于另一具体实施例中,所述流量引导模块12还用以在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
且所述视频流量引导装置1的应用原理以及技术特征与图2和图3所示的视频流量引导方法相对应,所以具体的实例描述在此不加赘述。
请参阅图5,显示为本发明的一种电子设备以及一种服务器在一具体实施例中的应用示意图。所述电子设备2系统优选为IOS系统,所述电子设备具有一视频流量引导装置21,以对接收的视频请求流量引导至服务器3,且所述服务器3于在接收到所述电子设备2发送的视频请求时,返回相应的视频予所述电子设备2。所述视频流量引导装置21的结构及应用原理与图4所示的视频流量引导装置1相同。优选的,所述电子设备为智能手机或平板电脑。
综上所述,本发明的一种视频流量引导方法、装置及一种电子设备,通过构造一新视频URL的初始化函数,交换原始初始化函数以及新视频URL的初始化函数的地址,劫持所述原始初始化函数,即在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器,实现了对于IOS的UIWebView控件的视频请求的流量引导。所以,本发明有效克服了现有技术中的种种缺点而具高度产业利用价值。
上述实施例仅例示性说明本发明的原理及其功效,而非用于限制本发明。任何熟悉此技 术的人士皆可在不违背本发明的精神及范畴下,对上述实施例进行修饰或改变。因此,举凡所属技术领域中具有通常知识者在未脱离本发明所揭示的精神与技术思想下所完成的一切等效修饰或改变,仍应由本发明的权利要求所涵盖。

Claims (11)

  1. 一种视频流量引导方法,其特征在于,所述方法包括如下步骤:
    构造一新视频URL的初始化函数,所述新视频URL的初始化函数的参数与返回值与原始初始化函数一致;
    劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指定代理服务器地址;进而将视频流量引导至指定代理服务器。
  2. 根据权利要求1所述的视频流量引导方法,其特征在于:所述劫持所述原始初始化函数的步骤包括:
    交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。
  3. 根据权利要求1或2所述的视频流量引导方法,其特征在于:所述新视频URL的初始化函数为AVUrlAsset类的初始化方法。
  4. 根据权利要求1所述的视频流量引导方法,其特征在于:所述执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器的步骤包括:
    判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同,如果相同,则直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器;如果不相同,则将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
  5. 根据权利要求4所述的视频流量引导方法,其特征在于:在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
  6. 一种视频流量引导装置,其特征在于,包括:
    函数构造模块,用于构造一新视频URL的初始化函数,所述新视频URL的初始化 函数的参数与返回值与原始初始化函数一致;
    流量引导模块,用于劫持所述原始初始化函数,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数,使得修改URL中的目标地址为指定代理服务器地址;进而将视频流量引导至指定代理服务器。
  7. 根据权利要求6所述的视频流量引导装置,其特征在于,所述流量引导模块用于劫持所述原始初始化函数包括:
    用于交换所述新视频URL的初始化函数与原始初始化函数的实际代码地址,以在系统调用所述原始初始化函数请求相应的视频时,执行所述新视频URL的初始化函数。
  8. 根据权利要求6或7所述的视频流量引导装置,其特征在于,所述新视频URL的初始化函数为AVUrlAsset类的初始化方法。
  9. 根据权利要求6所述的视频流量引导装置,其特征在于,所述流量引导模块执行所述新视频URL的初始化函数,进而将视频流量引导至指定代理服务器包括:判断所述原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同,如果相同,则直接回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器;如果不相同,则将所述URL参数的主机名修改为所述指定代理服务器的主机名,提取修改前的URL参数的主机名和路径作为修改后的URL参数的路径,再回调所述原始初始化函数请求相应的视频,以将视频流量引导至所述指定代理服务器。
  10. 根据权利要求9所述的视频流量引导装置,其特征在于:所述流量引导模块,还用以在执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤之前,判断原始初始化函数中URL参数的访问方式是否为http或https,如果不是,则直接回调所述原始初始化函数请求相应的视频;如果是,则执行判断原始初始化函数中URL参数的主机名是否与所述指定代理服务器的主机名相同的步骤。
  11. 一种电子设备,其特征在于,所述电子设备的系统为IOS系统,所述电子设备具有如权利要求6~10中任一项所述的视频流量引导装置,以对接收的视频请求进行流量的引导。
PCT/CN2015/094270 2015-06-26 2015-11-11 一种视频流量引导方法、装置及一种电子设备 WO2016206283A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US15/508,658 US20170280207A1 (en) 2015-06-26 2015-11-11 Video stream redirecting method, device, and an electronic apparatus
EP15896168.0A EP3188493B1 (en) 2015-06-26 2015-11-11 Method and device for guiding video traffic, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2015103597945 2015-06-26
CN201510359794.5A CN104954894B (zh) 2015-06-26 2015-06-26 一种视频流量引导方法、装置及一种电子设备

Publications (1)

Publication Number Publication Date
WO2016206283A1 true WO2016206283A1 (zh) 2016-12-29

Family

ID=54169178

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/094270 WO2016206283A1 (zh) 2015-06-26 2015-11-11 一种视频流量引导方法、装置及一种电子设备

Country Status (4)

Country Link
US (1) US20170280207A1 (zh)
EP (1) EP3188493B1 (zh)
CN (1) CN104954894B (zh)
WO (1) WO2016206283A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10320746B2 (en) * 2014-05-12 2019-06-11 Michael C. Wood Computer security system and method based on user-intended final destination
CN104954894B (zh) * 2015-06-26 2019-03-26 网宿科技股份有限公司 一种视频流量引导方法、装置及一种电子设备
CN106372005B (zh) * 2016-09-20 2019-10-11 深圳市华美兴泰科技股份有限公司 使用外接存储器在ios系统中存取图像数据的方法及装置
CN106507181B (zh) * 2016-11-30 2019-11-05 北京酷我科技有限公司 一种获取并存储在线视频数据的方法
CN107343042B (zh) * 2017-07-03 2020-06-23 网宿科技股份有限公司 浏览器流量劫持方法、装置及移动终端
CN109639442B (zh) * 2018-11-20 2022-01-18 网宿科技股份有限公司 流量分类引导方法及系统
CN109710671B (zh) * 2018-12-14 2023-05-30 国云科技股份有限公司 实现数据库操作数据引流的方法及其数据库防火墙系统
CN110769275B (zh) * 2019-10-09 2022-04-08 北京达佳互联信息技术有限公司 直播数据流的处理方法、装置及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120311167A1 (en) * 2011-03-31 2012-12-06 International Business Machines Corporation Non-intrusive single sign-on mechanism in cloud services
US20130166906A1 (en) * 2011-12-22 2013-06-27 Viswanathan Swaminathan Methods and Apparatus for Integrating Digital Rights Management (DRM) Systems with Native HTTP Live Streaming
CN103916405A (zh) * 2014-04-25 2014-07-09 厦门享游网络科技有限公司 一种IOS上针对App的TCP/UDP流量引导的方法
CN103944906A (zh) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 一种iOS上针对APP的HTTP流量引导的方法
CN103974141A (zh) * 2013-12-13 2014-08-06 乐视网信息技术(北京)股份有限公司 视频自动跳转播放的方法、终端及系统
CN104954894A (zh) * 2015-06-26 2015-09-30 网宿科技股份有限公司 一种视频流量引导方法、装置及一种电子设备

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7501621B2 (en) * 2006-07-12 2009-03-10 Leco Corporation Data acquisition system for a spectrometer using an adaptive threshold
US8392530B1 (en) * 2008-12-18 2013-03-05 Adobe Systems Incorporated Media streaming in a multi-tier client-server architecture
KR101657196B1 (ko) * 2009-12-01 2016-09-19 밴트릭스 코오퍼레이션 캐시를 이용한 효율적인 미디어 배송 시스템 및 방법
KR101734812B1 (ko) * 2010-03-29 2017-05-12 삼성전자 주식회사 이동통신시스템 및 그 이동 통신 시스템에서 캐리어 메저먼트 방법
US8966519B2 (en) * 2010-12-22 2015-02-24 Motorola Mobility Llc Method and apparatus for providing parental control using a playlist
US8767961B2 (en) * 2011-01-05 2014-07-01 Motorola Mobility Llc Secure live television streaming
US9161080B2 (en) * 2011-01-28 2015-10-13 Level 3 Communications, Llc Content delivery network with deep caching infrastructure
US20140059192A1 (en) * 2011-04-07 2014-02-27 Telefonaktiebolaget L M Ericsson (Publ) Ethernet Based Local IP Access
US20120290724A1 (en) * 2011-05-09 2012-11-15 Nomadix, Inc. System and method for network redirection
US20130036197A1 (en) * 2011-08-05 2013-02-07 Xtreme Labs Inc. Method and system for a mobile local server
CN103188629B (zh) * 2011-12-31 2016-08-10 中国移动通信集团江苏有限公司 一种不同制式网络间的流量引导方法和装置
US9253753B2 (en) * 2012-04-24 2016-02-02 Zetta Research And Development Llc-Forc Series Vehicle-to-vehicle safety transceiver using time slots
IN2015DN00630A (zh) * 2012-06-28 2015-06-26 Azuki Systems Inc
CN102891807B (zh) * 2012-07-16 2015-10-28 北京东方网信科技股份有限公司 一种基于主动引导的网络流量缓存方法及系统
CN103885756B (zh) * 2012-12-20 2017-10-31 腾讯科技(深圳)有限公司 智能终端的基础应用功能配置方法、实现方法和装置
US9432731B2 (en) * 2013-07-17 2016-08-30 Imvision Software Technologies Ltd. Method and system for detecting live over the top (OTT) streams in communications networks
CN104579992B (zh) * 2013-10-11 2018-05-29 华为技术有限公司 一种控制网络流量路径的方法及装置
CN104572777B (zh) * 2013-10-28 2019-05-14 腾讯科技(深圳)有限公司 基于UIWebView组件的网页加载方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120311167A1 (en) * 2011-03-31 2012-12-06 International Business Machines Corporation Non-intrusive single sign-on mechanism in cloud services
US20130166906A1 (en) * 2011-12-22 2013-06-27 Viswanathan Swaminathan Methods and Apparatus for Integrating Digital Rights Management (DRM) Systems with Native HTTP Live Streaming
CN103974141A (zh) * 2013-12-13 2014-08-06 乐视网信息技术(北京)股份有限公司 视频自动跳转播放的方法、终端及系统
CN103916405A (zh) * 2014-04-25 2014-07-09 厦门享游网络科技有限公司 一种IOS上针对App的TCP/UDP流量引导的方法
CN103944906A (zh) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 一种iOS上针对APP的HTTP流量引导的方法
CN104954894A (zh) * 2015-06-26 2015-09-30 网宿科技股份有限公司 一种视频流量引导方法、装置及一种电子设备

Also Published As

Publication number Publication date
EP3188493A1 (en) 2017-07-05
CN104954894B (zh) 2019-03-26
US20170280207A1 (en) 2017-09-28
CN104954894A (zh) 2015-09-30
EP3188493A4 (en) 2018-05-02
EP3188493B1 (en) 2019-10-23

Similar Documents

Publication Publication Date Title
WO2016206283A1 (zh) 一种视频流量引导方法、装置及一种电子设备
JP6397143B2 (ja) 仮想オブジェクトの衝突チェックによる反応型拡張現実カードゲームのデータ処理方法及び反応型拡張現実カードゲームプレイ装置
US9247060B2 (en) Call control for web calls
US10298882B1 (en) Device, system and method for embedded video chat
US8843631B2 (en) Dynamic local function binding apparatus and method
WO2018103405A1 (zh) 识别接入点和热点的方法及相关产品
WO2016041322A1 (zh) 移动智能终端下转发应用内流量的方法
WO2014135045A1 (en) Method and system for implementing transparent agent of ios system
JP2013246447A5 (zh)
WO2016070726A1 (zh) 页面标签的加载方法、装置和浏览器客户端
EP3101965A1 (en) Method and apparatus for adjacent node registration, and method and system for crossing node registration
CN109788029A (zh) 微服务的灰度调用方法、装置、终端及可读存储介质
CN110765223A (zh) 地图更新处理方法、装置、设备及存储介质
WO2017096967A1 (zh) 自适应显示网页的方法及装置
CN103546829A (zh) 一种视频业务处理方法及设备
CN105530232B (zh) 一种账号登录方法和装置
US10631046B2 (en) Method and device for adapting the display of a video stream by a client
JP2016177431A5 (ja) 情報端末、システム、情報処理方法、及びプログラム
US10712827B2 (en) Client device motion control via a video feed
WO2017185632A1 (zh) 数据传输的方法及电子设备
JP2016189204A5 (zh)
US9079309B2 (en) Terminal positioning method and system, and mobile terminal
US11601487B2 (en) Real-time web communication transmission profile adaptation
US11057489B2 (en) Content deployment method and delivery controller
JP2019047273A5 (zh)

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15508658

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2015896168

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015896168

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE