[go: up one dir, main page]

CN105610906A - Request forwarding method, device and system - Google Patents

Request forwarding method, device and system Download PDF

Info

Publication number
CN105610906A
CN105610906A CN201510959060.0A CN201510959060A CN105610906A CN 105610906 A CN105610906 A CN 105610906A CN 201510959060 A CN201510959060 A CN 201510959060A CN 105610906 A CN105610906 A CN 105610906A
Authority
CN
China
Prior art keywords
requests
forwarding
server
client
request
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.)
Pending
Application number
CN201510959060.0A
Other languages
Chinese (zh)
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.)
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Beijing Qianxin Technology Co 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 Beijing Qihoo Technology Co Ltd, Beijing Qianxin Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510959060.0A priority Critical patent/CN105610906A/en
Publication of CN105610906A publication Critical patent/CN105610906A/en
Pending legal-status Critical Current

Links

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/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing
    • 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/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a request forwarding method, device and system, relates to the technical field of the Internet, and solves a problem that a conventional request forwarding mode is low in efficiency. The method comprises the steps: a first-level forwarding server receives a request sent by a client, wherein the request comprises the unique identification of the client; all the requests sent by the same client are transmitted to the same second-level forwarding server according to the unique identification, so that the second-level forwarding server enables the same batch of cached requests to be transmitted to a processing server when the second-level forwarding server meets a preset caching condition, so as to enable the processing server to carry out one-time processing of one batch of requests. The method, device and system are used in a process of client request forwarding in an asynchronous framework system.

Description

转发请求的方法、装置及系统Method, device and system for forwarding request

技术领域technical field

本发明涉及互联网技术领域,尤其涉及一种转发请求的方法、装置及系统。The present invention relates to the technical field of the Internet, in particular to a method, device and system for forwarding requests.

背景技术Background technique

在异步框架体系中,对于客户端发送的请求通常会通过转发服务器转发给处理服务器,处理服务器就是客户端访问的目标服务器。为了提高转发服务器的利用效率,通常会将客户端的请求先进行缓存,当缓存量达到一定的阈值时,再由转发服务器将请求统一转发到处理服务器中。当客户端请求量很大时,一个转发服务器不足于满足需求,因此通常会有多个转发服务器来接收客户端的请求。In the asynchronous framework system, the request sent by the client is usually forwarded to the processing server through the forwarding server, and the processing server is the target server accessed by the client. In order to improve the utilization efficiency of the forwarding server, the client's request is usually cached first, and when the cached amount reaches a certain threshold, the forwarding server forwards the request to the processing server in a unified manner. When the amount of client requests is large, one forwarding server is not enough to meet the demand, so there are usually multiple forwarding servers to receive client requests.

在上述使用多个转发服务器接收客户端的请求时,存在一定的缺陷即同一个客户端的请求可能被分配到不同的转发服务器上,而不同的转发服务器在同一时刻的缓存量是不同的,但是他们的缓存量阈值是一致的,因此各转发服务器的转发请求不是同时的,从而导致出现同一客户端发送的有先后逻辑顺序的请求不能按照正常的逻辑顺序被转发给服务器,进而造成返回给客户端的数据错误的现象。例如:某一客户端先发送的一个请求发送给转发服务器A,而后发送的一个请求发送给转发服务器B,但是B比A先达到缓存量阈值,因此B会先向处理服务器转发请求,即该客户端后发送的请求被先转发,而先发送的请求被后转发,这样可能会导致请求的逻辑错误,从而影响返回给该客户端的请求结果。When using multiple forwarding servers to receive the client's request, there is a certain defect that the request of the same client may be allocated to different forwarding servers, and different forwarding servers have different caches at the same time, but they The cache volume thresholds are consistent, so the forwarding requests of each forwarding server are not at the same time, resulting in the request sent by the same client with a logical order cannot be forwarded to the server in the normal logical order, which in turn causes the request returned to the client data error phenomenon. For example: A client first sends a request to forwarding server A, and then sends a request to forwarding server B, but B reaches the cache threshold before A, so B will forward the request to the processing server first, that is, the The request sent later by the client is forwarded first, and the request sent first is forwarded later, which may cause logic errors in the request, thereby affecting the request result returned to the client.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的转发请求的、装置及系统。In view of the above problems, the present invention is proposed to provide a request forwarding device, device and system that overcome the above problems or at least partly solve the above problems.

为解决上述技术问题,一方面,本发明提供了一种转发请求的方法,包括:In order to solve the above technical problems, on the one hand, the present invention provides a method for forwarding requests, including:

一级转发服务器接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The first-level forwarding server receives the request sent by the client, and the request carries the unique identifier of the client;

根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,以便当所述二级转发服务器达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;According to the unique identifier, the previous requests sent by the same client are forwarded to the same second-level forwarding server, so that when the second-level forwarding server reaches the preset cache condition, a batch of cached requests are sent to the processing a server, so that the processing server performs one-time processing on the batch of requests;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

第二方面,本发明还提供了一种转发请求的方法,包括:In a second aspect, the present invention also provides a method for forwarding a request, including:

转发服务器接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The forwarding server receives the request sent by the client, and the request carries the unique identifier of the client;

根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中;According to the unique identifier, the previous requests sent by the same client are forwarded to the same cache process;

当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;When the cache process reaches a preset cache condition, send a batch of cached requests to a processing server, so that the processing server can process the batch of requests once;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

第三方面,本发明还提供了一种转发请求的装置,该装置位于一级转发服务器中,包括:In the third aspect, the present invention also provides a device for forwarding requests, which is located in a first-level forwarding server, including:

接收单元,用于接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The receiving unit is used to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,以便当所述二级转发服务器达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;The forwarding unit is configured to forward the previous requests sent by the same client to the same second-level forwarding server according to the unique identifier, so that when the second-level forwarding server reaches the preset caching condition, the cached one The batch requests are sent to the processing server, so that the processing server performs one-time processing on the batch of requests;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

第四方面,本发明还提供了一种转发请求的装置,该装置位于转发服务器中,包括:In the fourth aspect, the present invention also provides a device for forwarding requests, which is located in the forwarding server, including:

接收单元,用于接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The receiving unit is used to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中;A forwarding unit, configured to forward the previous requests sent by the same client to the same cache process according to the unique identifier;

发送单元,用于当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;A sending unit, configured to send a batch of cached requests to a processing server when the caching process reaches a preset caching condition, so that the processing server can process the batch of requests once;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

第五方面,本发明还提供了一种转发请求的系统,该系统包括:客户端、一级转发服务器、二级转发服务器以及处理服务器;In the fifth aspect, the present invention also provides a system for forwarding requests, the system comprising: a client, a first-level forwarding server, a second-level forwarding server, and a processing server;

所述客户端,用于向所述一级转发服务器发起请求,所述请求中携带有所述客户端的唯一标识;The client is configured to initiate a request to the primary forwarding server, and the request carries the unique identifier of the client;

所述一级转发服务器,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中;The first-level forwarding server is configured to forward the previous requests sent by the same client to the same second-level forwarding server according to the unique identifier;

所述二级转发服务器,用于对所述一级转发服务器转发的请求进行缓存,并当达到预设的缓存条件时,将缓存的一批请求发送给所述处理服务器;The second-level forwarding server is configured to cache the requests forwarded by the first-level forwarding server, and send a batch of cached requests to the processing server when a preset cache condition is reached;

所述处理服务器,用于对所述二级转发服务器发送的所述一批请求进行一次性处理;The processing server is configured to perform one-time processing on the batch of requests sent by the secondary forwarding server;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

第六方面,本发明还提供了一种转发请求的系统,该系统包括:客户端、转发服务器以及处理服务器;In a sixth aspect, the present invention also provides a system for forwarding requests, the system comprising: a client, a forwarding server, and a processing server;

所述客户端,用于向所述转发服务器发起请求,所述请求中携带有所述客户端的唯一标识;The client is configured to initiate a request to the forwarding server, and the request carries a unique identifier of the client;

所述转发服务器,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中,当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器;The forwarding server is configured to forward the previous requests sent by the same client to the same cache process according to the unique identifier, and send a batch of cached requests when the cache process reaches a preset cache condition to the processing server;

所述处理服务器,用于对所述转发服务器转发的所述一批请求进行一次性处理;The processing server is configured to perform one-time processing on the batch of requests forwarded by the forwarding server;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

借由上述技术方案,本发明提供的转发请求的方法、装置及系统,能够通过一级转发服务器接收客户端发送的带有客户端唯一标识的请求,然后根据唯一标识将同一客户端历次发送的请求转发到同一个二级转发服务器中,以使得二级服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。或者通过转发服务器接收客户端发送的带有客户端唯一标识的请求,然后将同一客户端历次发送的请求转发到同一个缓存进程中,当缓存进程在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。上述两种不同的实现基于两种不同的服务器结构。与现有技术相比,本发明能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给同一个二级转发服务器或者转发给转发服务器的同一个缓存进程中,然后再由二级转发服务器或者转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。By virtue of the above technical solution, the method, device and system for forwarding requests provided by the present invention can receive the request with the unique identifier of the client sent by the client through the first-level forwarding server, and then forward the requests sent by the same client in previous times according to the unique identifier. The request is forwarded to the same secondary forwarding server, so that the secondary server will send a batch of cached requests to the processing server for one-time processing when the preset cache condition is met. Or receive the request sent by the client with the unique identifier of the client through the forwarding server, and then forward the previous requests sent by the same client to the same cache process. When the cache process reaches the preset cache condition, the cached A batch of requests is sent to the processing server for one-time processing. The above two different implementations are based on two different server structures. Compared with the prior art, the present invention can forward the previous requests sent by the same client to the same secondary forwarding server or to the same caching process of the forwarding server through the unique identifier carried in the client request, and then the The secondary forwarding server or the forwarding server forwards to the processing server for the same processing, which ensures that the requests sent by the same client can be forwarded to the processing server in the order in which they are sent, and realizes the high efficiency of forwarding requests.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了本发明实施例提供的一种转发请求的方法流程图;FIG. 1 shows a flow chart of a method for forwarding a request provided by an embodiment of the present invention;

图2示出了本发明实施例提供的另一种转发请求的方法流程图;FIG. 2 shows a flow chart of another method for forwarding a request provided by an embodiment of the present invention;

图3示出了本发明实施例提供的又一种转发请求的方法流程图;FIG. 3 shows a flowchart of another method for forwarding a request provided by an embodiment of the present invention;

图4示出了本发明实施例提供的再一种转发请求的方法流程图;FIG. 4 shows a flowchart of another method for forwarding a request provided by an embodiment of the present invention;

图5示出了本发明实施例提供的一种转发请求的装置的组成框图;FIG. 5 shows a block diagram of a device for forwarding a request provided by an embodiment of the present invention;

图6示出了本发明实施例提供的另一种转发请求的装置的组成框图;FIG. 6 shows a block diagram of another device for forwarding requests provided by an embodiment of the present invention;

图7示出了本发明实施例提供的又一种转发请求的装置的组成框图;FIG. 7 shows a block diagram of another device for forwarding requests provided by an embodiment of the present invention;

图8示出了本发明实施例提供的再一种转发请求的装置的组成框图;FIG. 8 shows a block diagram of another device for forwarding requests provided by an embodiment of the present invention;

图9示出了本发明实施例提供的一种转发请求的系统框图;FIG. 9 shows a system block diagram of a forwarding request provided by an embodiment of the present invention;

图10示出了本发明实施例提供的另一种转发请求的系统框图。FIG. 10 shows a system block diagram of another forwarding request provided by an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

为解决现有转发请求的方式效率低的问题,本发明实施例提供了一种转发请求的方法,如图1所示,该方法包括:In order to solve the problem of low efficiency in the existing way of forwarding requests, an embodiment of the present invention provides a method for forwarding requests, as shown in FIG. 1 , the method includes:

101、一级转发服务器接收客户端发送的请求。101. The first-level forwarding server receives the request sent by the client.

本实施例中,客户端在发送请求给处理服务器时,需要通过一级转发器和二级转发器进行转发。因此首先由一级转发服务器接收客户端发送的请求,其中客户端发送的请求中携带有客户端的唯一标识。该唯一标识用于对不同的客户端进行区别,进而区别属于不同客户端的请求。需要说明的是处理服务器指客户端进行请求的目标服务器。In this embodiment, when the client sends the request to the processing server, it needs to forward it through the first-level forwarder and the second-level forwarder. Therefore, firstly, the first-level forwarding server receives the request sent by the client, wherein the request sent by the client carries the unique identifier of the client. The unique identifier is used to distinguish different clients, and further distinguish requests belonging to different clients. It should be noted that the processing server refers to the target server where the client makes the request.

102、根据唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中。102. According to the unique identifier, forward the previous requests sent by the same client to the same secondary forwarding server.

由于唯一标识是区别不同客户端的标识,因此可以按照唯一标识将由步骤101获得的请求按照不同的客户端进行分类。然后将属于同一个客户端的发送的请求转发到同一个二级转发服务器中。并且记录每个客户端对应的转发服务器,以使同一客户端历次发送的请求都发给同一个二级转发服务器。Since the unique identifier is an identifier for distinguishing different clients, the requests obtained in step 101 can be classified according to different clients according to the unique identifier. Then forward the requests sent by the same client to the same secondary forwarding server. And record the forwarding server corresponding to each client, so that all requests sent by the same client are sent to the same secondary forwarding server.

将同一个客户端的请求转发给同一个二级转发服务器是为了使二级转发服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理。The purpose of forwarding the requests of the same client to the same second-level forwarding server is to make the second-level forwarding server send a batch of cached requests to the processing server when the preset cache condition is reached, so that the processing server can process a batch of requests One time processing.

需要说明的是,二级转发服务器是按照请求发起的时间先后顺序对客户端发送的请求进行缓存的,因此在转发给处理服务器时也是按照请求的时间先后顺序转发的,所以可以保证处理服务器按照请求的先后顺序对同一客户端的请求进行处理。It should be noted that the second-level forwarding server caches the requests sent by the client according to the order in which the requests were initiated, so when forwarding to the processing server, it also forwards the requests in the order of time, so it can be guaranteed that the processing server follows the The sequence of requests processes requests from the same client.

本实施例提供的转发请求的方法,能够通过一级转发服务器接收客户端发送的带有客户端唯一标识的请求,然后根据唯一标识将同一客户端历次发送的请求转发到同一个二级转发服务器中,以使得二级服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给同一个二级转发服务器,然后再由二级转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The request forwarding method provided in this embodiment can receive the request sent by the client with the unique identifier of the client through the first-level forwarding server, and then forward the requests sent by the same client to the same second-level forwarding server according to the unique identifier In this way, the secondary server will send a batch of cached requests to the processing server for one-time processing when the preset cache condition is met. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same secondary forwarding server through the unique identifier carried in the client request, and then forward the secondary forwarding server to the processing server for the same processing. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

进一步的,作为对图1所示方法的细化及扩展,本发明实施例还提供了一种转发请求的方法,如图2所示,该方法包括:Further, as a refinement and extension of the method shown in Figure 1, the embodiment of the present invention also provides a method for forwarding a request, as shown in Figure 2, the method includes:

201、一级转发服务器接收客户端发送的请求。201. The first-level forwarding server receives the request sent by the client.

该步骤的实现方式与图1步骤101的实现方式相同,此处不再赘述。The implementation of this step is the same as the implementation of step 101 in FIG. 1 , and will not be repeated here.

202、将请求中携带的唯一标识转换为哈希值。202. Convert the unique identifier carried in the request into a hash value.

将由步骤201获得的请求中携带的唯一标识转化为其对应的哈希值。具体的本实施例中的唯一标识为网间协议(InternetProtocol,简称IP)地址。在将IP地址转换为哈希值时是通过哈希算法进行转换的。需要说明的是,本实施例中客户端的IP地址是固定不变的,且不同的客户端的IP地址是不同的,这样才可以保证IP地址转换为的哈希值也是唯一的。Convert the unique identifier carried in the request obtained in step 201 into its corresponding hash value. Specifically, the unique identifier in this embodiment is an Internet Protocol (Internet Protocol, IP for short) address. When converting an IP address into a hash value, it is converted through a hash algorithm. It should be noted that, in this embodiment, the IP address of the client is fixed, and the IP addresses of different clients are different, so as to ensure that the hash value converted from the IP address is also unique.

203、将请求转发到对应哈希值的二级转发服务器中。203. Forward the request to the secondary forwarding server corresponding to the hash value.

由于哈希值与IP地址是一一对应的,且IP地址与客户端是一一对应的,因此按照由步骤202得到的哈希值将请求进行分类,就可以将属于不同客户端的请求进行区分。然后将属于同一客户端的请求转发给同一个二级转发服务器,不同的哈希值对应不同的二级转发服务器。Since there is a one-to-one correspondence between the hash value and the IP address, and the one-to-one correspondence between the IP address and the client, the requests belonging to different clients can be distinguished by classifying the requests according to the hash values obtained in step 202 . Then forward requests belonging to the same client to the same secondary forwarding server, and different hash values correspond to different secondary forwarding servers.

将同一个客户端的请求转发给同一个二级转发服务器是为了使二级转发服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理。其中预设的缓存条件包括以下两种:一种为缓存的请求数量达到预设的数量阈值,数量阈值可以以请求的总条数设置,也可以以请求占的总存储容量设置,比如数量阈值可以设为100条或者500k等;另一种为缓存的时间达到预设的时长阈值,比如时长阈值可以设置为10s等。需要说明的是,以上两种预设条件可以单独使用,也可以结合一起使用。The purpose of forwarding the requests of the same client to the same second-level forwarding server is to make the second-level forwarding server send a batch of cached requests to the processing server when the preset cache condition is reached, so that the processing server can process a batch of requests One time processing. The preset cache conditions include the following two types: one is that the number of cached requests reaches the preset number threshold, and the number threshold can be set based on the total number of requests or the total storage capacity occupied by the request, such as the number threshold It can be set to 100 or 500k, etc.; the other is that the cache time reaches a preset duration threshold, for example, the duration threshold can be set to 10s, etc. It should be noted that the above two preset conditions can be used alone or in combination.

另外需要说明的是,二级转发服务器是按照请求发起的时间先后顺序对客户端发送的请求进行缓存的,因此在转发给处理服务器时也是按照请求的时间先后顺序转发的,所以可以保证处理服务器按照请求的先后顺序对同一客户端的请求进行处理。In addition, it should be noted that the second-level forwarding server caches the requests sent by the client according to the time sequence in which the requests were initiated, so when forwarding to the processing server, it also forwards them in the order of request time, so the processing server can be guaranteed Requests from the same client are processed in the order in which they are requested.

进一步的,对于图1以及图2中涉及的二级转发服务器为单核服务器,一核对应一个缓存进程,二级转发服务器通过缓存进程对一级转发服务器转发的请求进行缓存。Further, the second-level forwarding server involved in Figure 1 and Figure 2 is a single-core server, one core corresponds to one cache process, and the second-level forwarding server caches the request forwarded by the first-level forwarding server through the cache process.

进一步的,本发明实施例还提供了一种转发请求的方法,如图3所示,包括:Further, the embodiment of the present invention also provides a method for forwarding a request, as shown in FIG. 3 , including:

301、转发服务器接收客户端发送的请求。301. The forwarding server receives the request sent by the client.

本实施例中,客户端在发送请求给处理服务器时,需要通过转发服务器进行转发。因此首先由转发服务器接收客户端发送的请求,其中客户端发送的请求中携带有客户端的唯一标识。该唯一标识用于对不同的客户端进行区别,进而区别属于不同客户端的请求。需要说明的是,处理服务器为客户端进行请求的目标服务器。In this embodiment, when the client sends the request to the processing server, it needs to forward it through the forwarding server. Therefore, firstly, the forwarding server receives the request sent by the client, wherein the request sent by the client carries the unique identifier of the client. The unique identifier is used to distinguish different clients, and further distinguish requests belonging to different clients. It should be noted that the processing server is the target server for the client to request.

302、根据唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中。302. According to the unique identifier, forward the previous requests sent by the same client to the same cache process.

由于唯一标识是区别不同客户端的标识,因此可以按照唯一标识将由步骤301获得的请求按照不同的客户端进行分类。然后将属于同一个客户端的发送的请求转发到转发服务器中的同一个缓存进程中。并且记录各客户端对应的缓存进程,以使同一客户端历次发送的请求都转发给同一个缓存进程。Since the unique identifier is an identifier for distinguishing different clients, the requests obtained in step 301 can be classified according to different clients according to the unique identifier. Then forward the requests sent by the same client to the same cache process in the forwarding server. And record the cache process corresponding to each client, so that all the previous requests sent by the same client are forwarded to the same cache process.

303、当缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器。303. When the cache process reaches a preset cache condition, send a batch of cached requests to the processing server.

当缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理。When the cache process reaches the preset cache condition, it sends a batch of cached requests to the processing server, so that the processing server can process the batch of requests once.

需要说明的是,转发服务器中的缓存进程是按照请求发起的时间先后顺序对客户端发送的请求进行缓存的,因此在转发给处理服务器时也是按照请求的时间先后顺序转发的,所以可以保证处理服务器按照请求的先后顺序对同一客户端的请求进行处理。It should be noted that the caching process in the forwarding server caches the requests sent by the client according to the time sequence in which the requests are initiated, so when forwarding to the processing server, it is also forwarded according to the time sequence of the requests, so the processing can be guaranteed The server processes requests from the same client in the order in which they are requested.

本实施例提供的转发请求的方法,能够通过转发服务器接收客户端发送的带有客户端唯一标识的请求,然后将同一客户端历次发送的请求转发到同一个缓存进程中,当缓存进程在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给转发服务器的同一个缓存进程中,然后再由转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The method for forwarding a request provided in this embodiment can receive the request with the unique identifier of the client sent by the client through the forwarding server, and then forward the previous requests sent by the same client to the same cache process. When the preset cache condition is set, a batch of cached requests is sent to the processing server for one-time processing. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same cache process of the forwarding server through the unique identifier carried in the client request, and then forward the forwarding server to the processing server for the same cache process. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

进一步的,作为对图3所示方法的细化及扩展,本发明实施例还提供了一种转发请求的方法,如图4所示,该方法包括:Further, as a refinement and extension of the method shown in Figure 3, the embodiment of the present invention also provides a method for forwarding a request, as shown in Figure 4, the method includes:

401、转发服务器接收客户端发送的请求。401. The forwarding server receives the request sent by the client.

该步骤的实现方式与图3步骤301的实现方式相同,此处不再赘述。The implementation of this step is the same as the implementation of step 301 in FIG. 3 , and will not be repeated here.

402、将请求中携带的唯一标识转换为哈希值。402. Convert the unique identifier carried in the request into a hash value.

将由步骤401获得的请求中携带的唯一标识转化为对应的哈希值。具体的本实施例中的唯一标识为IP地址。在将IP地址转化为哈希值时是通过哈希算法进行转换的,需要说明的是本实施例中的客户端的IP地址是固定不变的,这样才可以保证IP地址转换为的哈希值也是唯一的。The unique identifier carried in the request obtained in step 401 is converted into a corresponding hash value. Specifically, the unique identifier in this embodiment is an IP address. When the IP address is converted into a hash value, it is converted by a hash algorithm. It should be noted that the IP address of the client in this embodiment is fixed, so that the hash value converted to the IP address can be guaranteed Also unique.

403、将请求转发到对应哈希值的缓存进程中。403. Forward the request to the cache process corresponding to the hash value.

由于哈希值与IP地址是一一对应的,且IP地址与客户端是一一对应的,因此按照哈希值将请求进行分类,就可以将属于不同客户端的请求进行区分。然后将属于同一客户端的请求转发到同一个缓存进程中,不同的哈希值对应不同的缓存进程。Since there is a one-to-one correspondence between the hash value and the IP address, and the one-to-one correspondence between the IP address and the client, the requests belonging to different clients can be distinguished by classifying the requests according to the hash value. Then forward requests belonging to the same client to the same cache process, and different hash values correspond to different cache processes.

404、当缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器。404. When the cache process reaches a preset cache condition, send a batch of cached requests to the processing server.

将同一个客户端的请求转发给转发服务器中的同一个缓存进程是为了使缓存进程在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理。其中预设的缓存条件包括以下两种:一种为缓存的请求数量达到预设的数量阈值,数量阈值可以以请求的总条数设置,也可以以请求占的总存储容量设置,比如数量阈值可以设为100条或者500k等;另一种为缓存的时间达到预设的时长阈值,比如时长阈值可以设置为10s等。需要说明的是,以上两种预设条件可以单独使用,也可以结合一起使用。The purpose of forwarding the same client's request to the same cache process in the forwarding server is to make the cache process send a batch of cached requests to the processing server when the preset cache condition is reached, so that the processing server can process a batch of requests One time processing. The preset cache conditions include the following two types: one is that the number of cached requests reaches the preset number threshold, and the number threshold can be set based on the total number of requests or the total storage capacity occupied by the request, such as the number threshold It can be set to 100 or 500k, etc.; the other is that the cache time reaches a preset duration threshold, for example, the duration threshold can be set to 10s, etc. It should be noted that the above two preset conditions can be used alone or in combination.

另外需要说明的是,转发服务器中的缓存进程是按照请求发起的时间先后顺序对客户端发送的请求进行缓存的,因此在转发给处理服务器时也是按照请求的时间先后顺序转发的,因此可以保证处理服务器按照请求的先后顺序对同一客户端的请求进行处理。In addition, it should be noted that the caching process in the forwarding server caches the requests sent by the client according to the time sequence in which the requests are initiated. Therefore, when forwarding to the processing server, it is also forwarded according to the time sequence of the requests. The processing server processes the requests of the same client according to the order of the requests.

进一步的,对于图3以及图4中涉及到的转发服务器为多核服务器,一核对应一个缓存进程,转发服务器通过不同的缓存进程对不同客户端发起的请求独立进行缓存。Further, the forwarding server involved in FIG. 3 and FIG. 4 is a multi-core server, one core corresponds to one cache process, and the forwarding server independently caches requests initiated by different clients through different cache processes.

进一步的,作为对上述各实施例的实现,本发明实施例的另一实施例还提供了一种转发请求的装置,该装置位于一级转发服务器中,用于实现上述图1及图2所述的方法。如图5所示,该装置包括:接收单元51及转发单元52。Furthermore, as an implementation of the above-mentioned embodiments, another embodiment of the present invention also provides a device for forwarding requests, which is located in a first-level forwarding server, and is used to realize the above-mentioned FIG. 1 and FIG. 2 described method. As shown in FIG. 5 , the device includes: a receiving unit 51 and a forwarding unit 52 .

接收单元51,用于接收客户端发送的请求,请求中携带有客户端的唯一标识;The receiving unit 51 is configured to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元52,用于根据唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,以便当二级转发服务器达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理;The forwarding unit 52 is configured to forward the previous requests sent by the same client to the same secondary forwarding server according to the unique identifier, so that when the secondary forwarding server reaches the preset caching condition, a batch of cached requests is sent to to the processing server so that the processing server processes a batch of requests at once;

其中,二级转发服务器按照请求发起的先后顺序对请求进行缓存,处理服务器按照二级转发服务器的缓存顺序对请求进行处理。Wherein, the second-level forwarding server caches the requests according to the order in which the requests are initiated, and the processing server processes the requests according to the order in which the second-level forwarding servers cache.

进一步的,如图6所示,转发单元52,包括:Further, as shown in FIG. 6, the forwarding unit 52 includes:

转换模块521,用于将请求中携带的唯一标识转换为哈希值;A conversion module 521, configured to convert the unique identifier carried in the request into a hash value;

转发模块522,用于将请求转发到对应哈希值的二级转发服务器中,其中不同的二级转发服务器对应不同的哈希值。The forwarding module 522 is configured to forward the request to a secondary forwarding server corresponding to the hash value, wherein different secondary forwarding servers correspond to different hash values.

进一步的,转发单元52中的唯一标识为客户端的网间协议IP地址。Further, the unique identifier in the forwarding unit 52 is the Internet Protocol IP address of the client.

进一步的,转发单元52中的预设的缓存条件,包括:Further, the preset cache conditions in the forwarding unit 52 include:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

本实施例提供的转发请求的装置,能够通过一级转发服务器接收客户端发送的带有客户端唯一标识的请求,然后根据唯一标识将同一客户端历次发送的请求转发到同一个二级转发服务器中,以使得二级服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给同一个二级转发服务器,然后再由二级转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The device for forwarding requests provided in this embodiment can receive the request sent by the client with the unique identifier of the client through the first-level forwarding server, and then forward the previous requests sent by the same client to the same second-level forwarding server according to the unique identifier In this way, the secondary server will send a batch of cached requests to the processing server for one-time processing when the preset cache condition is met. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same secondary forwarding server through the unique identifier carried in the client request, and then forward the secondary forwarding server to the processing server for the same processing. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

进一步的,作为对上述各实施例的实现,本发明实施例的另一实施例还提供了一种转发请求的装置,该装置位于转发服务器中,用于实现上述图3和图4所述的方法。如图7所示,该装置包括:接收单元71、转发单元72、以及发送单元73。Further, as an implementation of the above-mentioned embodiments, another embodiment of the present invention also provides a device for forwarding requests, which is located in the forwarding server, and is used to implement the above described in Figure 3 and Figure 4 method. As shown in FIG. 7 , the device includes: a receiving unit 71 , a forwarding unit 72 , and a sending unit 73 .

接收单元71,用于接收客户端发送的请求,请求中携带有客户端的唯一标识;The receiving unit 71 is configured to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元72,用于根据唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中;The forwarding unit 72 is configured to forward the previous requests sent by the same client to the same cache process according to the unique identifier;

发送单元73,用于当缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得处理服务器对一批请求进行一次性处理;The sending unit 73 is configured to send a batch of cached requests to the processing server when the cache process reaches a preset caching condition, so that the processing server can process the batch of requests once;

其中,缓存进程按照请求发起的先后顺序对请求进行缓存,处理服务器按照缓存进程的缓存顺序对请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

进一步的,如图8所示,转发单元72,包括:Further, as shown in FIG. 8, the forwarding unit 72 includes:

转换模块721,用于将请求中携带的唯一标识转换为哈希值;A conversion module 721, configured to convert the unique identifier carried in the request into a hash value;

转发模块722,用于将请求转发到对应哈希值的缓存进程中,其中不同的缓存进程对应不同的哈希值。The forwarding module 722 is configured to forward the request to a cache process corresponding to the hash value, where different cache processes correspond to different hash values.

进一步的,转发单元72中的唯一标识为客户端的网间协议IP地址。Further, the unique identifier in the forwarding unit 72 is the IP address of the client.

进一步的,转发单元72中的预设的缓存条件,包括:Further, the preset cache conditions in the forwarding unit 72 include:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

本实施例提供的转发请求的装置,能够通过转发服务器接收客户端发送的带有客户端唯一标识的请求,然后将同一客户端历次发送的请求转发到同一个缓存进程中,当缓存进程在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给转发服务器的同一个缓存进程中,然后再由转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The device for forwarding requests provided by this embodiment can receive the request sent by the client with the unique identifier of the client through the forwarding server, and then forward the previous requests sent by the same client to the same cache process. When the preset cache condition is set, a batch of cached requests is sent to the processing server for one-time processing. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same cache process of the forwarding server through the unique identifier carried in the client request, and then forward the forwarding server to the processing server for the same cache process. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

进一步的,本发明的又一实施例还提供了一种转发请求的系统,用以实现图1以及图2所示的方法。本系统实施例与前述方法实施例对应,能够实现前述方法实施例中的全部内容。为便于阅读,本系统实施例仅对前述方法实施例中的内容进行概要性描述,不对方法实施例中的细节内容进行逐一赘述。如图9所示,该系统包括客户端91、一级转发服务器92、二级转发服务器93以及处理服务器94,其中一级转发服务器92包括上述图5或图6所示的装置。具体的:Furthermore, another embodiment of the present invention also provides a system for forwarding requests, so as to implement the methods shown in FIG. 1 and FIG. 2 . This system embodiment corresponds to the foregoing method embodiments, and can realize all the content in the foregoing method embodiments. For ease of reading, this system embodiment only briefly describes the content in the foregoing method embodiments, and does not repeat details in the method embodiments one by one. As shown in FIG. 9 , the system includes a client 91 , a first-level forwarding server 92 , a second-level forwarding server 93 and a processing server 94 , wherein the first-level forwarding server 92 includes the device shown in FIG. 5 or FIG. 6 above. specific:

客户端91,用于向一级转发服务器发起请求,请求中携带有客户端的唯一标识;The client 91 is configured to initiate a request to the first-level forwarding server, and the request carries the unique identifier of the client;

一级转发服务器92,用于根据唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中;The first-level forwarding server 92 is used to forward the requests sent by the same client to the same second-level forwarding server according to the unique identifier;

二级转发服务器93,用于对一级转发服务器转发的请求进行缓存,并当达到预设的缓存条件时,将缓存的一批请求发送给处理服务器;The secondary forwarding server 93 is used to cache the request forwarded by the primary forwarding server, and when the preset cache condition is reached, send a batch of cached requests to the processing server;

处理服务器94,用于对二级转发服务器发送的一批请求进行一次性处理;The processing server 94 is configured to perform one-time processing on a batch of requests sent by the secondary forwarding server;

其中,二级转发服务器按照请求发起的先后顺序对请求进行缓存,处理服务器按照二级转发服务器的缓存顺序对请求进行处理。Wherein, the second-level forwarding server caches the requests according to the order in which the requests are initiated, and the processing server processes the requests according to the order in which the second-level forwarding servers cache.

进一步的,二级转发服务器93为单核服务器,一核对应一个缓存进程,二级转发服务器通过缓存进程对一级转发服务器92转发的请求进行缓存。Further, the second-level forwarding server 93 is a single-core server, and one core corresponds to one cache process, and the second-level forwarding server caches the request forwarded by the first-level forwarding server 92 through the cache process.

本实施例提供的转发请求的系统,能够通过一级转发服务器接收客户端发送的带有客户端唯一标识的请求,然后根据唯一标识将同一客户端历次发送的请求转发到同一个二级转发服务器中,以使得二级服务器在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给同一个二级转发服务器,然后再由二级转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The request forwarding system provided in this embodiment can receive the request sent by the client with the unique identifier of the client through the first-level forwarding server, and then forward the requests sent by the same client to the same second-level forwarding server according to the unique identifier In this way, the secondary server will send a batch of cached requests to the processing server for one-time processing when the preset cache condition is met. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same secondary forwarding server through the unique identifier carried in the client request, and then forward the secondary forwarding server to the processing server for the same processing. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

进一步的,本发明的最后一实施例还提供了一种转发请求的系统,用以实现图3以及图4所示的方法。本系统实施例与前述方法实施例对应,能够实现前述方法实施例中的全部内容。为便于阅读,本系统实施例仅对前述方法实施例中的内容进行概要性描述,不对方法实施例中的细节内容进行逐一赘述。如图10所示,该系统包括客户端1001、转发服务器1002以及处理服务器1003,其中转发服务器1002包括上述图7或图8所示的装置。具体的:Furthermore, the last embodiment of the present invention also provides a system for forwarding requests, so as to implement the methods shown in FIG. 3 and FIG. 4 . This system embodiment corresponds to the foregoing method embodiments, and can realize all the content in the foregoing method embodiments. For ease of reading, this system embodiment only briefly describes the content in the foregoing method embodiments, and does not repeat details in the method embodiments one by one. As shown in FIG. 10 , the system includes a client 1001 , a forwarding server 1002 and a processing server 1003 , wherein the forwarding server 1002 includes the device shown in FIG. 7 or 8 above. specific:

客户端1001,用于向转发服务器发起请求,请求中携带有客户端的唯一标识;The client 1001 is configured to initiate a request to the forwarding server, and the request carries the unique identifier of the client;

转发服务器1002,用于根据唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中,当缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器;The forwarding server 1002 is used to forward the previous requests sent by the same client to the same cache process according to the unique identifier, and when the cache process reaches the preset cache condition, send a batch of cached requests to the processing server;

处理服务器1003,用于对转发服务器转发的一批请求进行一次性处理;The processing server 1003 is configured to process a batch of requests forwarded by the forwarding server at one time;

其中,缓存进程按照请求发起的先后顺序对请求进行缓存,处理服务器按照缓存进程的缓存顺序对请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

