A service request processing method and apparatus
Patent Information
- Application Number
- CN202111084931.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2041-09-16
AI Technical Summary
[0005]有鉴于此,本发明实施例提供一种服务请求处理方法和装置,能够解决现有无法根本性的实现主机实例宕机容错的问题
[0021]One embodiment of the above invention has the following advantages or beneficial effects: The present invention, by monitoring the processing anomaly of the service instance corresponding to the host, obtains the data information of the user service request, responds to the presence of a session identifier in the data information, obtains the polling cumulative value in the data information and increments it, updates the data information and encapsulates it, and then uses the encapsulated data information as a new user service request for parsing, creatively solves the problem of not being able to provide services when there is sufficient traffic but no available instance, minimizes the probability of distributing user service requests to faulty machines, greatly reduces the possibility of returning a failure result, fundamentally realizes the fault tolerance capability of the system, and enhances the user experience.
Smart Images

Figure CN113806129B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a service request processing method and apparatus. Background Technology
[0002] Currently, websites often deploy multiple instances online to improve system robustness, with load balancers and reverse proxies added at the entry point for request distribution. Specifically, when deploying multiple instances on a specific application host, load balancing is achieved through Nginx (a high-performance HTTP and reverse proxy server), enabling disaster recovery and fault tolerance.
[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0004] In existing technologies, if a single instance of the application host goes down, retrying is performed by configuring Nginx's `proxy_next_upstream`. However, this retry process is too time-consuming, and after several rounds of polling, an error page is returned to the user, resulting in a poor user experience. Furthermore, while introducing third-party Nginx plugins to mark unavailable Nginx backend services for fault tolerance reduces retry time, it doesn't solve the problem of continuing to process service requests even when the application host instance is down. Therefore, existing technologies cannot fundamentally solve the problem of fault tolerance when host instances go down. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a service request processing method and apparatus that can solve the problem that existing methods cannot fundamentally achieve fault tolerance for host instance downtime.
[0006] To achieve the above objectives, according to one aspect of the present invention, a service request processing method is provided, comprising: receiving a user service request; locating a host mapped to a corresponding IP address by parsing the user service request, and allocating the user service request to the host for processing; detecting an abnormality in the processing of a service instance corresponding to the host, and obtaining data information of the user service request; responding to the presence of a session identifier in the data information, obtaining a polling cumulative value in the data information and incrementing it, updating the data information and encapsulating it, and then parsing the encapsulated data information as a new user service request.
[0007] Optionally, if the data information in response to the user service request does not have a session identifier, a polling cumulative value is configured and added to the data information to encapsulate the data information with the added polling cumulative value, and then the encapsulated data information is parsed as a new user service request.
[0008] Optionally, after detecting an anomaly in the service instance corresponding to the host, the following steps are taken:
[0009] The data information of the user service request is obtained and verified;
[0010] In response to the verification that the data information contains registered service information to be monitored and corresponding error codes, it is determined whether a session identifier exists; or
[0011] If the verification confirms that there is no registered service information to be monitored and the corresponding error code is not found in the data information, the processing result of the user service request is returned.
[0012] Optionally, the polling cumulative value in the data information is retrieved and incremented, including:
[0013] Get the current polling cumulative value, determine whether it is equal to the preset polling threshold, if yes, return the processing result of the user service request; otherwise, increment the polling cumulative value.
[0014] Optionally, after detecting an anomaly in the service instance corresponding to the host, the following steps are taken:
[0015] Obtain the error code and then generate an alarm message based on the user service request.
[0016] Optionally, after detecting an anomaly in the service instance corresponding to the host, the following steps are taken:
[0017] An exception handling request is generated and sent to the exception handling queue. When the exception handling request in the exception handling queue is processed, the corresponding data information of the user service request is obtained.
[0018] Optionally, it includes:
[0019] By resolving the domain name of the user service request, multiple IP addresses are obtained to locate multiple hosts. Then, a load balancing algorithm is used to distribute the user service request to the corresponding host for processing.
[0020] In addition, the present invention also provides a service request processing apparatus, including an acquisition module for receiving user service requests, locating the host mapped to the corresponding IP address by parsing the user service request, and allocating the user service request to the host for processing; and a processing module for detecting an abnormality in the processing of the service instance corresponding to the host, acquiring data information of the user service request; and in response to the presence of a session identifier in the data information, acquiring and incrementing the polling cumulative value in the data information, updating the data information and encapsulating it, and then parsing the encapsulated data information as a new user service request.
[0021] One embodiment of the above invention has the following advantages or beneficial effects: The present invention, by monitoring the processing anomaly of the service instance corresponding to the host, obtains the data information of the user service request, responds to the presence of a session identifier in the data information, obtains the polling cumulative value in the data information and increments it, updates the data information and encapsulates it, and then uses the encapsulated data information as a new user service request for parsing, creatively solves the problem of not being able to provide services when there is sufficient traffic but no available instance, minimizes the probability of distributing user service requests to faulty machines, greatly reduces the possibility of returning a failure result, fundamentally realizes the fault tolerance capability of the system, and enhances the user experience.
[0022] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0023] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0024] Figure 1 This is a schematic diagram of the main flow of the service request processing method according to the first embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram illustrating the allocation of user service requests to a host according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the main flow of the service request processing method according to the second embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram of the main flow of the service request processing method according to the third embodiment of the present invention;
[0028] Figure 5 This is a schematic diagram of the main modules of a service request processing apparatus according to an embodiment of the present invention;
[0029] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0030] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0031] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0032] Figure 1 This is a schematic diagram of the main flow of the service request processing method according to the first embodiment of the present invention, as shown below. Figure 1 As shown, the service request processing method includes:
[0033] Step S101: Receive a user service request, locate the host mapped to the corresponding IP address by parsing the user service request, and assign the user service request to the host for processing.
[0034] In some embodiments, such as Figure 2 As shown, multiple IP addresses (e.g., Virtual IP Addresses, or VIPs) are obtained by resolving the domain name (DNS) of the user service request to locate multiple hosts. A load balancing algorithm is then used to distribute the user service request to the appropriate hosts for processing. It can be seen that the domain name of the user service request can map to multiple IP addresses, and each IP address corresponds to a host. Each host implements one or more service instances (e.g., Server1, Server2).
[0035] Step S102: If an anomaly is detected in the service instance processing corresponding to the host, the data information of the user service request is obtained; in response to the presence of a session identifier in the data information, the polling cumulative value in the data information is obtained and incremented, the data information is updated and encapsulated, and then the encapsulated data information is parsed as a new user service request.
[0036] It is worth noting that step S102 can also respond to the absence of a session identifier in the data information of the user service request by configuring a polling cumulative value and adding it to the data information to encapsulate the data information with the added polling cumulative value, and then parse the encapsulated data information as a new user service request.
[0037] In one embodiment, after detecting an anomaly in the processing of the service instance corresponding to the host, the process includes: invoking a preset authentication model to obtain and verify the data information of the user service request; determining whether the verification passes, and if so, determining whether a session identifier exists; otherwise, returning the processing result of the user service request, such as returning a request failure. In a further embodiment, before detecting an anomaly in the processing of the service instance corresponding to the host, the service to be monitored (e.g., a website) can be registered, as can the service's relevant error codes, and the service information to be monitored and the corresponding error codes. After obtaining and verifying the data information of the user service request, it can be determined whether it is registered service information and the corresponding error code. In response to the verification that the data information contains registered service information to be monitored and the corresponding error code, it can be determined whether a session identifier exists; or in response to the verification that the data information does not contain registered service information to be monitored and the corresponding error code, the processing result of the user service request is returned, such as a request failure. As can be seen, the present invention can flexibly configure the monitored services and abnormal situations according to business needs, and perform authentication processing on the monitored services, thereby achieving targeted and effective monitoring and abnormal handling, and greatly improving the resource utilization of the server.
[0038] In a preferred embodiment, after configuration, an available URL (Uniform Resource Locator) for the service can be automatically obtained and stored using, for example, a web crawler system. This allows for effective service identification via the URL when an anomaly is detected in the corresponding service instance. Preferably, after verifying the data information of the user service request, it can also be determined whether the IP address of the user service request is the same as the stored URL. If so, the IP address of the user service request is valid, and then it can be determined whether a session identifier exists or other verifications can be performed (e.g., whether it is registered service information and the corresponding error code). Otherwise, the processing result of the user service request is returned, such as a request failure.
[0039] It's worth noting that all validations in the authentication model must pass before exception handling for user service requests can begin. Of course, the authentication model can be dynamically adjusted based on actual business needs.
[0040] In some embodiments, during step S102, it is necessary to determine whether a session identifier exists. That is, by using the SessionId of the user service request, it is determined whether the user service request has been processed. If so, it has been processed, and the polling cumulative value parameter is included in the data information of the user service request. The current polling cumulative value is then obtained, and it is determined whether it is equal to a preset polling threshold. If so, the processing result of the user service request is directly returned, such as a request failure. That is, when the number of exception handling reaches the preset polling threshold, the request is discarded and no longer processed. Otherwise, the current polling cumulative value is incremented, the data information is updated and encapsulated, and the encapsulated data information is then used as a new user service request for parsing. If otherwise, the user service request has not been processed, the polling cumulative value can be configured and initialized. The initialized polling cumulative value is added to the data information of the user service request, and the data information with the added polling cumulative value is encapsulated so that the encapsulated data information is used as a new user service request for parsing.
[0041] As some embodiments, after detecting an anomaly in the service instance corresponding to the host, an anomaly handling request can be generated and sent to a preset anomaly handling queue. When the anomaly handling request in the anomaly handling queue is processed, the user service request is obtained to obtain the corresponding data information. Preferably, an anomaly handling component can be pre-encapsulated. By calling the anomaly handling component, an anomaly handling request can be obtained from the anomaly handling queue, and then the user service request corresponding to the anomaly handling request can be obtained, so as to complete step S102 based on the data information corresponding to the user service request.
[0042] It is worth noting that step S102 can forward the encapsulated new user service request and parse it again to locate the host mapped to the corresponding IP address. That is, the user service request is redistributed and processed. During the process of redistributing the request, the probability of the user service request being distributed to the faulty machine will be reduced, which can effectively reduce the occurrence of failed user service requests.
[0043] In other embodiments, while reducing user service request failures, alarms can also be issued to allow relevant personnel to quickly resolve the issues, thereby ensuring that users receive the desired response rather than a boring error page. For example, after step S102 detects an anomaly in the processing of the service instance corresponding to the host, the error code can be obtained, and then an alarm message can be generated based on the user service request. The alarm message can then be sent to relevant personnel or system nodes (e.g., repair nodes) through a preset notification method (e.g., email, SMS, etc.).
[0044] Figure 3 This is a schematic diagram of the main flow of a service request processing method according to a second embodiment of the present invention. The service request processing method may include:
[0045] Step S301: Receive a user service request, and obtain multiple IP addresses by resolving the domain name of the user service request to locate multiple hosts.
[0046] Step S302: The user service request is distributed to the corresponding host for processing using a load balancing algorithm.
[0047] Step S303: An abnormality was detected in the service instance corresponding to the host.
[0048] Step S304: Invoke the preset authentication model to obtain the data information of the user service request for verification.
[0049] Step S305: Determine whether the information is registered service information and the corresponding error code. If yes, proceed to step S306; otherwise, proceed to step S310.
[0050] Step S306: Determine if a session identifier exists. If yes, proceed to step S307; otherwise, proceed to step S309.
[0051] Step S307: Obtain the current polling cumulative value and determine whether it is equal to the preset polling threshold. If yes, proceed to step S310; otherwise, proceed to step S308.
[0052] Step S308: Increment the polling cumulative value, update the data information and encapsulate it, then return to step S301.
[0053] Step S309: Configure the polling cumulative value and add it to the data information to encapsulate the data information with the added polling cumulative value, and return to step S301.
[0054] Step S310: Return the processing result of the user service request.
[0055] Figure 4 This is a schematic diagram of the main flow of a service request processing method according to a third embodiment of the present invention. The service request processing method may include:
[0056] Step S401: Receive user service requests, obtain multiple IP addresses by resolving the domain name of the user service request, and locate multiple hosts.
[0057] Step S402: The user service request is distributed to the corresponding host for processing using a load balancing algorithm.
[0058] Step S403: An anomaly was detected in the service instance processing corresponding to the host.
[0059] Step S404: Obtain the abnormal error code, and then generate an alarm message based on the user service request.
[0060] Step S405: Generate an exception handling request and send it to the exception handling queue.
[0061] Step S406: When the exception handling request in the exception handling queue is to be processed, a preset authentication model is invoked to obtain the data information of the user service request for verification.
[0062] Step S407: Determine whether the information is registered service information and the corresponding error code. If yes, proceed to step S408; otherwise, proceed to step S412.
[0063] Step S408: Determine if a session identifier exists. If yes, proceed to step S409; otherwise, proceed to step S411.
[0064] Step S409: Obtain the current polling cumulative value and determine whether it is equal to the preset polling threshold. If yes, proceed to step S412; otherwise, proceed to step S410.
[0065] Step S410: Increment the polling cumulative value, update the data information and encapsulate it, then return to step S401.
[0066] Step S411: Configure the polling cumulative value and add it to the data information to encapsulate the data information with the added polling cumulative value, and return to step S401.
[0067] Step S412: Return the processing result of the user service request.
[0068] Figure 5 This is a schematic diagram of the main modules of a service request processing apparatus according to an embodiment of the present invention, such as... Figure 5 As shown, the service request processing device 500 includes an acquisition module 501 and a processing module 502. The acquisition module 501 receives user service requests, parses the user service request to locate the host mapped to the corresponding IP address, and assigns the user service request to the host for processing. The processing module 502 detects an anomaly in the processing of the service instance corresponding to the host, then acquires the data information of the user service request; in response to the presence of a session identifier in the data information, it acquires the polling cumulative value in the data information and increments it, updates the data information, encapsulates it, and then parses the encapsulated data information as a new user service request.
[0069] In some embodiments, the processing module 502 is further configured to:
[0070] If the data information of the user service request does not have a session identifier, a polling cumulative value is configured and added to the data information to encapsulate the data information with the added polling cumulative value, and then the encapsulated data information is parsed as a new user service request.
[0071] In some embodiments, after the processing module 502 detects an anomaly in the service instance corresponding to the host, it includes:
[0072] The system retrieves and verifies the data information of the user service request. If the data information contains registered service information to be monitored and corresponding error codes, it determines whether a session identifier exists. Alternatively, if the data information does not contain registered service information to be monitored and corresponding error codes, the system returns the processing result of the user service request.
[0073] In some embodiments, the processing module 502 obtains the polling cumulative value from the data information and increments it, including:
[0074] Get the current polling cumulative value, determine whether it is equal to the preset polling threshold, if yes, return the processing result of the user service request; otherwise, increment the polling cumulative value.
[0075] In some embodiments, after the processing module 502 detects an anomaly in the service instance corresponding to the host, it includes:
[0076] Obtain the error code and then generate an alarm message based on the user service request.
[0077] In some embodiments, after the processing module 502 detects an anomaly in the service instance corresponding to the host, it includes:
[0078] An exception handling request is generated and sent to the exception handling queue. When the exception handling request in the exception handling queue is processed, the corresponding data information of the user service request is obtained.
[0079] In some embodiments, the acquisition module 501 is further configured to:
[0080] By resolving the domain name of the user service request, multiple IP addresses are obtained to locate multiple hosts. Then, a load balancing algorithm is used to distribute the user service request to the corresponding host for processing.
[0081] It should be noted that the service request processing method and the service request processing device described in this invention have a corresponding relationship in their specific implementation, so repeated content will not be described again.
[0082] Figure 6An exemplary system architecture 600 is shown that can be applied to the service request processing method or service request processing apparatus of the present invention.
[0083] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0084] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603.
[0085] Terminal devices 601, 602, and 603 can be various electronic devices with a service request processing screen and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0086] Server 605 can be a server that provides various services, such as a backend management server that supports users using terminal devices 601, 602, and 603 (for example only). The backend management server can analyze and process data such as received product information query requests, and feed back the processing results (such as target push information, product information - for example only) to the terminal devices.
[0087] It should be noted that the service request processing method provided in the embodiments of the present invention is generally executed by server 605, and correspondingly, the computing device is generally located in server 605.
[0088] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0089] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0090] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the computer system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0091] The following components are connected to the I / O interface 705: an input section 705 including a keyboard, mouse, etc.; an output section 706 including a cathode ray tube (CRT), liquid crystal service request processor (LCD), and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card and a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0092] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0093] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0094] The flowcharts and block diagrams in the accompanying drawings 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 a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0095] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including an acquisition module and a processing module. The names of these modules do not necessarily limit the module itself.
[0096] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to: receive a user service request; locate the host mapped to the corresponding IP address by parsing the user service request, and allocate the user service request to the host for processing; detect an anomaly in the processing of the service instance corresponding to the host, and obtain data information of the user service request; in response to the presence of a session identifier in the data information, obtain and increment the polling cumulative value in the data information, update the data information, and encapsulate it, thereby parsing the encapsulated data information as a new user service request.
[0097] According to the technical solution of the present invention, the problem that existing methods cannot fundamentally achieve fault tolerance for host instance downtime can be solved.
[0098] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A service request processing method characterized by comprising: include: Upon receiving a user service request, the system locates the host mapped to the corresponding IP address by parsing the user service request, and then assigns the user service request to the host for processing. If an anomaly is detected in the service instance corresponding to the host, the data information of the user service request is obtained for verification. If the verification shows that there is no registered service information to be monitored and no corresponding error code in the data information, the processing result of the user service request is returned. In response to verifying the existence of registered service information to be monitored and corresponding error codes in the data information, it is determined whether the data information contains a session identifier; In response to the absence of a session identifier in the data information, a polling cumulative value is configured and added to the data information to encapsulate the data information with the added polling cumulative value, and then the encapsulated data information is parsed as a new user service request; In response to the presence of a session identifier in the data information, the polling cumulative value in the data information is obtained and incremented, the data information is updated and encapsulated, and then the encapsulated data information is parsed as a new user service request.
2. The method according to claim 1, characterized in that, Retrieve the polling cumulative value from the data information and increment it, including: Get the current polling cumulative value, determine whether it is equal to the preset polling threshold, if yes, return the processing result of the user service request; otherwise, increment the polling cumulative value.
3. The method according to claim 1, characterized in that, After detecting an anomaly in the service instance corresponding to the host, the following is included: Obtain the error code and then generate an alarm message based on the user service request.
4. The method according to claim 1, characterized in that, After detecting an anomaly in the service instance corresponding to the host, the following is included: An exception handling request is generated and sent to the exception handling queue. When the exception handling request in the exception handling queue is processed, the corresponding data information of the user service request is obtained.
5. The method according to any one of claims 1-4, characterized in that, include: By resolving the domain name of the user service request, multiple IP addresses are obtained to locate multiple hosts. Then, a load balancing algorithm is used to distribute the user service request to the corresponding host for processing.
6. A service request processing apparatus, characterized in that, include: The acquisition module is used to receive user service requests, parse the user service requests to locate the host mapped to the corresponding IP address, and then assign the user service requests to the host for processing. The processing module is used to detect that the service instance corresponding to the host is processing abnormally, and then obtain the data information of the user service request for verification. In response to the verification that the data information does not contain registered service information to be monitored and the corresponding error code, the processing result of the user service request is returned. In response to verifying the existence of registered service information to be monitored and corresponding error codes in the data information, it is determined whether the data information contains a session identifier; In response to the absence of a session identifier in the data information, a polling cumulative value is configured and added to the data information to encapsulate the data information with the added polling cumulative value, and then the encapsulated data information is parsed as a new user service request; In response to the presence of a session identifier in the data information, the polling cumulative value in the data information is obtained and incremented, the data information is updated and encapsulated, and then the encapsulated data information is parsed as a new user service request.
7. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.
8. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Service response method and system
CN109584105A
Service request routing method and device
CN110581890A