CN112968975B - Service request processing method and device - Google Patents

Service request processing method and device Download PDF

Info

Publication number
CN112968975B
CN112968975B CN202110350341.1A CN202110350341A CN112968975B CN 112968975 B CN112968975 B CN 112968975B CN 202110350341 A CN202110350341 A CN 202110350341A CN 112968975 B CN112968975 B CN 112968975B
Authority
CN
China
Prior art keywords
service
request
server
service request
remainder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110350341.1A
Other languages
Chinese (zh)
Other versions
CN112968975A (en
Inventor
徐志轩
朱可
张元�
陈治宇
何城
方赤
尹传威
吴宇光
张荣宸
吴思
李洋莹
秦雯婧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110350341.1A priority Critical patent/CN112968975B/en
Publication of CN112968975A publication Critical patent/CN112968975A/en
Application granted granted Critical
Publication of CN112968975B publication Critical patent/CN112968975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a service request processing method and device, and relates to the technical field of big data. One embodiment of the method comprises the following steps: receiving a service request, wherein the service request comprises a request parameter; determining a target service group corresponding to the service request in the service cluster based on the request parameter and a preset routing strategy; and forwarding the service request to the target service packet so as to enable the server in the target service packet to respond to the service request corresponding to the remainder. According to the method, a service request is distributed to fixed service groups according to request parameters of the service request and a preset routing strategy, and when the service groups are unavailable, group-level fusing is performed; when a Killer-Request is received, the Killer-Request can be distributed to a designated service group, a failed server can be isolated if the Killer-Request causes service unavailability, and all the Killer-requests are led to a fusing node, so that the overall service availability of the service is ensured.

Description

Service request processing method and device
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method and an apparatus for processing a service request.
Background
With the development of internet micro-services, the mainstream business service construction modes are all constructed into stateless service cluster modes so as to realize high availability and dynamic capacity expansion of the system. The existing service request processing scheme mainly comprises the following steps: the stateless service cluster is uniformly realized at the service end, the client initiates a Request to be distributed to fixed services (the service strategy can be defined as random route, source service and the like) in the cluster through uniform service route, after any service end receives the Request, the service is executed to respond, the route service component determines the whole route strategy according to the health condition of a background server, and when a Killer-Request (a Request capable of causing system breakdown) occurs, a background monitoring system is required to monitor and pull up the service.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
because of the routing strategy relationship, the routing distribution logic has distribution defects and cannot distribute packets according to the request; the backend services are not naturally a packet service concept due to the complete stateless nature. For the above reasons, if the front end continuously sends a Killer-Request, all available backend services eventually crash gradually, and the whole system is finally unavailable. For example, for the financial industry, the unavailability of the system as a whole can pose a significant financial risk.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method and an apparatus for processing a service request, where the method distributes the service request to a fixed service packet according to a request parameter of the service request and a preset routing policy by the method for processing the service request, and when the service packet is unavailable, fuses at a packet level; when a Killer-Request is received, the Killer-Request can be distributed to a designated service group, if the Killer-Request causes service unavailability, a fault server can be isolated, and all the Killer-requests are led to a fusing node (i.e. the designated service group), so that the overall service availability of the service is ensured; the service Request is distributed to the grouped service end in a hash processing mode, so that the service Request can be distributed to the appointed service grouping more accurately and efficiently, and the fixed grouping processing Killer-Request can be realized without influencing the normal work of other service grouping.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for processing a service request, including:
receiving a service request, wherein the service request comprises a request parameter;
determining a target service group corresponding to the service request in a service cluster based on the request parameter and a preset routing strategy;
and forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
Optionally, based on the request parameter and a preset routing policy, determining a target service packet corresponding to the service request in the service cluster includes:
carrying out hash processing on the request parameters to obtain hash parameters of the service request;
and determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster.
Optionally, determining, based on the hash parameter and the number of servers in the service cluster, a target service packet corresponding to the service request in the service cluster includes:
determining the remainder of the hash parameter and the number of servers in the service cluster; and determining a target service group corresponding to the service request in the service cluster according to the remainder.
Optionally, the request parameters include one or more of: request type, request source, and parameter mode of request parameters.
Optionally, before receiving the service request, the method further comprises: and classifying the servers in the service cluster to obtain a plurality of service groups.
Optionally, classifying the servers in the service cluster to obtain a plurality of service packets includes: and classifying the servers in the service cluster according to the identifiers of the servers in the server cluster to obtain a plurality of service groups.
Optionally, the identification of the server includes one or more of: the IP address of the server, the media access control address of the server and the registration identification of the server.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided a service request processing apparatus, including:
the request receiving module is used for receiving a service request, wherein the service request comprises a request parameter;
the service determining module is used for determining a target service group corresponding to the service request in the service cluster based on the request parameter and a preset routing strategy;
and the request forwarding module is used for forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
Optionally, the service determining module is further configured to: carrying out hash processing on the request parameters to obtain hash parameters of the service request; and determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster.
Optionally, the service determining module is further configured to: determining the remainder of the hash parameter and the number of servers in the service cluster; and determining a target service group corresponding to the service request in the service cluster according to the remainder.
Optionally, the request parameters include one or more of: request type, request source, and parameter mode of request parameters.
Optionally, the device further includes a registration grouping module, configured to classify servers in the service cluster, to obtain a plurality of service groups.
Optionally, the registration grouping module is further configured to classify the servers in the service cluster according to the identifiers of the servers in the server cluster, so as to obtain a plurality of service groupings.
Optionally, the identification of the server includes one or more of: the IP address of the server, the media access control address of the server and the registration identification of the server.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic device including: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method for processing the service request provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of the embodiments of the present invention, there is provided a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements a method of processing a service request as provided by the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: distributing the service request to a fixed service packet according to the request parameter of the service request and a preset routing strategy by a service request processing method, and fusing the packet level when the service packet is unavailable; when a Killer-Request is received, the Killer-Request can be distributed to a designated service group, if the Killer-Request causes service unavailability, a fault server can be isolated, and all the Killer-requests are led to a fusing node (i.e. the designated service group), so that the overall service availability of the service is ensured; the service Request is distributed to the grouped service end in a hash processing mode, so that the service Request can be distributed to the appointed service grouping more accurately and efficiently, and the fixed grouping processing Killer-Request can be realized without influencing the normal work of other service grouping.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic flow diagram of a prior art service Request processing method upon encountering a Killer-Request;
FIG. 2 is a schematic diagram of a basic flow of a method for processing a service request according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a main flow of a service request processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of basic modules of a service request processing apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of basic modules of a service request processing apparatus according to another embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Term interpretation:
stateless services, which refer to the nature of services in the internet, are capable of responding in the same manner to requests by each server in the cluster.
Service fusing, a protection mechanism for a service may be performed for certain request characteristics (source client, request parameters, etc.) when a request is sent for a backend service.
In the prior art, a stateless service cluster is uniformly realized at a service end, a client initiates a Request to be distributed to fixed services (a service strategy can be defined by self such as random routing, source service and the like) in the cluster through uniform service routing, after any service end receives the Request, the service is executed to respond, a routing service component determines an overall routing strategy according to the health condition of a background server, and when a Killer-Request (a Killer-level Request refers to a Request capable of causing system crash) occurs to cause service crash, a background monitoring system is required to monitor and pull up the service.
FIG. 1 is a flow diagram of a prior art service Request processing method upon encountering a Killer-Request. As shown in fig. 1, the client generally uses a random manner to route the Request to the stateless service cluster at the back end, the service at the back end executes the processing response of the Request logic for the Request, when the Killer-Request reaches the back end, it is assumed that the stateless service a is crashed, and then the conventional routing manner will route the subsequent Request to the healthy service node to ensure high availability of the service, and then the service B is crashed due to the Killer-Request, and so on, all the services will be crashed finally. In the prior art, due to the routing strategy relationship, the routing distribution logic has distribution defects and cannot distribute packets according to the request; the service end has no packet service concept, and the like, so that the service end gradually leads to all available back-end services to be finally and completely crashed under the condition that the front end continuously sends Killer-Request, and finally leads to the unavailability of the whole system.
Fig. 2 is a schematic diagram of main flow of a service request processing method according to an embodiment of the present invention, as shown in fig. 2, where the method includes:
step S201: receiving a service request, wherein the service request comprises a request parameter;
step S202: determining a target service group corresponding to the service request in a service cluster based on the request parameter and a preset routing strategy;
step S203: and forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
According to the service request processing method, the service request is distributed to fixed service groups according to the request parameters of the service request and a preset routing strategy, and when the service groups are unavailable, group-level fusing is performed; when a Killer-Request is received, the Killer-Request can be distributed into a designated service group, a failed server can be isolated if the Killer-Request causes service unavailability, and all Killer-requests are led to a fusing node (i.e. the designated service group), so that the overall service availability of the service is ensured.
Specifically, in this embodiment, the service cluster includes a plurality of servers, and the plurality of servers in the service cluster may be classified in advance to obtain a plurality of service groups. Different service packets may handle different service requests. Further, in this embodiment, the servers may be classified according to the identifiers of the servers in the servers. Further, hash operation can be performed on the identifier of the server to obtain a hash value, and remainder operation is performed on the hash value and the number of servers to obtain a remainder, and the servers are classified according to the remainder. Wherein the identification of the server may include one or more of: the IP address of the server, the media access control address (Media Access Control Address, abbreviated MAC address) of the server, and the registration identity of the server. As an example, a hash operation may be performed on the IP address to obtain a hash value, a remainder operation may be performed on the hash value and the number of servers to obtain a remainder, and the servers may be classified according to the remainder.
After grouping the servers, a routing policy may be set to ensure that the received service Request is routed to a specific service group, thereby ensuring that when a Killer-Request is received, it may be allocated to a specified service group, isolating a failed server if the Killer-Request causes service unavailability, and draining all Killer-requests to a fusing node (i.e., the specified service group), isolating the failure, thereby ensuring the overall service availability of the service. In this embodiment, the nature of isolating the fault is to limit the fault to a local range by some mechanism, so as to ensure the overall stability of the system. The request parameters carried by the different service requests are different, so that the routing policy can be set according to the request parameters, so that after the service request is received, the service request is routed into a specific service packet according to the request parameters of the service request. As specific examples, the request parameters may include one or more of the following: request type, request source, and parameter mode of request parameters. The parameter mode of the request parameter can be flexibly set according to the application scene, and the invention is not limited herein.
Fig. 3 is a schematic diagram of main flow of a service request processing method according to another embodiment of the present invention, and as shown in fig. 3, the method includes:
step S301: receiving a service request, wherein the service request comprises a request parameter;
step S302: carrying out hash processing on the request parameters to obtain hash parameters of the service request;
step S303: determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster;
step S204: and forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
The embodiment of the invention can distribute the service Request to the grouped service end for response processing in a hash processing mode, when the Killer-Request is received, the service Request can be distributed to the appointed service grouping, service fusing is carried out aiming at the service grouping level, and all the Killer-Request is mechanically led to a fusing node (namely the appointed service grouping), so that the overall service availability of the service is ensured.
Specifically, for step S301, the request parameters carried by the different service requests are different, so that the routing policy may be set according to the request parameters, so that after the service request is received, the service request is routed into a specific service packet according to the request parameters of the service request. As specific examples, the request parameters may include one or more of the following: request type, request source, and parameter mode of request parameters. The parameter mode of the request parameter can be flexibly set according to the application scene, and the invention is not limited herein.
For step S302, hash processing is performed on the request type, the request source and the parameter pattern in the service request, so as to obtain the hash parameter of the service request. The hash processing means that an input with any length is converted into an output with a fixed length through a hash function, and if two inputs are not identical, the corresponding outputs with high probability are also not identical; if the two outputs are not identical, then the corresponding inputs to the two outputs are also not identical. Therefore, the hash processing is carried out on the Request parameters of the service requests, so that different hash parameters corresponding to different service requests can be ensured, further, the service requests can be more accurately and efficiently distributed to the designated service packets, and the fixed packet processing Killer-Request can be realized without affecting the normal work of other service packets.
For step S303, the hash processing is performed on the request parameters of the service request to obtain different hash parameters, and the number of servers in the service cluster is fixed, so that a remainder (the number of servers is used as a denominator) can be obtained by performing a remainder operation on the hash parameters and the number of servers, and the target service packet corresponding to the service request is determined according to the remainder.
For step S304, after determining the target service packet corresponding to the service request, the service request is routed onto the target packet, so that the server in the target service packet responds to the service request corresponding to the remainder. After the service request enters the determined service packet, any stateless service server in the service packet may perform response processing.
Fig. 4 is a schematic diagram of main modules of an apparatus 400 for processing a service request according to an embodiment of the present invention, and as shown in fig. 4, the apparatus 400 includes:
a request receiving module 401, configured to receive a service request, where the service request includes a request parameter;
a service determining module 402, configured to determine, based on the request parameter and a preset routing policy, a target service packet corresponding to the service request in a service cluster;
and a request forwarding module 403, configured to forward the service request to the target service packet, so that a server in the target service packet performs response processing on the service request corresponding to the remainder.
According to the service request processing device, a service request is distributed to fixed service groups according to the request parameters of the service request and a preset routing strategy by a service request processing method, and when the service groups are unavailable, group-level fusing is performed; when a Killer-Request is received, the Killer-Request can be distributed into a designated service group, a failed server can be isolated if the Killer-Request causes service unavailability, and all Killer-requests are led to a fusing node (i.e. the designated service group), so that the overall service availability of the service is ensured.
Optionally, the service determining module 402 is further configured to: carrying out hash processing on the request parameters to obtain hash parameters of the service request; and determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster. The processing device for service requests in the embodiment of the invention distributes the service requests to the grouped service terminals for response processing in a hash processing mode, when the Killer-Request is received, the service requests can be distributed to the designated service grouping, service fusing is carried out on the service grouping level, and all the Killer-Request is mechanically led to a fusing node (namely the designated service grouping), so that the overall service availability of the service is ensured. The service Request is distributed to the grouped service end in a hash processing mode, so that the service Request can be distributed to the appointed service grouping more accurately and efficiently, and the fixed grouping processing Killer-Request can be realized without influencing the normal work of other service grouping.
Optionally, the service determining module 402 is further configured to: determining the remainder of the hash parameter and the number of servers in the service cluster; and determining a target service group corresponding to the service request in the service cluster according to the remainder.
Optionally, the request parameters include one or more of: request type, request source, and parameter mode of request parameters.
Optionally, the identification of the server includes one or more of: the IP address of the server, the media access control address of the server and the registration identification of the server.
Fig. 5 is a schematic diagram of main modules of an apparatus 500 for processing a service request according to an embodiment of the present invention, and as shown in fig. 5, the apparatus 500 includes:
a registration grouping module 501, configured to classify servers in the service cluster to obtain a plurality of service groupings;
a request receiving module 502, configured to receive a service request, where the service request includes a request parameter;
a service determining module 503, configured to determine, based on the request parameter and a preset routing policy, a target service packet corresponding to the service request in a service cluster;
and a request forwarding module 504, configured to forward the service request to the target service packet, so that a server in the target service packet performs response processing on the service request corresponding to the remainder.
According to the service request processing device, a service request is distributed to fixed service groups according to the request parameters of the service request and a preset routing strategy by a service request processing method, and when the service groups are unavailable, group-level fusing is performed; when a Killer-Request is received, the Killer-Request can be distributed into a designated service group, a failed server can be isolated if the Killer-Request causes service unavailability, and all Killer-requests are led to a fusing node (i.e. the designated service group), so that the overall service availability of the service is ensured.
Optionally, the registration grouping module 501 is further configured to classify servers in the service cluster according to the identifiers of the servers in the service cluster, to obtain a plurality of service groupings.
In the embodiment of the invention, the device further comprises a back-end collapse notification module, which is used for sending the identifier and the working state of the service packet in the form of information when the service packet is detected to be fused.
Fig. 6 illustrates an exemplary system architecture 600 to which a service request processing method or service request processing apparatus of an embodiment of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server providing support for shopping-type websites browsed by the user using the terminal devices 601, 602, 603. The background management server can analyze and other processing on the received data such as the product information inquiry request and the like, and feed back processing results (such as target push information and product information) to the terminal equipment.
It should be noted that, the service request processing method provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the service request processing apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a receiving module, a parameter transformation module, a request distribution module, and a service response module. The names of these modules do not in any way limit the module itself, and for example, the receiving module may also be described as "a module that receives a service request sent by a client".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include:
receiving a service request, wherein the service request comprises a request parameter;
determining a target service group corresponding to the service request in the service cluster based on the request parameter and a preset routing strategy;
and forwarding the service request to the target service packet so as to enable the server in the target service packet to respond to the service request corresponding to the remainder.
According to the technical scheme of the embodiment of the invention, the service request is distributed to the fixed service packet according to the request parameter of the service request and the preset routing strategy, and when the service packet is unavailable, the fusing of the packet level is carried out; when a Killer-Request is received, the Killer-Request can be distributed to a designated service group, a failed server can be isolated if the Killer-Request causes service unavailability, and all the Killer-requests are led to a fusing node, so that the overall service availability of the service is ensured.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (8)

1. A method for processing a service request, comprising:
receiving a service request, wherein the service request comprises a request parameter; wherein prior to receiving the service request, the method comprises: obtaining the identification of a server in a service cluster, carrying out hash operation to obtain a hash value, carrying out remainder operation on the hash value and the number of the servers to obtain a remainder, and grouping the servers according to the remainder; the server identification comprises one or more of an IP address of the server, a media access control address of the server and a registration identification of the server;
based on the request parameter and a preset routing policy, determining a target service packet corresponding to the service request in the service cluster, including: carrying out hash processing on the request parameters to obtain hash parameters of the service request; determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster;
and forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
2. The method of claim 1, wherein determining a target service packet in a service cluster corresponding to the service request based on the hash parameter and the number of servers in the service cluster comprises:
determining the remainder of the hash parameter and the number of servers in the service cluster; and determining a target service group corresponding to the service request in the service cluster according to the remainder.
3. The method of claim 1, wherein the request parameters include one or more of: request type, request source, and parameter mode of request parameters.
4. A service request processing apparatus, comprising:
the request receiving module is used for receiving a service request, wherein the service request comprises a request parameter; wherein prior to receiving the service request, the method comprises: obtaining the identification of a server in a service cluster, carrying out hash operation to obtain a hash value, carrying out remainder operation on the hash value and the number of the servers to obtain a remainder, and grouping the servers according to the remainder; the server identification comprises one or more of an IP address of the server, a media access control address of the server and a registration identification of the server;
a service determining module, configured to determine, based on the request parameter and a preset routing policy, a target service packet corresponding to the service request in the service cluster, where the determining module includes: carrying out hash processing on the request parameters to obtain hash parameters of the service request; determining a target service packet corresponding to the service request in the service cluster based on the hash parameter and the number of servers in the service cluster;
and the request forwarding module is used for forwarding the service request to the target service packet so as to enable a server in the target service packet to respond to the service request corresponding to the remainder.
5. The apparatus of claim 4, wherein the service determination module is further configured to: determining the remainder of the hash parameter and the number of servers in the service cluster; and determining a target service group corresponding to the service request in the service cluster according to the remainder.
6. The apparatus of claim 4, wherein the request parameters comprise one or more of: request type, request source, and parameter mode of request parameters.
7. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-3.
8. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-3.
CN202110350341.1A 2021-03-31 2021-03-31 Service request processing method and device Active CN112968975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110350341.1A CN112968975B (en) 2021-03-31 2021-03-31 Service request processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110350341.1A CN112968975B (en) 2021-03-31 2021-03-31 Service request processing method and device

Publications (2)

Publication Number Publication Date
CN112968975A CN112968975A (en) 2021-06-15
CN112968975B true CN112968975B (en) 2023-05-09

Family

ID=76280562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110350341.1A Active CN112968975B (en) 2021-03-31 2021-03-31 Service request processing method and device

Country Status (1)

Country Link
CN (1) CN112968975B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018149221A1 (en) * 2017-02-20 2018-08-23 京信通信系统(中国)有限公司 Device management method and network management system
CN108737270A (en) * 2018-05-07 2018-11-02 北京京东尚科信息技术有限公司 A kind of method for managing resource and device of server cluster

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423085B (en) * 2017-04-24 2020-07-28 北京百度网讯科技有限公司 Method and apparatus for deploying applications
CN110311967B (en) * 2019-06-25 2022-06-10 北京达佳互联信息技术有限公司 Method, device, equipment and system for pushing data and receiving data
CN112422609A (en) * 2020-08-31 2021-02-26 上海哔哩哔哩科技有限公司 Programming device and service request connection method
CN112114869A (en) * 2020-09-18 2020-12-22 聚好看科技股份有限公司 Server, gray level publishing method, device and medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018149221A1 (en) * 2017-02-20 2018-08-23 京信通信系统(中国)有限公司 Device management method and network management system
CN108737270A (en) * 2018-05-07 2018-11-02 北京京东尚科信息技术有限公司 A kind of method for managing resource and device of server cluster

Also Published As

Publication number Publication date
CN112968975A (en) 2021-06-15

Similar Documents

Publication Publication Date Title
CN108737270B (en) Resource management method and device for server cluster
US9819697B2 (en) Diffusing denial-of-service attacks by using virtual machines
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
US10129152B2 (en) Setting method, server device and service chain system
US10313452B2 (en) Migrating a chat message service provided by a chat server to a new chat server
CN113472852B (en) Method, device and equipment for returning source of CDN node and storage medium
CN107635010B (en) Traffic scheduling method and device, computer readable storage medium and electronic equipment
CN111460129B (en) Method, device, electronic equipment and storage medium for generating identification
CN114398176A (en) Service access method, device, electronic equipment and storage medium
CN110650209B (en) Method and device for realizing load balancing
CN111181765A (en) Task processing method and device
CN112788076A (en) Method and device for deploying multi-service load
CN112702229B (en) Data transmission method, device, electronic equipment and storage medium
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN109471713B (en) Method and device for inquiring information
CN110519109B (en) Method, device, computing equipment and medium for detecting node association
CN110247847B (en) Method and device for back source routing between nodes
CN112968975B (en) Service request processing method and device
CN111831503A (en) Monitoring method based on monitoring agent and monitoring agent device
CN108696557B (en) Information processing system, method and device
CN110278133B (en) Checking method, device, computing equipment and medium executed by server
CN109831385B (en) Message processing method and device and electronic equipment
CN116932505A (en) Data query method, data writing method, related device and system
CN113419745A (en) Application instance number management method and device, electronic equipment and computer readable medium
CN112769960A (en) Active flow control method and system based on Nginx server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant