WO2019042240A1 - 一种短链接解析方法、装置及设备 - Google Patents

一种短链接解析方法、装置及设备 Download PDF

Info

Publication number
WO2019042240A1
WO2019042240A1 PCT/CN2018/102445 CN2018102445W WO2019042240A1 WO 2019042240 A1 WO2019042240 A1 WO 2019042240A1 CN 2018102445 W CN2018102445 W CN 2018102445W WO 2019042240 A1 WO2019042240 A1 WO 2019042240A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
short
parsing
long link
regular expression
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.)
Ceased
Application number
PCT/CN2018/102445
Other languages
English (en)
French (fr)
Inventor
郑莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to EP18851906.0A priority Critical patent/EP3605352B1/en
Priority to SG11201909987W priority patent/SG11201909987WA/en
Publication of WO2019042240A1 publication Critical patent/WO2019042240A1/zh
Priority to US16/698,253 priority patent/US10733257B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9562Bookmark management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1076Resource dissemination mechanisms or network resource keeping policies for optimal resource availability in the overlay network
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/672Short addresses

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a short link analysis method, apparatus, and device.
  • service providers such as websites, banks, telecom operators, etc.
  • social media such as social software clients, social networking sites, etc.
  • text messages such as text messages.
  • the published service promotion information is usually in the form of a Uniform Resource Locator (URL), and the user can access the corresponding page through the URL to obtain the business service content.
  • URL Uniform Resource Locator
  • the service provider Due to the limitation of the number of words of social media content or SMS content, the service provider usually converts the above URL into a short link.
  • the short code value corresponding to the short link is often determined, and based on this, the URL corresponding to the short code value stored in the database is queried. Redirect.
  • the embodiment of the present specification provides a short link parsing method, apparatus and device for solving the problem of providing a more effective short link parsing method.
  • a short link parsing method provided by an embodiment of the present disclosure is applicable to the parsing server side, and the method includes:
  • the access request is redirected to the long link obtained by the parsing.
  • a short link parsing method is also provided in the embodiment of the present specification, which can be applied to the matching server side, and the method includes:
  • the regular expression is distributed to each parsing server such that any of the parsing servers performs verification and redirection of the received short link request according to the regular expression.
  • an embodiment of the present specification further provides a short link parsing apparatus, which can be applied to the parsing server side, and the apparatus includes:
  • Parsing a module parsing the short link according to the access request, and obtaining a long link that matches the short link;
  • a verification module configured to verify the long link obtained by parsing according to a predefined long link regular expression; wherein the long link regular expression is distributed by a configuration server;
  • the redirecting module redirects the access request to the long link obtained by the parsing after the verification is passed.
  • the embodiment of the present specification further provides a short link parsing apparatus, which can be applied to the configuration server side, and the apparatus includes:
  • a receiving module receiving a regular expression that is edited and input to represent a long link structure
  • the distribution module distributes the regular expression to each parsing server such that any of the parsing servers performs verification and redirection of the received short link request according to the regular expression.
  • a short link parsing device provided by the embodiment of the present specification includes:
  • Memory storing a short link parser
  • a communication interface that receives a request based on a short link access
  • the processor after receiving the access request based on the short link, the communication interface calls a short link parser stored in the memory, and executes:
  • the access request is redirected to the long link obtained by the parsing.
  • a short link parsing device provided by the embodiment of the present specification includes:
  • the processor calls the regular expression configuration program stored in the memory and executes:
  • the configuration server distributes the defined regular expression to each parsing server, so that each parsing server verifies the parsing result (the long link parsed) of the short link according to the regular expression.
  • the regular expression can be used to dynamically control the secure domain name. When the corresponding secure domain name needs to be deleted, added or modified, the configuration server can synchronize the updated regular expression to each resolution server in real time.
  • the configuration server can also configure the corresponding content distribution network (CDN) traffic limiting page and the traffic limiting threshold of the corresponding domain name, which can reduce the access pressure of the resolution server and ensure the user's access experience, and can pass the domain name granularity.
  • CDN content distribution network
  • the current limiting mechanism implements centralized control of traffic portals.
  • FIG. 1 is a schematic structural diagram of a short link parsing method according to an embodiment of the present disclosure
  • FIG. 3 is a short link parsing process based on the parsing server side according to an embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of a short link analysis apparatus based on a configuration server side according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of a short link parsing apparatus based on a parsing server side according to an embodiment of the present disclosure.
  • the short link may be generated based on a normal URL, such as: calculated by a hash algorithm according to a URL.
  • a normal URL such as: calculated by a hash algorithm according to a URL.
  • short links can be obtained by a corresponding algorithm on the basis of long links, and the generated short links correspond to long links.
  • the normal URL is called: long link.
  • the composition of the short link may take the form of “domain name + short code value”, for example: for the short link Http://t.cn/8aabb , where “t.cn” is the domain name, “ 8aabb” is a short code value.
  • domain name in the short link can be regarded as a short domain name.
  • the short domain name has a clear correspondence with the normal domain name, which can usually be set and defined by the service provider. More details.
  • the short link may also be in the form of a specific string, that is, in this manner, the short link does not distinguish between the domain name and the short code value, but a string of specific strings. This string uniquely points to a long link.
  • the short link parsing method may adopt an architecture as shown in FIG. 1. At least the client, the resolution server, the CDN server, and the configuration center may be included in FIG.
  • the client may include a social application (Application, APP) provided by the service provider, and may also include a Short Message Service (SMS) function provided in the terminal device operating system.
  • the client can present the business content containing the short link to the user, and the user can click on the short link to achieve network access.
  • the foregoing terminal device may include a device such as a mobile terminal, a computer, or a server, and the present invention is not limited thereto.
  • the resolution server may be a Domain Name System (DNS) server, and generally adopts a distributed cluster architecture for receiving client access requests and implementing short link resolution and redirection.
  • DNS Domain Name System
  • the CDN server stores the corresponding backup page and the corresponding page content.
  • the parsing server redirects the URL corresponding to the short link to the backup page stored in the CDN server. To ensure the stability of the business.
  • the configuration center may specifically be a server or a server cluster having a configuration management function.
  • the configuration center can implement the definition of a long link.
  • the configuration center is referred to as a “configuration server”, which should not be construed as limiting the application.
  • the configuration server For the configuration server, a short link parsing method is provided in the embodiment of the present specification. As shown in FIG. 2, the execution subject may be regarded as a configuration server. Specifically, the following steps are included:
  • Step S201 Receive a regular expression of the edit input to represent the long link structure.
  • a business person can edit a corresponding regular expression in a configuration server, by which a standard structure of a corresponding long link is defined.
  • the standard structure described above may generally include a standard domain name, a character format, a character type, and the like in a long link. It can be seen that after defining the standard structure of the long link, the reference standard can be provided in the parsing process of the short link.
  • a long link regular expression input by the business person can be received.
  • Step S203 Distribute the generated regular expression to each parsing server.
  • the configuration server distributes the defined regular expression to each parsing server, so that each parsing server performs the parsing result (the long link parsed) of the short link according to the regular expression. Check and redirect based on the check result.
  • the page pointed to by the long link corresponding to some short links may not be the business content page provided by the service provider, or even the dangerous website. Then, based on the regular expression in the embodiment of the present specification, if the parsing result of the short link matches the regular expression, it indicates that the long link corresponding to the short link belongs to a pre-defined link of the service provider, and the link can be guaranteed. Security, in which case the resolution server will access the long links obtained by parsing the short links.
  • the long link obtained after parsing a short link needs to match the standard structure described above to be accessible.
  • each resolution server may store the regular expression list.
  • long links corresponding to all services can be defined in the same regular expression.
  • the dynamic expression control of the secure domain name can be implemented by using a regular expression.
  • the configuration server can synchronize the updated regular expression to each resolution server in real time. .
  • the resolution server may face a large number of access requests, resulting in extremely high workload, affecting the stable operation and processing efficiency of the resolution server. Therefore, in the process of parsing and redirecting the short link, the access amount of the secure domain name corresponding to the short link is also verified, so as to ensure the user's access experience and the stable operation of the server.
  • Method 1 traffic management for different domain names.
  • the configuration service configures a corresponding traffic limiting threshold for any domain name and distributes it to each resolution server.
  • each resolution server can perform flow limit management according to the current limit threshold. For example, the resolution server can count the number of requests for a domain name within a set time period (for example, 30s). If the average number of visits per second is greater than the current limit threshold set in the configuration, the access request can be denied.
  • the configuration server can synchronize the configured traffic limiting threshold to the memory of each resolution server. Then, for each resolution server, the configured traffic limiting threshold takes effect in real time.
  • Mode 2 based on the CDN address limit.
  • the configuration server may post the page resources in the service content page corresponding to the short link on the CDN server based on the short link, form a corresponding CDN address, and establish a short link. The correspondence between the short code value and the CDN address.
  • the configuration server can push the emergency message to the parsing server, then the parsing server obtains the short code value after receiving the short link-based access request, and according to the pre-storage Correspondence relationship, query the CDN address corresponding to the short code value, and redirect to the CDN address.
  • This method ensures the stability of the service provider's own system by means of the caching capability and load balancing functions of the CDN server.
  • the short link analysis method is also provided in the embodiment of the present specification. As shown in FIG. 3, the method includes the following steps:
  • Step S301 Receive an access request based on the short link.
  • the service provider can publish the corresponding business content in the form of short links in social media. Based on this, the access request may be issued by the user by triggering (eg, clicking) a short link in the social media.
  • Step S303 Parse the short link according to the access request to obtain a long link that matches the short link.
  • short links are usually generated based on long links, that is, short links usually correspond to corresponding long links. Then, the parsing server can parse the short link and get a matching long link.
  • the long link may be a CDN address or a URL pointing to a service content page. This is not specifically limited.
  • Step S305 Verify the parsed long link according to a predefined long link regular expression. Wherein the long link regular expression is distributed by the configuration server.
  • the long link that is parsed is verified according to the long link regular expression, and it can be considered as verifying whether the long link obtained by the parsing conforms to the regular expression, and more specifically, if the long link matches
  • the regular expression can be considered as a secure link.
  • Step S307 After the verification is passed, the access request is redirected to the long link obtained by the parsing.
  • the configuration server distributes the configured traffic limiting information (such as a traffic limiting threshold, a CDN address, and the like) to each resolution server, so that the resolution servers are During the analysis of the short connection, the current limiting control is performed.
  • configured traffic limiting information such as a traffic limiting threshold, a CDN address, and the like
  • the short link is parsed according to the access request, and the long link matching the short link is obtained, which may include: determining a short code value corresponding to the short connection, according to the foregoing Corresponding relationship between the established short code value and the CDN address, determining whether the short code value of the short connection on which the access request is based corresponds to a CDN address, and if so, returning the CDN address as a long link obtained by parsing; otherwise, And determining, according to the short code value, a long link pre-established with the short code value as the long link obtained by the parsing.
  • the verifying the long link that is parsed may include: checking whether the long link matches a predefined long link regular expression, and if so, the verification passes; otherwise, the verification fails.
  • the redirecting the access request to the long link obtained by the parsing may include: determining a domain name corresponding to the long link, and counting a visit amount of the domain name within a set time period, according to the Determining whether the amount of domain name access corresponding to the long link exceeds a traffic limiting threshold, and if yes, redirecting the access request to a preset traffic limiting page; otherwise, And redirecting the access request to the long link obtained by parsing.
  • the traffic limiting page described herein may be a page that includes the traffic limiting prompt information.
  • the prompt message “Server is busy, queued access, please wait” is displayed on the page.
  • this is only an example and should not be construed as limiting the application.
  • a completed short link parsing process may be as shown in FIG. 4, and specifically includes the following steps:
  • Step S401 Receive an access request of the user based on the short link.
  • Step S403 Acquire a short code value in the short link.
  • Step S405 It is determined whether the short code value matches the preset CDN current limit page. If yes, step S407 is performed; otherwise, step 409 is performed.
  • Step 407 Determine a URL of the CDN traffic limiting page as a redirect address of the short link.
  • Step S409 Query the corresponding long link URL according to the short code value.
  • Step S411 Verify whether the long link URL matches the predefined long link regular expression, and if yes, execute step S413; otherwise, execute step S415.
  • step S413 the domain name corresponding to the long link URL is determined, and the number of the accesses of the domain name is counted, and the current limit threshold is compared with the preset current limit threshold to determine whether flow limiting is required. If yes, go to step S417; otherwise, go to step S419. .
  • Step S415 Return to the error page.
  • Step S417 Return to the current limit page.
  • Step S419 Return the parsed long link URL.
  • the short link analysis method provided by the embodiment of the present disclosure is based on the same idea.
  • the embodiment of the present specification further provides a short link parsing apparatus. As shown in FIG. 5, the apparatus includes:
  • the request receiving module 501 receives an access request based on the short link
  • the parsing module 502 parses the short link according to the access request to obtain a long link that matches the short link
  • the verification module 503 is configured to perform verification on the parsed long link according to a predefined long link regular expression; wherein the long link regular expression is distributed by the configuration server;
  • the redirecting module 504 redirects the access request to the parsed long link after the verification is passed.
  • the parsing module 502 is configured to determine a short code value corresponding to the short connection, and determine, according to a correspondence between the pre-established short code value and the CDN address, whether the short code value of the short connection on which the access request is based is Corresponding to the CDN address, if yes, returning the CDN address as a long link obtained by parsing; otherwise, determining a long link pre-established corresponding relationship with the short code value according to the short code value, as the length of the parsing link.
  • the verification module 503 verifies whether the long link matches a predefined long link regular expression, and if so, the verification passes; otherwise, the verification fails.
  • the redirection module 504 is configured to determine a domain name corresponding to the long link, and count the amount of access of the domain name within a set time period, and determine, according to the access amount and a current limiting threshold set in advance for the domain name. Whether the access amount of the domain name corresponding to the long link exceeds the traffic limiting threshold, and if yes, redirecting the access request to a preset traffic limiting page; otherwise, redirecting the access request to the long link.
  • the embodiment of the present specification further provides a short link parsing apparatus, where the apparatus includes:
  • the receiving module 601 receives a regular expression that is edited and input to represent a long link structure
  • the distribution module 602 distributes the generated regular expression to each parsing server, so that any of the parsing servers performs verification and redirection on the received short link request according to the regular expression.
  • the device further includes: a traffic limiting current limiting module 603, configured with a traffic limiting threshold for any domain name, and updates the traffic limiting threshold to each of the resolution servers.
  • a traffic limiting current limiting module 603 configured with a traffic limiting threshold for any domain name, and updates the traffic limiting threshold to each of the resolution servers.
  • the device further includes: a CDN current limiting module 604, determining, for a short link, a URL page resource corresponding to the short link, publishing the page resource on a CDN server, and generating a CDN address, establishing a short connection of the short connection The correspondence between the code value and the CDN address is distributed to each resolution server.
  • the embodiment of the present specification further provides a short link parsing device on the parsing server side, including:
  • Memory storing a short link parser
  • a communication interface that receives a request based on a short link access
  • the processor after receiving the access request based on the short link, the communication interface calls a short link parser stored in the memory, and executes:
  • the access request is redirected to the long link obtained by the parsing.
  • a short link parsing device further provided on the configuration server side includes:
  • the processor calls the regular expression configuration program stored in the memory and executes:
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • a typical implementation device is a computer.
  • the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage computer readable media, such as modulated data signal numbers and carrier waves.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the application can take the form of an entirely hardware embodiment, an entirely software embodiment or a combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular transactions or implement particular abstract data types.
  • the present application can also be practiced in distributed computing environments where transactions are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

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