进一步的,转发服务器1002为多核服务器,一核对应一个缓存进程,转发服务器通过不同的缓存进程对不同客户端1001发起的请求独立进行缓存。Further, the forwarding server 1002 is a multi-core server, one core corresponds to one cache process, and the forwarding server independently caches requests initiated by different clients 1001 through different cache processes.

本实施例提供的转发请求的系统,能够通过转发服务器接收客户端发送的带有客户端唯一标识的请求,然后将同一客户端历次发送的请求转发到同一个缓存进程中,当缓存进程在达到预设的缓存条件时,将缓存的一批请求发送给处理服务器进行一次性处理。与现有技术相比,本实施例能够通过客户端请求中携带的唯一标识将同一客户端历次发送的请求转发给转发服务器的同一个缓存进程中,然后再由转发服务器转发给处理服务器进行同一处理,保证了同一客户端发送的请求能被按照发送的先后顺序转发给处理服务器,实现转发请求的高效性。The request forwarding system provided by this embodiment can receive the request sent by the client with the unique identifier of the client through the forwarding server, and then forward the previous requests sent by the same client to the same cache process. When the preset cache condition is set, a batch of cached requests is sent to the processing server for one-time processing. Compared with the prior art, this embodiment can forward the previous requests sent by the same client to the same cache process of the forwarding server through the unique identifier carried in the client request, and then forward the forwarding server to the processing server for the same cache process. Processing ensures that requests sent by the same client can be forwarded to the processing server in the order in which they were sent, achieving high efficiency in forwarding requests.

本发明的实施例公开了:Embodiments of the invention disclose:

A1、一种转发请求的方法,其特征在于,所述方法包括:A1. A method for forwarding a request, characterized in that the method comprises:

一级转发服务器接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The first-level forwarding server receives the request sent by the client, and the request carries the unique identifier of the client;

根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,以便当所述二级转发服务器达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;According to the unique identifier, the previous requests sent by the same client are forwarded to the same second-level forwarding server, so that when the second-level forwarding server reaches the preset cache condition, a batch of cached requests are sent to the processing a server, so that the processing server performs one-time processing on the batch of requests;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

A2、根据A1所述的方法,其特征在于,所述根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,包括:A2, according to the method described in A1, it is characterized in that, according to the unique identifier, the requests sent by the same client are forwarded to the same secondary forwarding server, including:

将所述请求中携带的唯一标识转换为哈希值;converting the unique identifier carried in the request into a hash value;

将所述请求转发到对应所述哈希值的二级转发服务器中,其中不同的二级转发服务器对应不同的哈希值。The request is forwarded to a secondary forwarding server corresponding to the hash value, wherein different secondary forwarding servers correspond to different hash values.

A3、根据A2所述的方法,其特征在于,所述唯一标识为所述客户端的网间协议IP地址。A3. The method according to A2, wherein the unique identifier is the Internet Protocol IP address of the client.

A4、根据A1所述的方法,其特征在于,所述预设的缓存条件,包括:A4. The method according to A1, wherein the preset cache condition includes:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

A5、根据A1至4中任一项所述的方法,其特征在于,所述二级转发服务器为单核服务器,一核对应一个缓存进程,所述二级转发服务器通过所述缓存进程对所述一级转发服务器转发的请求进行缓存。A5. The method according to any one of A1 to 4, wherein the secondary forwarding server is a single-core server, one core corresponds to a cache process, and the secondary forwarding server uses the cache process to process all The request forwarded by the first-level forwarding server is cached.

B6、一种转发请求的方法,其特征在于,所述方法包括:B6, a method for forwarding request, is characterized in that, described method comprises:

转发服务器接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The forwarding server receives the request sent by the client, and the request carries the unique identifier of the client;

根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中;According to the unique identifier, the previous requests sent by the same client are forwarded to the same cache process;

当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;When the cache process reaches a preset cache condition, send a batch of cached requests to a processing server, so that the processing server can process the batch of requests once;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

B7、根据B6所述的方法,其特征在于,所述根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中,包括:B7, according to the method described in B6, it is characterized in that, described according to described unique identification, the request that same client sends all the time is forwarded in the same cache process, including:

将所述请求中携带的唯一标识转换为哈希值;converting the unique identifier carried in the request into a hash value;

将所述请求转发到对应所述哈希值的缓存进程中,其中不同的缓存进程对应不同的哈希值。Forwarding the request to a cache process corresponding to the hash value, wherein different cache processes correspond to different hash values.

B8、根据B7所述的方法,其特征在于,所述唯一标识为所述客户端的网间协议IP地址。B8. The method according to B7, wherein the unique identifier is the Internet Protocol IP address of the client.

B9、根据B6所述的方法,其特征在于,所述预设的缓存条件,包括:B9, according to the method described in B6, it is characterized in that, described preset caching condition, comprises:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

B10、根据B6至9中任一项所述的方法,其特征在于,所述转发服务器为多核服务器,一核对应一个缓存进程,所述转发服务器通过不同的缓存进程对不同客户端发起的请求独立进行缓存。B10. The method according to any one of B6 to 9, wherein the forwarding server is a multi-core server, and one core corresponds to a cache process, and the forwarding server initiates requests to different clients through different cache processes cache independently.

C11、一种转发请求的装置,所述装置位于一级转发服务器中,其特征在于,所述装置包括:C11. A device for forwarding a request, said device being located in a primary forwarding server, characterized in that said device comprises:

接收单元,用于接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The receiving unit is used to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中,以便当所述二级转发服务器达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;The forwarding unit is configured to forward the previous requests sent by the same client to the same second-level forwarding server according to the unique identifier, so that when the second-level forwarding server reaches the preset caching condition, the cached one The batch requests are sent to the processing server, so that the processing server performs one-time processing on the batch of requests;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

C12、根据C11所述的装置,其特征在于,所述转发单元,包括:C12. The device according to C11, wherein the forwarding unit includes:

转换模块,用于将所述请求中携带的唯一标识转换为哈希值;A conversion module, configured to convert the unique identifier carried in the request into a hash value;

转发模块,用于将所述请求转发到对应所述哈希值的二级转发服务器中,其中不同的二级转发服务器对应不同的哈希值。A forwarding module, configured to forward the request to a secondary forwarding server corresponding to the hash value, wherein different secondary forwarding servers correspond to different hash values.

C13、根据C12所述的装置,其特征在于,所述转发单元中的所述唯一标识为所述客户端的网间协议IP地址。C13. The device according to C12, wherein the unique identifier in the forwarding unit is the Internet Protocol IP address of the client.

C14、根据C11所述的装置,其特征在于,所述转发单元中的所述预设的缓存条件,包括:C14. The device according to C11, wherein the preset cache condition in the forwarding unit includes:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

D15、一种转发请求的装置,所述装置位于转发服务器中,其特征在于,所述装置包括:D15. A device for forwarding a request, said device being located in a forwarding server, characterized in that said device comprises:

接收单元,用于接收客户端发送的请求,所述请求中携带有客户端的唯一标识;The receiving unit is used to receive the request sent by the client, and the request carries the unique identifier of the client;

转发单元,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中;A forwarding unit, configured to forward the previous requests sent by the same client to the same cache process according to the unique identifier;

发送单元,用于当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器,以使得所述处理服务器对所述一批请求进行一次性处理;A sending unit, configured to send a batch of cached requests to a processing server when the caching process reaches a preset caching condition, so that the processing server can process the batch of requests once;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

D16、根据D15所述的装置,其特征在于,所述转发单元,包括:D16. The device according to D15, wherein the forwarding unit includes:

转换模块,用于将所述请求中携带的唯一标识转换为哈希值;A conversion module, configured to convert the unique identifier carried in the request into a hash value;

转发模块,用于将所述请求转发到对应所述哈希值的缓存进程中,其中不同的缓存进程对应不同的哈希值。A forwarding module, configured to forward the request to a cache process corresponding to the hash value, where different cache processes correspond to different hash values.

D17、根据D16所述的装置,其特征在于,所述转发单元中的所述唯一标识为所述客户端的网间协议IP地址。D17. The device according to D16, wherein the unique identifier in the forwarding unit is the Internet Protocol IP address of the client.

D18、根据D15所述的装置,其特征在于,所述转发单元中的所述预设的缓存条件,包括:D18. The device according to D15, wherein the preset cache condition in the forwarding unit includes:

缓存的请求数量达到预设的数量阈值;和/或,The number of cached requests reaches a preset number threshold; and/or,

缓存的时间达到预设的时长阈值。The cache time reaches the preset duration threshold.

E19、一种转发请求的系统,其特征在于,所述系统包括:客户端、一级转发服务器、二级转发服务器以及处理服务器;其中,E19. A system for forwarding requests, characterized in that the system includes: a client, a first-level forwarding server, a second-level forwarding server, and a processing server; wherein,

所述客户端,用于向所述一级转发服务器发起请求,所述请求中携带有所述客户端的唯一标识;The client is configured to initiate a request to the primary forwarding server, and the request carries the unique identifier of the client;

所述一级转发服务器,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个二级转发服务器中;The first-level forwarding server is configured to forward the previous requests sent by the same client to the same second-level forwarding server according to the unique identifier;

所述二级转发服务器,用于对所述一级转发服务器转发的请求进行缓存,并当达到预设的缓存条件时,将缓存的一批请求发送给所述处理服务器;The second-level forwarding server is configured to cache the requests forwarded by the first-level forwarding server, and send a batch of cached requests to the processing server when a preset cache condition is reached;

所述处理服务器,用于对所述二级转发服务器发送的所述一批请求进行一次性处理;The processing server is configured to perform one-time processing on the batch of requests sent by the secondary forwarding server;

其中,所述二级转发服务器按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述二级转发服务器的缓存顺序对所述请求进行处理。Wherein, the secondary forwarding server caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the secondary forwarding servers.

E20、根据E19所述的系统,其特征在于,所述二级转发服务器为单核服务器,一核对应一个缓存进程,所述二级转发服务器通过所述缓存进程对所述一级转发服务器转发的请求进行缓存。E20. The system according to E19, wherein the secondary forwarding server is a single-core server, one core corresponds to a cache process, and the secondary forwarding server forwards to the primary forwarding server through the cache process requests are cached.

F21、一种转发请求的系统,其特征在于,所述系统包括:客户端、转发服务器以及处理服务器;其中,F21. A system for forwarding requests, characterized in that the system includes: a client, a forwarding server, and a processing server; wherein,

所述客户端,用于向所述转发服务器发起请求,所述请求中携带有所述客户端的唯一标识;The client is configured to initiate a request to the forwarding server, and the request carries a unique identifier of the client;

所述转发服务器,用于根据所述唯一标识,将同一个客户端历次发送的请求转发到同一个缓存进程中,当所述缓存进程达到预设的缓存条件时,将缓存的一批请求发送给处理服务器;The forwarding server is configured to forward the previous requests sent by the same client to the same cache process according to the unique identifier, and send a batch of cached requests when the cache process reaches a preset cache condition to the processing server;

所述处理服务器,用于对所述转发服务器转发的所述一批请求进行一次性处理;The processing server is configured to perform one-time processing on the batch of requests forwarded by the forwarding server;

其中,所述缓存进程按照请求发起的先后顺序对请求进行缓存,所述处理服务器按照所述缓存进程的缓存顺序对所述请求进行处理。Wherein, the cache process caches the requests according to the sequence in which the requests are initiated, and the processing server processes the requests according to the cache sequence of the cache processes.

F22、根据F21所述的系统,其特征在于,所述转发服务器为多核服务器,一核对应一个缓存进程,所述转发服务器通过不同的缓存进程对不同客户端发起的请求独立进行缓存。F22. The system according to F21, wherein the forwarding server is a multi-core server, one core corresponds to one cache process, and the forwarding server independently caches requests initiated by different clients through different cache processes.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.

可以理解的是,上述方法及装置中的相关特征可以相互参考。另外,上述实施例中的“第一”、“第二”等是用于区分各实施例,而并不代表各实施例的优劣。It can be understood that related features in the above methods and devices can refer to each other. In addition, "first", "second" and so on in the above embodiments are used to distinguish each embodiment, and do not represent the advantages and disadvantages of each embodiment.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的发明名称(如确定网站内链接等级的装置)中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) can be used in practice to implement some or all of the components in the title of the invention (such as the device for determining the link level in the website) according to the embodiment of the present invention some or all of the features. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (10)

1. A method of forwarding a request, the method comprising:
a first-level forwarding server receives a request sent by a client, wherein the request carries a unique identifier of the client;
according to the unique identification, forwarding the requests sent by the same client to the same secondary forwarding server all the time, so that when the secondary forwarding server reaches a preset caching condition, sending a batch of cached requests to a processing server, and enabling the processing server to process the batch of requests at one time;
the second-level forwarding server caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the caching sequence of the second-level forwarding server.
2. The method according to claim 1, wherein said forwarding the request sent by the same client to the same secondary forwarding server according to the unique identifier comprises:
converting the unique identifier carried in the request into a hash value;
and forwarding the request to a secondary forwarding server corresponding to the hash value, wherein different secondary forwarding servers correspond to different hash values.
3. The method of claim 2, wherein the unique identifier is an internet protocol, IP, address of the client.
4. The method of claim 1, wherein the predetermined buffer condition comprises:
the number of the cached requests reaches a preset number threshold; and/or the presence of a gas in the gas,
the caching time reaches a preset time threshold.
5. The method according to any one of claims 1 to 4, wherein the secondary forwarding server is a single-core server, and a core corresponds to a caching process, and the secondary forwarding server caches the request forwarded by the primary forwarding server through the caching process.
6. A method of forwarding a request, the method comprising:
a forwarding server receives a request sent by a client, wherein the request carries a unique identifier of the client;
forwarding the request sent by the same client all the time to the same cache process according to the unique identifier;
when the caching process reaches a preset caching condition, sending a batch of cached requests to a processing server so that the processing server can process the batch of requests at one time;
the cache process caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the cache sequence of the cache process.
7. An apparatus for forwarding a request, the apparatus being located in a primary forwarding server, the apparatus comprising:
the receiving unit is used for receiving a request sent by a client, wherein the request carries a unique identifier of the client;
the forwarding unit is used for forwarding the requests sent by the same client to the same secondary forwarding server according to the unique identifier, so that when the secondary forwarding server reaches a preset caching condition, a batch of cached requests are sent to the processing server, and the processing server can process the batch of requests at one time;
the second-level forwarding server caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the caching sequence of the second-level forwarding server.
8. An apparatus for forwarding a request, the apparatus being located in a forwarding server, the apparatus comprising:
the receiving unit is used for receiving a request sent by a client, wherein the request carries a unique identifier of the client;
the forwarding unit is used for forwarding the requests sent by the same client all the time to the same cache process according to the unique identifier;
the sending unit is used for sending a batch of cached requests to a processing server when the caching process reaches a preset caching condition so that the processing server can process the batch of requests at one time;
the cache process caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the cache sequence of the cache process.
9. A system for forwarding a request, the system comprising: the system comprises a client, a primary forwarding server, a secondary forwarding server and a processing server; wherein,
the client is used for initiating a request to the primary forwarding server, and the request carries the unique identifier of the client;
the primary forwarding server is used for forwarding the requests sent by the same client all the time to the same secondary forwarding server according to the unique identifier;
the second-level forwarding server is used for caching the requests forwarded by the first-level forwarding server and sending a batch of cached requests to the processing server when a preset caching condition is met;
the processing server is used for processing the batch of requests sent by the secondary forwarding server at one time;
the second-level forwarding server caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the caching sequence of the second-level forwarding server.
10. A system for forwarding a request, the system comprising: the system comprises a client, a forwarding server and a processing server; wherein,
the client is used for initiating a request to the forwarding server, and the request carries the unique identifier of the client;
the forwarding server is used for forwarding the requests sent by the same client all the time to the same caching process according to the unique identifier, and sending a batch of cached requests to the processing server when the caching process reaches a preset caching condition;
the processing server is used for processing the batch of requests forwarded by the forwarding server at one time;
the cache process caches the requests according to the sequence initiated by the requests, and the processing server processes the requests according to the cache sequence of the cache process.
CN201510959060.0A 2015-12-18 2015-12-18 Request forwarding method, device and system Pending CN105610906A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510959060.0A CN105610906A (en) 2015-12-18 2015-12-18 Request forwarding method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510959060.0A CN105610906A (en) 2015-12-18 2015-12-18 Request forwarding method, device and system

Publications (1)

Publication Number Publication Date
CN105610906A true CN105610906A (en) 2016-05-25

Family

ID=55990440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510959060.0A Pending CN105610906A (en) 2015-12-18 2015-12-18 Request forwarding method, device and system

Country Status (1)

Country Link
CN (1) CN105610906A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060164A (en) * 2016-07-12 2016-10-26 Tcl集团股份有限公司 Telescopic cloud server system and communication method thereof
CN106302145A (en) * 2016-08-23 2017-01-04 惠州市拉维尼科技有限公司 Forward request processing method
CN106331095A (en) * 2016-08-23 2017-01-11 惠州市拉维尼科技有限公司 Information forwarding method
CN107436767A (en) * 2017-07-31 2017-12-05 杭州安恒信息技术有限公司 The optimization method that idempotent operates in a kind of asynchronous framework
CN110730224A (en) * 2019-09-30 2020-01-24 深圳市金证前海金融科技有限公司 Data reporting method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161403A1 (en) * 2009-12-31 2011-06-30 Nokia Corporation Method and apparatus for providing client-side caching
CN102708173A (en) * 2012-05-02 2012-10-03 奇智软件(北京)有限公司 Method and system for processing user requests of accessing to web pages
CN102984266A (en) * 2012-12-05 2013-03-20 杭州勒卡斯广告策划有限公司 Interactive processing method and device for data
CN103297395A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Achievement method, system and device of internet business
CN104063461A (en) * 2012-05-02 2014-09-24 北京奇虎科技有限公司 Method and system for processing user requests of access to web pages
CN104077381A (en) * 2012-05-02 2014-10-01 北京奇虎科技有限公司 Webpage access request handling method and distribution method
CN104331461A (en) * 2014-10-31 2015-02-04 北京奇虎科技有限公司 Statement length control method and device
CN104408088A (en) * 2014-11-11 2015-03-11 北京奇虎科技有限公司 Control method and device for concurrent requests
CN104503853A (en) * 2014-12-25 2015-04-08 般固(北京)科技股份有限公司 Session holding method of multi-process server program on Linux system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110161403A1 (en) * 2009-12-31 2011-06-30 Nokia Corporation Method and apparatus for providing client-side caching
CN103297395A (en) * 2012-02-24 2013-09-11 阿里巴巴集团控股有限公司 Achievement method, system and device of internet business
CN102708173A (en) * 2012-05-02 2012-10-03 奇智软件(北京)有限公司 Method and system for processing user requests of accessing to web pages
CN104063461A (en) * 2012-05-02 2014-09-24 北京奇虎科技有限公司 Method and system for processing user requests of access to web pages
CN104077381A (en) * 2012-05-02 2014-10-01 北京奇虎科技有限公司 Webpage access request handling method and distribution method
CN102984266A (en) * 2012-12-05 2013-03-20 杭州勒卡斯广告策划有限公司 Interactive processing method and device for data
CN104331461A (en) * 2014-10-31 2015-02-04 北京奇虎科技有限公司 Statement length control method and device
CN104408088A (en) * 2014-11-11 2015-03-11 北京奇虎科技有限公司 Control method and device for concurrent requests
CN104503853A (en) * 2014-12-25 2015-04-08 般固(北京)科技股份有限公司 Session holding method of multi-process server program on Linux system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106060164A (en) * 2016-07-12 2016-10-26 Tcl集团股份有限公司 Telescopic cloud server system and communication method thereof
CN106302145A (en) * 2016-08-23 2017-01-04 惠州市拉维尼科技有限公司 Forward request processing method
CN106331095A (en) * 2016-08-23 2017-01-11 惠州市拉维尼科技有限公司 Information forwarding method
CN107436767A (en) * 2017-07-31 2017-12-05 杭州安恒信息技术有限公司 The optimization method that idempotent operates in a kind of asynchronous framework
CN110730224A (en) * 2019-09-30 2020-01-24 深圳市金证前海金融科技有限公司 Data reporting method and device

Similar Documents

Publication Publication Date Title
CN105610906A (en) Request forwarding method, device and system
CN103024053B (en) Cloud storage means, resource scheduling system, cloud memory node and system
CN103370917B (en) Message treatment method and server
US20150032837A1 (en) Hard Disk and Data Processing Method
CN104063344B (en) A kind of method and network interface card for storing data
CN103248684A (en) Resource acquiring method and device on Internet
CN105530127A (en) Method and proxy server for processing network access request by proxy server
CN105608159B (en) Method and device for data caching
WO2019127915A1 (en) Distributed consensus protocol-based data reading method and apparatus
CN106648832B (en) Device and method for improving resource utilization rate of virtual machine
CN104202434A (en) Node access method and device
CN104579948A (en) Method and device for message fragmentation processing
CN104125303B (en) Reading and writing data requesting method, client and system
CN105704171B (en) System and method for realizing CDN access
CN108228799A (en) The storage method and device of object indexing information
WO2017166524A1 (en) Domain name parsing method and apparatus
US10999371B2 (en) Request multiplexing
CN109788050B (en) A method, system, electronic device and medium for obtaining IP address of source station
CN102857547B (en) The method and apparatus of distributed caching
CN105592083B (en) Method and device for terminal to access server by using token
CN105227673A (en) The data download method of anti-abduction, client, server and system
CN105100224A (en) Data transmission method and device
CN102984138B (en) A kind of methods, devices and systems obtaining object
CN107798239B (en) Operational risk processing method, apparatus, computer equipment and storage medium
CN104580435A (en) Method and device for caching network connections

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160525

RJ01 Rejection of invention patent application after publication