WO2021114890A1 - Access request distribution method and related device - Google Patents
Access request distribution method and related device Download PDFInfo
- Publication number
- WO2021114890A1 WO2021114890A1 PCT/CN2020/122919 CN2020122919W WO2021114890A1 WO 2021114890 A1 WO2021114890 A1 WO 2021114890A1 CN 2020122919 W CN2020122919 W CN 2020122919W WO 2021114890 A1 WO2021114890 A1 WO 2021114890A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- access request
- requesting end
- identifier
- service
- access
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Definitions
- This application relates to the field of computer technology, and in particular to a method, device, computer equipment, and computer-readable storage medium for offloading access requests.
- the systems to be visited that provide access services include multiple systems.
- smart city systems include smart government systems, smart medical systems, and smart transportation systems.
- the inventor realizes that the amount of data in the access request to the system to be accessed is too large, which increases the pressure on the system to be accessed, causing the server to be prone to problems such as interruption, unresponsiveness, response timeout, and response time being too long, resulting in the stability of the system to be accessed reduce.
- the first aspect of the present application provides a method for offloading access requests, and the method for offloading access requests includes:
- the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
- the second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- a second aspect of the present application provides an access request distribution device, the access request distribution device including:
- the first receiving module is configured to receive the first access request from the requesting end;
- a judging module configured to judge the access type of the requesting end according to the first access request
- a determining module configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
- the return module is used to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
- a second receiving module configured to receive a second access request carrying the cookie identifier from the requesting end
- the offloading module is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
- a third aspect of the present application provides a computer device that includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:
- the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
- the second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- a fourth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
- the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
- the second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- This application receives the first access request of the requesting end; judges the access type of the requesting end according to the first access request; when the access type of the requesting end is a webpage request, according to the service identification of the first access request
- the target system is determined in the system; the cookie identifier is returned to the requesting terminal through the target system, so that the requesting terminal stores the cookie identifier; receiving the second access request carrying the cookie identifier from the requesting terminal;
- the COOKIE identifier in the second access request diverts the second access request to the target system.
- This application diverts different types of access requests, diverts the access requests to the target system, balances the access pressure of the system to be accessed including multiple systems, and improves the stability of the system to be accessed.
- Fig. 1 is a flowchart of an access request offloading method provided by an embodiment of the present application.
- Fig. 2 is a structural diagram of an access request shunting device provided by an embodiment of the present application.
- Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
- the access request shunting method of this application is applied to one or more computer devices.
- the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions.
- Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
- ASIC application specific integrated circuit
- FPGA Field-Programmable Gate Array
- DSP Digital Processor
- embedded equipment etc.
- This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc.
- This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module.
- program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
- This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network.
- program modules can be located in local and remote computer storage media including storage devices.
- the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
- FIG. 1 is a flowchart of a method for offloading access requests provided in Embodiment 1 of the present application.
- the access request shunting method is applied to computer equipment, and is used to shunt access requests, balance the access pressure of the system to be accessed including multiple systems, and improve the stability of the system to be accessed.
- the access request distribution method specifically includes the following steps. According to different requirements, the sequence of the steps in the flowchart can be changed, and some of the steps can be omitted.
- the requesting terminal may include a mobile terminal or a PC terminal.
- the first access request of the mobile terminal can be received, or the first access request of the PC terminal can be received.
- the first access request may include type identification, service identification, description information of the target data that needs to be requested, and the like.
- the requester when the requester needs to provide services from multiple systems to be accessed, or needs to request target data, the requester sends all the data to one of the multiple systems through the offload server (computer equipment).
- the first access request of the requesting end is received based on TCP (Transmission Control Protocol) or UDP (User Datagram Protocol).
- the type identifier may be extracted from the first access request, and the access type of the requesting end may be determined according to the type identifier of the first access request.
- the access type of the requester includes a web page request, an interface call request, and the like.
- the type identifier of the first access request when the type identifier of the first access request is "1", it is determined that the access type of the requesting end is an interface call request; when the type identifier of the first access request is "2", it is determined that the access type of the requesting end is a web page request.
- the type identification of the first access request may also include other character identifications.
- the access type of the requesting end is a web page request
- the determining a target system from a plurality of systems according to the service identifier of the first access request includes:
- the queried system is determined as the target system.
- the system associated with the business identity is "prd1".
- the system associated with the service identifier of the first access request is "prd1" as the key of the service routing table query with the service identifier of the first access request, "prd1" is determined as the target system.
- the returning the COOKIE (data stored on the user's local terminal) identifier to the requesting end through the target system includes:
- the first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
- the target system When forwarding the first access request to the target system, the target system intercepts the first access request through the pre-interceptor of the target system, and recognizes the access in the first access request When the type is a web page request, the cookie identifier is generated, and the cookie identifier is written into the response information returned to the requester.
- the method for offloading access requests further includes:
- the service ID of the first access request is "hh”
- the service ID "hh” of the first access request is used as the key, and the system associated with the service ID of the first access request is not queried from the service routing table.
- the first access request may be a same-domain cascading request of the first access request, and the second access request carries the cookie identifier.
- the requesting end When the requesting end receives the response information returned by the target system in response to the first access request, it writes the COOKIE identifier in the response information to the requesting end.
- the offloading the second access request to the target system according to the cookie identifier in the second access request includes:
- the target data description information in the second access request determine whether the target data is stored locally on the requesting end;
- the requesting end When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;
- the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
- the requesting end When the requesting end stores the target data, it returns a local read identifier to the requesting end, so that the requesting end reads the target data from the requesting end, so that the requesting end does not need to read the target data from the requesting end.
- the target system obtains the target data.
- the method for offloading access requests further includes:
- the access type of the requesting end is an interface call request
- the first access request is diverted to a designated system according to the service identifier of the first access request.
- the requesting side's access request is diverted to different systems.
- the method for offloading access requests further includes:
- a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
- the access request offloading method of the first embodiment receives the first access request of the requesting end; judges the access type of the requesting end according to the first access request; when the access type of the requesting end is a webpage request, according to the first access request
- the service identification of the service identifies the target system from multiple systems; the cookie identification is returned to the requesting end through the target system, so that the requesting end stores the cookie identification; receiving the requesting end’s second carrying the cookie identification 2.
- the first embodiment realizes the demand for the business to monopolize a system, and meets the requirements of the requesting side for system security and stability; isolates different request flows to different systems, and when the request volume on a certain system increases suddenly or the business fails , And also ensure that other systems are not affected.
- This application diverts different types of access requests, diverts the access requests to the target system, balances the access pressure of the system to be accessed including multiple systems, and improves the stability of the system to be accessed.
- Fig. 2 is a structural diagram of an access request shunting device provided in the second embodiment of the present application.
- the access request shunting device 20 is applied to computer equipment.
- the access request shunting device 20 is used to shunt access requests, balance the access pressure of the system to be accessed including multiple systems, and improve the stability of the system to be accessed.
- the access request shunting device 20 may include a first receiving module 201, a judging module 202, a determining module 203, a returning module 204, a second receiving module 205, and a shunting module 206.
- the first receiving module 201 is configured to receive the first access request from the requesting end.
- the requesting terminal may include a mobile terminal or a PC terminal.
- the first access request of the mobile terminal can be received, or the first access request of the PC terminal can be received.
- the first access request may include type identification, service identification, description information of the target data that needs to be requested, and the like.
- the requester when the requester needs to provide services from multiple systems to be accessed, or needs to request target data, the requester sends all the data to one of the multiple systems through the offload server (computer equipment).
- the first access request of the requesting end is received based on TCP (Transmission Control Protocol) or UDP (User Datagram Protocol).
- the judging module 202 is configured to judge the access type of the requesting end according to the first access request.
- the type identifier may be extracted from the first access request, and the access type of the requesting end may be determined according to the type identifier of the first access request.
- the access type of the requester includes a web page request, an interface call request, and the like.
- the type identifier of the first access request when the type identifier of the first access request is "1", it is determined that the access type of the requesting end is an interface call request; when the type identifier of the first access request is "2", it is determined that the access type of the requesting end is a web page request.
- the type identification of the first access request may also include other character identifications.
- the determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request.
- the determining a target system from a plurality of systems according to the service identifier of the first access request includes:
- the queried system is determined as the target system.
- the system associated with the business identity is "prd1".
- the system associated with the service identifier of the first access request is "prd1" as the key of the service routing table query with the service identifier of the first access request, "prd1" is determined as the target system.
- the return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier.
- the returning the COOKIE (data stored on the user's local terminal) identifier to the requesting end through the target system includes:
- the first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
- the target system When forwarding the first access request to the target system, the target system intercepts the first access request through the pre-interceptor of the target system, and recognizes the access in the first access request When the type is a web page request, the cookie identifier is generated, and the cookie identifier is written into the response information returned to the requester.
- the return module is further configured to use the service identifier of the first access request as a key to find no information associated with the service identifier of the first access request from the service routing table. In the case of the system, a prompt message is returned to the requesting end to remind the access error.
- the service ID of the first access request is "hh”
- the service ID "hh” of the first access request is used as the key, and the system associated with the service ID of the first access request is not queried from the service routing table.
- the second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end.
- the first access request may be a same-domain cascading request of the first access request, and the second access request carries the cookie identifier.
- the requesting end When the requesting end receives the response information returned by the target system in response to the first access request, it writes the COOKIE identifier in the response information to the requesting end.
- the offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
- the offloading the second access request to the target system according to the cookie identifier in the second access request includes:
- the target data description information in the second access request determine whether the target data is stored locally on the requesting end;
- the requesting end When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;
- the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
- the requesting end When the requesting end stores the target data, it returns a local read identifier to the requesting end, so that the requesting end reads the target data from the requesting end, so that the requesting end does not need to read the target data from the requesting end.
- the target system obtains the target data.
- the offloading module is further configured to offload the first access request to a designated system according to the service identifier of the first access request when the access type of the requesting end is an interface call request.
- the requesting side's access request is diverted to different systems.
- the access request shunting device further includes a reminder module, configured to obtain the first time point when the first access request is received;
- a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
- the access request shunting device 20 of the second embodiment realizes the demand for the business to monopolize a system, and meets the requirements of the requesting end for system security and stability; separates different request flows to different systems, when the request volume on a certain system In the event of a sudden increase or business failure, it is also ensured that other systems are not affected.
- different types of access requests are diverted, the access requests are diverted to the target system, the access pressure of the system to be accessed including multiple systems is balanced, and the stability of the system to be accessed is improved.
- This embodiment provides a computer-readable storage medium having computer-readable instructions stored thereon.
- the computer-readable storage medium may be non-volatile or volatile.
- the steps in the embodiment of the access request offloading method are realized, for example, steps 101-106 shown in FIG. 1:
- the access type of the requesting end is a web page request
- each module in the above-mentioned device embodiment is realized, for example, the modules 201-206 in FIG. 2:
- the first receiving module 201 is configured to receive the first access request from the requesting end;
- the judging module 202 is configured to judge the access type of the requesting end according to the first access request
- the determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
- the return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
- the second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end;
- the offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
- FIG. 3 is a schematic diagram of the computer equipment provided in the fourth embodiment of the application.
- the computer device 30 includes a memory 301, a processor 302, and computer-readable instructions 303 stored in the memory 301 and running on the processor 302, such as an access request shunt program.
- the processor 302 executes the computer-readable instruction 303, the steps in the above-mentioned access request offloading method embodiment are implemented, for example, steps 101-106 shown in FIG. 1:
- the access type of the requesting end is a web page request
- each module in the above-mentioned device embodiment is realized, for example, the modules 201-206 in FIG. 2:
- the first receiving module 201 is configured to receive the first access request from the requesting end;
- the judging module 202 is configured to judge the access type of the requesting end according to the first access request
- the determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
- the return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
- the second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end;
- the offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
- the computer-readable instruction 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method.
- the one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer readable instruction 303 in the computer device 30.
- the computer-readable instruction 303 can be divided into the first receiving module 201, the judging module 202, the determining module 203, the returning module 204, the second receiving module 205, and the shunting module 206 in FIG. 2.
- Example two For the specific functions of each module, see ⁇ Example two.
- the computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the schematic diagram 3 is only an example of the computer device 30, and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or different components.
- the computer device 30 may also include input and output devices, network access devices, buses, and so on.
- the so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc.
- the processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30. Various parts.
- the memory 301 may be used to store the computer-readable instructions 303, and the processor 302 executes or executes the computer-readable instructions or modules stored in the memory 301 and calls the data stored in the memory 301 to implement Various functions of the computer device 30.
- the memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may Data and the like created in accordance with the use of the computer device 30 are stored.
- the memory 301 may include a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), at least one disk storage device, flash memory Devices, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), or other non-volatile/volatile storage devices.
- the integrated module of the computer device 30 may be stored in a computer-readable storage medium.
- the computer-readable storage medium may be non-volatile or volatile. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium.
- the computer-readable instruction when executed by the processor, it can implement the steps of the foregoing method embodiments.
- the computer-readable instructions may be in the form of source code, object code, executable file, or some intermediate forms, etc.
- the computer-readable storage medium may include: any entity or device capable of carrying the computer-readable instructions, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, read only memory (ROM), random access memory ( RAM).
- modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
- the above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
- the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium.
- the above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the access request described in each embodiment of this application Some steps of the shunt method.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present application relates to the technical field of computers, and provides an access request distribution method and related device. In the access request distribution method, a first access request is received from a requesting terminal; the access type of the requesting terminal is determined according to the first access request; if the access type of the requesting terminal is a webpage request, then a target system is determined from among a plurality of systems according to a service identifier of the first access request; a COOKIE identifier is returned to the requesting terminal by means of the target system, causing the requesting terminal to store the COOKIE identifier; a second access request carrying a COOKIE identifier is received from the requesting terminal; the second access request is distributed to the target system according to the COOKIE identifier in the second access request. The present application can be applied to fields such as smart cities, and thus can promote the construction of smart cities. The present application distributes access requests, balancing the access pressure of a system to be accessed, improving the stability of the system to be accessed.
Description
本申请要求于2020年07月30日提交中国专利局,申请号为202010754519.4申请名称为“访问请求分流方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims to be submitted to the Chinese Patent Office on July 30, 2020. The application number is 202010754519.4. The application titled "Access request shunting method and related equipment" is the priority of the Chinese patent application, the entire content of which is incorporated into this application by reference.
本申请涉及计算机技术领域,具体涉及一种访问请求分流方法、装置、计算机设备及计算机可读存储介质。This application relates to the field of computer technology, and in particular to a method, device, computer equipment, and computer-readable storage medium for offloading access requests.
目前,提供访问服务的待访问系统包括多个系统。例如,智慧城市系统包括智慧政务系统、智慧医疗系统、智慧交通系统等。发明人意识到,对待访问系统的访问请求的数据量过大,增加待访问系统的压力,造成服务器容易出现中断、无响应、响应超时、响应时间过长等问题,致使待访问系统的稳定性降低。Currently, the systems to be visited that provide access services include multiple systems. For example, smart city systems include smart government systems, smart medical systems, and smart transportation systems. The inventor realizes that the amount of data in the access request to the system to be accessed is too large, which increases the pressure on the system to be accessed, causing the server to be prone to problems such as interruption, unresponsiveness, response timeout, and response time being too long, resulting in the stability of the system to be accessed reduce.
如何提升待访问系统的稳定性成为待解决的问题。How to improve the stability of the system to be accessed has become a problem to be solved.
发明内容Summary of the invention
鉴于以上内容,有必要提出一种访问请求分流方法、装置、计算机设备及计算机可读存储介质,其可以对访问请求进行分流,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。In view of the above, it is necessary to propose a method, device, computer equipment, and computer-readable storage medium for shunting access requests, which can shunt access requests, balance the access pressure of the system to be accessed including multiple systems, and improve the system to be accessed The stability.
本申请的第一方面提供一种访问请求分流方法,所述访问请求分流方法包括:The first aspect of the present application provides a method for offloading access requests, and the method for offloading access requests includes:
接收请求端的第一访问请求;Receiving the first access request from the requesting end;
根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;
当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;
根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
本申请的第二方面提供一种访问请求分流装置,所述访问请求分流装置包括:A second aspect of the present application provides an access request distribution device, the access request distribution device including:
第一接收模块,用于接收请求端的第一访问请求;The first receiving module is configured to receive the first access request from the requesting end;
判断模块,用于根据所述第一访问请求判断所述请求端的访问类型;A judging module, configured to judge the access type of the requesting end according to the first access request;
确定模块,用于当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;A determining module, configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
返回模块,用于通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;The return module is used to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
第二接收模块,用于接收所述请求端的携带所述COOKIE标识的第二访问请求;A second receiving module, configured to receive a second access request carrying the cookie identifier from the requesting end;
分流模块,用于根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The offloading module is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
本申请的第三方面提供一种计算机设备,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:A third aspect of the present application provides a computer device that includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:
接收请求端的第一访问请求;Receiving the first access request from the requesting end;
根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;
当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;
根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
本申请的第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:A fourth aspect of the present application provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
接收请求端的第一访问请求;Receiving the first access request from the requesting end;
根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;
当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;
通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;
根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
本申请接收请求端的第一访问请求;根据所述第一访问请求判断所述请求端的访问类型;当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;接收所述请求端的携带所述COOKIE标识的第二访问请求;根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。本申请对不同类型的访问请求进行分流,将访问请求分流至目标系统,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。This application receives the first access request of the requesting end; judges the access type of the requesting end according to the first access request; when the access type of the requesting end is a webpage request, according to the service identification of the first access request The target system is determined in the system; the cookie identifier is returned to the requesting terminal through the target system, so that the requesting terminal stores the cookie identifier; receiving the second access request carrying the cookie identifier from the requesting terminal; The COOKIE identifier in the second access request diverts the second access request to the target system. This application diverts different types of access requests, diverts the access requests to the target system, balances the access pressure of the system to be accessed including multiple systems, and improves the stability of the system to be accessed.
图1是本申请实施例提供的访问请求分流方法的流程图。Fig. 1 is a flowchart of an access request offloading method provided by an embodiment of the present application.
图2是本申请实施例提供的访问请求分流装置的结构图。Fig. 2 is a structural diagram of an access request shunting device provided by an embodiment of the present application.
图3是本申请实施例提供的计算机设备的示意图。Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to be able to understand the above objectives, features and advantages of the application more clearly, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the application and the features in the embodiments can be combined with each other if there is no conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In the following description, many specific details are set forth in order to fully understand the present application. The described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field of this application. The terms used in the specification of the application herein are only for the purpose of describing specific embodiments, and are not intended to limit the application.
优选地,本申请的访问请求分流方法应用在一个或者多个计算机设备中。所述计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。Preferably, the access request shunting method of this application is applied to one or more computer devices. The computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。This application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, small computers, large computers, including Distributed computing environment for any of the above systems or equipment, etc. This application may be described in the general context of computer-executable instructions executed by a computer, such as a program module. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。The computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
实施例一Example one
图1是本申请实施例一提供的访问请求分流方法的流程图。所述访问请求分流方法应用于计算机设备,用于对访问请求进行分流,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。FIG. 1 is a flowchart of a method for offloading access requests provided in Embodiment 1 of the present application. The access request shunting method is applied to computer equipment, and is used to shunt access requests, balance the access pressure of the system to be accessed including multiple systems, and improve the stability of the system to be accessed.
所述访问请求分流方法具体包括以下步骤,根据不同的需求,该流程图中步骤的顺序可以改变,某些可以省略。The access request distribution method specifically includes the following steps. According to different requirements, the sequence of the steps in the flowchart can be changed, and some of the steps can be omitted.
101,接收请求端的第一访问请求。101. Receive a first access request from the requesting end.
所述请求端可以包括移动终端或PC终端。可以接收移动终端的第一访问请求,或接收PC终端的第一访问请求。The requesting terminal may include a mobile terminal or a PC terminal. The first access request of the mobile terminal can be received, or the first access request of the PC terminal can be received.
所述第一访问请求可以包括类型标识、业务标识、对需要请求的目标数据的描述信息等。The first access request may include type identification, service identification, description information of the target data that needs to be requested, and the like.
在一具体实施例中,当所述请求端需要待访问的多个系统提供服务,或需要请求目标数据时,所述请求端通过分流服务器(计算机设备)向多个系统中的一个系统发送所述第一访问请求。基于TCP(传输控制协议,Transmission Control Protocol)或UDP(用户数据报协议,User Datagram Protocol)接收所述请求端的所述第一访问请求。In a specific embodiment, when the requester needs to provide services from multiple systems to be accessed, or needs to request target data, the requester sends all the data to one of the multiple systems through the offload server (computer equipment). The first access request. The first access request of the requesting end is received based on TCP (Transmission Control Protocol) or UDP (User Datagram Protocol).
102,根据所述第一访问请求判断所述请求端的访问类型。102. Determine the access type of the requesting end according to the first access request.
当接收到所述第一访问请求时,可以从所述第一访问请求中提取类型标识,根据所述第一访问请求的类型标识判断所述请求端的访问类型。When the first access request is received, the type identifier may be extracted from the first access request, and the access type of the requesting end may be determined according to the type identifier of the first access request.
所述请求端的访问类型包括网页请求、接口调用请求等。The access type of the requester includes a web page request, an interface call request, and the like.
例如,当第一访问请求的类型标识为“1”,确定请求端的访问类型为接口调用请求;当第一访问请求的类型标识为“2”,确定请求端的访问类型为网页请求。第一访问请求的类型标识还可以包括其它字符标识。For example, when the type identifier of the first access request is "1", it is determined that the access type of the requesting end is an interface call request; when the type identifier of the first access request is "2", it is determined that the access type of the requesting end is a web page request. The type identification of the first access request may also include other character identifications.
103,当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统。103. When the access type of the requesting end is a web page request, determine a target system from multiple systems according to the service identifier of the first access request.
在一具体实施例中,所述根据所述第一访问请求的业务标识从多个系统中确定目标系统包括:In a specific embodiment, the determining a target system from a plurality of systems according to the service identifier of the first access request includes:
获取业务路由表,所述业务路由表包括关联存储的业务标识和系统;Acquiring a service routing table, where the service routing table includes associated stored service identifiers and systems;
以所述第一访问请求的业务标识为关键字从所述业务路由表中查询与所述第一访问请求的业务标识关联的系统;Using the service identifier of the first access request as a key to query the system associated with the service identifier of the first access request from the service routing table;
当以所述第一访问请求的业务标识为关键字从所述业务路由表中查询到与所述第一访问请求的业务标识关联的系统时,将查询到的系统确定为目标系统。When a system associated with the service identifier of the first access request is queried from the service routing table using the service identifier of the first access request as a key, the queried system is determined as the target system.
例如,业务路由表关联存储了业务标识和系统的映射关系为“yh=prd1、cx=prd2”,其中,“yh”、“cx”为业务标识,“=”为一一映射关系,“prd1”、“prd2”为系统 (包括系统路由)。系统可以包括服务系统、被调用系统等。可以从第一访问请求https://xxx.paic.com.cn/login?biz=yh中根据关键字“biz”提取到第一访问请求的业务标识为“yh”,以第一访问请求的业务标识“yh”为关键字从业务路由表中查询与第一访问请求的业务标识关联的系统为“prd1”。当以第一访问请求的业务标识为关键字从业务路由表中查询到与第一访问请求的业务标识关联的系统为“prd1”时,将“prd1”确定为目标系统。For example, the business routing table stores the mapping relationship between the business identifier and the system as "yh=prd1, cx=prd2", where "yh" and "cx" are business identifiers, "=" is a one-to-one mapping relationship, and "prd1" "And "prd2" are systems (including system routing). The system can include a service system, a called system, and so on. Can the first visit request https://xxx.paic.com.cn/login? In biz=yh, the business ID of the first access request extracted according to the keyword "biz" is "yh", and the business routing table is queried from the business routing table with the first access request’s business ID "yh" as the key. The system associated with the business identity is "prd1". When the system associated with the service identifier of the first access request is "prd1" as the key of the service routing table query with the service identifier of the first access request, "prd1" is determined as the target system.
104,通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识。104. Return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier.
在一具体实施例中,所述通过所述目标系统将COOKIE(储存在用户本地终端上的数据)标识返回给所述请求端包括:In a specific embodiment, the returning the COOKIE (data stored on the user's local terminal) identifier to the requesting end through the target system includes:
将所述第一访问请求转发给所述目标系统,使所述目标系统生成所述COOKIE标识,响应于所述第一访问请求将所述COOKIE返回至所述请求端。The first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
将所述第一访问请求转发给所述目标系统时,所述目标系统通过所述目标系统的前置拦截器对所述第一访问请求进行拦截,识别到所述第一访问请求中的访问类型为网页请求时,生成所述COOKIE标识,将所述COOKIE标识写入返回所述请求端的响应信息中。When forwarding the first access request to the target system, the target system intercepts the first access request through the pre-interceptor of the target system, and recognizes the access in the first access request When the type is a web page request, the cookie identifier is generated, and the cookie identifier is written into the response information returned to the requester.
在另一实施例中,所述访问请求分流方法还包括:In another embodiment, the method for offloading access requests further includes:
当以所述第一访问请求的业务标识为关键字从所述业务路由表中未查询到与所述第一访问请求的业务标识关联的系统时,向所述请求端返回提示信息以提醒访问出错。When the system associated with the service ID of the first access request is not queried from the service routing table using the service ID of the first access request as a key, prompt information is returned to the requesting end to remind the access Something went wrong.
如上例,当第一访问请求的业务标识为“hh”时,以第一访问请求的业务标识“hh”为关键字没有从业务路由表中查询到与第一访问请求的业务标识关联的系统,返回给请求端一个提示信息(如404)以提醒访问出错。As in the above example, when the service ID of the first access request is "hh", the service ID "hh" of the first access request is used as the key, and the system associated with the service ID of the first access request is not queried from the service routing table. , Return a prompt message (such as 404) to the requester to remind the access error.
105,接收所述请求端的携带所述COOKIE标识的第二访问请求。105. Receive a second access request carrying the COOKIE identifier from the requesting end.
在一具体实施例中,所述第一访问请求可以是所述第一访问请求的同域级联请求,所述第二访问请求携带有所述COOKIE标识。In a specific embodiment, the first access request may be a same-domain cascading request of the first access request, and the second access request carries the cookie identifier.
当所述请求端接收到所述目标系统响应于所述第一访问请求返回的响应信息时,将所述响应信息中的COOKIE标识写入所述请求端。When the requesting end receives the response information returned by the target system in response to the first access request, it writes the COOKIE identifier in the response information to the requesting end.
106,根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。106. Offload the second access request to the target system according to the COOKIE identifier in the second access request.
在一具体实施例中,所述根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统包括:In a specific embodiment, the offloading the second access request to the target system according to the cookie identifier in the second access request includes:
根据所述第二访问请求中的目标数据描述信息,判断所述请求端的本地是否存储有目标数据;According to the target data description information in the second access request, determine whether the target data is stored locally on the requesting end;
当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据;When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;
当所述请求端没有存储所述目标数据时,将所述第二访问请求发送至所述目标系统,通过所述目标系统向所述请求端发送所述目标数据。When the requesting end does not store the target data, the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据,使得所述请求端不用从所述目标系统获取所述目标数据。When the requesting end stores the target data, it returns a local read identifier to the requesting end, so that the requesting end reads the target data from the requesting end, so that the requesting end does not need to read the target data from the requesting end. The target system obtains the target data.
在另一实施例中,所述访问请求分流方法还包括:In another embodiment, the method for offloading access requests further includes:
当所述请求端的访问类型为接口调用请求时,根据所述第一访问请求的业务标识将所述第一访问请求分流至指定系统。When the access type of the requesting end is an interface call request, the first access request is diverted to a designated system according to the service identifier of the first access request.
根据请求端的访问类型将请求端的访问请求分流至不同的系统。According to the access type of the requesting side, the requesting side's access request is diverted to different systems.
在另一实施例中,所述访问请求分流方法还包括:In another embodiment, the method for offloading access requests further includes:
获取接收所述第一访问请求的第一时间点;Acquiring the first time point when the first access request is received;
获取接收所述第二访问请求的第二时间点;Acquiring a second time point when the second access request is received;
计算所述第一时间点与所述第二时间点的时间差;Calculating the time difference between the first time point and the second time point;
当所述时间差超过预设时间差时,向所述请求端发出请求超时的提醒信息,以提醒所述请求端重新获取所述COOKIE标识。When the time difference exceeds the preset time difference, a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
实施例一的访问请求分流方法接收请求端的第一访问请求;根据所述第一访问请求判断所述请求端的访问类型;当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;接收所述请求端的携带所述COOKIE标识的第二访问请求;根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。实施例一实现了业务独占一个系统的诉求,满足请求端对于系统安全和稳定性上的需求;将不同的请求流量隔离到不同系统上,当某一系统上的请求量突增或者业务故障时,也确保不影响到其他系统。本申请对不同类型的访问请求进行分流,将访问请求分流至目标系统,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。The access request offloading method of the first embodiment receives the first access request of the requesting end; judges the access type of the requesting end according to the first access request; when the access type of the requesting end is a webpage request, according to the first access request The service identification of the service identifies the target system from multiple systems; the cookie identification is returned to the requesting end through the target system, so that the requesting end stores the cookie identification; receiving the requesting end’s second carrying the cookie identification 2. Access request; according to the COOKIE identifier in the second access request, the second access request is diverted to the target system. The first embodiment realizes the demand for the business to monopolize a system, and meets the requirements of the requesting side for system security and stability; isolates different request flows to different systems, and when the request volume on a certain system increases suddenly or the business fails , And also ensure that other systems are not affected. This application diverts different types of access requests, diverts the access requests to the target system, balances the access pressure of the system to be accessed including multiple systems, and improves the stability of the system to be accessed.
实施例二Example two
图2是本申请实施例二提供的访问请求分流装置的结构图。所述访问请求分流装置20应用于计算机设备。所述访问请求分流装置20用于对访问请求进行分流,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。Fig. 2 is a structural diagram of an access request shunting device provided in the second embodiment of the present application. The access request shunting device 20 is applied to computer equipment. The access request shunting device 20 is used to shunt access requests, balance the access pressure of the system to be accessed including multiple systems, and improve the stability of the system to be accessed.
如图2所示,所述访问请求分流装置20可以包括第一接收模块201、判断模块202、确定模块203、返回模块204、第二接收模块205、分流模块206。As shown in FIG. 2, the access request shunting device 20 may include a first receiving module 201, a judging module 202, a determining module 203, a returning module 204, a second receiving module 205, and a shunting module 206.
第一接收模块201,用于接收请求端的第一访问请求。The first receiving module 201 is configured to receive the first access request from the requesting end.
所述请求端可以包括移动终端或PC终端。可以接收移动终端的第一访问请求,或接收PC终端的第一访问请求。The requesting terminal may include a mobile terminal or a PC terminal. The first access request of the mobile terminal can be received, or the first access request of the PC terminal can be received.
所述第一访问请求可以包括类型标识、业务标识、对需要请求的目标数据的描述信息等。The first access request may include type identification, service identification, description information of the target data that needs to be requested, and the like.
在一具体实施例中,当所述请求端需要待访问的多个系统提供服务,或需要请求目标数据时,所述请求端通过分流服务器(计算机设备)向多个系统中的一个系统发送所述第一访问请求。基于TCP(传输控制协议,Transmission Control Protocol)或UDP(用户数据报协议,User Datagram Protocol)接收所述请求端的所述第一访问请求。In a specific embodiment, when the requester needs to provide services from multiple systems to be accessed, or needs to request target data, the requester sends all the data to one of the multiple systems through the offload server (computer equipment). The first access request. The first access request of the requesting end is received based on TCP (Transmission Control Protocol) or UDP (User Datagram Protocol).
判断模块202,用于根据所述第一访问请求判断所述请求端的访问类型。The judging module 202 is configured to judge the access type of the requesting end according to the first access request.
当接收到所述第一访问请求时,可以从所述第一访问请求中提取类型标识,根据所述第一访问请求的类型标识判断所述请求端的访问类型。When the first access request is received, the type identifier may be extracted from the first access request, and the access type of the requesting end may be determined according to the type identifier of the first access request.
所述请求端的访问类型包括网页请求、接口调用请求等。The access type of the requester includes a web page request, an interface call request, and the like.
例如,当第一访问请求的类型标识为“1”,确定请求端的访问类型为接口调用请求;当第一访问请求的类型标识为“2”,确定请求端的访问类型为网页请求。第一访问请求的类型标识还可以包括其它字符标识。For example, when the type identifier of the first access request is "1", it is determined that the access type of the requesting end is an interface call request; when the type identifier of the first access request is "2", it is determined that the access type of the requesting end is a web page request. The type identification of the first access request may also include other character identifications.
确定模块203,用于当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统。The determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request.
在一具体实施例中,所述根据所述第一访问请求的业务标识从多个系统中确定目标系统包括:In a specific embodiment, the determining a target system from a plurality of systems according to the service identifier of the first access request includes:
获取业务路由表,所述业务路由表包括关联存储的业务标识和系统;Acquiring a service routing table, where the service routing table includes associated stored service identifiers and systems;
以所述第一访问请求的业务标识为关键字从所述业务路由表中查询与所述第一访问请求的业务标识关联的系统;Using the service identifier of the first access request as a key to query the system associated with the service identifier of the first access request from the service routing table;
当以所述第一访问请求的业务标识为关键字从所述业务路由表中查询到与所述第一访问请求的业务标识关联的系统时,将查询到的系统确定为目标系统。When a system associated with the service identifier of the first access request is queried from the service routing table using the service identifier of the first access request as a key, the queried system is determined as the target system.
例如,业务路由表关联存储了业务标识和系统的映射关系为“yh=prd1、cx=prd2”,其中,“yh”、“cx”为业务标识,“=”为一一映射关系,“prd1”、“prd2”为系统(包括系统路由)。系统可以包括服务系统、被调用系统等。可以从第一访问请求https://xxx.paic.com.cn/login?biz=yh中根据关键字“biz”提取到第一访问请求的业务标识为“yh”,以第一访问请求的业务标识“yh”为关键字从业务路由表中查询与第一访问请求的业务标识关联的系统为“prd1”。当以第一访问请求的业务标识为关键字从业务路由表中查询到与第一访问请求的业务标识关联的系统为“prd1”时,将“prd1”确定为目标系统。For example, the business routing table stores the mapping relationship between the business identifier and the system as "yh=prd1, cx=prd2", where "yh" and "cx" are business identifiers, "=" is a one-to-one mapping relationship, and "prd1" "And "prd2" are systems (including system routing). The system can include a service system, a called system, and so on. Can the first visit request https://xxx.paic.com.cn/login? In biz=yh, the business ID of the first access request extracted according to the keyword "biz" is "yh", and the business routing table is queried from the business routing table with the first access request’s business ID "yh" as the key. The system associated with the business identity is "prd1". When the system associated with the service identifier of the first access request is "prd1" as the key of the service routing table query with the service identifier of the first access request, "prd1" is determined as the target system.
返回模块204,用于通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识。The return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier.
在一具体实施例中,所述通过所述目标系统将COOKIE(储存在用户本地终端上的数据)标识返回给所述请求端包括:In a specific embodiment, the returning the COOKIE (data stored on the user's local terminal) identifier to the requesting end through the target system includes:
将所述第一访问请求转发给所述目标系统,使所述目标系统生成所述COOKIE标识,响应于所述第一访问请求将所述COOKIE返回至所述请求端。The first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
将所述第一访问请求转发给所述目标系统时,所述目标系统通过所述目标系统的前置拦截器对所述第一访问请求进行拦截,识别到所述第一访问请求中的访问类型为网页请求时,生成所述COOKIE标识,将所述COOKIE标识写入返回所述请求端的响应信息中。When forwarding the first access request to the target system, the target system intercepts the first access request through the pre-interceptor of the target system, and recognizes the access in the first access request When the type is a web page request, the cookie identifier is generated, and the cookie identifier is written into the response information returned to the requester.
在另一实施例中,所述返回模块还用于当以所述第一访问请求的业务标识为关键字从所述业务路由表中未查询到与所述第一访问请求的业务标识关联的系统时,向所述请求端返回提示信息以提醒访问出错。In another embodiment, the return module is further configured to use the service identifier of the first access request as a key to find no information associated with the service identifier of the first access request from the service routing table. In the case of the system, a prompt message is returned to the requesting end to remind the access error.
如上例,当第一访问请求的业务标识为“hh”时,以第一访问请求的业务标识“hh”为关键字没有从业务路由表中查询到与第一访问请求的业务标识关联的系统,返回给请求端一个提示信息(如404)以提醒访问出错。As in the above example, when the service ID of the first access request is "hh", the service ID "hh" of the first access request is used as the key, and the system associated with the service ID of the first access request is not queried from the service routing table. , Return a prompt message (such as 404) to the requester to remind the access error.
第二接收模块205,用于接收所述请求端的携带所述COOKIE标识的第二访问请求。The second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end.
在一具体实施例中,所述第一访问请求可以是所述第一访问请求的同域级联请求,所述第二访问请求携带有所述COOKIE标识。In a specific embodiment, the first access request may be a same-domain cascading request of the first access request, and the second access request carries the cookie identifier.
当所述请求端接收到所述目标系统响应于所述第一访问请求返回的响应信息时,将所述响应信息中的COOKIE标识写入所述请求端。When the requesting end receives the response information returned by the target system in response to the first access request, it writes the COOKIE identifier in the response information to the requesting end.
分流模块206,用于根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
在一具体实施例中,所述根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统包括:In a specific embodiment, the offloading the second access request to the target system according to the cookie identifier in the second access request includes:
根据所述第二访问请求中的目标数据描述信息,判断所述请求端的本地是否存储有目标数据;According to the target data description information in the second access request, determine whether the target data is stored locally on the requesting end;
当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据;When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;
当所述请求端没有存储所述目标数据时,将所述第二访问请求发送至所述目标系统,通过所述目标系统向所述请求端发送所述目标数据。When the requesting end does not store the target data, the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据,使得所述请求端不用从所述目标系统获取所述目标数据。When the requesting end stores the target data, it returns a local read identifier to the requesting end, so that the requesting end reads the target data from the requesting end, so that the requesting end does not need to read the target data from the requesting end. The target system obtains the target data.
在另一实施例中,所述分流模块还用于当所述请求端的访问类型为接口调用请求时,根据所述第一访问请求的业务标识将所述第一访问请求分流至指定系统。In another embodiment, the offloading module is further configured to offload the first access request to a designated system according to the service identifier of the first access request when the access type of the requesting end is an interface call request.
根据请求端的访问类型将请求端的访问请求分流至不同的系统。According to the access type of the requesting side, the requesting side's access request is diverted to different systems.
在另一实施例中,所述访问请求分流装置还包括提醒模块,用于获取接收所述第一 访问请求的第一时间点;In another embodiment, the access request shunting device further includes a reminder module, configured to obtain the first time point when the first access request is received;
获取接收所述第二访问请求的第二时间点;Acquiring a second time point when the second access request is received;
计算所述第一时间点与所述第二时间点的时间差;Calculating the time difference between the first time point and the second time point;
当所述时间差超过预设时间差时,向所述请求端发出请求超时的提醒信息,以提醒所述请求端重新获取所述COOKIE标识。When the time difference exceeds the preset time difference, a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
实施例二的访问请求分流装置20实现了业务独占一个系统的诉求,满足请求端对于系统安全和稳定性上的需求;将不同的请求流量隔离到不同系统上,当某一系统上的请求量突增或者业务故障时,也确保不影响到其他系统。实施例二对不同类型的访问请求进行分流,将访问请求分流至目标系统,均衡包括多个系统的待访问系统的访问压力,提升待访问系统的稳定性。The access request shunting device 20 of the second embodiment realizes the demand for the business to monopolize a system, and meets the requirements of the requesting end for system security and stability; separates different request flows to different systems, when the request volume on a certain system In the event of a sudden increase or business failure, it is also ensured that other systems are not affected. In the second embodiment, different types of access requests are diverted, the access requests are diverted to the target system, the access pressure of the system to be accessed including multiple systems is balanced, and the stability of the system to be accessed is improved.
实施例三Example three
本实施例提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,所述计算机可读存储介质可以是非易失性,也可以是易失性。该计算机可读指令被处理器执行时实现上述访问请求分流方法实施例中的步骤,例如图1所示的步骤101-106:This embodiment provides a computer-readable storage medium having computer-readable instructions stored thereon. The computer-readable storage medium may be non-volatile or volatile. When the computer-readable instruction is executed by the processor, the steps in the embodiment of the access request offloading method are realized, for example, steps 101-106 shown in FIG. 1:
101,接收请求端的第一访问请求;101. Receive a first access request from the requesting end;
102,根据所述第一访问请求判断所述请求端的访问类型;102. Judging the access type of the requesting end according to the first access request;
103,当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;103. When the access type of the requesting end is a web page request, determine a target system from multiple systems according to the service identifier of the first access request;
104,通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;104. Return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
105,接收所述请求端的携带所述COOKIE标识的第二访问请求;105. Receive a second access request carrying the cookie identifier from the requesting end;
106,根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。106. Offload the second access request to the target system according to the COOKIE identifier in the second access request.
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-206:Or, when the computer-readable instruction is executed by the processor, the function of each module in the above-mentioned device embodiment is realized, for example, the modules 201-206 in FIG. 2:
第一接收模块201,用于接收请求端的第一访问请求;The first receiving module 201 is configured to receive the first access request from the requesting end;
判断模块202,用于根据所述第一访问请求判断所述请求端的访问类型;The judging module 202 is configured to judge the access type of the requesting end according to the first access request;
确定模块203,用于当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;The determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
返回模块204,用于通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;The return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
第二接收模块205,用于接收所述请求端的携带所述COOKIE标识的第二访问请求;The second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end;
分流模块206,用于根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
实施例四Example four
图3为本申请实施例四提供的计算机设备的示意图。所述计算机设备30包括存储器301、处理器302以及存储在所述存储器301中并可在所述处理器302上运行的计算机可读指令303,例如访问请求分流程序。所述处理器302执行所述计算机可读指令303时实现上述访问请求分流方法实施例中的步骤,例如图1所示的步骤101-106:FIG. 3 is a schematic diagram of the computer equipment provided in the fourth embodiment of the application. The computer device 30 includes a memory 301, a processor 302, and computer-readable instructions 303 stored in the memory 301 and running on the processor 302, such as an access request shunt program. When the processor 302 executes the computer-readable instruction 303, the steps in the above-mentioned access request offloading method embodiment are implemented, for example, steps 101-106 shown in FIG. 1:
101,接收请求端的第一访问请求;101. Receive a first access request from the requesting end;
102,根据所述第一访问请求判断所述请求端的访问类型;102. Judging the access type of the requesting end according to the first access request;
103,当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;103. When the access type of the requesting end is a web page request, determine a target system from multiple systems according to the service identifier of the first access request;
104,通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述 COOKIE标识;104. Return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
105,接收所述请求端的携带所述COOKIE标识的第二访问请求;105. Receive a second access request carrying the cookie identifier from the requesting end;
106,根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。106. Offload the second access request to the target system according to the COOKIE identifier in the second access request.
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-206:Or, when the computer-readable instruction is executed by the processor, the function of each module in the above-mentioned device embodiment is realized, for example, the modules 201-206 in FIG. 2:
第一接收模块201,用于接收请求端的第一访问请求;The first receiving module 201 is configured to receive the first access request from the requesting end;
判断模块202,用于根据所述第一访问请求判断所述请求端的访问类型;The judging module 202 is configured to judge the access type of the requesting end according to the first access request;
确定模块203,用于当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;The determining module 203 is configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;
返回模块204,用于通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;The return module 204 is configured to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;
第二接收模块205,用于接收所述请求端的携带所述COOKIE标识的第二访问请求;The second receiving module 205 is configured to receive a second access request carrying the COOKIE identifier from the requesting end;
分流模块206,用于根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The offloading module 206 is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
示例性的,所述计算机可读指令303可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器301中,并由所述处理器302执行,以完成本方法。所述一个或多个模块可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机可读指令303在所述计算机设备30中的执行过程。例如,所述计算机可读指令303可以被分割成图2中的第一接收模块201、判断模块202、确定模块203、返回模块204、第二接收模块205、分流模块206,各模块具体功能参见实施例二。Exemplarily, the computer-readable instruction 303 may be divided into one or more modules, and the one or more modules are stored in the memory 301 and executed by the processor 302 to complete the method. . The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer readable instruction 303 in the computer device 30. For example, the computer-readable instruction 303 can be divided into the first receiving module 201, the judging module 202, the determining module 203, the returning module 204, the second receiving module 205, and the shunting module 206 in FIG. 2. For the specific functions of each module, see实施例二。 Example two.
所述计算机设备30可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。本领域技术人员可以理解,所述示意图3仅仅是计算机设备30的示例,并不构成对计算机设备30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机设备30还可以包括输入输出设备、网络接入设备、总线等。The computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. Those skilled in the art can understand that the schematic diagram 3 is only an example of the computer device 30, and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, and so on.
所称处理器302可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器302也可以是任何常规的处理器等,所述处理器302是所述计算机设备30的控制中心,利用各种接口和线路连接整个计算机设备30的各个部分。The so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc. The processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30. Various parts.
所述存储器301可用于存储所述计算机可读指令303,所述处理器302通过运行或执行存储在所述存储器301内的计算机可读指令或模块,以及调用存储在存储器301内的数据,实现所述计算机设备30的各种功能。所述存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备30的使用所创建的数据等。此外,存储器301可以包括硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)或其他非易失性/易失性存储器件。The memory 301 may be used to store the computer-readable instructions 303, and the processor 302 executes or executes the computer-readable instructions or modules stored in the memory 301 and calls the data stored in the memory 301 to implement Various functions of the computer device 30. The memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.); the storage data area may Data and the like created in accordance with the use of the computer device 30 are stored. In addition, the memory 301 may include a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), at least one disk storage device, flash memory Devices, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), or other non-volatile/volatile storage devices.
所述计算机设备30集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是非易失性,也可以是易失性。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现 上述各个方法实施例的步骤。其中,所述计算机可读指令可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机可读指令的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、只读存储器(ROM)、随机存取存储器(RAM)。If the integrated module of the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it may be stored in a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile. Based on this understanding, this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. Here, when the computer-readable instruction is executed by the processor, it can implement the steps of the foregoing method embodiments. Wherein, the computer-readable instructions may be in the form of source code, object code, executable file, or some intermediate forms, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer-readable instructions, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, read only memory (ROM), random access memory ( RAM).
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述访问请求分流方法的部分步骤。The above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the access request described in each embodiment of this application Some steps of the shunt method.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他模块或步骤,单数不排除复数。系统权利要求中陈述的多个模块或装置也可以由一个模块或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the application. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any associated diagram marks in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or devices stated in the system claims can also be implemented by one module or device through software or hardware. Words such as first and second are used to denote names, but do not denote any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.
Claims (20)
- 一种访问请求分流方法,所述访问请求分流方法包括:A method for distributing access requests, the method for distributing access requests includes:接收请求端的第一访问请求;Receiving the first access request from the requesting end;根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- 如权利要求1所述的访问请求分流方法,其中,所述根据所述第一访问请求的业务标识从多个系统中确定目标系统包括:The access request distribution method according to claim 1, wherein the determining a target system from a plurality of systems according to the service identifier of the first access request comprises:获取业务路由表,所述业务路由表包括关联存储的业务标识和系统;Acquiring a service routing table, where the service routing table includes associated stored service identifiers and systems;以所述第一访问请求的业务标识为关键字从所述业务路由表中查询与所述第一访问请求的业务标识关联的系统;Using the service identifier of the first access request as a key to query the system associated with the service identifier of the first access request from the service routing table;当以所述第一访问请求的业务标识为关键字从所述业务路由表中查询到与所述第一访问请求的业务标识关联的系统时,将查询到的系统确定为目标系统。When a system associated with the service identifier of the first access request is queried from the service routing table using the service identifier of the first access request as a key, the queried system is determined as the target system.
- 如权利要求2所述的访问请求分流方法,其中,所述访问请求分流方法还包括:The access request distribution method according to claim 2, wherein the access request distribution method further comprises:当以所述第一访问请求的业务标识为关键字从所述业务路由表中未查询到与所述第一访问请求的业务标识关联的系统时,向所述请求端返回提示信息以提醒访问出错。When the system associated with the service ID of the first access request is not queried from the service routing table using the service ID of the first access request as a key, prompt information is returned to the requesting end to remind the access Something went wrong.
- 如权利要求1所述的访问请求分流方法,其中,所述访问请求分流方法还包括:The access request distribution method according to claim 1, wherein the access request distribution method further comprises:当所述请求端的访问类型为接口调用请求时,根据所述第一访问请求的业务标识将所述第一访问请求分流至指定系统。When the access type of the requesting end is an interface call request, the first access request is diverted to a designated system according to the service identifier of the first access request.
- 如权利要求1所述的访问请求分流方法,其中,所述通过所述目标系统将COOKIE标识返回给所述请求端包括:The access request distribution method according to claim 1, wherein the returning the COOKIE identifier to the requesting end through the target system comprises:将所述第一访问请求转发给所述目标系统,使所述目标系统生成所述COOKIE标识,响应于所述第一访问请求将所述COOKIE返回至所述请求端。The first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
- 如权利要求1所述的访问请求分流方法,其中,所述根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统包括:The access request offloading method according to claim 1, wherein the offloading the second access request to the target system according to the cookie identifier in the second access request comprises:根据所述第二访问请求中的目标数据描述信息,判断所述请求端的本地是否存储有目标数据;According to the target data description information in the second access request, determine whether the target data is stored locally on the requesting end;当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据;When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;当所述请求端没有存储所述目标数据时,将所述第二访问请求发送至所述目标系统,通过所述目标系统向所述请求端发送所述目标数据。When the requesting end does not store the target data, the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
- 如权利要求1所述的访问请求分流方法,其中,所述访问请求分流方法还包括:The access request distribution method according to claim 1, wherein the access request distribution method further comprises:获取接收所述第一访问请求的第一时间点;Acquiring the first time point when the first access request is received;获取接收所述第二访问请求的第二时间点;Acquiring a second time point when the second access request is received;计算所述第一时间点与所述第二时间点的时间差;Calculating the time difference between the first time point and the second time point;当所述时间差超过预设时间差时,向所述请求端发出请求超时的提醒信息,以提醒所述请求端重新获取所述COOKIE标识。When the time difference exceeds the preset time difference, a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
- 一种访问请求分流装置,其中,所述访问请求分流装置包括:An access request distribution device, wherein the access request distribution device includes:第一接收模块,用于接收请求端的第一访问请求;The first receiving module is configured to receive the first access request from the requesting end;判断模块,用于根据所述第一访问请求判断所述请求端的访问类型;A judging module, configured to judge the access type of the requesting end according to the first access request;确定模块,用于当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;A determining module, configured to determine a target system from multiple systems according to the service identifier of the first access request when the access type of the requesting end is a web page request;返回模块,用于通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;The return module is used to return the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;第二接收模块,用于接收所述请求端的携带所述COOKIE标识的第二访问请求;A second receiving module, configured to receive a second access request carrying the cookie identifier from the requesting end;分流模块,用于根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The offloading module is configured to offload the second access request to the target system according to the cookie identifier in the second access request.
- 一种计算机设备,其中,所述计算机设备包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:A computer device, wherein the computer device includes a processor, and the processor is configured to execute computer-readable instructions stored in a memory to implement the following steps:接收请求端的第一访问请求;Receiving the first access request from the requesting end;根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述第一访问请求的业务标识从多个系统中确定目标系统时,包括:The computer device according to claim 9, wherein the processor executes computer-readable instructions stored in the memory to realize the time when the target system is determined from a plurality of systems according to the service identifier of the first access request ,include:获取业务路由表,所述业务路由表包括关联存储的业务标识和系统;Acquiring a service routing table, where the service routing table includes associated stored service identifiers and systems;以所述第一访问请求的业务标识为关键字从所述业务路由表中查询与所述第一访问请求的业务标识关联的系统;Using the service identifier of the first access request as a key to query the system associated with the service identifier of the first access request from the service routing table;当以所述第一访问请求的业务标识为关键字从所述业务路由表中查询到与所述第一访问请求的业务标识关联的系统时,将查询到的系统确定为目标系统。When a system associated with the service identifier of the first access request is queried from the service routing table using the service identifier of the first access request as a key, the queried system is determined as the target system.
- 如权利要求10所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令还用以实现以下步骤:11. The computer device of claim 10, wherein the processor executing the computer-readable instructions stored in the memory is further used to implement the following steps:当以所述第一访问请求的业务标识为关键字从所述业务路由表中未查询到与所述第一访问请求的业务标识关联的系统时,向所述请求端返回提示信息以提醒访问出错。When the system associated with the service ID of the first access request is not queried from the service routing table using the service ID of the first access request as a key, prompt information is returned to the requesting end to remind the access Something went wrong.
- 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令还用以实现以下步骤:9. The computer device of claim 9, wherein the processor executes the computer-readable instructions stored in the memory to further implement the following steps:当所述请求端的访问类型为接口调用请求时,根据所述第一访问请求的业务标识将所述第一访问请求分流至指定系统。When the access type of the requesting end is an interface call request, the first access request is diverted to a designated system according to the service identifier of the first access request.
- 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述通过所述目标系统将COOKIE标识返回给所述请求端时,包括:9. The computer device according to claim 9, wherein, when the processor executes the computer-readable instructions stored in the memory to realize the returning the COOKIE identifier to the requesting end through the target system, the method comprises:将所述第一访问请求转发给所述目标系统,使所述目标系统生成所述COOKIE标识,响应于所述第一访问请求将所述COOKIE返回至所述请求端。The first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
- 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统时,包括:The computer device according to claim 9, wherein the processor executes computer-readable instructions stored in the memory to implement the shunting of the second access request according to the cookie identifier in the second access request To the target system, including:根据所述第二访问请求中的目标数据描述信息,判断所述请求端的本地是否存储有目标数据;According to the target data description information in the second access request, determine whether the target data is stored locally on the requesting end;当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据;When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;当所述请求端没有存储所述目标数据时,将所述第二访问请求发送至所述目标系统,通过所述目标系统向所述请求端发送所述目标数据。When the requesting end does not store the target data, the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
- 如权利要求9所述的计算机设备,其中,所述处理器执行所述存储器中存储的计算机可读指令还用以实现以下步骤:9. The computer device of claim 9, wherein the processor executes the computer-readable instructions stored in the memory to further implement the following steps:获取接收所述第一访问请求的第一时间点;Acquiring the first time point when the first access request is received;获取接收所述第二访问请求的第二时间点;Acquiring a second time point when the second access request is received;计算所述第一时间点与所述第二时间点的时间差;Calculating the time difference between the first time point and the second time point;当所述时间差超过预设时间差时,向所述请求端发出请求超时的提醒信息,以提醒所述请求端重新获取所述COOKIE标识。When the time difference exceeds the preset time difference, a reminder message of request timeout is sent to the requesting terminal to remind the requesting terminal to obtain the COOKIE identifier again.
- 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions implement the following steps when executed by a processor:接收请求端的第一访问请求;Receiving the first access request from the requesting end;根据所述第一访问请求判断所述请求端的访问类型;Judging the access type of the requesting end according to the first access request;当所述请求端的访问类型为网页请求时,根据所述第一访问请求的业务标识从多个系统中确定目标系统;When the access type of the requesting end is a web page request, determining a target system from multiple systems according to the service identifier of the first access request;通过所述目标系统将COOKIE标识返回给所述请求端,使所述请求端存储所述COOKIE标识;Returning the COOKIE identifier to the requesting terminal through the target system, so that the requesting terminal stores the COOKIE identifier;接收所述请求端的携带所述COOKIE标识的第二访问请求;Receiving a second access request carrying the cookie identifier from the requesting end;根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统。The second access request is diverted to the target system according to the COOKIE identifier in the second access request.
- 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述第一访问请求的业务标识从多个系统中确定目标系统时,包括:15. The storage medium according to claim 16, wherein, when the computer-readable instructions are executed by the processor to implement the determination of the target system from a plurality of systems according to the service identifier of the first access request, the method comprises:获取业务路由表,所述业务路由表包括关联存储的业务标识和系统;Acquiring a service routing table, where the service routing table includes associated stored service identifiers and systems;以所述第一访问请求的业务标识为关键字从所述业务路由表中查询与所述第一访问请求的业务标识关联的系统;Using the service identifier of the first access request as a key to query the system associated with the service identifier of the first access request from the service routing table;当以所述第一访问请求的业务标识为关键字从所述业务路由表中查询到与所述第一访问请求的业务标识关联的系统时,将查询到的系统确定为目标系统。When a system associated with the service identifier of the first access request is queried from the service routing table using the service identifier of the first access request as a key, the queried system is determined as the target system.
- 如权利要求17所述的存储介质,其中,所述计算机可读指令被所述处理器执行还用以实现以下步骤:18. The storage medium of claim 17, wherein the computer-readable instructions are executed by the processor to further implement the following steps:当以所述第一访问请求的业务标识为关键字从所述业务路由表中未查询到与所述第一访问请求的业务标识关联的系统时,向所述请求端返回提示信息以提醒访问出错。When the system associated with the service ID of the first access request is not queried from the service routing table using the service ID of the first access request as a key, prompt information is returned to the requesting end to remind the access Something went wrong.
- 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述通过所述目标系统将COOKIE标识返回给所述请求端时,包括:15. The storage medium according to claim 16, wherein, when the computer-readable instructions are executed by the processor to realize the returning of the COOKIE identifier to the requesting end through the target system, the method comprises:将所述第一访问请求转发给所述目标系统,使所述目标系统生成所述COOKIE标识,响应于所述第一访问请求将所述COOKIE返回至所述请求端。The first access request is forwarded to the target system, so that the target system generates the cookie identifier, and returns the cookie to the requesting end in response to the first access request.
- 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述第二访问请求中的COOKIE标识将所述第二访问请求分流至所述目标系统时,包括:The storage medium of claim 16, wherein the computer-readable instructions are executed by the processor to implement the offloading of the second access request to the cookie according to the COOKIE identifier in the second access request When the target system includes:根据所述第二访问请求中的目标数据描述信息,判断所述请求端的本地是否存储有目标数据;According to the target data description information in the second access request, determine whether the target data is stored locally on the requesting end;当所述请求端存储有所述目标数据时,向所述请求端返回本地读取标识,使所述请求端从所述请求端读取所述目标数据;When the requesting end stores the target data, returning a local read identifier to the requesting end, so that the requesting end can read the target data from the requesting end;当所述请求端没有存储所述目标数据时,将所述第二访问请求发送至所述目标系统,通过所述目标系统向所述请求端发送所述目标数据。When the requesting end does not store the target data, the second access request is sent to the target system, and the target data is sent to the requesting end through the target system.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010754519.4 | 2020-07-30 | ||
CN202010754519.4A CN111914150A (en) | 2020-07-30 | 2020-07-30 | Access request distribution method and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021114890A1 true WO2021114890A1 (en) | 2021-06-17 |
Family
ID=73286471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/122919 WO2021114890A1 (en) | 2020-07-30 | 2020-10-22 | Access request distribution method and related device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111914150A (en) |
WO (1) | WO2021114890A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114760238B (en) * | 2020-12-28 | 2024-08-23 | 浙江省公众信息产业有限公司 | Internet of things information processing method and system for peer-to-peer network and Internet of things equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160380883A1 (en) * | 2015-06-23 | 2016-12-29 | At&T Intellectual Property I, L.P. | Determining a custom content delivery network via an intelligent software-defined network |
CN108763396A (en) * | 2018-05-22 | 2018-11-06 | 陆金所(上海)科技服务有限公司 | Access request processing method, device, computer equipment and storage medium |
CN111274516A (en) * | 2018-12-04 | 2020-06-12 | 阿里巴巴集团控股有限公司 | Page display method, page configuration method and device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102056333A (en) * | 2009-11-05 | 2011-05-11 | 中国移动通信集团河南有限公司 | WAP (wireless application protocol) gateway, service processing method thereof and WAP proxy server |
CN106453452A (en) * | 2015-08-07 | 2017-02-22 | 百度在线网络技术(北京)有限公司 | Data access request processing method and server used for processing data access request |
CN106998370A (en) * | 2017-06-15 | 2017-08-01 | 北京微影时代科技有限公司 | Access control method, device and system |
CN108881430A (en) * | 2018-06-14 | 2018-11-23 | 平安科技(深圳)有限公司 | Session keeping method, device, computer equipment and storage medium |
CN111314459B (en) * | 2020-02-13 | 2022-06-03 | 北京奇艺世纪科技有限公司 | Service request method, device, electronic equipment and storage medium |
-
2020
- 2020-07-30 CN CN202010754519.4A patent/CN111914150A/en active Pending
- 2020-10-22 WO PCT/CN2020/122919 patent/WO2021114890A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160380883A1 (en) * | 2015-06-23 | 2016-12-29 | At&T Intellectual Property I, L.P. | Determining a custom content delivery network via an intelligent software-defined network |
CN108763396A (en) * | 2018-05-22 | 2018-11-06 | 陆金所(上海)科技服务有限公司 | Access request processing method, device, computer equipment and storage medium |
CN111274516A (en) * | 2018-12-04 | 2020-06-12 | 阿里巴巴集团控股有限公司 | Page display method, page configuration method and device |
Also Published As
Publication number | Publication date |
---|---|
CN111914150A (en) | 2020-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10079905B2 (en) | Cross domain in-browser proxy | |
WO2021217863A1 (en) | Order identifier generation method and apparatus, server, and storage medium | |
US10511651B2 (en) | Infinite micro-services architecture | |
US11411921B2 (en) | Enabling access across private networks for a managed blockchain service | |
US10574741B2 (en) | Multi-level load balancing | |
US20180293257A1 (en) | Method for accessing distributed database and distributed data service apparatus | |
US10649928B1 (en) | Broadcasting reads to multiple modules | |
WO2019223136A1 (en) | Data acquisition method and apparatus, and computer device and storage medium | |
WO2021114890A1 (en) | Access request distribution method and related device | |
CN111984712B (en) | Information processing method, device and storage medium | |
WO2020082580A1 (en) | Information synchronization method and apparatus, and storage medium and server | |
CN113992748A (en) | Reverse proxy method, system, medium, and terminal | |
US9692806B2 (en) | Route a service | |
US11663664B2 (en) | Switching layer for trading on global markets | |
US10587725B2 (en) | Enabling a traditional language platform to participate in a Java enterprise computing environment | |
WO2020243798A1 (en) | Three layered system of upgradeable and extendable smart contracts hosted on and executed by decentralised virtual machines of a decentralised network | |
WO2017090142A1 (en) | Service-providing system | |
US20210034629A1 (en) | Networked interpersonal matching application, system and method | |
CN111325456B (en) | Asset data processing method and apparatus, computer system, and storage medium | |
CN110753082A (en) | Service calling method and terminal equipment | |
US11483314B2 (en) | Distributed evaluation list updating | |
CN110519357B (en) | File transmission method and system, computer device and storage medium | |
US20230093598A1 (en) | System and method for implementing a standardize context identifier module | |
JP2013190971A (en) | Integrated access control system | |
US20230153450A1 (en) | Privacy data management in distributed computing systems |
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: 20898532 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20898532 Country of ref document: EP Kind code of ref document: A1 |