External request processing method and device, equipment and storage medium

By allocating independent request queues and thread pools for each application in the Dubbo gateway, the problem of insufficient traffic isolation between applications in the microservice system is solved, and refined traffic isolation between applications is achieved, improving the stability and security of the system.

CN120378495APending Publication Date: 2025-07-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510735246.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing Dubbo gateways have insufficient traffic isolation between applications in the microservice system, which leads to high-traffic applications affecting the normal services of other applications and reducing system stability.

Method used

By assigning independent request queues and thread pools to each application in the Dubbo gateway, storing requests into the corresponding request queues according to the application identification, and routing requests to the target application according to the maximum concurrency of the thread pool, achieving refined traffic isolation.

Benefits of technology

Ensure that external requests of different applications in the microservice system are processed independently, avoid the impact of high-traffic applications on other applications, and improve the stability and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378495A_ABST
    Figure CN120378495A_ABST
Patent Text Reader

Abstract

The invention discloses an external request processing method and device, equipment and a storage medium, and belongs to the field of distributed technologies, and the method comprises the steps: obtaining a to-be-processed request passing through a target gateway; according to a target application identifier in the to-be-processed request, storing the to-be-processed request in a target request queue corresponding to the target application identifier in a target gateway; and according to the maximum concurrency number of a target thread pool corresponding to the target application identifier, by calling threads in the target thread pool, routing the to-be-processed request in the target request queue to a target application corresponding to the target application identifier. According to the invention, independent processing of external requests of different applications in the micro-service system is ensured, the influence of external request processing of a certain application in the micro-service system on normal services of other applications in the micro-service system is avoided, refined flow isolation between applications in the Dubbo gateway in the micro-service system is realized, and the stability of the micro-service system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technologies, and in particular, to an external request processing method, apparatus, device, and storage medium. Background Art

[0002] In the evolution of large-scale distributed system architectures, the microservices architecture has leaped to the mainstream technical solution. This architecture realizes system decoupling through refined service splitting, significantly improving business flexibility and horizontal scalability. In this architecture, communication between services relies on gateways to achieve standardized access and intelligent routing. As a key hub in the microservices ecosystem, the Dubbo gateway undertakes the core function of request proxy. It accurately distributes external requests to the corresponding backend service instances through a dynamic routing mechanism.

[0003] However, in microservices systems, the existing Dubbo gateways have the problem of insufficient traffic isolation between applications. If the traffic of a certain application in the Dubbo gateway suddenly increases, it may affect the normal services of other applications in the Dubbo gateway, thereby leading to a decline in the stability of the microservices system. Summary of the Invention

[0004] The present invention provides an external request processing method, apparatus, device, and storage medium to achieve refined traffic isolation between applications in the Dubbo gateway of a microservices system and improve the stability of the microservices system.

[0005] According to one aspect of the present invention, there is provided an external request processing method, the method comprising:

[0006] Obtaining a to-be-processed request passing through a target gateway;

[0007] Storing the to-be-processed request into a target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed request;

[0008] Routing the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier by calling threads in the target thread pool according to the maximum concurrency number of the target thread pool corresponding to the target application identifier.

[0009] According to another aspect of the present invention, there is provided an external request processing apparatus, the apparatus comprising:

[0010] A to-be-processed request obtaining module, configured to obtain a to-be-processed request passing through a target gateway;

[0011] A to-be-processed request storing module, configured to store the to-be-processed request into a target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed request;

[0012] A to-be-processed request processing module, configured to route the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier by calling the threads in the target thread pool according to the maximum concurrency of the target thread pool corresponding to the target application identifier.

[0013] According to another aspect of the present invention, there is provided an electronic device, which includes:

[0014] At least one processor;

[0015] And a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the external request processing method of any embodiment of the present invention.

[0017] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the external request processing method of any embodiment of the present invention when executed.

[0018] According to another aspect of the present invention, there is provided a computer program product including a computer program, which implements the external request processing method of any embodiment of the present invention when executed by a processor.

[0019] The technical solution of the embodiment of the present invention includes obtaining the to-be-processed requests passing through the target gateway; storing the to-be-processed requests into the target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed requests; and routing the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier by calling the threads in the target thread pool according to the maximum concurrency of the target thread pool corresponding to the target application identifier. By storing the to-be-processed requests with the same target application identifier into the target request queue corresponding to the target application identifier, and then routing the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier by the target thread pool corresponding to the target application identifier, the above technical solution ensures the independent processing of external requests of different applications in the microservice system, avoids the impact of the external request processing of a certain application in the microservice system on the normal services of other applications in the microservice system, realizes the fine-grained traffic isolation between applications in the Dubbo gateway of the microservice system, and improves the stability of the microservice system.

[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. Description of the Drawings

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0022] Figure 1 is a flowchart of an external request processing method provided according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of an external request processing method provided according to Embodiment 2 of the present invention;

[0024] Figure 3 is a schematic structural diagram of an external request processing device provided according to Embodiment 3 of the present invention;

[0025] Figure 4 is a schematic structural diagram of an electronic device for implementing the external request processing method of the embodiments of the present invention. Specific Embodiments

[0026] In order to enable those skilled in the art to better understand the solution of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0027] It should be noted that the terms "target", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0028] Embodiment 1

[0029] Figure 1The flowchart of an external request processing method provided by the first embodiment of the present invention. This embodiment is applicable to the situation of processing external requests passing through the Dubbo gateway in a microservice system, especially applicable to the situation of processing external requests passing through the Dubbo gateway in a large-scale microservice system. This method can be executed by an external request processing device, which can be implemented in the form of hardware and / or software and can be configured in an electronic device. As Figure 1 shown, the method includes:

[0030] S101. Obtain a to-be-processed request passing through the target gateway.

[0031] Among them, the target gateway refers to the entry through which external requests enter the microservice system; optionally, the target gateway can be the Dubbo gateway. Among them, the Dubbo gateway refers to an API (Application Programming Interface) gateway extended based on the Dubbo framework. The to-be-processed request refers to an external request that needs to be processed in the target gateway.

[0032] Specifically, through a traffic capture tool, obtain the to-be-processed request passing through the target gateway in the microservice system.

[0033] S102. According to the target application identifier in the to-be-processed request, store the to-be-processed request into the target request queue corresponding to the target application identifier in the target gateway.

[0034] Among them, the target application identifier refers to the application identifier included in the to-be-processed request. It should be noted that an application identifier is used to uniquely identify an application in the microservice system. The target request queue refers to the request queue corresponding to the target application identifier. It should be noted that an independent request queue and thread pool are allocated for each application in the target gateway. Since each application in the microservice system has its own unique application identifier, in the target gateway, one application identifier corresponds to one request queue and one thread pool.

[0035] Specifically, according to the target application identifier in the to-be-processed request, determine the current request rate corresponding to the target application identifier in the target gateway; detect whether the current request rate is greater than the maximum request rate corresponding to the target application identifier; if so, perform traffic limiting processing on the to-be-processed request; otherwise, according to the target application identifier, store the to-be-processed request into the target request queue corresponding to the target application identifier in the target gateway.

[0036] Among them, the current request rate refers to the number of external requests sent to the target application corresponding to the target application identifier in the current environment per unit time. The maximum request rate refers to the maximum number of external requests allowed to be sent to the target application corresponding to the target application identifier per unit time. Among them, the unit time can be per second or per minute.

[0037] Exemplarily, for the to-be-processed request 1 passing through the target gateway, if the target application identifier in the to-be-processed request 1 is Application 2, then taking Application 2 as the index condition, the number of to-be-processed requests with the application identifier being Application 2 within the unit time window in the target gateway is counted as the current request rate corresponding to Application 2; if the current request rate corresponding to Application 2 is 5r / s, that is, the current request rate corresponding to Application 2 is 5 to-be-processed requests per second, and the maximum request rate corresponding to Application 2 is 10r / s, it can be known that the current request rate corresponding to Application 2 is less than the maximum request rate corresponding to Application 2, then according to Application 2, the to-be-processed request 1 is stored in the target request queue corresponding to Application 2 in the target gateway; if the current request rate corresponding to Application 2 is 6r / s and the maximum request rate corresponding to Application 2 is 5r / s, it can be known that the current request rate corresponding to Application 2 is greater than the maximum request rate corresponding to Application 2, then rate limiting processing is performed on the to-be-processed request 1, that is, the to-be-processed request 1 is not stored in the target request queue corresponding to Application 2 in the target gateway.

[0038] It can be understood that by comparing the current request rate and the maximum request rate corresponding to the target application identifier, it is determined whether to perform rate limiting processing on the to-be-processed request currently containing the target application identifier or store the to-be-processed request currently containing the target application identifier in the target request queue corresponding to the target application identifier, preventing the occurrence of application traffic overload in the microservice system, ensuring the availability of each application in the microservice system under high traffic conditions, and enabling the microservice system to still operate stably when a certain application has high traffic.

[0039] Optionally, in order to prevent traffic overload of the target application in the microservice system and also to improve the accuracy of the maximum request rate corresponding to the target application identifier, the maximum request rate is determined according to the expected load of the target application corresponding to the target application identifier and the system resource usage of the microservice system. Among them, the expected load of the target application refers to the number of external requests that the target application is expected to be able to process per unit time. The system resource usage of the microservice system refers to the usage of resources such as CPU, memory, storage, and network bandwidth consumed by each application in the microservice system during operation.

[0040] S103. According to the maximum concurrency number of the target thread pool corresponding to the target application identifier, by calling the threads in the target thread pool, route the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier.

[0041] Among them, the target thread pool refers to the thread pool corresponding to the target application identifier. The maximum concurrency refers to the maximum number of threads that the target thread pool can execute at one time.

[0042] Specifically, according to the maximum concurrency of the target thread pool corresponding to the target application identifier, call the maximum number of concurrent threads in the target thread pool, and route the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier.

[0043] The technical solution of the embodiment of the present invention is as follows: obtain the to-be-processed requests passing through the target gateway; according to the target application identifier in the to-be-processed requests, store the to-be-processed requests in the target request queue corresponding to the target application identifier in the target gateway; according to the maximum concurrency of the target thread pool corresponding to the target application identifier, by calling the threads in the target thread pool, route the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier. The above technical solution stores the to-be-processed requests with the same target application identifier in the target request queue corresponding to the target application identifier, and then, the target thread pool corresponding to the target application identifier routes the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier, ensuring the independent processing of external requests of different applications in the microservice system, avoiding the impact of the external request processing of a certain application in the microservice system on the normal services of other applications in the microservice system, realizing the fine-grained traffic isolation between applications in the Dubbo gateway of the microservice system, and improving the stability of the microservice system.

[0044] Embodiment Two

[0045] Figure 2 The following is a flowchart of an external request processing method provided by the second embodiment of the present invention. On the basis of the above embodiment, an optional implementation solution is provided. It should be noted that for the parts not detailed in the embodiment of the present invention, reference can be made to the relevant descriptions of other embodiments. As Figure 2 shown, the method includes:

[0046] S201. Obtain the to-be-processed requests passing through the target gateway.

[0047] S202. Detect whether the to-be-processed requests are abnormal requests.

[0048] Among them, abnormal requests refer to external requests that do not conform to the security specifications or business logics of the microservice system. It should be noted that abnormal requests generally originate from malicious attacks, misoperations, system failures, or unexpected client behaviors, and their core feature is to disrupt the normal operation of the microservice system or attempt to bypass the security control of the microservice system.

[0049] Specifically, an anomaly request detection model that has been pre-trained can be used to detect whether a request to be processed is an anomaly request. If so, that is, the model output result is an anomaly request, then S203 is executed; if not, that is, the model output result is a normal request, then S204, S205, and S206 are executed.

[0050] S203: Intercept the request to be processed and send an alarm message to the operation and maintenance personnel.

[0051] It can be understood that before storing the request to be processed, it is necessary to detect whether the request to be processed is an anomaly request. If so, intercept the request to be processed and send an alarm message to the operation and maintenance personnel to help the operation and maintenance personnel discover and process anomaly requests in a timely manner, block the attack chain of the microservice system, reduce the risk of data leakage in the microservice system, and improve the security of the microservice system.

[0052] S204: According to the target application identifier in the request to be processed, store the request to be processed in the target request queue corresponding to the target application identifier in the target gateway.

[0053] S205: According to the maximum concurrency of the target thread pool corresponding to the target application identifier, route the request to be processed in the target request queue to the target application corresponding to the target application identifier by calling the threads in the target thread pool.

[0054] S206: If the service response result feedback from the target application is not received within the preset service response time, trigger the circuit breaker mechanism in the target gateway.

[0055] Among them, the preset service response time refers to the time set in advance for the target application to respond to external requests. Optionally, the preset service response time can be determined according to the request data format and request type of the request to be processed. For example, if the request data format of the request to be processed is JSON format and the request type is a picture upload request, the preset service response time can be 800 milliseconds. Among them, the request data format of the request to be processed can be one of data formats such as JSON format, Protocol Buffers format, Thrift format, and Avro format. It should be noted that the request type of the request to be processed refers to the request type determined according to the request intention. For example, if the request to be processed is to log in to application A, the request type of the request to be processed is a user login request. The service response result refers to the result of the target application responding to the request to be processed.

[0056] Specifically, if the service response result feedback from the target application is not received within the preset service response time, trigger the circuit breaker mechanism in the target gateway to avoid continuous calls to faulty applications, thereby avoiding the spread of faults in the microservice system and avoiding microservice system avalanche.

