CN109996201A - A kind of Network Access Method and the network equipment - Google Patents
A kind of Network Access Method and the network equipment Download PDFInfo
- Publication number
- CN109996201A CN109996201A CN201810000824.7A CN201810000824A CN109996201A CN 109996201 A CN109996201 A CN 109996201A CN 201810000824 A CN201810000824 A CN 201810000824A CN 109996201 A CN109996201 A CN 109996201A
- Authority
- CN
- China
- Prior art keywords
- address
- request
- service request
- service
- cache server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M15/00—Arrangements for metering, time-control or time indication ; Metering, charging or billing arrangements for voice wireline or wireless communications, e.g. VoIP
- H04M15/47—Fraud detection or prevention means
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/24—Accounting or billing
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种网络访问方法及网络设备,其方法包括:检测用户终端发送的业务请求的头部字段中是否存在IP地址;若存在,则提取IP地址,并在满足预设条件时,确定业务请求为重定向请求;根据IP地址,将重定向请求恢复为初始业务请求;根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。本发明的网络设备检测用户终端的业务请求的头部字段中是否存在IP地址,若存在,则根据IP地址识别重定向请求。网络设备还可将重定向请求恢复为初始业务请求,再根据初始业务请求确定目标业务是否为计费业务,以解决重定向业务请求的计费匹配问题,保证重定向业务请求的正确匹配,又可沿用当前计费匹配规则,避免流量欺诈行为。
The present invention provides a network access method and network equipment. The method includes: detecting whether an IP address exists in a header field of a service request sent by a user terminal; if so, extracting the IP address, and when a preset condition is met, Determine that the service request is a redirection request; restore the redirection request to an initial service request according to the IP address; and determine whether the target service requested by the initial service request is a charging service according to a preset charging matching rule. The network device of the present invention detects whether there is an IP address in the header field of the service request of the user terminal, and if so, identifies the redirection request according to the IP address. The network device can also restore the redirection request to the initial service request, and then determine whether the target service is a charging service according to the initial service request, so as to solve the charging matching problem of the redirected service request, ensure the correct matching of the redirected service request, and The current charging matching rules can be used to avoid traffic fraud.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种网络访问方法及网络设备。The present invention relates to the field of communication technologies, and in particular, to a network access method and network equipment.
背景技术Background technique
业务计费是运营商核心网网关的核心功能之一,其中,具有计费功能的网关实体包括:分组数据网网关(Packet Data Network Gateway,PGW)实体和通用分组无线业务(General Packet Radio Service,GPRS)网关支持节点(Gateway GPRS Support Node,GGSN)实体。业务计费最初应用于运营商自有业务流量的核减,即自有业务免流量,以提升自有业务吸引力与竞争力。近年来运营商为提升流量价值,推出了定向流量套餐(如:任我看等),流量后向统付(如:内容提供商为用户流量买单)等许多特色业务,这类业务需要识别用户业务类别,进行区分计费,采用的就是运营商核心网网关的内容计费功能。Service charging is one of the core functions of the operator's core network gateway. The gateway entities with charging functions include: Packet Data Network Gateway (PGW) entity and General Packet Radio Service (General Packet Radio Service, GPRS) gateway support node (Gateway GPRS Support Node, GGSN) entity. Service billing is initially applied to the reduction of the operator's own service traffic, that is, the self-service traffic is exempted, so as to improve the attractiveness and competitiveness of the operator's own service. In recent years, in order to increase the value of traffic, operators have launched many special services such as directional traffic packages (such as: let me see, etc.), and unified payment of traffic (such as: content providers pay for user traffic). Such services need to identify users The service category is differentiated for charging, and the content charging function of the operator's core network gateway is used.
其中,业务计费功能是基于网关的深度包检测(Deep Packet Inspection,DPI)能力实现的。具体地,DPI技术可提取出业务数据包七层协议中超文本传输协议(Hyper TextTransfer Protocol,HTTP)头中的统一资源定位符(Uniform Resource Locator,URL)字段,并与预先定义好的业务URL规则进行匹配,从而实现业务类型的识别。以流量后向统付业务为例:假设新浪体育进行业务推广,用户可以免流量访问新浪体育页面,该业务的URL规则为:“sports.sina.com.cn/*”,核心网网关解析用户数据包的HTTP头中的URL字段,当用户的URL可以匹配“sports.sina.com.cn/*”,则核心网网关将该业务数据流识别为新浪体育的流量后向统付业务,在该数据流的话单(核心网网关负责生成流量话单)中标识特定的服务标识(service ID),业务运营支撑系统(Business&Operation Support System,BOSS)系统收到话单后根据Service ID对用户流量进行免费,向新浪生成流量话单。The service charging function is implemented based on the deep packet inspection (Deep Packet Inspection, DPI) capability of the gateway. Specifically, the DPI technology can extract the uniform resource locator (Uniform Resource Locator, URL) field in the Hyper Text Transfer Protocol (Hyper Text Transfer Protocol, HTTP) header in the seven-layer protocol of the service data packet, and match it with the pre-defined service URL rules. Matching is performed to realize the identification of business types. Take the traffic backward unified payment service as an example: Assuming that Sina Sports conducts business promotion, users can visit the Sina Sports page without traffic. The URL rule of this service is: "sports.sina.com.cn/*", and the core network gateway parses the user In the URL field in the HTTP header of the data packet, when the user's URL can match "sports.sina.com.cn/*", the core network gateway will identify the service data flow as Sina Sports' traffic and then pay for it in the unified payment service. The data flow bill (the core network gateway is responsible for generating the traffic bill) identifies a specific service ID (service ID). After receiving the bill, the Business&Operation Support System (BOSS) system processes the user traffic according to the Service ID. Free, generate traffic bills to Sina.
为了避免非法网站构造URL骗取免费/第三方付费流量,例如:若后向统付计费URL规则为:“*sports.sina.com.cn*”,当访问业务的URL为:“http://www.fakesite.com/fakedir/sports.sina.com.cn/fakecontent”时同样可以匹配上述后向统付计费规则。为避免此种情况发生,计费规则匹配方式为:URL中的HOST部分不可以全用通配符“*”替代,HOST中的通配符“*”不可以通配“/”,以避免出现业务请求URL的path中内容与内容计费规则中URL HOST中的关键字匹配的情况。In order to prevent illegal websites from constructing URLs to defraud free/third-party paid traffic, for example, if the URL rule for backward billing is: "*sports.sina.com.cn*", when the URL for accessing services is: "http:/ /www.fakesite.com/fakedir/sports.sina.com.cn/fakecontent” can also match the above-mentioned backward billing rules. In order to avoid this situation, the charging rule matching method is as follows: the HOST part in the URL cannot be replaced with the wildcard "*", and the wildcard "*" in the HOST cannot be wildcarded with "/" to avoid the service request URL. The content in the path matches the keyword in the URL HOST in the content billing rule.
进一步地,为了提高用户访问网络内容的访问速度,核心网将用户需要频繁访问的网络内容存放在离用户较近、访问速度更快的网络节点中,其中,缓存(cache)服务器为存放频繁访问内容的服务器。内容分发网络(Content Delivery Network,CDN)依靠部署在各地的边缘服务器,通过中心平台的负载均衡、内容分发、调度等功能模块,使用户就近获取所需内容,降低网络拥塞,提高用户访问响应速度和命中率。CDN的基本原理为广泛采用各种缓存服务器,将这些缓存服务器分布到用户访问相对集中的地区或网络中,在用户访问网站时,利用全局负载技术将用户的访问指向距离最近的工作正常的缓存服务器上,有缓存服务器直接响应用户请求。Further, in order to improve the access speed of users accessing network content, the core network stores the network content that users need to access frequently in network nodes that are closer to the user and have faster access speeds, wherein the cache (cache) server is used to store frequently accessed network content. content server. Content Delivery Network (CDN) relies on edge servers deployed in various places, through the load balancing, content distribution, scheduling and other functional modules of the central platform, so that users can obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate. The basic principle of CDN is to widely use various cache servers, distribute these cache servers to regions or networks where user access is relatively concentrated, and use global load technology to direct users' access to the nearest working cache when users visit a website. On the server, there is a cache server that directly responds to user requests.
其中,视频流量的cache或CDN通常采用重定向方式将用户的访问请求重定向到就近的cache服务器或CDN节点,具体方式为:截取用户访问请求,回复302跳转消息给用户,消息中包含修改后的重定向URL。其中,重定向URL的修改方式是保留原URL,并在URL开头添加cache服务器或CDN节点的IP地址。假设用于请求的原URL为:“http://apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk”,那么,修改后的重定向URL为:“http://112.17.27.140/apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk?wsiphost=local”,在原URL前添加了“112.17.27.140/”,这个IP地址为cache服务器或CDN节点的IP地址,cache服务器或CDN节点接收到该重定向请求后,会根据IP地址后的URL返回用户需要的缓存内容。Among them, the cache or CDN of video traffic usually redirects the user's access request to the nearest cache server or CDN node by means of redirection. The redirect URL after. The modification method of the redirection URL is to keep the original URL and add the IP address of the cache server or CDN node at the beginning of the URL. Assuming that the original URL used for the request is: "http://apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk", then the modified The redirect URL is: "http://112.17.27.140/apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk?wsiphost=local", in the original "112.17.27.140/" is added before the URL. This IP address is the IP address of the cache server or CDN node. After the cache server or CDN node receives the redirection request, it will return the cached content required by the user according to the URL after the IP address. .
当计费URL规则为“apk.r1.market.hiapk.com/*.apk”时,原URL可以正确匹配,但是被cache服务器或CDN节点重定向修改后的URL为“http://112.17.27.140/apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk?wsiphost=local”无法正确匹配。若将计费URL规则修改为“*/apk.r1.market.hiapk.com/*.apk”,重定向的URL可以正确匹配,但无法避免流量欺诈行为,不符合URL中HOST部分不能用“*”替代的计费匹配规则。因此,亟需一种新的计费匹配方式既可以保证重定向URL的正确匹配,又可以避免流量欺诈行为。When the billing URL rule is "apk.r1.market.hiapk.com/*.apk", the original URL can be correctly matched, but the modified URL redirected by the cache server or CDN node is "http://112.17. 27.140/apk.r1.market.hiapk.com/data/upload/apkres/2017/6_28/12/com.hnzx.hnrb_122813.apk?wsiphost=local" does not match correctly. If the billing URL rule is modified to "*/apk.r1.market.hiapk.com/*.apk", the redirected URL can be correctly matched, but traffic fraud cannot be avoided, and the HOST part of the URL that does not match cannot be used with "" *" alternative billing match rule. Therefore, there is an urgent need for a new charging matching method that can not only ensure the correct matching of redirection URLs, but also avoid traffic fraud.
发明内容SUMMARY OF THE INVENTION
本发明提供一种网络访问方法及网络设备,解决了现有技术中重定向URL识别与计费匹配的问题。The present invention provides a network access method and network equipment, which solve the problem of matching redirection URL identification and charging in the prior art.
本发明的实施例提供一种网络访问方法,包括:An embodiment of the present invention provides a network access method, including:
检测用户终端发送的业务请求的头部字段中是否存在IP地址;Detect whether there is an IP address in the header field of the service request sent by the user terminal;
若存在,则提取IP地址,并在IP地址满足预设条件时,确定业务请求为重定向请求;If it exists, extract the IP address, and when the IP address meets the preset condition, determine that the service request is a redirection request;
根据IP地址,将重定向请求恢复为初始业务请求;According to the IP address, the redirection request is restored to the original service request;
根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。According to the preset charging matching rule, it is determined whether the target service requested by the initial service request is a charging service.
其中,检测用户终端发送的业务请求的头部字段中是否存在IP地址的步骤,包括:Wherein, the step of detecting whether there is an IP address in the header field of the service request sent by the user terminal includes:
接收用户终端发送的请求目标业务的业务请求;Receive the service request requesting the target service sent by the user terminal;
检测业务请求的头部字段中是否存在指示IP地址的指示字符。Check whether there is an indicator character indicating an IP address in the header field of the service request.
其中,检测检测用户终端发送的业务请求的头部字段中是否存在IP地址的步骤之后,还包括:Wherein, after the step of detecting whether there is an IP address in the header field of the service request sent by the user terminal, the method further includes:
若不存在,则转发业务请求。If it does not exist, the service request is forwarded.
其中,在IP地址满足预设条件时,确定业务请求为重定向请求的步骤,包括:Wherein, when the IP address meets the preset condition, the step of determining that the service request is a redirection request includes:
检测IP地址是否存在于预设IP地址列表中;其中,预设IP地址列表中包含全部缓存服务器和/或内容分发网络CDN节点的IP地址;Detecting whether the IP address exists in the preset IP address list; wherein, the preset IP address list includes the IP addresses of all cache servers and/or CDN nodes of the content distribution network;
若是,则确定业务请求为重定向请求;否则转发业务请求。If so, the service request is determined to be a redirection request; otherwise, the service request is forwarded.
其中,检测IP地址是否存在于预设IP地址列表中的步骤之前,还包括:Wherein, before the step of detecting whether the IP address exists in the preset IP address list, the method further includes:
获取各个缓存服务器和/或CDN节点的IP地址;Obtain the IP address of each cache server and/or CDN node;
根据缓存服务器和/或CDN节点的IP地址,生成预设IP地址列表。A preset IP address list is generated according to the IP addresses of the cache servers and/or CDN nodes.
其中,根据IP地址,将重定向请求恢复为初始业务请求的步骤,包括:Wherein, according to the IP address, the steps of restoring the redirection request to the initial service request include:
根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息;其中,预设对应关系中一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息;Determine the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP addresses of the cache servers and/or CDN nodes and the parameter information; wherein, one cache server in the preset correspondence Or the IP address of the CDN node corresponds to the parameter information of the same cache server or CDN node;
检测重定向请求中是否携带有指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段;Detecting whether the redirection request carries a parameter field indicating the parameter information of the target cache server and/or the target CDN node;
若携带有参数字段,则将重定向请求的头部字段和参数字段去除,得到初始业务请求。If the parameter field is carried, the header field and parameter field of the redirection request are removed to obtain the initial service request.
其中,根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息的步骤之前,还包括:Wherein, before the step of determining the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP address of the cache server and/or the CDN node and the parameter information, the method further includes:
获取各个缓存服务器和/或CDN节点的IP地址和参数信息;Obtain the IP address and parameter information of each cache server and/or CDN node;
根据缓存服务器和/或CDN节点的IP地址和参数信息,生成IP地址和参数信息的预设对应关系。According to the IP address and parameter information of the cache server and/or the CDN node, a preset corresponding relationship between the IP address and the parameter information is generated.
其中,根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务的步骤,包括:Wherein, according to the preset charging matching rule, the step of determining whether the target service requested by the initial service request is a charging service includes:
检测初始业务请求中是否存在与预设计费匹配规则定义的计费标记字段;Detecting whether there is a charging flag field defined by the preset charging matching rule in the initial service request;
若存在,则确定初始业务请求所请求的目标业务是否为计费业务,否则确定初始业务请求所请求的目标业务是否为免费业务。If it exists, it is determined whether the target service requested by the initial service request is a charging service; otherwise, it is determined whether the target service requested by the initial service request is a free service.
本发明的实施例还提供了一种网络设备,包括:An embodiment of the present invention also provides a network device, including:
第一检测模块,用于检测用户终端发送的业务请求的头部字段中是否存在IP地址;The first detection module is used to detect whether there is an IP address in the header field of the service request sent by the user terminal;
第一处理模块,用于若存在,则提取IP地址,并在IP地址满足预设条件时,确定业务请求为重定向请求;a first processing module, configured to extract the IP address if it exists, and determine that the service request is a redirection request when the IP address meets a preset condition;
恢复模块,用于根据IP地址,将重定向请求恢复为初始业务请求;The recovery module is used to restore the redirection request to the initial service request according to the IP address;
计费模块,用于根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。The charging module is configured to determine whether the target service requested by the initial service request is a charging service according to a preset charging matching rule.
其中,第一检测模块包括:Wherein, the first detection module includes:
第一接收子模块,用于接收用户终端发送的请求目标业务的业务请求;a first receiving sub-module, configured to receive a service request requesting a target service sent by a user terminal;
第一检测子模块,用于检测业务请求的头部字段中是否存在指示IP地址的指示字符。The first detection submodule is used for detecting whether there is an indicator character indicating an IP address in the header field of the service request.
其中,网络设备还包括:Among them, the network equipment also includes:
第一转发模块,用于若不存在,则转发业务请求。The first forwarding module is configured to forward the service request if it does not exist.
其中,第一处理模块包括:Wherein, the first processing module includes:
第二检测子模块,用于检测IP地址是否存在于预设IP地址列表中;其中,预设IP地址列表中包含全部缓存服务器和/或内容分发网络CDN节点的IP地址;The second detection sub-module is used to detect whether the IP address exists in the preset IP address list; wherein, the preset IP address list includes the IP addresses of all cache servers and/or content distribution network CDN nodes;
第一处理子模块,用于若是,则确定业务请求为重定向请求;否则转发业务请求。The first processing submodule is configured to determine that the service request is a redirection request if yes; otherwise, forward the service request.
其中,第一处理模块还包括:Wherein, the first processing module further includes:
第一获取子模块,用于获取各个缓存服务器和/或CDN节点的IP地址;The first obtaining submodule is used to obtain the IP addresses of each cache server and/or CDN node;
第一生成子模块,用于根据缓存服务器和/或CDN节点的IP地址,生成预设IP地址列表。The first generating sub-module is configured to generate a preset IP address list according to the IP addresses of the cache server and/or the CDN node.
其中,恢复模块包括:Among them, the recovery module includes:
第二处理子模块,用于根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息;其中,预设对应关系中一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息;The second processing sub-module is configured to determine the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP address of the cache server and/or the CDN node and the parameter information; wherein, The IP address of a cache server or CDN node in the preset corresponding relationship corresponds to the parameter information of the same cache server or CDN node;
第三检测子模块,用于检测重定向请求中是否携带有指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段;A third detection submodule, configured to detect whether the redirection request carries a parameter field indicating parameter information of the target cache server and/or the target CDN node;
恢复子模块,用于若携带有参数字段,则将重定向请求的头部字段和参数字段去除,得到初始业务请求。The recovery submodule is used to remove the header field and the parameter field of the redirection request if the parameter field is carried to obtain the initial service request.
其中,恢复模块还包括:Among them, the recovery module also includes:
第二获取子模块,用于获取各个缓存服务器和/或CDN节点的IP地址和参数信息;The second acquisition sub-module is used to acquire the IP address and parameter information of each cache server and/or CDN node;
第二生成子模块,用于根据缓存服务器和/或CDN节点的IP地址和参数信息,生成IP地址和参数信息的预设对应关系。The second generating sub-module is configured to generate a preset corresponding relationship between the IP address and the parameter information according to the IP address and parameter information of the cache server and/or the CDN node.
其中,计费模块包括:Among them, the billing module includes:
第四检测子模块,用于检测初始业务请求中是否存在与预设计费匹配规则定义的计费标记字段;a fourth detection submodule, configured to detect whether there is a charging flag field defined by a preset charging matching rule in the initial service request;
计费子模块,用于若存在,则确定初始业务请求所请求的目标业务是否为计费业务,否则确定初始业务请求所请求的目标业务是否为免费业务。The charging sub-module is configured to determine whether the target service requested by the initial service request is a charging service if it exists; otherwise, determine whether the target service requested by the initial service request is a free service.
本发明的实施例还提供了一种网络设备,包括:处理器;与处理器相连接的存储器,以及与处理器相连接的收发机;其中,处理器用于调用并执行存储器中所存储的程序和数据,实现上述的网络访问方法的步骤。An embodiment of the present invention also provides a network device, comprising: a processor; a memory connected to the processor, and a transceiver connected to the processor; wherein the processor is used to call and execute a program stored in the memory and data to implement the steps of the above-mentioned network access method.
本发明的上述技术方案的有益效果是:网络设备在接收到业务请求后,检测用户终端的业务请求的头部字段中是否存在IP地址,在业务请求的头部字段中存在IP地址时,根据IP地址确定该业务请求是否为重定向请求,以实现对重定向请求的识别。此外网络设备还可将重定向请求恢复为初始业务请求,再根据初始业务请求确定所请求的目标业务是否为计费业务,解决重定向业务请求的计费匹配问题,保证重定向业务请求的正确匹配,又可沿用当前计费匹配规则,避免流量欺诈行为。The beneficial effects of the above technical solutions of the present invention are: after receiving the service request, the network device detects whether there is an IP address in the header field of the service request of the user terminal, and when there is an IP address in the header field of the service request, according to The IP address determines whether the service request is a redirection request, so as to realize the identification of the redirection request. In addition, the network device can restore the redirection request to the initial service request, and then determine whether the requested target service is a charging service according to the initial service request, solve the charging matching problem of the redirection service request, and ensure the correctness of the redirection service request. If it matches, the current charging matching rules can be used to avoid traffic fraud.
附图说明Description of drawings
图1表示本发明实施例的网络访问方法的流程示意图;1 shows a schematic flowchart of a network access method according to an embodiment of the present invention;
图2表示本发明实施例的网络设备的模块示意图;2 is a schematic diagram of a module of a network device according to an embodiment of the present invention;
图3表示本发明实施例的网络设备框图。FIG. 3 shows a block diagram of a network device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。在下面的描述中,提供诸如具体的配置和组件的特定细节仅仅是为了帮助全面理解本发明的实施例。因此,本领域技术人员应该清楚,可以对这里描述的实施例进行各种改变和修改而不脱离本发明的范围和精神。另外,为了清楚和简洁,省略了对已知功能和构造的描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, the following will be described in detail with reference to the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided merely to assist in a comprehensive understanding of embodiments of the present invention. Accordingly, it should be apparent to those skilled in the art that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted for clarity and conciseness.
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
在本发明的各种实施例中,应理解,下述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。In various embodiments of the present invention, it should be understood that the size of the sequence numbers of the following processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, rather than the implementation of the present invention The implementation of the examples constitutes no limitation.
另外,本文中术语“系统”和“网络”在本文中常可互换使用。Additionally, the terms "system" and "network" are often used interchangeably herein.
在本申请所提供的实施例中,应理解,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean that B is only determined according to A, and B may also be determined according to A and/or other information.
如图1所示,本发明的实施例提供了一种网络访问方法,具体包括以下步骤:As shown in FIG. 1, an embodiment of the present invention provides a network access method, which specifically includes the following steps:
步骤11:检测用户终端发送的业务请求的头部字段中是否存在IP地址。Step 11: Detect whether there is an IP address in the header field of the service request sent by the user terminal.
其中,这里指的是网络设备在接收到用户终端发送的业务请求时,检测该业务请求的头部字段中是否存在IP地址。其中,网络设备尤其指的是具有计费功能的GGSN实体或P-GW实体。这里所说的业务请求在经GGSN实体或P-GW实体解析后得到统一资源定位符URL,当用户终端有业务请求发生时,尤其是有HTTP请求发生时,GGSN实体或P-GW实体通过解析七层URL,得到该HTTP请求的目标访问地址的URL,根据该目标访问地址可判断出该HTTP请求属于哪类业务,并将其归入相应的收费业务或免费业务。在本发明实施例中,GGSN实体或P-GW实体除了上述解析能力外,还具备检测URL的HOST字段(头部字段)中是否存在字符型IP地址格式的IP地址。Wherein, this refers to that when the network device receives the service request sent by the user terminal, it detects whether there is an IP address in the header field of the service request. The network device especially refers to a GGSN entity or a P-GW entity with a charging function. The service request mentioned here is parsed by the GGSN entity or the P-GW entity to obtain the Uniform Resource Locator URL. When the user terminal has a service request, especially when an HTTP request occurs, the GGSN entity or the P-GW entity analyzes the URL. The seven-layer URL is used to obtain the URL of the target access address of the HTTP request. According to the target access address, it is possible to determine which type of service the HTTP request belongs to, and classify it into the corresponding chargeable service or free service. In this embodiment of the present invention, the GGSN entity or the P-GW entity is capable of detecting whether there is an IP address in a character IP address format in the HOST field (header field) of the URL in addition to the above-mentioned parsing capability.
步骤12:若存在,则提取IP地址,并在IP地址满足预设条件时,确定业务请求为重定向请求。Step 12: If it exists, extract the IP address, and when the IP address meets the preset condition, determine that the service request is a redirection request.
若存在,则触发重定向请求的识别功能,若不存在,则直接按照预设计费匹配规则进行计费匹配,即根据预设计费匹配规则,确定该业务请求所请求的目标业务是否为计费业务,并转发该业务请求。其中,重定向请求识别流程为:GGSN实体或P-GW实体提取URL中HOST字段中的IP地址,并在该IP地址满足预设条件时,将该业务请求确定为重定向请求。If it exists, the identification function of the redirection request is triggered. If it does not exist, the charging matching is performed directly according to the preset charging matching rules, that is, according to the preset charging matching rules, it is determined whether the target service requested by the service request is billing service, and forward the service request. The redirection request identification process is as follows: the GGSN entity or the P-GW entity extracts the IP address in the HOST field in the URL, and determines the service request as a redirection request when the IP address meets a preset condition.
步骤13:根据IP地址,将重定向请求恢复为初始业务请求。Step 13: Restore the redirection request to the original service request according to the IP address.
这里指的是,网络设备除了具备重定向请求识别功能,还具备将重定向请求恢复为初始业务请求的恢复功能。具体地,GGSN实体或P-GW实体从重定向请求中提取出IP地址,将重定向请求恢复为初始业务请求。Here, it means that, in addition to the redirection request identification function, the network device also has the recovery function of restoring the redirection request to the original service request. Specifically, the GGSN entity or the P-GW entity extracts the IP address from the redirection request, and restores the redirection request to the initial service request.
步骤14:根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。Step 14: According to the preset charging matching rule, determine whether the target service requested by the initial service request is a charging service.
其中,预设计费匹配规则为具有防流量欺诈的匹配规则,如背景技术中提及的URL中的HOST字段不可以全用通配符“*”替代,HOST中的通配符“*”不可以通配“/”,以避免出现业务请求URL的path中内容与内容计费规则中URL HOST中的关键字匹配的情况。根据预设计费匹配规则,对重定向请求的初始业务请求进行匹配,确定重定向请求所请求的业务是否为计费业务。The preset charging matching rule is a matching rule with anti-traffic fraud. For example, as mentioned in the background art, the HOST field in the URL cannot be replaced with the wildcard "*", and the wildcard "*" in the HOST cannot be wildcarded "/" to avoid the situation where the content in the path of the service request URL matches the keyword in the URL HOST in the content charging rule. According to the preset charging matching rule, the initial service request of the redirection request is matched to determine whether the service requested by the redirection request is a charging service.
具体地,步骤11具体包括:接收用户终端发送的请求目标业务的业务请求;检测业务请求的头部字段中是否存在指示IP地址的指示字符。当用户终端有业务请求发生时,尤其是有HTTP请求发生时,GGSN实体或P-GW实体接收用户终端发送的TTTP请求,并通过解析七层URL,得到该HTTP请求的目标访问地址的URL,GGSN实体或P-GW实体进一步检测URL的HOST字段(头部字段)中是否存在字符型IP地址格式的IP地址。若存在,则触发重定向请求识别功能,若不存在则触发普通计费匹配功能。Specifically, step 11 specifically includes: receiving a service request requesting a target service sent by a user terminal; and detecting whether an indicator character indicating an IP address exists in a header field of the service request. When the user terminal has a service request, especially when an HTTP request occurs, the GGSN entity or the P-GW entity receives the TTTP request sent by the user terminal, and obtains the URL of the target access address of the HTTP request by parsing the seven-layer URL, The GGSN entity or the P-GW entity further detects whether there is an IP address in a character IP address format in the HOST field (header field) of the URL. If it exists, the redirection request identification function is triggered, and if it does not exist, the normal charging matching function is triggered.
具体地,步骤12包括:检测IP地址是否存在于预设IP地址列表中;若是,则确定业务请求为重定向请求;否则转发业务请求。其中,预设IP地址列表中包含全部缓存服务器和/或内容分发网络CDN节点的IP地址。也就是说,GGSN实体或P-GW实体在检测到URL的HOST字段中存在字符型IP地址格式的IP地址时,将URL的HOST中的字符型IP地址提取出来,处理后与CACHE服务器和/或CDN节点的预设IP地址列表比对,若该IP地址不在列表中,则触发普通计费匹配功能;若该IP地址在列表中,则表示此URL是CACHE/CDN重定向后的URL,触发初始业务请求的恢复功能,即调用URL还原功能。Specifically, step 12 includes: detecting whether the IP address exists in the preset IP address list; if so, determining that the service request is a redirection request; otherwise, forwarding the service request. The preset IP address list includes the IP addresses of all cache servers and/or CDN nodes of the content distribution network. That is to say, when the GGSN entity or the P-GW entity detects that there is an IP address in the format of a character IP address in the HOST field of the URL, it extracts the character IP address in the HOST of the URL, and communicates with the CACHE server and/or after processing. Or the preset IP address list of the CDN node is compared. If the IP address is not in the list, the normal charging matching function is triggered; if the IP address is in the list, it means that the URL is the URL after CACHE/CDN redirection. The recovery function of the initial service request is triggered, that is, the URL recovery function is called.
其中,值得指出的是,检测IP地址是否存在于预设IP地址列表中的步骤之前,还包括:获取各个缓存服务器和/或CDN节点的IP地址;根据缓存服务器和/或CDN节点的IP地址,生成预设IP地址列表。也就是说,内容计费网关实体,即GGSN实体或P-GW实体,设置CACHE服务器和CDN节点的预设IP地址列表,该预设IP地址列表根据CACHE服务器和CDN节点地址列表实时更新。Among them, it is worth pointing out that before the step of detecting whether the IP address exists in the preset IP address list, the step further includes: obtaining the IP addresses of each cache server and/or CDN node; according to the IP address of the cache server and/or CDN node to generate a list of preset IP addresses. That is, the content charging gateway entity, that is, the GGSN entity or the P-GW entity, sets the preset IP address list of the CACHE server and the CDN node, and the preset IP address list is updated in real time according to the address list of the CACHE server and the CDN node.
触发初始业务请求的恢复功能,即调用URL还原功能后,GGSN实体或P-GW实体根据该IP地址将重定向请求恢复为初始业务请求。具体地,步骤14包括:根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息;检测重定向请求中是否携带有指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段;若携带有参数字段,则将重定向请求的头部字段和参数字段去除,得到初始业务请求,否则将重定向请求的头部字段去除,得到初始业务请求。其中,预设对应关系中一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息。Trigger the restoration function of the initial service request, that is, after calling the URL restoration function, the GGSN entity or the P-GW entity restores the redirection request to the initial service request according to the IP address. Specifically, step 14 includes: determining the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP addresses of the cache server and/or the CDN node and the parameter information; detecting the redirection Whether the request carries the parameter field indicating the parameter information of the target cache server and/or the target CDN node; if it carries the parameter field, remove the header field and parameter field of the redirection request to obtain the initial service request, otherwise it will repeat the request. The header field of the directional request is removed to obtain the initial service request. Wherein, the IP address of one cache server or CDN node in the preset correspondence relationship corresponds to the parameter information of the same cache server or CDN node.
具体地,为了更好地匹配到缓存服务器和/或CDN节点上,在重定向请求中增加指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段。一个CACHE服务器或CDN节点具有唯一的IP地址,此外,一个CACHE服务器或CDN节点还可能具有至少一个参数信息。一个CACHE服务器或CDN节点的IP地址与参数信息之间具有预设对应关系,即一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息。在初始业务请求恢复流程中,GGSN实体或P-GW实体根据IP地址与参数信息的预设对应关系,确定重定向请求可能携带的参数信息;检测接收到的重定向请求中是否存在只是该参数信息的参数字段;若存在,则将重定向请求中指示IP地址的头部字段以及指示参数信息的参数字段去除得到初始业务请求;若不存在,则仅将重定向请求中指示IP地址的头部字段去除得到初始业务请求。Specifically, in order to better match the cache server and/or the CDN node, a parameter field indicating the parameter information of the target cache server and/or the target CDN node is added to the redirection request. A CACHE server or CDN node has a unique IP address, in addition, a CACHE server or CDN node may also have at least one parameter information. There is a preset correspondence between the IP address of a CACHE server or CDN node and the parameter information, that is, the IP address of one cache server or CDN node corresponds to the parameter information of the same cache server or CDN node. In the initial service request recovery process, the GGSN entity or the P-GW entity determines the parameter information that may be carried in the redirection request according to the preset correspondence between the IP address and the parameter information; it is only the parameter that detects whether the received redirection request exists. The parameter field of the information; if it exists, remove the header field indicating the IP address and the parameter field indicating the parameter information in the redirection request to obtain the initial service request; if it does not exist, only the header indicating the IP address in the redirection request will be removed. Part field removal to get the initial service request.
其中,根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息的步骤之前还包括:获取各个缓存服务器和/或CDN节点的IP地址和参数信息;根据缓存服务器和/或CDN节点的IP地址和参数信息,生成IP地址和参数信息的预设对应关系。也就是说,内容计费网关实体,即GGSN实体或P-GW实体,设置CACHE服务器和CDN节点的IP地址与参数信息之间的预设对应关系,该预设对应关系根据CACHE服务器和CDN节点的地址列表实时更新。Wherein, before the step of determining the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP addresses of the cache server and/or the CDN nodes and the parameter information, the step further includes: acquiring each cache The IP address and parameter information of the server and/or the CDN node; according to the IP address and parameter information of the cache server and/or the CDN node, a preset corresponding relationship between the IP address and the parameter information is generated. That is to say, the content charging gateway entity, that is, the GGSN entity or the P-GW entity, sets a preset correspondence between the IP addresses of the CACHE server and the CDN node and the parameter information, and the preset correspondence is based on the CACHE server and the CDN node. The address list is updated in real time.
步骤14具体包括:检测初始业务请求中是否存在与预设计费匹配规则定义的计费标记字段;若存在,则确定初始业务请求所请求的目标业务是否为计费业务,否则确定初始业务请求所请求的目标业务是否为免费业务。假设预设计费匹配规则为:业务请求的URL中的HOST字段不可以全用通配符“*”替代,HOST中的通配符“*”不可以通配“/”,后向统付计费标记字段为“sports.sina.com.cn*”,当访问业务的URL为:“http://www.fakesite.com/fakedir/sports.sina.com.cn/fakecontent”时,无法匹配上述后向统付计费规则,避免了业务请求URL的path中内容与内容计费规则中URL HOST中的关键字匹配的情况。Step 14 specifically includes: detecting whether there is a charging flag field defined by the preset charging matching rule in the initial service request; if there is, determining whether the target service requested by the initial service request is a charging service, otherwise determining the initial service request Whether the requested target service is a free service. Assume that the preset charging matching rules are: the HOST field in the URL of the service request cannot be replaced with the wildcard "*", and the wildcard "*" in the HOST cannot be wildcarded with "/", and the billing mark field will be billed later. is "sports.sina.com.cn*", when the URL for accessing the business is: "http://www.fakesite.com/fakedir/sports.sina.com.cn/fakecontent", the above backward system cannot be matched The payment charging rule avoids the situation that the content in the path of the service request URL matches the keyword in the URL HOST in the content charging rule.
本发明的网络访问方法中,网络设备在接收到业务请求后,检测用户终端的业务请求的头部字段中是否存在IP地址,在业务请求的头部字段中存在IP地址时,根据IP地址确定该业务请求是否为重定向请求,以实现对重定向请求的识别。此外网络设备还可将重定向请求恢复为初始业务请求,再根据初始业务请求确定所请求的目标业务是否为计费业务,解决重定向业务请求的计费匹配问题,保证重定向业务请求的正确匹配,又可沿用当前计费匹配规则,避免流量欺诈行为。In the network access method of the present invention, after receiving the service request, the network device detects whether an IP address exists in the header field of the service request of the user terminal, and when there is an IP address in the header field of the service request, it is determined according to the IP address. Whether the service request is a redirection request, so as to realize the identification of the redirection request. In addition, the network device can restore the redirection request to the initial service request, and then determine whether the requested target service is a charging service according to the initial service request, solve the charging matching problem of the redirection service request, and ensure the correctness of the redirection service request. If it matches, the current charging matching rules can be used to avoid traffic fraud.
以上实施例分别就本发明的网络访问方法做出介绍,下面本实施例将结合附图对其对应的网络设备做进一步说明。The above embodiments respectively introduce the network access method of the present invention, and the corresponding network device will be further described in this embodiment with reference to the accompanying drawings below.
具体地,如图2所示,本发明实施例的网络设备200,包括:Specifically, as shown in FIG. 2 , the network device 200 according to the embodiment of the present invention includes:
第一检测模块210,用于检测用户终端发送的业务请求的头部字段中是否存在IP地址;The first detection module 210 is used to detect whether there is an IP address in the header field of the service request sent by the user terminal;
第一处理模块220,用于若存在,则提取IP地址,并在IP地址满足预设条件时,确定业务请求为重定向请求;The first processing module 220 is configured to extract the IP address if it exists, and determine that the service request is a redirection request when the IP address meets a preset condition;
恢复模块230,用于根据IP地址,将重定向请求恢复为初始业务请求;Restoring module 230, configured to restore the redirection request to the initial service request according to the IP address;
计费模块240,用于根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。The charging module 240 is configured to determine whether the target service requested by the initial service request is a charging service according to a preset charging matching rule.
其中,第一检测模块210包括:Wherein, the first detection module 210 includes:
第一接收子模块,用于接收用户终端发送的请求目标业务的业务请求;a first receiving sub-module, configured to receive a service request requesting a target service sent by a user terminal;
第一检测子模块,用于检测业务请求的头部字段中是否存在指示IP地址的指示字符。The first detection submodule is used for detecting whether there is an indicator character indicating an IP address in the header field of the service request.
其中,网络设备200还包括:Wherein, the network device 200 further includes:
第一转发模块,用于若业务请求的头部字段中不存在IP地址,则转发业务请求。The first forwarding module is configured to forward the service request if there is no IP address in the header field of the service request.
其中,第一处理模块220包括:Wherein, the first processing module 220 includes:
第二检测子模块,用于检测IP地址是否存在于预设IP地址列表中;其中,预设IP地址列表中包含全部缓存服务器和/或内容分发网络CDN节点的IP地址;The second detection sub-module is used to detect whether the IP address exists in the preset IP address list; wherein, the preset IP address list includes the IP addresses of all cache servers and/or content distribution network CDN nodes;
第一处理子模块,用于若是,则确定业务请求为重定向请求;否则转发业务请求。The first processing submodule is configured to determine that the service request is a redirection request if yes; otherwise, forward the service request.
其中,第一处理模块220还包括:Wherein, the first processing module 220 further includes:
第一获取子模块,用于获取各个缓存服务器和/或CDN节点的IP地址;The first obtaining submodule is used to obtain the IP addresses of each cache server and/or CDN node;
第一生成子模块,用于根据缓存服务器和/或CDN节点的IP地址,生成预设IP地址列表。The first generating sub-module is configured to generate a preset IP address list according to the IP addresses of the cache server and/or the CDN node.
其中,恢复模块230包括:Wherein, the recovery module 230 includes:
第二处理子模块,用于根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息;其中,预设对应关系中一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息;The second processing sub-module is configured to determine the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP address of the cache server and/or the CDN node and the parameter information; wherein, The IP address of a cache server or CDN node in the preset corresponding relationship corresponds to the parameter information of the same cache server or CDN node;
第三检测子模块,用于检测重定向请求中是否携带有指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段;A third detection submodule, configured to detect whether the redirection request carries a parameter field indicating parameter information of the target cache server and/or the target CDN node;
恢复子模块,用于若携带有参数字段,则将重定向请求的头部字段和参数字段去除,得到初始业务请求。The recovery submodule is used to remove the header field and the parameter field of the redirection request if the parameter field is carried to obtain the initial service request.
其中,恢复模块230还包括:Wherein, the recovery module 230 further includes:
第二获取子模块,用于获取各个缓存服务器和/或CDN节点的IP地址和参数信息;The second acquisition sub-module is used to acquire the IP address and parameter information of each cache server and/or CDN node;
第二生成子模块,用于根据缓存服务器和/或CDN节点的IP地址和参数信息,生成IP地址和参数信息的预设对应关系。The second generating sub-module is configured to generate a preset corresponding relationship between the IP address and the parameter information according to the IP address and parameter information of the cache server and/or the CDN node.
其中,计费模块240包括:Wherein, the charging module 240 includes:
第四检测子模块,用于检测初始业务请求中是否存在与预设计费匹配规则定义的计费标记字段;a fourth detection submodule, configured to detect whether there is a charging flag field defined by a preset charging matching rule in the initial service request;
计费子模块,用于若存在,则确定初始业务请求所请求的目标业务是否为计费业务,否则确定初始业务请求所请求的目标业务是否为免费业务。The charging sub-module is configured to determine whether the target service requested by the initial service request is a charging service if it exists; otherwise, determine whether the target service requested by the initial service request is a free service.
本发明的网络设备实施例是与上述方法的实施例对应的,上述方法实施例中的所有实现手段均适用于该网络设备的实施例中,也能达到相同的技术效果。该网络设备在接收到业务请求后,检测用户终端的业务请求的头部字段中是否存在IP地址,在业务请求的头部字段中存在IP地址时,根据IP地址确定该业务请求是否为重定向请求,以实现对重定向请求的识别。此外网络设备还可将重定向请求恢复为初始业务请求,再根据初始业务请求确定所请求的目标业务是否为计费业务,解决重定向业务请求的计费匹配问题,保证重定向业务请求的正确匹配,又可沿用当前计费匹配规则,避免流量欺诈行为。The network device embodiments of the present invention correspond to the foregoing method embodiments, and all implementation means in the foregoing method embodiments are applicable to the network device embodiments, and the same technical effects can also be achieved. After receiving the service request, the network device detects whether there is an IP address in the header field of the service request of the user terminal, and when there is an IP address in the header field of the service request, determines whether the service request is a redirection according to the IP address request to enable the identification of redirected requests. In addition, the network device can restore the redirection request to the initial service request, and then determine whether the requested target service is a charging service according to the initial service request, solve the charging matching problem of the redirection service request, and ensure the correctness of the redirection service request. If it matches, the current charging matching rules can be used to avoid traffic fraud.
为了更好的实现上述目的,如图3所示,本发明的实施例还提供了一种网络设备,该网络设备包括:处理器300;通过总线接口与所述处理器300相连接的存储器320,以及通过总线接口与处理器300相连接的收发机310;所述存储器320用于存储所述处理器在执行操作时所使用的程序和数据;通过所述收发机310发送数据信息或者导频,还通过所述收发机310接收上行控制信道;当处理器300调用并执行所述存储器320中所存储的程序和数据时,实现如下功能:In order to better achieve the above purpose, as shown in FIG. 3, an embodiment of the present invention further provides a network device, the network device includes: a processor 300; a memory 320 connected to the processor 300 through a bus interface , and a transceiver 310 connected to the processor 300 through a bus interface; the memory 320 is used to store programs and data used by the processor when performing operations; data information or pilot frequencies are sent through the transceiver 310 , and also receive the uplink control channel through the transceiver 310; when the processor 300 calls and executes the program and data stored in the memory 320, the following functions are implemented:
处理器300用于读取存储器320中的程序,执行下列过程:检测用户终端发送的业务请求的头部字段中是否存在IP地址;The processor 300 is configured to read the program in the memory 320, and perform the following process: detect whether there is an IP address in the header field of the service request sent by the user terminal;
若存在,则提取IP地址,并在IP地址满足预设条件时,确定业务请求为重定向请求;If it exists, extract the IP address, and when the IP address meets the preset condition, determine that the service request is a redirection request;
根据IP地址,将重定向请求恢复为初始业务请求;According to the IP address, the redirection request is restored to the original service request;
根据预设计费匹配规则,确定初始业务请求所请求的目标业务是否为计费业务。According to the preset charging matching rule, it is determined whether the target service requested by the initial service request is a charging service.
收发机310,用于在处理器300的控制下接收和发送数据。The transceiver 310 is used for receiving and transmitting data under the control of the processor 300 .
具体地,收发机310,用于在处理器300的控制下接收和发送数据,具体用于:接收用户终端发送的请求目标业务的业务请求;Specifically, the transceiver 310 is configured to receive and send data under the control of the processor 300, and is specifically configured to: receive a service request for a target service sent by a user terminal;
处理器300还用于:检测业务请求的头部字段中是否存在指示IP地址的指示字符。The processor 300 is further configured to: detect whether there is an indicator character indicating the IP address in the header field of the service request.
具体地,处理器300还用于:若业务请求的头部字段中不用存在IP地址,则转发业务请求。Specifically, the processor 300 is further configured to: forward the service request if the IP address does not exist in the header field of the service request.
具体地,处理器300还用于:检测IP地址是否存在于预设IP地址列表中;其中,预设IP地址列表中包含全部缓存服务器和/或内容分发网络CDN节点的IP地址;Specifically, the processor 300 is further configured to: detect whether the IP address exists in the preset IP address list; wherein, the preset IP address list includes the IP addresses of all cache servers and/or content distribution network CDN nodes;
若是,则确定业务请求为重定向请求;否则转发业务请求。If so, the service request is determined to be a redirection request; otherwise, the service request is forwarded.
具体地,处理器300还用于:获取各个缓存服务器和/或CDN节点的IP地址;Specifically, the processor 300 is further configured to: obtain the IP addresses of each cache server and/or CDN node;
根据缓存服务器和/或CDN节点的IP地址,生成预设IP地址列表。A preset IP address list is generated according to the IP addresses of the cache servers and/or CDN nodes.
具体地,处理器300还用于:根据缓存服务器和/或CDN节点的IP地址与参数信息的预设对应关系,确定重定向请求所对应的目标缓存服务器和/或目标CDN节点的参数信息;其中,预设对应关系中一个缓存服务器或CDN节点的IP地址对应同一缓存服务器或CDN节点的参数信息;Specifically, the processor 300 is further configured to: determine the parameter information of the target cache server and/or the target CDN node corresponding to the redirection request according to the preset correspondence between the IP address of the cache server and/or the CDN node and the parameter information; Wherein, the IP address of a cache server or CDN node in the preset corresponding relationship corresponds to the parameter information of the same cache server or CDN node;
检测重定向请求中是否携带有指示目标缓存服务器和/或目标CDN节点的参数信息的参数字段;Detecting whether the redirection request carries a parameter field indicating the parameter information of the target cache server and/or the target CDN node;
若携带有参数字段,则将重定向请求的头部字段和参数字段去除,得到初始业务请求。If the parameter field is carried, the header field and parameter field of the redirection request are removed to obtain the initial service request.
具体地,处理器300还用于:获取各个缓存服务器和/或CDN节点的IP地址和参数信息;Specifically, the processor 300 is further configured to: obtain the IP addresses and parameter information of each cache server and/or CDN node;
根据缓存服务器和/或CDN节点的IP地址和参数信息,生成IP地址和参数信息的预设对应关系。According to the IP address and parameter information of the cache server and/or the CDN node, a preset corresponding relationship between the IP address and the parameter information is generated.
具体地,处理器300还用于:检测初始业务请求中是否存在与预设计费匹配规则定义的计费标记字段;Specifically, the processor 300 is further configured to: detect whether there is a charging flag field defined by a preset charging matching rule in the initial service request;
若存在,则确定初始业务请求所请求的目标业务是否为计费业务,否则确定初始业务请求所请求的目标业务是否为免费业务。If it exists, it is determined whether the target service requested by the initial service request is a charging service; otherwise, it is determined whether the target service requested by the initial service request is a free service.
其中,在图3中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器300代表的一个或多个处理器和存储器320代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机310可以是多个元件,即包括发送机和收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器300负责管理总线架构和通常的处理,存储器320可以存储处理器300在执行操作时所使用的数据。3, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 300 and various circuits of memory represented by memory 320 are linked together. The bus architecture may also link together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be described further herein. The bus interface provides the interface. Transceiver 310 may be a number of elements, including a transmitter and a transceiver, providing a means for communicating with various other devices over a transmission medium. The processor 300 is responsible for managing the bus architecture and general processing, and the memory 320 may store data used by the processor 300 in performing operations.
本领域技术人员可以理解,实现上述实施例的全部或者部分步骤可以通过硬件来完成,也可以通过计算机程序来指示相关的硬件来完成,所述计算机程序包括执行上述方法的部分或者全部步骤的指令;且该计算机程序可以存储于一可读存储介质中,存储介质可以是任何形式的存储介质。Those skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a computer program, where the computer program includes instructions for executing part or all of the steps of the above method ; and the computer program can be stored in a readable storage medium, and the storage medium can be any form of storage medium.
此外,需要指出的是,在本发明的装置和方法中,显然,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本发明的等效方案。并且,执行上述系列处理的步骤可以自然地按照说明的顺序按时间顺序执行,但是并不需要一定按照时间顺序执行,某些步骤可以并行或彼此独立地执行。对本领域的普通技术人员而言,能够理解本发明的方法和装置的全部或者任何步骤或者部件,可以在任何计算装置(包括处理器、存储介质等)或者计算装置的网络中,以硬件、固件、软件或者它们的组合加以实现,这是本领域普通技术人员在阅读了本发明的说明的情况下运用他们的基本编程技能就能实现的。In addition, it should be pointed out that, in the apparatus and method of the present invention, obviously, each component or each step can be decomposed and/or recombined. These disaggregations and/or recombinations should be considered as equivalents of the present invention. Also, the steps of performing the above-mentioned series of processes can naturally be performed in chronological order in the order described, but need not necessarily be performed in chronological order, and some steps can be performed in parallel or independently of each other. Those of ordinary skill in the art can understand that all or any steps or components of the method and device of the present invention can be implemented in any computing device (including a processor, storage medium, etc.) or a network of computing devices in hardware, firmware, etc. , software or a combination thereof, which can be realized by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.
因此,本发明的目的还可以通过在任何计算装置上运行一个程序或者一组程序来实现。所述计算装置可以是公知的通用装置。因此,本发明的目的也可以仅仅通过提供包含实现所述方法或者装置的程序代码的程序产品来实现。也就是说,这样的程序产品也构成本发明,并且存储有这样的程序产品的存储介质也构成本发明。显然,所述存储介质可以是任何公知的存储介质或者将来所开发出来的任何存储介质。还需要指出的是,在本发明的装置和方法中,显然,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本发明的等效方案。并且,执行上述系列处理的步骤可以自然地按照说明的顺序按时间顺序执行,但是并不需要一定按照时间顺序执行。某些步骤可以并行或彼此独立地执行。Accordingly, the objects of the present invention can also be achieved by running a program or set of programs on any computing device. The computing device may be a known general purpose device. Therefore, the object of the present invention can also be achieved only by providing a program product containing program code for implementing the method or apparatus. That is, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be pointed out that, in the device and method of the present invention, obviously, each component or each step can be decomposed and/or recombined. These disaggregations and/or recombinations should be considered as equivalents of the present invention. Also, the steps of executing the above-described series of processes can naturally be executed in chronological order in the order described, but need not necessarily be executed in chronological order. Certain steps may be performed in parallel or independently of each other.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, several improvements and modifications can be made. It should be regarded as the protection scope of the present invention.
Claims (17)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810000824.7A CN109996201B (en) | 2018-01-02 | 2018-01-02 | A network access method and network device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810000824.7A CN109996201B (en) | 2018-01-02 | 2018-01-02 | A network access method and network device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109996201A true CN109996201A (en) | 2019-07-09 |
| CN109996201B CN109996201B (en) | 2021-01-15 |
Family
ID=67128326
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810000824.7A Active CN109996201B (en) | 2018-01-02 | 2018-01-02 | A network access method and network device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109996201B (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110705978A (en) * | 2019-08-30 | 2020-01-17 | 深圳壹账通智能科技有限公司 | Interface service method and device |
| CN110830564A (en) * | 2019-10-30 | 2020-02-21 | 北京金山云网络技术有限公司 | CDN scheduling method, apparatus, system, and computer-readable storage medium |
| CN111224952A (en) * | 2019-12-24 | 2020-06-02 | 中移(杭州)信息技术有限公司 | Network resource acquisition method, device and storage medium for directed traffic |
| CN111953761A (en) * | 2020-08-04 | 2020-11-17 | Oppo广东移动通信有限公司 | Data processing method, device, electronic device and storage medium |
| CN112307279A (en) * | 2020-10-29 | 2021-02-02 | 宜通世纪物联网研究院(广州)有限公司 | DPI service identification method and device, electronic equipment and storage medium |
| CN114785778A (en) * | 2022-03-10 | 2022-07-22 | 聚好看科技股份有限公司 | Gateway device and content distribution method |
| CN118890205A (en) * | 2024-08-19 | 2024-11-01 | 中国移动通信集团浙江有限公司 | URL detection method, device, electronic device and storage medium |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1585346A (en) * | 2004-05-28 | 2005-02-23 | 南京邮电学院 | Method for realizing chaff network data flow heavy orientation |
| WO2011140419A1 (en) * | 2010-05-06 | 2011-11-10 | Desvio, Inc. | Method and system for monitoring and redirecting http requests away from unintended web sites |
| CN102970669A (en) * | 2012-11-15 | 2013-03-13 | 大唐移动通信设备有限公司 | Phone bill sending and processing method and device |
| CN104243344A (en) * | 2014-10-11 | 2014-12-24 | 网宿科技股份有限公司 | Effective data packet capturing method and request redirection server |
| CN105338187A (en) * | 2015-11-16 | 2016-02-17 | 联想(北京)有限公司 | Information processing method and electronic equipment |
| CN105516165A (en) * | 2015-12-22 | 2016-04-20 | 华为技术有限公司 | Method, device and system for identifying illegal proxy for charging fraud |
-
2018
- 2018-01-02 CN CN201810000824.7A patent/CN109996201B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1585346A (en) * | 2004-05-28 | 2005-02-23 | 南京邮电学院 | Method for realizing chaff network data flow heavy orientation |
| WO2011140419A1 (en) * | 2010-05-06 | 2011-11-10 | Desvio, Inc. | Method and system for monitoring and redirecting http requests away from unintended web sites |
| CN102970669A (en) * | 2012-11-15 | 2013-03-13 | 大唐移动通信设备有限公司 | Phone bill sending and processing method and device |
| CN104243344A (en) * | 2014-10-11 | 2014-12-24 | 网宿科技股份有限公司 | Effective data packet capturing method and request redirection server |
| CN105338187A (en) * | 2015-11-16 | 2016-02-17 | 联想(北京)有限公司 | Information processing method and electronic equipment |
| CN105516165A (en) * | 2015-12-22 | 2016-04-20 | 华为技术有限公司 | Method, device and system for identifying illegal proxy for charging fraud |
Non-Patent Citations (2)
| Title |
|---|
| 袁春阳、徐娜、王明华: "僵尸网络的类型、危害及防范措施", 《现代电信科技》 * |
| 阮一荻: "基于综合网关的移动互联网缓存新方案", 《电信技术》 * |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110705978A (en) * | 2019-08-30 | 2020-01-17 | 深圳壹账通智能科技有限公司 | Interface service method and device |
| CN110830564A (en) * | 2019-10-30 | 2020-02-21 | 北京金山云网络技术有限公司 | CDN scheduling method, apparatus, system, and computer-readable storage medium |
| CN110830564B (en) * | 2019-10-30 | 2022-11-01 | 北京金山云网络技术有限公司 | CDN scheduling method, device, system and computer readable storage medium |
| CN111224952A (en) * | 2019-12-24 | 2020-06-02 | 中移(杭州)信息技术有限公司 | Network resource acquisition method, device and storage medium for directed traffic |
| CN111953761A (en) * | 2020-08-04 | 2020-11-17 | Oppo广东移动通信有限公司 | Data processing method, device, electronic device and storage medium |
| CN111953761B (en) * | 2020-08-04 | 2023-07-25 | Oppo广东移动通信有限公司 | Data processing method, device, electronic equipment and storage medium |
| CN112307279A (en) * | 2020-10-29 | 2021-02-02 | 宜通世纪物联网研究院(广州)有限公司 | DPI service identification method and device, electronic equipment and storage medium |
| CN114785778A (en) * | 2022-03-10 | 2022-07-22 | 聚好看科技股份有限公司 | Gateway device and content distribution method |
| CN114785778B (en) * | 2022-03-10 | 2023-09-01 | 聚好看科技股份有限公司 | Gateway device and content distribution method |
| CN118890205A (en) * | 2024-08-19 | 2024-11-01 | 中国移动通信集团浙江有限公司 | URL detection method, device, electronic device and storage medium |
| CN118890205B (en) * | 2024-08-19 | 2025-10-31 | 中国移动通信集团浙江有限公司 | URL detection method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109996201B (en) | 2021-01-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109996201A (en) | A kind of Network Access Method and the network equipment | |
| US7792086B2 (en) | Method for implementing an intelligent content rating middleware platform and gateway system | |
| US9659305B2 (en) | Click quality classification and delivery | |
| CN102884764B (en) | Message receiving method, deep packet inspection device, and system | |
| CN108337652B (en) | A method and device for detecting traffic fraud | |
| US20170032412A1 (en) | Methods and systems for preventing advertisements from being delivered to untrustworthy client devices | |
| US20020128984A1 (en) | Method and system for transmission-based billing of applications | |
| US10075303B2 (en) | Method and apparatus for performing charging control to a sponsored data application | |
| CN105516165A (en) | Method, device and system for identifying illegal proxy for charging fraud | |
| CN103052049B (en) | Adjust the method for user's access service, Apparatus and system | |
| CN106412975B (en) | A testing method and device for content billing vulnerability | |
| US11503442B2 (en) | Methods of enabling flexible charging in M2M IoT service layer | |
| CN112073512A (en) | Data processing method and device | |
| JP5259412B2 (en) | Identification of fake information requests | |
| CN101188505B (en) | Method and device for content type identification | |
| CN104683313A (en) | Multimedia business processing device, multimedia business processing method and multimedia business processing system | |
| CN106899549A (en) | A kind of network security detection method and device | |
| US7782881B1 (en) | Method and apparatus for traffic quality and billing authorization by request token insertion | |
| CN105099803A (en) | A traffic identification method, application server and network element equipment | |
| CN108322354B (en) | A method and device for identifying a sneak traffic account | |
| CN102395117B (en) | Method and device for identifying content type | |
| CN109525682A (en) | Method for processing business, device, network element entity and computer readable storage medium | |
| JP6050526B2 (en) | Communication cost calculation method, management device, and network system | |
| CN114268480B (en) | Picture transmission monitoring method and device, storage medium and terminal | |
| KR102110758B1 (en) | Charging method for each service based on host name of dns and packet inspection apparatus |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |