WO2016026400A1 - 一种处理连续重定向的方法和装置 - Google Patents

一种处理连续重定向的方法和装置 Download PDF

Info

Publication number
WO2016026400A1
WO2016026400A1 PCT/CN2015/086614 CN2015086614W WO2016026400A1 WO 2016026400 A1 WO2016026400 A1 WO 2016026400A1 CN 2015086614 W CN2015086614 W CN 2015086614W WO 2016026400 A1 WO2016026400 A1 WO 2016026400A1
Authority
WO
WIPO (PCT)
Prior art keywords
service request
redirection
service
redirect
destination address
Prior art date
Application number
PCT/CN2015/086614
Other languages
English (en)
French (fr)
Inventor
张岩
Original Assignee
阿里巴巴集团控股有限公司
张岩
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司, 张岩 filed Critical 阿里巴巴集团控股有限公司
Priority to SG11201700630RA priority Critical patent/SG11201700630RA/en
Priority to JP2017510569A priority patent/JP6514322B2/ja
Priority to PL15834055T priority patent/PL3185512T3/pl
Priority to KR1020177004878A priority patent/KR101970901B1/ko
Priority to ES15834055T priority patent/ES2829832T3/es
Priority to EP15834055.4A priority patent/EP3185512B8/en
Priority to US15/505,418 priority patent/US10673972B2/en
Publication of WO2016026400A1 publication Critical patent/WO2016026400A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/563Data redirection of data network streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection

Definitions

  • the present application relates to the field of the Internet, and in particular, to a method and apparatus for processing continuous redirection.
  • the service request is sent to address A, after which the service request is redirected by server 302 to address B, after which the service request is received by the server.
  • 302 redirects to address C, after which the service request is redirected by server 302 to address D, and so on, the service request may be redirected 302 multiple times.
  • the browser has a limit on the number of 302 redirects. If the number of 302 redirects exceeds the limit, the browser will report the error, such as outputting a 404 error. At this point, the business will not be able to continue, that is, the business will be interrupted, thus affecting the user's business experience.
  • the embodiment of the present invention provides a method and an apparatus for processing continuous redirection, which can avoid error processing caused by the number of redirections in the redirection exceeding the limit number of times.
  • the embodiment of the present application provides a method for processing continuous redirection, including:
  • the header of the hypertext markup language HTML of the intermediate page includes a preset instruction for implementing to redirect the service request to the destination address after inserting the intermediate page.
  • the method further includes: storing, in the memory, a correspondence between the service identifier corresponding to the service request and the number of redirections; wherein, the initial value of the redirection number is 0;
  • the service identifier corresponding to the service request is determined, and the number of redirects corresponding to the service identifier is incremented by one in the memory;
  • the service identifier corresponding to the service request is determined, and the number of redirects corresponding to the service identifier is cleared in the memory.
  • the method further includes: when the number of redirections does not reach the preset threshold, if there is an error processing caused by the number of times the redirection of the service request exceeds a preset threshold, determining the service identifier corresponding to the service request, and in the memory Querying the number of redirects corresponding to the service identifier;
  • the preset threshold is adjusted to the number of redirections corresponding to the service identifier, and the number of redirections corresponding to the service identifier is cleared in the memory.
  • the method further includes: intercepting all service requests in the process of redirecting the service request to the destination address, to select from all the service requests that need to be heavy Directional processing of business requests.
  • the redirection specifically includes 302 redirection.
  • the embodiment of the present application provides a redirection processing device, where the redirection processing device includes:
  • a determining module configured to determine a number of redirects corresponding to the service request when receiving a service request that needs to be redirected;
  • a determining module configured to determine whether the number of redirects reaches a preset threshold
  • a processing module configured to: when the number of redirects reaches a preset threshold, interrupt the redirect of the service request, and continue to redirect the service request to a destination address after interrupting the redirect of the service request;
  • the service request is redirected to the destination address.
  • the processing module is specifically configured to temporarily insert an intermediate page to interrupt the continuous redirection corresponding to the service request by inserting the intermediate page; after interrupting the redirection of the service request by inserting the intermediate page, continue The service request is redirected to the destination address.
  • the header of the hypertext markup language HTML of the intermediate page includes a preset instruction for implementing to redirect the service request to the destination address after inserting the intermediate page.
  • the processing module is specifically configured to invoke an interrupt mode configured in the pool of the 302 redirect method, and interrupt the continuous redirect corresponding to the service request by using the interrupt mode; interrupting the service request by using the interrupt mode After the orientation, the service request is continued to be redirected to the destination address; wherein the continuous 302 redirect method pool is configured with an interrupt mode for interrupting the redirect of the service request.
  • the determining module is further configured to store, in the memory, a correspondence between a service identifier corresponding to the service request and a redirection number; wherein, the initial value of the redirection number is 0;
  • the service identifier corresponding to the service request is determined, and the number of redirects corresponding to the service identifier is incremented by one in the memory;
  • the service identifier corresponding to the service request Determining, by the determining module, the service identifier corresponding to the service request, if the number of redirection times does not reach a preset threshold, if an operation request occurs that the number of redirection times exceeds a preset threshold, the service identifier corresponding to the service request is determined, and Querying, in the memory, the number of redirects corresponding to the service identifier;
  • the preset threshold is adjusted to the number of redirections corresponding to the service identifier, and the number of redirections corresponding to the service identifier is cleared in the memory.
  • the determining module is further configured to intercept all service requests in the process of redirecting the service request to the destination address before receiving the service request that needs to be redirected, so as to select from all the service requests Directional processing of business requests.
  • the redirection specifically includes 302 redirection.
  • the redirection processing device determines whether the redirection number reaches a preset threshold, and when the redirection number reaches a preset threshold, interrupts the redirection of the service request, and After interrupting the redirect of the service request, the service request is redirected to the destination address, thereby avoiding the error processing (such as 404 error) caused by the number of redirects exceeding the limit of the browser, thereby avoiding service interruption and service failure.
  • error processing such as 404 error
  • FIG. 1 is a schematic flowchart of a method for processing continuous redirection according to Embodiment 1 of the present application;
  • FIG. 2 is a schematic structural diagram of a redirection processing apparatus according to Embodiment 2 of the present application.
  • FIG. 3 is a schematic flowchart of a method for processing continuous redirection according to Embodiment 2 of the present application;
  • FIG. 4 is a schematic structural diagram of a redirection processing apparatus according to Embodiment 3 of the present application.
  • a method for processing continuous redirection provided in Embodiment 1 of the present application is applied to a network including a client, a server, and a redirection processing device, and the network may be a large website or distributed. system.
  • the redirection processing device can be deployed as a functional module on the server, and the redirection processing device can also be a separate device in the network.
  • the redirection processing device is configured to process a redirection process of the service request. For example, when a client (browser) sends a service request (ie, a WEB service request) to the server, the service request is sent to address A.
  • the subsequent redirection process is processed by the redirection processing device, such as the redirection processing device redirecting the service request to the address B, after which the redirection processing device redirects the service request to the address C, after which the redirection processing device will The service request is redirected to address D, and so on.
  • the method for processing continuous redirection includes the following steps:
  • Step 101 After receiving the service request that needs to be redirected, the redirection processing device determines the number of redirections corresponding to the service request, and determines whether the redirection number reaches a preset threshold. If the preset threshold is reached, step 102 is performed; if the preset threshold is not reached, step 103 is performed.
  • the preset threshold may be set by the redirect processing device based on a limit of the number of times the browser redirects. For example, when the number of redirects exceeds 5 times, the browser performs error processing, and the redirection processing device can set the preset threshold to 4 times (5-1).
  • the directional processing device intercepts all service requests to select a service request from all service requests that needs to be redirected. Based on this, the redirect processing device needs to intercept the service request for the service request sent by the client to the server. If the service request does not need to be redirected, the redirection processing device releases the service request to perform subsequent service processing on the service request, and the process is not described in detail. If the service request needs to be redirected, the redirection processing device determines that the service request needs to be redirected, determines the number of redirections corresponding to the service request, and determines whether the redirection number reaches a preset threshold.
  • Step 102 The redirection processing device interrupts the redirection of the service request, and after the redirection of the service request is interrupted, the redirection processing device continues to redirect the service request to the destination address.
  • step 103 the redirect processing device directly redirects the service request to the destination address.
  • the redirection processing device needs to store the correspondence between the service identifier corresponding to the service request and the number of redirections in the memory; wherein the initial value of the redirection number is 0. Based on this, when the service request needs to be redirected, the redirection processing device determines the service identifier corresponding to the service request, and obtains the service identifier by querying the correspondence between the service identifier and the redirection number stored in the memory. Corresponding redirection times, and determining that the redirection number is the number of redirections corresponding to the service request, and then determining whether the redirection number reaches a preset threshold.
  • the redirecting processing device redirects the service request to the destination address, the service identifier corresponding to the service request needs to be determined, and the number of redirects corresponding to the service identifier is increased by one in the memory.
  • the redirection processing device interrupts the redirection of the service request, the service identifier corresponding to the service request needs to be determined, and the number of redirection times corresponding to the service identifier is cleared in the memory.
  • the redirection processing device interrupts the redirection of the service request, and continues to redirect the service request to the destination address after the redirection of the service request, including but not limited to the following:
  • the device temporarily inserts the intermediate page to interrupt the continuous redirect corresponding to the service request through the intermediate page; further, the redirect processing device continues to redirect the service request to the destination address after interrupting the redirect of the service request by inserting the intermediate page.
  • the intermediate page includes, but is not limited to, a 200 OK page (for returning an acknowledgment to the client).
  • the redirect processing device temporarily inserts an intermediate page to interrupt the continuous redirect corresponding to the service request by inserting the intermediate page, and after the intermediate page is refreshed, the redirect processing device can continue to redirect the service request to the destination address. , that is, redirect to a subsequent page or URL (Uniform Resource Locator) address, and then let the business continue.
  • URL Uniform Resource Locator
  • the head (header) of the HTML (Hyper Text Markup Language) of the middle page includes a method for enabling the redirect processing device to continue to redirect the service request to the destination address after inserting the intermediate page.
  • the preset instruction in particular, the preset instruction may be a piece of code, and the code may carry a destination address that the service request needs to be redirected.
  • the http-equiv attribute is refresh to indicate that the code is used to automatically refresh the page.
  • the content attribute is 0 to indicate that the page content is empty, and the nextUrl is for the purpose of redirecting the service request. address.
  • the intermediate page may interrupt the continuous redirection corresponding to the service request.
  • the automatic refresh of the intermediate page can be implemented based on the http-equiv attribute in the preset instruction being refresh. After the automatic refresh, based on the inside of the nextUrl in the preset instruction, the redirection processing device can continue to redirect the service request to the destination address, that is, redirect to the subsequent page or URL address, and continue to perform subsequent services.
  • the redirection processing device interrupts the redirection of the service request, and continues to redirect the service request to the destination address after the redirection of the service request, including but not limited to the following:
  • the device instructs the continuous 302 to redirect the interrupt mode configured in the method pool, and interrupts the continuous redirect corresponding to the service request by using the interrupt mode; after interrupting the redirect of the service request by the interrupt mode, the service request is redirected to the destination address;
  • the continuous 302 redirect method pool is configured with an interrupt mode for interrupting the service request.
  • the redirection processing device when the number of redirections does not reach the preset threshold, if there is an error processing caused by the number of redirection times of the service request exceeding a preset threshold (such as a browser output 404 error), the redirection processing device is configured.
  • the preset threshold is too large. Based on this, the redirection processing device needs to adjust the preset threshold configured on the redirection processing device.
  • the redirection processing device needs to determine the service identifier corresponding to the service request, and query the memory for the current redirection number of the service identifier. Then, the redirection processing device adjusts the preset threshold configured on the redirection processing device to the number of redirections currently corresponding to the service identifier.
  • the redirection processing device needs to clear the number of redirections corresponding to the service identifier in the memory.
  • the redirection includes, but is not limited to, 302 redirection.
  • the embodiment of the present application has at least the following advantages:
  • the redirection processing device determines whether the redirection number reaches a preset threshold, and the number of redirections When the preset threshold is reached, the redirection of the service request is interrupted, and after the service request is redirected, the service request is redirected to the destination address, thereby avoiding the error caused by the number of times that the 302 redirection exceeds the limit of the browser. Processing (such as 404 errors), and then avoid business interruptions and business failures, improve the business experience and user experience.
  • the second embodiment of the present application provides a method for processing continuous redirection, which is applied to a network including a client, a server, and a redirection processing device, and the network may be a large website or a distributed system.
  • the redirection processing device can be deployed as a functional module on the server, and the redirection processing device can also be a separate device in the network.
  • the redirection processing device is configured to process a redirection process of the service request. For example, when a client (browser) sends a service request (ie, a WEB service request) to the server, the service request is sent to address A.
  • the subsequent redirection process is processed by the redirection processing device, for example, the redirection processing device redirects the service request to the address B, and then the redirection processing device redirects the service request. To address C, the redirect processing device then redirects the service request to address D, and so on.
  • the redirection processing device may specifically include the following functional modules: 302 redirection detection module, decision control module, and continuous 302 redirection method pool. , data cache module, configuration module.
  • the function modules in the redirection processing device may be integrated into one or may be deployed separately. Each function module can be combined into one module, or can be further split into multiple sub-modules.
  • the 302 redirect detection module is primarily responsible for intercepting 302 redirect requests. For the non-302 redirect, the 302 redirect detection module directly releases and continues to perform subsequent business operations. For the 302 redirection, if the 302 redirection detection module finds that there is a 302 redirection, the 302 redirection related information (such as a redirect address, etc.) is synchronized to the decision control module.
  • the decision control module is responsible for the linkage 302 redirection detection module, the continuous 302 redirection method pool, the data cache module, and the configuration module.
  • the decision control module receives the 302 redirection information of the 302 redirection detection module, and calculates whether there is a continuous 302 redirection according to the data caching module and the related information of the configuration module, and whether the number of consecutive 302 redirection times reaches the configured browsing. The maximum number of times. If the maximum number of browsers is reached, the decision control module invokes the method in the continuous 302 redirect method pool for corresponding processing. If the number of 302 redirects has not reached the maximum number of browsers before the 404 error has occurred, the decision control module is responsible for recording the alarm information and refreshing the memory in the data cache module by calling the configuration module to modify the maximum number of browsers.
  • Continuous 302 redirect method pool When there is a continuous 302 redirection, and the decision control module knows that the number of consecutive 302 redirections reaches the maximum number of browsers, the continuous 302 redirection method pool provides a method for the decision control module, and the decision control module calls consecutive 302 The methods in the directed method pool are processed accordingly.
  • the continuous 302 redirect method pool can be configured with multiple processing methods, and the application can select the processing method according to the actual situation.
  • the method configured in the continuous 302 redirect method pool includes: temporarily inserting an intermediate page, returning 200, interrupting the continuous 302 redirect, and redirecting to a subsequent web page or URL address after refreshing, and letting the business continue. Enter In one step, the continuous 302 redirect method pool also needs to provide functions such as adding, deleting, and modifying processing methods.
  • Data cache module It is mainly responsible for the configuration information of the cached application, such as the maximum number of cached browsers and the number of redirects corresponding to the service identifier. Further, the data cache module needs to provide a function such as timeout release of the cache, that is, after the configuration information is timed out (for example, the data is cached for 24 hours), the data cache module needs to delete the cached configuration information.
  • Configuration module Based on this configuration module, the application configures the number of times that the corresponding browser can continuously jump 302 according to its own service. Based on this configuration module, when the number of consecutive 302 hops reaches the configured value, the corresponding solution is configured, that is, the method in the continuous 302 redirection method pool is configured. Further, the configuration module also needs to provide functions such as adding, deleting, and modifying configuration information.
  • the method for processing continuous redirection includes the following steps:
  • Step 301, 302 redirects the detection module to intercept all service requests that need to be redirected to the destination address, and sends a service request that needs to be redirected to the destination address to the decision control module.
  • the 302 redirect detection module in the process of redirecting the service request (ie, the WEB service request) 302 to the destination address, the 302 redirect detection module needs to intercept all service requests that need to be redirected to the destination address. Based on this, for the service request sent by the client to the server, the 302 redirect detection module needs to intercept the service request. If the service request does not need to perform the 302 redirection process, the 302 redirection detection module releases the service request to perform subsequent service processing on the service request, and the process is not described in detail.
  • the 302 redirection detection module determines that the service request 302 needs to be redirected, and sends a service request that needs to be redirected to the destination address to the decision control module for subsequent processing.
  • Step 302 The decision control module determines the number of redirections corresponding to the service request, and determines whether the redirection number reaches a preset threshold (that is, the maximum number of browsers configured by the configuration module). If the preset threshold is not reached, step 303 is performed; if the preset threshold is reached, step 304 is performed.
  • the preset threshold is the maximum number of consecutive 302 redirects that are acceptable to the browser configured by the configuration module.
  • the data cache module needs to store the service corresponding to the service request in the memory.
  • the decision control module needs to determine the service identifier corresponding to the service request, and obtain the service by querying the correspondence between the service identifier and the number of redirects stored in the memory.
  • the number of redirects is determined, and the number of redirects is determined by the number of redirects corresponding to the service request, and then the number of redirects reaches a preset threshold.
  • the data cache module needs to store the correspondence between the service identifier corresponding to the service request and the number of redirections in the memory. Each time the service request 302 is redirected to the destination address, the data cache module needs to determine the service corresponding to the service request. ID, plus 1 for the number of redirects corresponding to the service ID in memory. When the 302 redirection of the service request is interrupted, the data caching module needs to determine the service identifier corresponding to the service request, and clear the number of redirection times corresponding to the service identifier in the memory.
  • step 303 the decision control module directly redirects the service request 302 to the destination address.
  • the decision control module notifies 302 that the redirect detection module continues to monitor 302 the redirect, ie, step 301 is performed.
  • Step 304 The decision control module invokes the method provided in the pool 302 redirect method pool to interrupt the 302 redirect of the service request by using the method provided in the continuous 302 redirect method pool, and continues after the 302 redirect of the interrupt service request.
  • the service request 302 is redirected to the destination address.
  • the decision control module notifies 302 that the redirect detection module continues to monitor 302 the redirect, ie, step 301 is performed.
  • the decision control module interrupts the 302 redirect of the service request, and after the 302 redirect of the interrupt service request, continues to redirect the service request 302 to the destination address, specifically including
  • the method is not limited to the following: the decision control module temporarily inserts an intermediate page to interrupt the continuous 302 redirection of the service request through the intermediate page; further, the decision control module determines the control module after interrupting the 302 request to interrupt the service request by inserting the intermediate page.
  • the service request 302 can continue to be redirected to the destination address.
  • the intermediate page includes but is not limited to a 200 OK page.
  • Decision control module through temporary insertion Enter an intermediate page to interrupt the 302 consecutive redirects corresponding to the service request through the intermediate page, and after the intermediate page is refreshed, the decision control module can continue to redirect the service request 302 to the destination address, ie, 302 redirects to subsequent The page or URL address, which in turn allows the business to proceed.
  • the intermediate page can interrupt the continuous 302 redirection corresponding to the service request, and implement automatic refresh of the intermediate page, and cause the decision control module to continue to redirect the service request 302 to the destination address and continue to perform subsequent services.
  • the decision control module needs to re-adjust the preset threshold of the data cache module cache. In the process of adjusting the preset threshold, the decision control module needs to determine the service identifier corresponding to the service request, and query the memory for the current number of redirects corresponding to the service identifier.
  • the decision control module adjusts the preset threshold of the data cache module cache to the current number of redirects corresponding to the service identifier. Further, if there is an error processing caused by the number of times the redirection of the service request exceeds a preset threshold (such as a browser output 404 error), the decision control module needs to clear the number of redirections corresponding to the service identifier in the memory.
  • a preset threshold such as a browser output 404 error
  • the embodiment of the present application has at least the following advantages:
  • the decision control module determines whether the redirection number reaches a preset threshold, and the number of redirections.
  • the preset threshold is reached, the 302 redirect of the service request is interrupted, and after the 302 redirect of the interrupt service request, the service request 302 is redirected to the destination address, thereby avoiding the number of 302 redirects exceeding the limit of the browser limit.
  • the resulting error handling which in turn avoids business interruptions and business failures, improves the business experience and user experience.
  • the redirection is described by using 302 redirection.
  • the redirection is not limited thereto.
  • the embodiment of the present application further provides a redirection processing device.
  • the redirection processing device specifically includes:
  • the determining module 11 is configured to determine, according to the service request that needs to perform the redirection process, the number of redirections corresponding to the service request;
  • the determining module 12 is configured to determine whether the number of redirects reaches a preset threshold
  • the processing module 13 is configured to interrupt the redirect of the service request when the number of redirects reaches a preset threshold, and continue to redirect the service request to the destination address after interrupting the redirect of the service request ;
  • the service request is redirected to the destination address.
  • the processing module 13 is specifically configured to temporarily insert an intermediate page to interrupt the continuous redirection corresponding to the service request by inserting the intermediate page; after interrupting the redirection of the service request by inserting the intermediate page, continue Redirect the service request to the destination address.
  • the header of the hypertext markup language HTML of the intermediate page includes a preset instruction for implementing to redirect the service request to the destination address after inserting the intermediate page, and the preset instruction is The destination address that the service request needs to be redirected may be carried.
  • the preset instruction may specifically be a program code.
  • the processing module 13 is specifically configured to invoke an interrupt mode configured in the pool of the 302 redirect method, and interrupt the continuous redirect corresponding to the service request by using the interrupt mode; interrupting the service request by using the interrupt mode After the redirecting, the service request is redirected to the destination address; wherein the continuous 302 redirect method pool is configured with an interrupt mode for interrupting the redirect of the service request.
  • the determining module 11 is further configured to store, in the memory, a correspondence between a service identifier corresponding to the service request and a redirection number; wherein, the initial value of the redirection number is 0;
  • the service identifier corresponding to the service request is determined, and the number of redirects corresponding to the service identifier is incremented by one in the memory;
  • the service identifier corresponding to the service request is determined, and the number of redirects corresponding to the service identifier is cleared in the memory.
  • the determining module 11 is further configured to: when the number of redirection times does not reach a preset threshold, if an operation request occurs that the number of redirection times exceeds a preset threshold, the service identifier corresponding to the service request is determined, And querying, in the memory, the number of redirects corresponding to the service identifier;
  • the preset threshold is adjusted to the number of redirections corresponding to the service identifier, and the number of redirections corresponding to the service identifier is cleared in the memory.
  • the determining module 11 is further configured to intercept all service requests in the process of redirecting the service request to the destination address before receiving the service request that needs to be redirected, so as to select from all the service requests. Redirect the processed business request.
  • the redirection specifically includes 302 redirection.
  • the modules of the device of the present application may be integrated into one or may be deployed separately.
  • the above modules can be combined into one module, or can be further split into multiple sub-modules.
  • modules in the apparatus in the embodiments may be distributed in the apparatus of the embodiment according to the description of the embodiments, or the corresponding changes may be located in one or more apparatuses different from the embodiment.
  • the modules of the above embodiments may be combined into one module, or may be further split into multiple sub-modules.
  • the serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
  • the above disclosure is only a few specific embodiments of the present application, but the present application is not limited thereto, and any changes that can be made by those skilled in the art should fall within the protection scope of the present application.

Landscapes

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

Abstract

本申请公开了一种处理连续重定向的方法和装置,该方法包括:在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数,并判断所述重定向次数是否达到预设阈值;如果是,则中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;如果否,则将所述业务请求重定向到目的地址。本申请实施例中,重定向处理装置可以避免302重定向的次数超过浏览器限制的次数所导致的报错处理(如404错误),继而避免业务发生中断以及业务失败,提高业务体验和用户使用感受。

Description

一种处理连续重定向的方法和装置 技术领域
本申请涉及互联网领域,尤其是涉及一种处理连续重定向的方法和装置。
背景技术
在大型网站或者分布式***中,客户端(浏览器)向服务器发送业务请求时,该业务请求被发送至地址A,之后该业务请求被服务器302重定向到地址B,之后该业务请求被服务器302重定向到地址C,之后该业务请求被服务器302重定向到地址D,以此类推,该业务请求可能被多次进行302重定向。
但是,浏览器对于302重定向的次数是有限制的,如果302重定向的次数超过限制的次数,则浏览器会进行报错处理,如输出404错误。此时,业务将无法继续进行,即业务将发生中断,从而影响用户的业务体验。
发明内容
本申请实施例提供一种处理连续重定向的方法和装置,可避免重定向中重定向的次数超过限制的次数导致的报错处理。
本申请实施例提供一种处理连续重定向的方法,包括:
在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数,并判断所述重定向次数是否达到预设阈值;
如果是,则中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;
如果否,则将所述业务请求重定向到目的地址。
所述中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址的过程,具体包括:
临时***中间页面,以通过***所述中间页面中断所述业务请求对应的连续重定向;在通过***所述中间页面中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址。
所述中间页面的超文本标记语言HTML的头head中包括了用于实现在***所述中间页面之后,继续将所述业务请求重定向到目的地址的预设指令。
所述中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址的过程,具体包括:
调用连续302重定向方法池内配置的中断方式,并通过所述中断方式中断所述业务请求对应的连续重定向;在通过所述中断方式中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;其中,所述连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
所述方法进一步包括:在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系;其中,所述重定向次数的初始值为0;
每次将业务请求重定向到目的地址时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数加1;
在中断业务请求的重定向时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数清零。
所述方法进一步包括:当所述重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理,则确定所述业务请求对应的业务标识,并在内存中查询所述业务标识对应的重定向次数;
将所述预设阈值调整为所述业务标识对应的重定向次数,并在内存中将所述业务标识对应的重定向次数清零。
所述在接收到需要进行重定向处理的业务请求之前,所述方法进一步包括:在将业务请求重定向到目的地址的过程中,拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。
所述重定向具体包括302重定向。
本申请实施例提供一种重定向处理装置,所述重定向处理装置包括:
确定模块,用于在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数;
判断模块,用于判断所述重定向次数是否达到预设阈值;
处理模块,用于当所述重定向次数达到预设阈值时,中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;
当所述重定向次数未达到预设阈值时,将所述业务请求重定向到目的地址。
所述处理模块,具体用于临时***中间页面,以通过***所述中间页面中断所述业务请求对应的连续重定向;在通过***所述中间页面中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址。
所述中间页面的超文本标记语言HTML的头head中包括了用于实现在***所述中间页面之后,继续将所述业务请求重定向到目的地址的预设指令。
所述处理模块,具体用于调用连续302重定向方法池内配置的中断方式,并通过所述中断方式中断所述业务请求对应的连续重定向;在通过所述中断方式中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;其中,所述连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
所述确定模块,进一步用于在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系;其中,所述重定向次数的初始值为0;
每次将业务请求重定向到目的地址时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数加1;
在中断业务请求的重定向时,确定所述业务请求对应的业务标识,并在 内存中将所述业务标识对应的重定向次数清零。
所述确定模块,进一步用于当所述重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理,则确定所述业务请求对应的业务标识,并在内存中查询所述业务标识对应的重定向次数;
将所述预设阈值调整为所述业务标识对应的重定向次数,并在内存中将所述业务标识对应的重定向次数清零。
所述确定模块,进一步用于在接收到需要进行重定向处理的业务请求之前,在将业务请求重定向到目的地址的过程中,拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。
所述重定向具体包括302重定向。
本申请实施例中,在对业务请求进行重定向处理之前,重定向处理装置通过判断重定向次数是否达到预设阈值,并在重定向次数达到预设阈值时,中断业务请求的重定向,并在中断业务请求的重定向之后,继续将业务请求重定向到目的地址,从而避免重定向的次数超过浏览器限制的次数所导致的报错处理(如404错误),继而避免业务发生中断以及业务失败,提高业务体验和用户使用感受。
附图说明
为了更加清楚地说明本申请实施例的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据本申请实施例的这些附图获得其他的附图。
图1是本申请实施例一提供的一种处理连续重定向的方法流程示意图;
图2是本申请实施例二提供的一种重定向处理装置的结构示意图;
图3是本申请实施例二提供的一种处理连续重定向的方法流程示意图;
图4是本申请实施例三提供的一种重定向处理装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例一
针对现有技术中存在的问题,本申请实施例一提供的一种处理连续重定向的方法,应用于包括客户端、服务器和重定向处理装置的网络中,该网络可以为大型网站或者分布式***。重定向处理装置可以作为功能模块部署在服务器上,重定向处理装置也可以在网络中作为单独的设备。本申请实施例中,重定向处理装置用于对业务请求的重定向过程进行处理。例如,客户端(浏览器)向服务器发送业务请求(即WEB业务请求)时,该业务请求被发送至地址A。之后的重定向过程均由重定向处理装置进行处理,如重定向处理装置将该业务请求重定向到地址B,之后重定向处理装置将该业务请求重定向到地址C,之后重定向处理装置将该业务请求重定向到地址D,以此类推。
在上述应用场景下,如图1所示,处理连续重定向的方法包括以下步骤:
步骤101,在接收到需要进行重定向处理的业务请求时,重定向处理装置确定业务请求对应的重定向次数,并判断重定向次数是否达到预设阈值。如果达到预设阈值,则执行步骤102;如果未达到预设阈值,则执行步骤103。
本申请实施例中,预设阈值可以是重定向处理装置基于浏览器对于重定向的次数的限制进行设置的。例如,当重定向的次数超过5次浏览器会进行报错处理时,则重定向处理装置可以将预设阈值设置为4次(5-1)。
本申请实施例中,在服务器将业务请求重定向到目的地址的过程中,重 定向处理装置拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。基于此,对于客户端发送给服务器的业务请求,重定向处理装置需要对该业务请求进行拦截。如果该业务请求不需要进行重定向处理,则重定向处理装置放行该业务请求,以对该业务请求执行后续业务处理,该处理不再详加赘述。如果该业务请求需要进行重定向处理,则重定向处理装置确定需要对业务请求进行重定向处理,确定业务请求对应的重定向次数,并判断重定向次数是否达到预设阈值。
步骤102,重定向处理装置中断业务请求的重定向,并在中断业务请求的重定向之后,重定向处理装置继续将业务请求重定向到目的地址。
步骤103,重定向处理装置直接将业务请求重定向到目的地址。
本申请实施例中,重定向处理装置需要在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系;其中,重定向次数的初始值为0。基于此,在需要对业务请求进行重定向处理时,重定向处理装置确定该业务请求对应的业务标识,并通过查询内存中存储的业务标识与重定向次数之间的对应关系,可以获得业务标识对应的重定向次数,并确定该重定向次数为业务请求对应的重定向次数,继而判断重定向次数是否达到预设阈值。
进一步的,重定向处理装置每次将业务请求重定向到目的地址时,均需要确定该业务请求对应的业务标识,并在内存中将该业务标识对应的重定向次数加1。重定向处理装置在中断业务请求的重定向时,需要确定该业务请求对应的业务标识,并在内存中将该业务标识对应的重定向次数清零。
本申请实施例中,重定向处理装置中断业务请求的重定向,并在中断业务请求的重定向之后,继续将业务请求重定向到目的地址的过程,具体包括但不限于如下方式:重定向处理装置临时***中间页面,以通过中间页面中断业务请求对应的连续重定向;进一步的,重定向处理装置在通过***中间页面中断业务请求的重定向之后,继续将业务请求重定向到目的地址。
其中,该中间页面包括但不限于200OK页面(用于向客户端返回确认)。
其中,重定向处理装置通过临时***一个中间页面,以通过***中间页面中断业务请求对应的连续重定向,并在中间页面被刷新后,可以使重定向处理装置继续将业务请求重定向到目的地址,即重定向至后续的页面或URL(Uniform Resource Locator,统一资源定位符)地址,继而让业务继续进行。
其中,中间页面的HTML(Hyper Text Markup Language,超文本标记语言)的head(头)中包括了用于实现在***中间页面之后,使重定向处理装置能够继续将业务请求重定向到目的地址的预设指令,具体地,该预设指令可以是一段代码,且该代码中可携带有业务请求需要重定向的目的地址。其中,该代码具体包括但不限于如下代码:<meta http-equiv="refresh"content="0;url=nextUrl">;meta用来描述该代码的属性,且该meta共有两个属性,这两个属性分别是http-equiv属性和content属性,http-equiv属性为refresh表示该代码用于对页面进行自动刷新,该content属性为0表示页面内容为空,nextUrl为业务请求需要重定向的目的地址。基于此预设指令,在***该预设指令对应的中间页面之后,中间页面可以中断业务请求对应的连续重定向。基于该预设指令中的http-equiv属性为refresh,可以实现中间页面的自动刷新。在自动刷新之后,基于该预设指令中的nextUrl的内,可以使重定向处理装置继续将业务请求重定向到目的地址,即重定向至后续的页面或URL地址,并继续执行后续业务。
本申请实施例中,重定向处理装置中断业务请求的重定向,并在中断业务请求的重定向之后,继续将业务请求重定向到目的地址的过程,具体包括但不限于如下方式:重定向处理装置调用连续302重定向方法池内配置的中断方式,并通过该中断方式中断业务请求对应的连续重定向;在通过中断方式中断业务请求的重定向之后,继续将业务请求重定向到目的地址;其中,连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
本申请实施例中,当重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理(如浏览器输出404错误),则说明重定向处理装置上配置的预设阈值过大。基于此,重定向处理装置需要调整本重定向处理装置上配置的预设阈值。在调整预设阈值的过程中,重定向处理装置需要确定业务请求对应的业务标识,并在内存中查询业务标识当前对应的重定向次数。之后,重定向处理装置将本重定向处理装置上配置的预设阈值调整为业务标识当前对应的重定向次数。进一步的,如果有业务请求发生重定向次数超过预设阈值导致的报错处理(如浏览器输出404错误),则重定向处理装置还需要在内存中将业务标识对应的重定向次数清零。
本申请实施例中,重定向具体包括但不限于302重定向。
综上所述,本申请实施例至少具有以下优点:本申请实施例中,在对业务请求进行重定向处理之前,重定向处理装置通过判断重定向次数是否达到预设阈值,并在重定向次数达到预设阈值时,中断业务请求的重定向,并在中断业务请求的重定向之后,继续将业务请求重定向到目的地址,从而避免302重定向的次数超过浏览器限制的次数所导致的报错处理(如404错误),继而避免业务发生中断以及业务失败,提高业务体验和用户使用感受。
实施例二
在一种具体应用下,本申请实施例二提供一种处理连续重定向的方法,该方法应用于包括客户端、服务器和重定向处理装置的网络中,该网络可以为大型网站或者分布式***。重定向处理装置可以作为功能模块部署在服务器上,重定向处理装置也可以在网络中作为单独的设备。本申请实施例中,重定向处理装置用于对业务请求的重定向过程进行处理。例如,客户端(浏览器)向服务器发送业务请求(即WEB业务请求)时,该业务请求被发送至地址A。之后的重定向过程均由重定向处理装置进行处理,如重定向处理装置将该业务请求重定向到地址B,之后重定向处理装置将该业务请求重定向 到地址C,之后重定向处理装置将该业务请求重定向到地址D,以此类推。
本申请实施例中,如图2所示,为重定向处理装置的一种结构示意图,重定向处理装置具体可以包括以下功能模块:302重定向检测模块、决策控制模块、连续302重定向方法池、数据缓存模块、配置模块。其中,重定向处理装置中的各个功能模块可以集成于一体,也可以分离部署。各个功能模块可以合并为一个模块,也可以进一步拆分成多个子模块。
(1)302重定向检测模块。302重定向检测模块主要负责拦截302重定向请求。对于非302重定向,302重定向检测模块直接放行,继续执行后续业务操作。对于302重定向,302重定向检测模块如果发现有302重定向时,则将该302重定向的相关信息(如重定向地址等)同步给决策控制模块。
(2)决策控制模块。决策控制模块负责联动302重定向检测模块、连续302重定向方法池、数据缓存模块、配置模块。决策控制模块接收302重定向检测模块的302重定向信息,根据数据缓存模块和配置模块的相关信息,计算出是否有连续的302重定向,以及连续的302重定向的次数是否达到了配置的浏览器最大次数。如果达到了浏览器最大次数,则决策控制模块调用连续302重定向方法池中的方法进行相应处理。如果302重定向的次数未达到浏览器最大次数之前,已经出现了404错误,决策控制模块负责记录报警信息,并通过调用配置模块修改浏览器最大次数,刷新数据缓存模块中的内存。
(3)连续302重定向方法池。当有连续的302重定向,且决策控制模块获知连续的302重定向的次数达到了浏览器最大次数,则由连续302重定向方法池为决策控制模块提供方法,由决策控制模块调用连续302重定向方法池中的方法进行相应处理。其中,连续302重定向方法池可以配置多个处理方法,应用根据实际情况,可自行选择处理方法。例如,连续302重定向方法池中配置的方法包括:临时***一个中间页面,返回200,中断连续302重定向,并且刷新后重定向至后续的网页或URL地址,并让业务继续进行。进 一步的,连续302重定向方法池还需要提供处理方法的增、删、改等功能。
(4)数据缓存模块。主要负责缓存应用的配置信息,如缓存浏览器最大次数、业务标识对应的重定向次数等配置信息。进一步的,数据缓存模块还需要提供缓存的超时释放等功能,即在配置信息被缓存的时间超时(如数据被缓存了24小时)之后,数据缓存模块需要将缓存的配置信息删除。
(5)配置模块。基于此配置模块,应用根据自身的业务,配置相应浏览器可连续302跳转的次数。基于此配置模块,连续302跳转的次数达到配置的数值时,配置相应的解决方法,即配置连续302重定向方法池中的方法。进一步的,配置模块还需要提供配置信息的增、删、改等功能。
在上述应用场景下,如图3所示,处理连续重定向的方法包括以下步骤:
步骤301,302重定向检测模块拦截所有需要302重定向到目的地址的业务请求,并将需要302重定向到目的地址的业务请求发送给决策控制模块。
本申请实施例中,在服务器将业务请求(即WEB业务请求)302重定向到目的地址的过程中,302重定向检测模块需要拦截所有需要302重定向到目的地址的业务请求。基于此,对于客户端发送给服务器的业务请求,302重定向检测模块需要对该业务请求进行拦截。如果该业务请求不需要进行302重定向处理,则302重定向检测模块放行该业务请求,以对该业务请求执行后续业务处理,该处理不再详加赘述。如果该业务请求需要进行302重定向处理,则302重定向检测模块确定需要对业务请求进行302重定向处理,并将需要302重定向到目的地址的业务请求发送给决策控制模块进行后续处理。
步骤302,决策控制模块确定业务请求对应的重定向次数,并判断该重定向次数是否达到预设阈值(即通过配置模块配置的浏览器最大次数)。如果未达到预设阈值,则执行步骤303;如果达到预设阈值,则执行步骤304。其中,预设阈值是通过配置模块配置的浏览器可接受的最大连续302重定向次数。
本申请实施例中,数据缓存模块需要在内存中存储业务请求对应的业务 标识与重定向次数之间的对应关系;其中,重定向次数的初始值可以为0。基于此,在需要对业务请求进行302重定向处理时,决策控制模块需要确定该业务请求对应的业务标识,并通过查询内存中存储的业务标识与重定向次数之间的对应关系,可以获得业务标识对应的重定向次数,并确定该重定向次数为业务请求对应的重定向次数,继而判断出重定向次数是否达到预设阈值。
数据缓存模块需要在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系,在每次将业务请求302重定向到目的地址时,数据缓存模块均需要确定该业务请求对应的业务标识,在内存中将该业务标识对应的重定向次数加1。在中断业务请求的302重定向时,数据缓存模块需要确定该业务请求对应的业务标识,在内存中将该业务标识对应的重定向次数清零。
步骤303,决策控制模块直接将业务请求302重定向到目的地址。决策控制模块通知302重定向检测模块继续监测302重定向,即执行步骤301。
步骤304,决策控制模块调用连续302重定向方法池中提供的方法,以利用连续302重定向方法池中提供的方法中断业务请求的302重定向,并在中断业务请求的302重定向之后,继续将业务请求302重定向到目的地址。决策控制模块通知302重定向检测模块继续监测302重定向,即执行步骤301。
假设连续302重定向方法池中提供的方法是:临时***一个中间页面,返回200OK,中断连续302重定向,并且刷新后302重定向至后续的页面或URL地址,并让业务继续进行。则基于连续302重定向方法池中提供的方法,决策控制模块中断业务请求的302重定向,在中断业务请求的302重定向后,继续将业务请求302重定向到目的地址的过程,具体包括但不限于如下方式:决策控制模块临时***一个中间页面,以通过中间页面中断业务请求的连续302重定向;进一步的,决策控制模块在通过***中间页面中断业务请求的302重定向之后,决策控制模块可以继续将业务请求302重定向到目的地址。
其中,该中间页面包括但不限于200OK页面。决策控制模块通过临时插 入一个中间页面,以通过中间页面中断业务请求对应的302连续重定向,并且在中间页面被刷新之后,可以使决策控制模块继续将业务请求302重定向到目的地址,即302重定向至后续的页面或URL地址,继而让业务继续进行。
其中,中间页面的HTML的head中可以包括如下代码,且该代码用于实现在***一个中间页面之后,使决策控制模块能够继续将业务请求302重定向到目的地址;<meta http-equiv="refresh"content="0;url=nextUrl">;nextUrl为业务请求需要302重定向的目的地址。基于此代码,中间页面可以中断业务请求对应的连续302重定向,并实现中间页面的自动刷新,并使决策控制模块继续将业务请求302重定向到目的地址,并继续执行后续业务。
本申请实施例中,当重定向次数未达到预设阈值时(即还没有达到配置的最大302重定向次数),如果有业务请求发生重定向次数超过预设阈值(即浏览器可接受的最大连续302重定向次数)导致的报错处理(如浏览器输出404错误),则说明通过配置模块配置的预设阈值过大。基于此,决策控制模块需要重新调整数据缓存模块缓存的预设阈值。在调整预设阈值的过程中,决策控制模块需要确定业务请求对应的业务标识,并在内存中查询业务标识当前对应的重定向次数。之后,决策控制模块将数据缓存模块缓存的预设阈值调整为业务标识当前对应的重定向次数。进一步的,如果有业务请求发生重定向次数超过预设阈值导致的报错处理(如浏览器输出404错误),则决策控制模块还需要在内存中将业务标识对应的重定向次数清零。
综上所述,本申请实施例至少具有以下优点:本申请实施例中,在对业务请求进行302重定向处理之前,决策控制模块通过判断重定向次数是否达到预设阈值,并在重定向次数达到预设阈值时,中断业务请求的302重定向,并在中断业务请求的302重定向之后,继续将业务请求302重定向到目的地址,从而避免302重定向的次数超过浏览器限制的次数所导致的报错处理,继而避免业务发生中断以及业务失败,提高业务体验和用户使用感受。
本申请实施例中,所述的重定向是以302重定向来进行说明,实际应用中,可不局限于此。
实施例三
基于与上述方法同样的申请构思,本申请实施例中还提供了一种重定向处理装置,如图4所示,所述重定向处理装置具体包括:
确定模块11,用于在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数;
判断模块12,用于判断所述重定向次数是否达到预设阈值;
处理模块13,用于当所述重定向次数达到预设阈值时,中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;
当所述重定向次数未达到预设阈值时,将所述业务请求重定向到目的地址。
所述处理模块13,具体用于临时***中间页面,以通过***所述中间页面中断所述业务请求对应的连续重定向;在通过***所述中间页面中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址。
所述中间页面的超文本标记语言HTML的头head中包括了用于实现在***所述中间页面之后,继续将所述业务请求重定向到目的地址的预设指令,且所述预设指令中可携带有所述业务请求需要重定向的所述目的地址。该预设指令具体可以是程序代码。
所述处理模块13,具体用于调用连续302重定向方法池内配置的中断方式,并通过所述中断方式中断所述业务请求对应的连续重定向;在通过所述中断方式中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;其中,所述连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
所述确定模块11,进一步用于在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系;其中,所述重定向次数的初始值为0;
每次将业务请求重定向到目的地址时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数加1;
在中断业务请求的重定向时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数清零。
所述确定模块11,进一步用于当所述重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理,则确定所述业务请求对应的业务标识,并在内存中查询所述业务标识对应的重定向次数;
将所述预设阈值调整为所述业务标识对应的重定向次数,并在内存中将所述业务标识对应的重定向次数清零。
所述确定模块11,进一步用于在接收到需要进行重定向处理的业务请求之前,在将业务请求重定向到目的地址的过程中,拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。
本申请实施例中,所述重定向具体包括302重定向。
其中,本申请装置的各个模块可以集成于一体,也可以分离部署。上述模块可以合并为一个模块,也可以进一步拆分成多个子模块。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。本领域技术人员可以理解附图只是一个优选实施例的示意图,附图中的模块或流程并不一定是实施本申请所必须的。 本领域技术人员可以理解实施例中的装置中的模块可以按照实施例描述进行分布于实施例的装置中,也可以进行相应变化位于不同于本实施例的一个或多个装置中。上述实施例的模块可以合并为一个模块,也可以进一步拆分成多个子模块。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上公开的仅为本申请的几个具体实施例,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。

Claims (16)

  1. 一种处理连续重定向的方法,其特征在于,包括:
    在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数,并判断所述重定向次数是否达到预设阈值;
    如果是,则中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;
    如果否,则将所述业务请求重定向到目的地址。
  2. 如权利要求1所述的方法,其特征在于,
    所述中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址的过程,具体包括:
    临时***中间页面,以通过***所述中间页面中断所述业务请求对应的连续重定向;在通过***所述中间页面中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址。
  3. 如权利要求2所述的方法,其特征在于,
    所述中间页面的超文本标记语言HTML的头head中包括了用于实现在***所述中间页面之后,继续将所述业务请求重定向到目的地址的预设指令。
  4. 如权利要求1所述的方法,其特征在于,
    所述中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址的过程,具体包括:
    调用连续302重定向方法池内配置的中断方式,并通过所述中断方式中断所述业务请求对应的连续重定向;在通过所述中断方式中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;其中,所述连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:
    在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系; 其中,所述重定向次数的初始值为0;
    每次将业务请求重定向到目的地址时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数加1;
    在中断业务请求的重定向时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数清零。
  6. 如权利要求5所述的方法,其特征在于,所述方法进一步包括:
    当所述重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理,则确定所述业务请求对应的业务标识,并在内存中查询所述业务标识对应的重定向次数;
    将所述预设阈值调整为所述业务标识对应的重定向次数,并在内存中将所述业务标识对应的重定向次数清零。
  7. 如权利要求1-4任一项所述的方法,其特征在于,所述在接收到需要进行重定向处理的业务请求之前,所述方法进一步包括:
    在将业务请求重定向到目的地址的过程中,拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。
  8. 如权利要求1-4任一项所述的方法,其特征在于,
    所述重定向具体包括302重定向。
  9. 一种重定向处理装置,其特征在于,所述重定向处理装置包括:
    确定模块,用于在接收到需要进行重定向处理的业务请求时,确定所述业务请求对应的重定向次数;
    判断模块,用于判断所述重定向次数是否达到预设阈值;
    处理模块,用于当所述重定向次数达到预设阈值时,中断所述业务请求的重定向,并在中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;
    当所述重定向次数未达到预设阈值时,将所述业务请求重定向到目的地 址。
  10. 如权利要求9所述的重定向处理装置,其特征在于,
    所述处理模块,具体用于临时***中间页面,以通过***所述中间页面中断所述业务请求对应的连续重定向;在通过***所述中间页面中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址。
  11. 如权利要求10所述的重定向处理装置,其特征在于,所述中间页面的超文本标记语言HTML的头head中包括了用于实现在***所述中间页面之后,继续将所述业务请求重定向到目的地址的预设指令。
  12. 如权利要求9所述的重定向处理装置,其特征在于,
    所述处理模块,具体用于调用连续302重定向方法池内配置的中断方式,并通过所述中断方式中断所述业务请求对应的连续重定向;在通过所述中断方式中断所述业务请求的重定向之后,继续将所述业务请求重定向到目的地址;其中,所述连续302重定向方法池内配置了用于中断业务请求的重定向的中断方式。
  13. 如权利要求9-12任一项所述的重定向处理装置,其特征在于,
    所述确定模块,进一步用于在内存中存储业务请求对应的业务标识与重定向次数之间的对应关系;其中,所述重定向次数的初始值为0;
    每次将业务请求重定向到目的地址时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数加1;
    在中断业务请求的重定向时,确定所述业务请求对应的业务标识,并在内存中将所述业务标识对应的重定向次数清零。
  14. 如权利要求13所述的重定向处理装置,其特征在于,
    所述确定模块,进一步用于当所述重定向次数未达到预设阈值时,如果有业务请求发生重定向次数超过预设阈值导致的报错处理,则确定所述业务请求对应的业务标识,并在内存中查询所述业务标识对应的重定向次数;
    将所述预设阈值调整为所述业务标识对应的重定向次数,并在内存中将所述业务标识对应的重定向次数清零。
  15. 如权利要求9-12任一项所述的重定向处理装置,其特征在于,
    所述确定模块,进一步用于在接收到需要进行重定向处理的业务请求之前,在将业务请求重定向到目的地址的过程中,拦截所有业务请求,以从所有业务请求中选择出需要进行重定向处理的业务请求。
  16. 如权利要求9-12任一项所述的重定向处理装置,其特征在于,
    所述重定向具体包括302重定向。
PCT/CN2015/086614 2014-08-22 2015-08-11 一种处理连续重定向的方法和装置 WO2016026400A1 (zh)

Priority Applications (7)

Application Number Priority Date Filing Date Title
SG11201700630RA SG11201700630RA (en) 2014-08-22 2015-08-11 Method and device for processing continuous redirection
JP2017510569A JP6514322B2 (ja) 2014-08-22 2015-08-11 連続的リダイレクションを処理する方法及び装置
PL15834055T PL3185512T3 (pl) 2014-08-22 2015-08-11 Sposób i urządzenie do przetwarzania ciągłego przekierowania
KR1020177004878A KR101970901B1 (ko) 2014-08-22 2015-08-11 연속적 리디렉션을 처리하기 위한 방법 및 디바이스
ES15834055T ES2829832T3 (es) 2014-08-22 2015-08-11 Método y dispositivo para procesar el redireccionamiento continuo
EP15834055.4A EP3185512B8 (en) 2014-08-22 2015-08-11 Method and device for processing continuous redirection
US15/505,418 US10673972B2 (en) 2014-08-22 2015-08-11 Method and device for processing continuous redirection

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410418834.4 2014-08-22
CN201410418834.4A CN105450694B (zh) 2014-08-22 2014-08-22 一种处理连续重定向的方法和装置

Publications (1)

Publication Number Publication Date
WO2016026400A1 true WO2016026400A1 (zh) 2016-02-25

Family

ID=55350192

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086614 WO2016026400A1 (zh) 2014-08-22 2015-08-11 一种处理连续重定向的方法和装置

Country Status (10)

Country Link
US (1) US10673972B2 (zh)
EP (1) EP3185512B8 (zh)
JP (1) JP6514322B2 (zh)
KR (1) KR101970901B1 (zh)
CN (1) CN105450694B (zh)
ES (1) ES2829832T3 (zh)
HK (1) HK1222056A1 (zh)
PL (1) PL3185512T3 (zh)
SG (1) SG11201700630RA (zh)
WO (1) WO2016026400A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112925628A (zh) * 2021-03-29 2021-06-08 建信金融科技有限责任公司 一种服务管理方法和装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106020880B (zh) * 2016-05-17 2019-05-07 珠海豹趣科技有限公司 一种浏览器启动方法、装置及电子设备
US10733376B2 (en) * 2017-03-01 2020-08-04 Google Llc Delivering auto-play media content element from cross origin resources
CN109816453B (zh) * 2019-01-31 2021-04-16 珠海天燕科技有限公司 一种推广资源链接的检测方法及装置
CN110362761B (zh) * 2019-06-27 2023-02-07 上海淇馥信息技术有限公司 一种基于网页地址监听的网页跳转方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098594A (zh) * 2011-02-25 2011-06-15 清华大学 一种基于信息扩散光网络的连接建立信令冲突避免方法
CN102291390A (zh) * 2011-07-14 2011-12-21 南京邮电大学 一种基于云计算平台的防御拒绝服务攻击的方法
CN102870470A (zh) * 2012-06-27 2013-01-09 华为技术有限公司 重定向处理方法、设备及***
CN103019960A (zh) * 2012-12-03 2013-04-03 华为技术有限公司 分布式缓存方法及***

Family Cites Families (37)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5222125A (en) 1991-09-03 1993-06-22 At&T Bell Laboratories System for providing personalized telephone calling features
US5432845A (en) 1992-12-21 1995-07-11 At&T Corp. Post answer telephone call redirection or rerouting
US6820133B1 (en) * 2000-02-07 2004-11-16 Netli, Inc. System and method for high-performance delivery of web content using high-performance communications protocol between the first and second specialized intermediate nodes to optimize a measure of communications performance between the source and the destination
US6829654B1 (en) 2000-06-23 2004-12-07 Cloudshield Technologies, Inc. Apparatus and method for virtual edge placement of web sites
US20020194483A1 (en) 2001-02-25 2002-12-19 Storymail, Inc. System and method for authorization of access to a resource
AU2002232551A1 (en) * 2000-11-08 2002-05-21 Sprint Spectrum L.P. Method and system for providing services in communications networks
US20020078191A1 (en) 2000-12-20 2002-06-20 Todd Lorenz User tracking in a Web session spanning multiple Web resources without need to modify user-side hardware or software or to store cookies at user-side hardware
AU2002338270A1 (en) 2001-04-02 2002-10-15 Akamai Technologies, Inc. Scalable, high performance and highly available distributed storage system for internet content
US6876656B2 (en) * 2001-06-15 2005-04-05 Broadcom Corporation Switch assisted frame aliasing for storage virtualization
US20030093523A1 (en) * 2001-11-15 2003-05-15 Cranor Charles D. Method for associating clients with domain name servers
US7289519B1 (en) 2002-05-01 2007-10-30 Cisco Technology, Inc. Methods and apparatus for processing content requests using domain name service
US7929953B2 (en) 2003-08-05 2011-04-19 Roamware, Inc. Controlling traffic of an inbound roaming mobile station between a first VPMN, a second VPMN and a HPMN
JP2004110094A (ja) 2002-09-13 2004-04-08 Vodafone Kk 移動無線端末装置
US7441026B2 (en) * 2003-07-10 2008-10-21 Sun Microsystems, Inc. System and method for guarding against infinite loops from multi-point redirects in a multi-threaded environment
US20050262253A1 (en) 2004-04-16 2005-11-24 Qiang Li Method and apparatus for a loosely coupled, scalable distributed multimedia streaming system
US7760720B2 (en) 2004-11-09 2010-07-20 Cisco Technology, Inc. Translating native medium access control (MAC) addresses to hierarchical MAC addresses and their use
JP4387962B2 (ja) * 2005-02-18 2009-12-24 株式会社東芝 コンテンツ再生装置、コンテンツ再生方法及びプログラム
US7603696B2 (en) 2005-06-10 2009-10-13 Intel Corporation Hybrid distributed firewall apparatus, systems, and methods
US8850056B2 (en) 2005-08-22 2014-09-30 Oracle America, Inc. Method and system for managing client-server affinity
US8612569B2 (en) * 2005-12-12 2013-12-17 Ebay Inc. Method and system for proxy tracking of third party interactions
US7224642B1 (en) 2006-01-26 2007-05-29 Tran Bao Q Wireless sensor data processing systems
CN101207914B (zh) * 2006-12-21 2010-09-22 华为技术有限公司 进行无线资源控制连接的方法、装置及***
WO2009151667A2 (en) * 2008-03-07 2009-12-17 Citrix Systems, Inc. Systems and methods for content injection
US8217803B2 (en) 2008-04-22 2012-07-10 Srd Innovations Inc. Wireless data acquisition network and operating methods
BRPI0822632B1 (pt) * 2008-05-12 2020-10-20 Telecom Italia S.P.A. método para fornecer um serviço para usuários em uma rede de telecomunicações, controlador de recurso de comunicações para uma rede de telecomunicações, rede de telecomunicações, e, meio de armazenamento legível por computador
WO2010068465A2 (en) 2008-11-25 2010-06-17 Citrix Systems. Inc. Systems and methods for maintaining persistence by a backup virtual server
US9800690B1 (en) * 2009-06-26 2017-10-24 Tata Communications (America) Inc. Content-based redirection
WO2011024930A1 (ja) 2009-08-24 2011-03-03 日本電気株式会社 コンテンツ配信システム、コンテンツ配信方法及びコンテンツ配信用プログラム
US8862699B2 (en) * 2009-12-14 2014-10-14 Microsoft Corporation Reputation based redirection service
US8856281B2 (en) 2010-03-22 2014-10-07 At&T Intellectual Property I, L.P. Internet protocol version 6 content routing
US8745266B2 (en) 2011-06-30 2014-06-03 Citrix Systems, Inc. Transparent layer 2 redirection of request to single sign in service based on applying policy to content of request
US9119019B2 (en) 2011-07-11 2015-08-25 Srd Innovations Inc. Wireless mesh network and method for remote seismic recording
KR101311524B1 (ko) 2011-10-27 2013-09-25 주식회사 케이티 이종 망의 경계 주변에 위치하는 단말의 망 천이 방법
WO2013138528A1 (en) 2012-03-14 2013-09-19 Visa International Service Association Point-of-transaction account feature redirection apparatuses, methods and systems
CN102685215B (zh) * 2012-04-18 2015-12-16 华为技术有限公司 移动终端上网监控的方法、装置和***
US9628346B2 (en) * 2012-12-13 2017-04-18 Level 3 Communications, Llc Devices and methods supporting content delivery with reducer services
WO2015171969A1 (en) * 2014-05-07 2015-11-12 Hughes Network Systems, Llc State-based intercept of interactive communications network connections for provision of targeted, status-based messaging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098594A (zh) * 2011-02-25 2011-06-15 清华大学 一种基于信息扩散光网络的连接建立信令冲突避免方法
CN102291390A (zh) * 2011-07-14 2011-12-21 南京邮电大学 一种基于云计算平台的防御拒绝服务攻击的方法
CN102870470A (zh) * 2012-06-27 2013-01-09 华为技术有限公司 重定向处理方法、设备及***
CN103019960A (zh) * 2012-12-03 2013-04-03 华为技术有限公司 分布式缓存方法及***

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3185512A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112925628A (zh) * 2021-03-29 2021-06-08 建信金融科技有限责任公司 一种服务管理方法和装置