Abstract

本申请公开了一种短链接解析方法、装置及设备,配置服务器会将定义的正则表达式分发给各解析服务器,以使得各解析服务器根据正则表达式,对短链接解析后所得到的长链接进行校验。采用正则表达式的方式,可以实现对安全域名的动态管控,当需要删除、增加或修改相应的安全域名时,配置服务器只需调整正则表达式中的内容,并可将更新后的正则表达式实时地同步至各个解析服务器。

Description

一种短链接解析方法、装置及设备 技术领域
本申请涉及计算机技术领域,尤其涉及一种短链接解析方法、装置及设备。
背景技术
随着互联网技术的不断发展,业务提供方(如:网站、银行、电信运营商等)可通过社交媒体(如:社交软件客户端、社交网站等)或短信的方式向用户发布相应的业务推广信息。发布的业务推广信息通常采用统一资源定位符(Uniform Resource locator,URL)的形式,进而,用户可通过该URL访问至相应的页面以获得业务服务内容。而由于受到社交媒体内容或短信内容字数的限制,业务提供方通常会将上述的URL转换为短链接。
现有技术中,当业务提供方接收到相应的短链接请求后,往往会确定出短链接所对应的短码值,并基于此,查询数据库中存储的、与短码值相对应的URL,进行重定向。
基于现有技术,我们需要一种更加有效的短链接解析方法。
发明内容
本说明书实施例提供一种短链接解析方法、装置及设备,用以解决提供一种更加有效的短链接解析方式的问题。
本说明书实施例提供的一种短链接解析方法,可应用于解析服务器侧,所述方法包括:
接收基于短链接的访问请求;
根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
本说明书实施例还提供的一种短链接解析方法,可应用于匹配服务器侧, 所述方法包括:
接收编辑输入的、用以表征长链接结构的正则表达式;
将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
基于同样思想,本说明书实施例还提供的一种短链接解析装置,可应用于解析服务器侧,所述装置包括:
请求接收模块,接收基于短链接的访问请求;
解析模块,根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
校验模块,根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
重定向模块,当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
相类似地,本说明书实施例还提供的一种短链接解析装置,可应用于配置服务器侧,所述装置包括:
接收模块,接收编辑输入的、用以表征长链接结构的正则表达式;
分发模块,将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
基于同样思想,在解析服务器侧,本说明书实施例还提供的一种短链接解析设备,包括:
存储器,存储短链接解析程序;
通讯接口,接收基于短链接访问请求;
处理器,在通讯接口接收到基于所述短链接的访问请求后,调用存储器中存储的短链接解析程序,并执行:
根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
此外,基于配置服务器侧,本说明书实施例还提供的一种短链接解析设备,包括:
存储器,存储正则表达式配置程序;
通讯接口;
处理器,调用存储器中存储的正则表达式配置程序,并执行:
接收编辑输入的、用以表征长链接结构的正则表达式;
通过所述通讯接口,将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:
配置服务器会将定义的正则表达式分发给各解析服务器,以使得各解析服务器根据正则表达式,对短链接的解析结果(解析得到的长链接)进行校验。采用正则表达式的方式,可以实现对安全域名的动态管控,当需要删除、增加或修改相应的安全域名时,配置服务器可以将更新后的正则表达式实时地同步至各个解析服务器。
此外,配置服务器还可以配置相应的内容分发网络(Content Delivery Network,CDN)限流页和相应域名的限流阈值,能够减轻解析服务器的访问压力,并保障用户的访问体验,并可以通过域名粒度的限流机制,实现流量入口的集中管控。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本说明书实施例提供的短链接解析方法所基于的架构示意图;
图2为本说明书实施例提供的基于配置服务器侧的短链接解析过程;
图3为本说明书实施例提供的基于解析服务器侧的短链接解析过程;
图4为本说明书实施例提供的在实际应用中的短链接解析的执行流程示意图;
图5为本说明书实施例提供的基于配置服务器侧的短链接解析装置结构示意图;
图6为本说明书实施例提供的基于解析服务器侧的短链接解析装置结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
在本说明书中的一个或多个实施例中,所述的短链接通常可基于正常的URL生成,如:根据URL通过hash算法计算得到。在实际应用中,短链接可在长链接的基础上通过相应的算法转换得到,生成的短链接与长链接相对应。为了便于描述,将正常的URL称为:长链接。
在一些实施例中,短链接的组成可以采用“域名+短码值”的形式,例如:对于短链接 Http://t.cn/8aabb而言,其中,“t.cn”为域名,“8aabb”为短码值。值的注意的是,短链接中的域名可认为是一种短域名,当然,短域名与正常的域名之间具有明确的对应关系,通常可由业务提供方进行设置和定义,这里并不进行过多赘述。
在另一些实施例中,所述的短链接还可以采用特定字符串的形式,也即,在这种方式中,短链接中不区分域名和短码值,而是一串特定的字符串,该字符串唯一地指向某一长链接。
当然,具体采用何种形式的短链接,通常将根据实际应用的需要而确定, 这里不进行过多赘述。
在本说明书的一个或多个实施例中,所述的短链接解析方法可采用如图1所示的架构。在图1中至少可包括:客户端、解析服务器、CDN服务器以及配置中心。
其中,所述的客户端,可包括业务提供方所提供的社交应用(Application,APP),也可包括终端设备操作系统内自带的短信息服务(Short Message Service,SMS)功能。客户端可将包含短链接的业务内容展示给用户,进而,用户可点击短链接实现网络访问。在一些实际应用场景中,上述的终端设备可包括如移动终端、计算机或者是服务器等设备,这里并不应构成对本申请的限定。
所述的解析服务器,可以是域名系统(Domain Name System,DNS)服务器,通常采用分布式集群的架构,用于接收客户端的访问请求,并实现短链接解析和重定向。
所述的CDN服务器,存储相应的备份页面以及相应的页面内容,当上述的解析服务器的访问量过大时,解析服务器会将短链接所对应的URL重定向至CDN服务器中存储的备份页面,以保证业务的稳定。
所述的配置中心,具体可以是具有配置管理功能的服务器或服务器集群。配置中心可实现对长链接的定义,在后续的描述中,将配置中心称为“配置服务器”,这里不应作为对本申请的限定。
下面基于如图1所示的架构,来描述本说明书实施例中提供的短链接解析的过程。
对于配置服务器而言,在本说明书实施例中提供一种短链接解析方法,可如图2所示,其执行主体可认为是配置服务器。具体包括以下步骤:
步骤S201:接收编辑输入的、用以表征长链接结构的正则表达式。
在实际应用中,业务提供方的业务人员通常可根据实际业务的需求,定义长链接的标准结构。在本说明书中的一个或多个实施例中,业务人员可以在配置服务器中编辑相应的正则表达式,通过该正则表达式定义相应长链接的标准 结构。
需要说明的是,所述的标准结构,通常可包括长链接中标准的域名、字符格式、字符类型等。可见,在定义了长链接的标准结构之后,便可以在短链接的解析过程中提供参照标准。
例如:假设一个正则表达式表示为“http(s)?://(taobao)\.(com|net|cn)”,可见,该正则表达式定义了长链接的标准结构应包含三部分,即,传输协议“http(s)”+域名主体“taobao”+域名后缀“com|net|cn”。
基于上述内容,对于配置服务器而言,可接收到由业务人员所编辑输入的长链接正则表达式。
步骤S203:将生成的所述正则表达式分发给各解析服务器。
在本说明书实施例中,所述的配置服务器会将定义的正则表达式分发给各解析服务器,以使得各解析服务器根据正则表达式,对短链接的解析结果(解析得到的长链接)进行校验,并基于校验结果进行重定向。
考虑到在实际应用场景中,某些短链接所对应的长链接所指向的页面可能并非是业务提供方所提供的业务内容页面,甚至是危险网站。那么,基于本说明书实施例中的正则表达式可知,如果短链接的解析结果与正则表达式相匹配,则说明该短链接所对应的长链接属于业务提供方预先定义的链接,能够保证链接的安全性,在这种情况下,解析服务器才会访问解析短链接所得到的长链接。
正如前述示例,针对某一短链接解析后所得到的长链接需要匹配上述的标准结构,才能够进行访问。
基于上述内容,作为一种可行的实施方式,可针对不同类型的业务,定义不同的正则表达式。
例如:如下表1所示,展示出了不同的业务各自所对应的正则表达式。
业务类型 正则表达式
支付业务 http(s)?://(pay)\.(com|net|cn)(:\\d+)?([/;?].*)*$
多媒体业务 http(s)?://(media)\.(com|net|cn)(:\\d+)?([/;?].*)*$
增值业务 http(s)?://(value-added service)\.(com|net|cn)(:\\d+)?([/;?].*)*$
表1
可见,不同的业务对应不同的长链接正则表达式。在实际的应用场景中,配置服务器将定义的正则表达式分发给不同的解析服务器后,每一解析服务器可采用正则表达式列表的方式进行存储。
这里需要说明的是,表1中的增值表达式中包含的诸如“\d”、“+”、“?”等字符的含义和作用,可参考现有的正则表达式元字符描述,这里便不做过多赘述。同时应理解,上述表1仅是一种示例,并不应作为对本申请的限定。
而作为另一种可行的实施方式,可将所有业务所对应的长链接定义在同一个正则表达式中。例如:
http(s)?://([a-z0-9_\\-]+\.)*(alipay|taobao|tmall|alibaba)\.(com|net|cn|hk|com\.c n)。可见,该正则表达式中包含不同业务所涉及到的长链接结构。
当然,上述两种方式并不应构成对本申请的限定。具体采用何种方式,将根据实际应用的需要进行确定。
通过上述步骤,采用正则表达式的方式,可以实现对安全域名的动态管控,当需要删除、增加或修改相应的安全域名时,配置服务器可以将更新后的正则表达式实时地同步至各个解析服务器。
除了上述内容之外,在实际的业务场景中,解析服务器可能会面对大量的访问请求,从而导致极高的工作负荷,影响解析服务器的稳定运行和处理效率。因此,在针对短链接的解析及重定向过程中,还会针对短链接对应的安全域名的访问量进行校验,以便保障用户的访问体验以及服务器的稳定运行。
在本说明书实施例中,提供两种限流管理方式,具体为:
方式一,针对不同的域名,进行流量管理。具体而言:配置服务针对任一域名,配置相应的限流阈值,并分发给各解析服务器。这样一来,各解析服务器便可根据该限流阈值,进行限流管理。例如:解析服务器可统计设定时间段(如:30s)内某个域名的请求数量,如果平均每秒的访问量大于配置中设置 的限流阈值,则可拒绝访问请求。在实际应用中,配置服务器可将配置完成的限流阈值同步到各解析服务器的内存中,那么,对于各解析服务器而言,配置的限流阈值将实时生效。
方式二,基于CDN地址的限流。具体而言:在实际应用场景中,某些时间段内有可能发生巨量访问(如:电商平台的活动期间),这样的访问量可能导致解析服务器的工作负荷急剧增加,甚至远超解析服务器的承载能力。那么,为了保证在此情况下解析服务器的正常工作,配置服务器可基于短链接,将对应于短链接的业务内容页面中的页面资源发布在CDN服务器上,形成相应的CDN地址,并建立短链接的短码值与CDN地址的对应关系。这样一来,当发生巨量访问或遭到恶意攻击时,配置服务器可向解析服务器推送应急消息,那么,解析服务器在收到基于短链接的访问请求后,获取短码值,并根据预先存储的对应关系,查询对应于该短码值的CDN地址,并重定向至该CDN地址。该方式借助CDN服务器的缓存能力和负载均衡等功能,保障业务提供方自身系统的稳定性。
以上是基于配置服务器侧的描述,对于解析服务器而言,本说明书实施例中还提供一种短链接解析方法,如图3所示,具体包括以下步骤:
步骤S301:接收基于短链接的访问请求。
正如前述,业务提供方可在社交媒体中以短链接的形式发布相应的业务内容。基于此可知,所述的访问请求,便可以是用户通过触发(如:点击)社交媒体中的短链接而发出的。
步骤S303:根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接。
在实际应用场景中,短链接通常是基于长链接所生成,也就是说,短链接通常会对应着相应的长链接。那么,解析服务器便可针对短链接进行解析后,得到相匹配的长链接。在本说明书实施例中,所述的长链接可以是CDN地址,也可以是指向业务内容页面的URL。这里并不作具体限定。
步骤S305:根据预先定义的长链接正则表达式,对解析得到的所述长链接 进行校验。其中,所述长链接正则表达式由配置服务器分发。
在本说明书实施例中,根据长链接正则表达式对解析得到的长链接进行校验,可认为是校验该解析得到的长链接是否符合该正则表达式,更为具体地,如果长链接符合该正则表达式,则可认为该长链接属于安全的链接。
步骤S307:当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
需要说明的是,如前所述,在实际的应用场景中,配置服务器会将配置好的限流信息(如:限流阈值、CDN地址等)分发给各解析服务器,以使得各解析服务器在对短连接进行解析的过程中,进行限流管控。
基于此,上述如图3所示的方法,根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接,可包括:确定所述短连接所对应的短码值,根据预先建立的短码值与CDN地址的对应关系,判断所述访问请求所基于的短连接的短码值是否对应有CDN地址,若是,则返回所述CDN地址,作为解析得到的长链接,否则,则根据所述短码值,确定与该短码值预先建立对应关系的长链接,作为解析得到的长链接。
此外,对解析得到的所述长链接进行校验,可包括:校验所述长链接与预先定义的长链接正则表达式是否匹配,若是,则校验通过;否则,则校验不通过。
进一步地,将所述访问请求重定向至解析得到的所述长链接,可包括:确定所述长链接所对应的域名,统计所述域名在设定时间段之内的访问量,根据所述访问量以及预先针对所述域名设置的限流阈值,判断所述长链接对应的域名访问量是否超过限流阈值,若是,则将所述访问请求重定向至预设的限流页面,否则,则将所述访问请求重定向至解析得到的所述长链接。
这里所述的限流页面,具体可以是包含限流提示信息的页面,例如:在该页面中显示“服务器忙,正在排队访问,请等待”等提示信息。当然,这里仅是一种示例,并不应构成对本申请的限定。
基于上述内容,在实际应用中,一个完成的短链接解析流程可如图4所示, 具体包括以下步骤:
步骤S401:接收用户基于短链接的访问请求。
步骤S403:获取该短链接中的短码值。
步骤S405:判断所述短码值是否与预设的CDN限流页相匹配,若是,则执行步骤S407,否则,执行步骤409。
步骤407:将所述CDN限流页的URL确定为所述短链接的重定向地址。
步骤S409:根据所述短码值查询对应的长链接URL。
步骤S411:校验所述长链接URL是否匹配于预定义的长链接正则表达式,若是,则执行步骤S413;否则,执行步骤S415。
步骤S413:确定所述长链接URL对应的域名,并统计该域名的访问量计数,与预设的限流阈值比对,判断是否需要进行限流,若是,执行步骤S417,否则,执行步骤S419。
步骤S415:返回错误页面。
步骤S417:返回限流页面。
步骤S419:返回解析后的长链接URL。
以上为本说明书实施例提供的短链接解析方法,基于同样的思路,本说明书实施例还提供一种短链接解析装置,如图5所示,所述装置包括:
请求接收模块501,接收基于短链接的访问请求;
解析模块502,根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接
校验模块503,根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
重定向模块504,当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
进一步地,所述解析模块502,确定所述短连接所对应的短码值,根据预先建立的短码值与CDN地址的对应关系,判断所述访问请求所基于的短连接 的短码值是否对应有CDN地址,若是,则返回所述CDN地址,作为解析得到的长链接;否则,则根据所述短码值,确定与该短码值预先建立对应关系的长链接,作为解析得到的长链接。
所述校验模块503,校验所述长链接与预先定义的长链接正则表达式是否匹配,若是,则校验通过,否则,则校验不通过。
所述重定向模块504,确定所述长链接所对应的域名,统计所述域名在设定时间段之内的访问量,根据所述访问量以及预先针对所述域名设置的限流阈值,判断所述长链接对应的域名访问量是否超过限流阈值,若是,则将所述访问请求重定向至预设的限流页面;否则,则将所述访问请求重定向至解析得到的所述长链接。
如图6所示,本说明书实施例还提供一种短链接解析装置,所述装置包括:
接收模块601,接收编辑输入的、用以表征长链接结构的正则表达式;
分发模块602,将生成的所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
进一步地,所述装置还包括:访问量限流模块603,针对任一域名,配置限流阈值,将所述限流阈值更新至所述各解析服务器。
所述装置还包括:CDN限流模块604,针对短链接,确定该短链接所对应的URL页面资源,将所述页面资源发布在CDN服务器上,并生成CDN地址,建立所述短连接的短码值与所述CDN地址之间的对应关系,并分发给各解析服务器。
本说明书实施例在解析服务器侧还提供一种短链接解析设备,包括:
存储器,存储短链接解析程序;
通讯接口,接收基于短链接访问请求;
处理器,在通讯接口接收到基于所述短链接的访问请求后,调用存储器中存储的短链接解析程序,并执行:
根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
相类似地,本说明书实施例中,在配置服务器侧还提供的一种短链接解析设备,包括:
存储器,存储正则表达式配置程序;
通讯接口;
处理器,调用存储器中存储的正则表达式配置程序,并执行:
接收编辑输入的、用以表征长链接结构的正则表达式;
通过所述通讯接口,将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、设备和介质类实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可,这里就不再一一赘述。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤或模块可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程 编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形 式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信编号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和 硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定事务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行事务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利范围之中。

Claims (16)

  1. 一种短链接解析方法,包括:
    接收基于短链接的访问请求;
    根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
    根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
    当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
  2. 如权利要求1所述的方法,根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接,具体包括:
    确定所述短连接所对应的短码值;
    根据预先建立的短码值与内容分发网络CDN地址的对应关系,判断所述访问请求所基于的短连接的短码值是否对应有CDN地址;
    若是,则返回所述CDN地址,作为解析得到的长链接;
    否则,则根据所述短码值,确定与该短码值预先建立对应关系的长链接,作为解析得到的长链接。
  3. 如权利要求1所述的方法,对解析得到的所述长链接进行校验,具体包括:
    校验所述长链接与预先定义的长链接正则表达式是否匹配;
    若是,则校验通过;
    否则,则校验不通过。
  4. 如权利要求1所述的方法,将所述访问请求重定向至解析得到的所述长链接,具体包括:
    确定所述长链接所对应的域名;
    统计所述域名在设定时间段之内的访问量;
    根据所述访问量以及预先针对所述域名设置的限流阈值,判断所述长链接对应的域名访问量是否超过限流阈值;
    若是,则将所述访问请求重定向至预设的限流页面;
    否则,则将所述访问请求重定向至解析得到的所述长链接。
  5. 一种短链接解析方法,包括:
    接收编辑输入的、用以表征长链接结构的正则表达式;
    将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
  6. 如权利要求5所述的方法,所述方法还包括:
    针对任一域名,配置限流阈值;
    将所述限流阈值分发至所述各解析服务器。
  7. 如权利要求5所述的方法,所述方法包括:
    针对短链接,确定该短链接所对应的页面资源;
    将所述页面资源发布在CDN服务器上,并生成CDN地址;
    建立所述短连接的短码值与所述CDN地址之间的对应关系,并分发给各解析服务器。
  8. 一种短链接解析装置,包括:
    请求接收模块,接收基于短链接的访问请求;
    解析模块,根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
    校验模块,根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
    重定向模块,当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
  9. 如权利要求8所述的装置,所述解析模块,确定所述短连接所对应的短码值,根据预先建立的短码值与CDN地址的对应关系,判断所述访问请求所基于的短连接的短码值是否对应有CDN地址,若是,则返回所述CDN地址,作为解析得到的长链接;否则,则根据所述短码值,确定与该短码值预先建立 对应关系的长链接,作为解析得到的长链接。
  10. 如权利要求8所述的装置,所述校验模块,校验所述长链接与预先定义的长链接正则表达式是否匹配,若是,则校验通过,否则,则校验不通过。
  11. 如权利要求8所述的装置,所述重定向模块,确定所述长链接所对应的域名,统计所述域名在设定时间段之内的访问量,根据所述访问量以及预先针对所述域名设置的限流阈值,判断所述长链接对应的域名访问量是否超过限流阈值,若是,则将所述访问请求重定向至预设的限流页面;否则,则将所述访问请求重定向至解析得到的所述长链接。
  12. 一种短链接解析装置,包括:
    接收模块,接收编辑输入的、用以表征长链接结构的正则表达式;
    分发模块,将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
  13. 如权利要求12所述的装置,所述装置还包括:访问量限流模块,针对任一域名,配置限流阈值,将所述限流阈值分发至所述各解析服务器。
  14. 如权利要求12所述的装置,所述装置还包括:CDN限流模块,针对短链接,确定该短链接所对应的URL页面资源,将所述页面资源发布在CDN服务器上,并生成CDN地址,建立所述短连接的短码值与所述CDN地址之间的对应关系,并分发给各解析服务器。
  15. 一种短链接解析设备,包括:
    存储器,存储短链接解析程序;
    通讯接口,接收基于短链接访问请求;
    处理器,在通讯接口接收到基于所述短链接的访问请求后,调用存储器中存储的短链接解析程序,并执行:
    根据所述访问请求解析所述短链接,得到匹配于该短链接的长链接;
    根据预先定义的长链接正则表达式,对解析得到的所述长链接进行校验;其中,所述长链接正则表达式由配置服务器分发;
    当校验通过后,将所述访问请求重定向至解析得到的所述长链接。
  16. 一种短链接解析设备,包括:
    存储器,存储正则表达式配置程序;
    通讯接口;
    处理器,调用存储器中存储的正则表达式配置程序,并执行:
    接收编辑输入的、用以表征长链接结构的正则表达式;
    通过所述通讯接口,将所述正则表达式分发给各解析服务器,以使得任一所述解析服务器根据所述正则表达式对接收到的短链接请求进行校验及重定向。
PCT/CN2018/102445 2017-08-28 2018-08-27 一种短链接解析方法、装置及设备 Ceased WO2019042240A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP18851906.0A EP3605352B1 (en) 2017-08-28 2018-08-27 Short-link parsing method, apparatus and device
SG11201909987W SG11201909987WA (en) 2017-08-28 2018-08-27 Short-link parsing method, apparatus, and device
US16/698,253 US10733257B2 (en) 2017-08-28 2019-11-27 Short-link parsing methods, apparatus, and devices

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710748157.6A CN107733972B (zh) 2017-08-28 2017-08-28 一种短链接解析方法、装置及设备
CN201710748157.6 2017-08-28

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/698,253 Continuation US10733257B2 (en) 2017-08-28 2019-11-27 Short-link parsing methods, apparatus, and devices

Publications (1)

Publication Number Publication Date
WO2019042240A1 true WO2019042240A1 (zh) 2019-03-07

Family

ID=61205328

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/102445 Ceased WO2019042240A1 (zh) 2017-08-28 2018-08-27 一种短链接解析方法、装置及设备

Country Status (6)

Country Link
US (1) US10733257B2 (zh)
EP (1) EP3605352B1 (zh)
CN (1) CN107733972B (zh)
SG (1) SG11201909987WA (zh)
TW (1) TWI682653B (zh)
WO (1) WO2019042240A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797334A (zh) * 2020-06-19 2020-10-20 北京达佳互联信息技术有限公司 一种网址访问方法、装置、电子设备及存储介质
CN113761406B (zh) * 2021-09-03 2024-06-04 丰巢网络技术有限公司 一种智能柜二维码短链生成方法、装置、介质及电子设备

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733972B (zh) 2017-08-28 2020-09-08 阿里巴巴集团控股有限公司 一种短链接解析方法、装置及设备
US10664547B1 (en) * 2018-02-20 2020-05-26 United Services Automobile Association (Usaa) Configurable short locators
CN110138756B (zh) * 2019-04-30 2021-05-25 网宿科技股份有限公司 一种限流方法及系统
CN111782986B (zh) * 2019-05-17 2024-09-20 北京京东尚科信息技术有限公司 一种监控基于短链接进行访问的方法和装置
CN110191447A (zh) * 2019-05-28 2019-08-30 深圳云里物里科技股份有限公司 一种esl中蓝牙广播包的过滤方法及相关装置
CN112311904A (zh) * 2019-07-25 2021-02-02 北京中关村科金技术有限公司 更新域名记录的方法、装置、存储介质以及域名管理系统
CN111047413B (zh) * 2019-12-17 2023-11-07 秒针信息技术有限公司 发文内容获取方法、装置、计算机设备和可读存储介质
CN111355732B (zh) * 2020-02-28 2021-06-11 腾讯科技(深圳)有限公司 链接检测方法、装置、电子设备及存储介质
CN111651695A (zh) * 2020-05-29 2020-09-11 深圳前海微众银行股份有限公司 一种短链接的生成与解析方法及装置
CN111966506B (zh) * 2020-07-22 2024-03-22 招联消费金融股份有限公司 基于不同应用程序的内容分享方法和计算机设备
CN112437329B (zh) * 2020-11-05 2024-01-26 上海幻电信息科技有限公司 一种播放视频的方法、装置、设备、及可读存储介质
CN114980277B (zh) * 2021-02-19 2024-01-16 海能达通信股份有限公司 一种省电方法、窄带通信设备和存储介质
JP7494788B2 (ja) * 2021-04-28 2024-06-04 オムロン株式会社 制御システム、データ提供方法および中継処理プログラム
CN113794773B (zh) * 2021-09-15 2023-04-07 中国电信股份有限公司 边缘节点调度方法及装置、存储介质、电子设备
CN113872876A (zh) * 2021-09-23 2021-12-31 深圳市雷鸟网络传媒有限公司 请求限制方法、装置、电子设备和计算机可读存储介质
US12185220B2 (en) * 2021-11-09 2024-12-31 At&T Intellectual Property I, L.P. Message routing for partner carrier subscribers
CN114448842B (zh) * 2021-12-08 2023-06-16 统信软件技术有限公司 一种资源访问方法、装置及计算设备
US12099565B2 (en) * 2022-04-08 2024-09-24 Cloud Linux Software Inc. Systems and method for caching shortcodes and database queries
CN115174479B (zh) * 2022-07-19 2023-10-13 天翼云科技有限公司 一种流量控制方法及装置
CN116166900A (zh) * 2023-03-31 2023-05-26 深圳市星卡科技股份有限公司 一种基于短链接访问长链接的方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003007162A1 (en) * 2001-07-13 2003-01-23 Adalive.Com, Inc. Interactive communications system coupled to portable computing devices using short range communications
CN104065736A (zh) * 2014-07-03 2014-09-24 车智互联(北京)科技有限公司 一种url重定向方法、装置及系统
CN106202187A (zh) * 2016-06-28 2016-12-07 北京京东尚科信息技术有限公司 一种在浏览器中处理短链接的方法和装置
CN107733972A (zh) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 一种短链接解析方法、装置及设备

Family Cites Families (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7574499B1 (en) 2000-07-19 2009-08-11 Akamai Technologies, Inc. Global traffic management system using IP anycast routing and dynamic load-balancing
US6957224B1 (en) * 2000-09-11 2005-10-18 International Business Machines Corporation Efficient retrieval of uniform resource locators
US20070047583A1 (en) * 2005-08-29 2007-03-01 Siemens Aktiengesellschaft Method for using a short address in a packet header
US7698269B2 (en) * 2005-11-29 2010-04-13 Yahoo! Inc. URL shortening and authentication with reverse hash lookup
US20070124500A1 (en) * 2005-11-30 2007-05-31 Bedingfield James C Sr Automatic substitute uniform resource locator (URL) generation
US20090254425A1 (en) * 2008-04-02 2009-10-08 Evan Horowitz Wiki-type collective intelligence mechanism for implementing a url redirect
US8307431B2 (en) * 2008-05-30 2012-11-06 At&T Intellectual Property I, L.P. Method and apparatus for identifying phishing websites in network traffic using generated regular expressions
US8494958B2 (en) * 2008-06-25 2013-07-23 Softerware Inc. Method and system to process payment using URL shortening and/or QR codes
US8844040B2 (en) * 2009-03-20 2014-09-23 Citrix Systems, Inc. Systems and methods for using end point auditing in connection with traffic management
US20100268739A1 (en) * 2009-04-21 2010-10-21 George David Zalepa Systems and methods for automatically detecting and removing redirected uniform resource locators
US8862699B2 (en) * 2009-12-14 2014-10-14 Microsoft Corporation Reputation based redirection service
US9058242B2 (en) * 2010-03-04 2015-06-16 Gshift Labs Inc. Method and system of optimizing a web page for search engines
US8630200B2 (en) * 2010-06-01 2014-01-14 Meltwater News International Holdings, GmbH Method and apparatus for embedding information in a short URL
US8381276B2 (en) * 2010-08-23 2013-02-19 Microsoft Corporation Safe URL shortening
CN102810089B (zh) * 2011-05-30 2017-07-04 盛乐信息技术(上海)有限公司 基于内容的短链接系统及实现方法
US20130282714A1 (en) * 2012-04-18 2013-10-24 Yumber, Inc. Personalized Redirection Identifiers
CN103678333B (zh) * 2012-09-03 2018-12-25 北京千橡网景科技发展有限公司 用于提高统一资源定位符提取准确率的方法和设备
CN102902780B (zh) 2012-09-28 2016-04-20 五八有限公司 一种统一资源定位符url动态匹配方法及装置
US9210229B2 (en) * 2012-10-15 2015-12-08 Exacttarget, Inc. System and method for generating personalized short links and monitoring activity
CN102917307A (zh) 2012-10-16 2013-02-06 北京小米科技有限责任公司 一种信息发送方法、装置、ue和通信系统
US9742661B2 (en) * 2012-11-07 2017-08-22 Pure Oxygen Labs LLC Uniform resource locator mapping and routing system and method
US9549035B2 (en) * 2013-03-13 2017-01-17 Apple Inc. Automatic updating of redirected location references
US10177967B2 (en) * 2013-03-15 2019-01-08 Jesse Lakes Redirection service resource locator mechanism
US20150025981A1 (en) * 2013-03-15 2015-01-22 David Zaretsky Url shortening computer-processed platform for processing internet traffic
US10057207B2 (en) * 2013-04-07 2018-08-21 Verisign, Inc. Smart navigation for shortened URLs
US9569728B2 (en) 2014-11-14 2017-02-14 Bublup Technologies, Inc. Deriving semantic relationships based on empirical organization of content by users
CN106412140A (zh) * 2015-08-03 2017-02-15 沈阳东软睿道教育服务有限公司 短链接地址生成方法及系统
CN106933854B (zh) * 2015-12-30 2020-06-30 阿里巴巴集团控股有限公司 短链接处理方法、装置及服务器
CN106933871B (zh) * 2015-12-30 2021-08-17 创新先进技术有限公司 短链接处理方法、装置及短链接服务器
CN106375189A (zh) * 2016-08-31 2017-02-01 北京炎黄新星网络科技有限公司 一种长短链转换的方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003007162A1 (en) * 2001-07-13 2003-01-23 Adalive.Com, Inc. Interactive communications system coupled to portable computing devices using short range communications
CN104065736A (zh) * 2014-07-03 2014-09-24 车智互联(北京)科技有限公司 一种url重定向方法、装置及系统
CN106202187A (zh) * 2016-06-28 2016-12-07 北京京东尚科信息技术有限公司 一种在浏览器中处理短链接的方法和装置
CN107733972A (zh) * 2017-08-28 2018-02-23 阿里巴巴集团控股有限公司 一种短链接解析方法、装置及设备

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797334A (zh) * 2020-06-19 2020-10-20 北京达佳互联信息技术有限公司 一种网址访问方法、装置、电子设备及存储介质
CN111797334B (zh) * 2020-06-19 2024-01-23 北京达佳互联信息技术有限公司 一种网址访问方法、装置、电子设备及存储介质
CN113761406B (zh) * 2021-09-03 2024-06-04 丰巢网络技术有限公司 一种智能柜二维码短链生成方法、装置、介质及电子设备

Also Published As

Publication number Publication date
EP3605352A1 (en) 2020-02-05
CN107733972B (zh) 2020-09-08
CN107733972A (zh) 2018-02-23
TWI682653B (zh) 2020-01-11
US10733257B2 (en) 2020-08-04
US20200097513A1 (en) 2020-03-26
TW201919375A (zh) 2019-05-16
SG11201909987WA (en) 2019-11-28
EP3605352A4 (en) 2020-05-27
EP3605352B1 (en) 2021-07-07

Similar Documents

Publication Publication Date Title
CN107733972B (zh) 一种短链接解析方法、装置及设备
CN107426169B (zh) 一种基于权限的业务处理方法及装置
US9148332B2 (en) Content delivery network
EP2805257A1 (en) Managing font distribution
US9578012B2 (en) Restricted content publishing with search engine registry
CN107038041A (zh) 数据处理方法、错误码动态兼容方法、装置和系统
US20170171104A1 (en) Method and apparatus for providing access of content resources
CN107168960A (zh) 一种业务执行方法及装置
US10673789B2 (en) Bot-invocable software development kits to access legacy systems
CN109981719A (zh) 信息处理方法及其系统、计算机系统和计算机可读介质
US11797701B1 (en) Secure data collaboration
CN109936605A (zh) 一种加载接口数据的方法和装置
CN110209662A (zh) 一种自动化加载数据的方法和装置
CN113746882B (zh) 一种用户会话信息存储方法、装置及电子设备
KR102245358B1 (ko) 네트워크 리소스 요청을 제로 레이팅 네트워크 요청으로 변환하는 기술
CN110417919A (zh) 一种流量劫持方法及装置
CN112015383B (zh) 一种登录方法和装置
CN110705935B (zh) 一种物流单据的处理方法和装置
CN110020373A (zh) 静态页面存储、浏览的方法和装置
CN113760346A (zh) 信息管理方法和装置
CN113778909B (zh) 一种缓存数据的方法和装置
US20180246860A1 (en) Dynamic cognitive optimization of web applications
HK1249303B (zh) 一种短链接解析方法、装置及设备
EP4229576A1 (en) Client-side device bloom filter mapping
HK1249303A1 (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: 18851906

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018851906

Country of ref document: EP

Effective date: 20191028

NENP Non-entry into the national phase

Ref country code: DE

WWG Wipo information: grant in national office

Ref document number: 201947043671

Country of ref document: IN