[0057] In the technical solution of the embodiment of the present invention, after obtaining a request to be processed, the request to be processed is detected to determine whether the request to be processed is an abnormal request; if it is determined that the request to be processed is an abnormal request, the request to be processed is intercepted, and an alarm message is sent to the operation and maintenance personnel to help the operation and maintenance personnel discover and process abnormal requests in a timely manner, blocking the attack chain of attacking the microservice system, reducing the risk of data leakage in the microservice system, and improving the security of the microservice system; if it is determined that the request to be processed is a normal request, the requests to be processed with the same target application identifier are stored in the target request queue corresponding to the target application identifier, and then, the target thread pool corresponding to the target application identifier routes the requests to be processed in the target request queue to the target application corresponding to the target application identifier, ensuring the independent processing of external requests of different applications in the microservice system, avoiding the influence of the external request processing of a certain application in the microservice system on the normal services of other applications in the microservice system, realizing the fine-grained traffic isolation between applications in the Dubbo gateway of the microservice system, and improving the stability of the microservice system; then, according to the service response time of the target application, the circuit breaker mechanism in the target gateway is triggered, avoiding continuous calls to the faulty application, thereby avoiding the spread of faults in the microservice system and avoiding the avalanche of the microservice system.

[0058] On the basis of the above embodiment, as an optional manner of the embodiment of the present invention, after routing the requests to be processed in the target request queue to the target application corresponding to the target application identifier, if it is detected that the error rate of the target application is greater than or equal to the application error rate threshold, the circuit breaker mechanism in the target gateway is triggered.

[0059] Wherein, the application error rate threshold refers to the maximum number of errors allowed for an application within a specific time; optionally, the application error rate threshold can be preset according to the experience of those skilled in the art, and the embodiment of the present invention does not make specific limitations on it. Among them, the specific time can be preset according to the experience of those skilled in the art, and the embodiment of the present invention does not make specific limitations on it.

[0060] Specifically, after routing the requests to be processed in the target request queue to the target application corresponding to the target application identifier, the error rate of the target application within a specific time is detected. If the error rate is greater than or equal to the application error rate threshold, the circuit breaker mechanism in the target gateway is triggered to avoid continuous calls to the faulty application, thereby avoiding the spread of faults in the microservice system and avoiding the avalanche of the microservice system; if the error rate is less than the application error rate threshold, the target application is continued to be called to respond to the requests to be processed.

[0061] Embodiment III

[0062] Figure 3Schematic diagram of an external request processing device provided in Embodiment 3 of the present invention. This embodiment is applicable to the situation of processing external requests passing through the Dubbo gateway in a microservices system, especially applicable to the situation of processing external requests passing through the Dubbo gateway in a large-scale microservices system. The device can be implemented in the form of hardware and / or software and can be configured in an electronic device. As Figure 3 shown, the device includes:

[0063] A to-be-processed request acquisition module 301, configured to acquire a to-be-processed request passing through a target gateway;

[0064] A to-be-processed request storage module 302, configured to store the to-be-processed request into a target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed request;

[0065] A to-be-processed request processing module 303, configured to route the to-be-processed request in the target request queue to a target application corresponding to the target application identifier by calling a thread in the target thread pool according to the maximum concurrency number of the target thread pool corresponding to the target application identifier.

[0066] The technical solution of the embodiment of the present invention is as follows: acquire a to-be-processed request passing through a target gateway; store the to-be-processed request into a target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed request; and route the to-be-processed request in the target request queue to a target application corresponding to the target application identifier by calling a thread in the target thread pool according to the maximum concurrency number of the target thread pool corresponding to the target application identifier. Through the above technical solution, by storing the to-be-processed requests with the same target application identifier into the target request queue corresponding to the target application identifier, and then, routing the to-be-processed requests in the target request queue to the target application corresponding to the target application identifier by the target thread pool corresponding to the target application identifier, it ensures the independent processing of external requests of different applications in the microservices system, avoids the impact of the external request processing of a certain application in the microservices system on the normal services of other applications in the microservices system, realizes the fine-grained traffic isolation between applications in the Dubbo gateway of the microservices system, and improves the stability of the microservices system.

[0067] Optionally, the to-be-processed request storage module 302 is specifically configured to:

[0068] Determine the current request rate corresponding to the target application identifier in the target gateway according to the target application identifier in the to-be-processed request;

[0069] Detect whether the current request rate is greater than the maximum request rate corresponding to the target application identifier;

[0070] If so, perform rate limiting processing on the to-be-processed request;

[0071] Otherwise, according to the target application identifier, store the request to be processed into the target request queue corresponding to the target application identifier in the target gateway.

[0072] Optionally, the maximum request rate is determined according to the expected load of the target application corresponding to the target application identifier and the system resource usage of the microservice system.

[0073] Optionally, the device further includes:

[0074] An abnormal request detection module, configured to detect whether the request to be processed is an abnormal request before storing the request to be processed into the target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the request to be processed; if so, intercept the request to be processed and send an alarm message to the operation and maintenance personnel.

[0075] Optionally, the device further includes:

[0076] A first service fusing module, configured to trigger the fusing mechanism in the target gateway if the service response result feedback by the target application is not received within the preset service response time after routing the request to be processed in the target request queue to the target application corresponding to the target application identifier.

[0077] Optionally, the device further includes:

[0078] A second service fusing module, configured to trigger the fusing mechanism in the target gateway if it is detected that the error rate of the target application is greater than the application error rate threshold after routing the request to be processed in the target request queue to the target application corresponding to the target application identifier.

[0079] The external request processing device provided by the embodiments of the present invention can execute the external request processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing each external request processing method.

[0080] According to the embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0081] Embodiment 4

[0082] Figure 4The schematic structural diagram of the electronic device 10 that can be used to implement the embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0083] As Figure 4 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.

[0084] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0085] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the external request processing method.

[0086] In some embodiments, the external request processing method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the external request processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the external request processing method by any other suitable means (e.g., by means of firmware).

[0087] The various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0088] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer programs are executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0089] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, 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.

[0090] For providing interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used for providing interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0091] The systems and techniques described herein can be implemented in a computing system that includes backend components (such as, for example, a data server), or a computing system that includes middleware components (such as, for example, an application server), or a computing system that includes frontend components (such as, for example, a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (such as, for example, a communication network). Examples of the communication network include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0092] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs that run on respective computers and have a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0093] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

[0094] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. An external request processing method, characterized in that, Including: Obtain a request to be processed passing through the target gateway; According to the target application identifier in the request to be processed, store the request to be processed into the target request queue corresponding to the target application identifier in the target gateway; According to the maximum concurrency of the target thread pool corresponding to the target application identifier, route the request to be processed in the target request queue to the target application corresponding to the target application identifier by calling the threads in the target thread pool.

2. The method according to claim 1, characterized in that, According to the target application identifier in the request to be processed, storing the request to be processed into the target request queue corresponding to the target application identifier in the target gateway includes: Determine the current request rate corresponding to the target application identifier in the target gateway according to the target application identifier in the request to be processed; Detect whether the current request rate is greater than the maximum request rate corresponding to the target application identifier; If so, perform traffic limiting processing on the request to be processed; Otherwise, according to the target application identifier, store the request to be processed into the target request queue corresponding to the target application identifier in the target gateway.

3. The method according to claim 2, wherein The maximum request rate is determined according to the expected load of the target application corresponding to the target application identifier and the system resource usage of the microservice system.

4. The method according to claim 1, characterized in that Before storing the request to be processed into the target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the request to be processed, the method further includes: Detect whether the request to be processed is an abnormal request; If so, intercept the request to be processed and send an alarm message to the operation and maintenance personnel.

5. The method according to claim 1, characterized in that, After routing the request to be processed in the target request queue to the target application corresponding to the target application identifier, the method further includes: If the service response result feedback from the target application is not received within the preset service response time, trigger the circuit breaker mechanism in the target gateway.

6. The method according to claim 1, characterized in that, After routing the request to be processed in the target request queue to the target application corresponding to the target application identifier, the method further includes: If it is detected that the error rate of the target application is greater than or equal to the application error rate threshold, trigger the circuit breaker mechanism in the target gateway.

7. An external request processing device, characterized in that, Including: A module for obtaining a request to be processed, configured to obtain a request to be processed passing through the target gateway; A module for storing a request to be processed, configured to store the request to be processed into the target request queue corresponding to the target application identifier in the target gateway according to the target application identifier in the request to be processed; A module for processing a request to be processed, configured to route the request to be processed in the target request queue to the target application corresponding to the target application identifier by calling the threads in the target thread pool according to the maximum concurrency of the target thread pool corresponding to the target application identifier.

8. An electronic device, characterized in that, The electronic device includes: At least one processor; And a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, enables the at least one processor to execute the external request processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for implementing the external request processing method according to any one of claims 1-6 when the computer instructions are executed by a processor.

10. A computer program product, comprising a computer program which, when executed by a processor, implements the external request processing method according to any one of claims 1-6.