Also Published As

Publication number Publication date
SG11201700630RA (en) 2017-03-30
US10673972B2 (en) 2020-06-02
EP3185512B1 (en) 2020-10-07
US20170272531A1 (en) 2017-09-21
JP6514322B2 (ja) 2019-05-15
EP3185512B8 (en) 2021-03-10
KR20170034416A (ko) 2017-03-28
KR101970901B1 (ko) 2019-04-19
CN105450694B (zh) 2019-06-21
EP3185512A4 (en) 2018-02-21
ES2829832T3 (es) 2021-06-02
HK1222056A1 (zh) 2017-06-16
EP3185512A1 (en) 2017-06-28
PL3185512T3 (pl) 2021-05-04
JP2017533492A (ja) 2017-11-09
CN105450694A (zh) 2016-03-30

Similar Documents

Publication Publication Date Title
WO2016026400A1 (zh) 一种处理连续重定向的方法和装置
EP3243140B1 (en) Html streaming
US10798199B2 (en) Network traffic accelerator
US20120254402A1 (en) Systems, apparatus, and methods for mobile device detection
US20140344437A1 (en) Method and system for implementing a transparent proxy of an ios system
CN109450766B (zh) 一种工作区级vpn的访问处理方法及装置
US11797653B2 (en) Hash-based dynamic restriction of content on information resources
US11165868B2 (en) Systems and methods for achieving session stickiness for stateful cloud services with non-sticky load balancers
CN103475657A (zh) 防syn泛洪攻击的处理方法和装置
KR102196403B1 (ko) 재지향 감소
CN105554740A (zh) 一种识别无线热点的方法、装置及设备
US10992702B2 (en) Detecting malware on SPDY connections
US20200402115A1 (en) Serving an Online Advertisement Asynchronously
US10873599B1 (en) Providing application security using causal graph
EP3516541A1 (en) Deploying countermeasures to hash-based dynamic restriction of content elements on information resources
KR102157477B1 (ko) 컨텐츠 전송 서비스를 위한 트래픽 제어 방법 및 이를 구현한 프로그램을 기록한 컴퓨터 판독 가능한 기록 매체

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

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2015834055

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2017510569

Country of ref document: JP

Kind code of ref document: A

Ref document number: 20177004878

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 15505418

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE