Request processing method, device and system

By intercepting client requests and resolving plugin sequential dependencies to process business requests, the data bottleneck and scalability issues of the proxy gateway system are resolved, enabling flexible plugin configuration and efficient business processing, and improving the system's scalability and maintainability.

CN121644658APending Publication Date: 2026-03-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing proxy gateway systems suffer from data bottlenecks, low processing efficiency, poor scalability, low flexibility, and strong code coupling, especially in centralized and microservice architectures.

Method used

By intercepting client requests, the proxy configuration information is obtained, multiple plugins and their sequential dependencies are parsed, business requests are processed according to the sequential dependencies of the plugins, and request and response information is forwarded on the server side. Flexible configuration and editing of plugins are supported, including operations such as adding, modifying, and deleting.

Benefits of technology

It improves the flexibility and scalability of the proxy service, enhances the system's configuration flexibility, and improves the system's processing efficiency and maintainability through non-intrusive integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644658A_ABST
    Figure CN121644658A_ABST
Patent Text Reader

Abstract

The invention discloses a request processing method, device and system, and relates to the technical field of proxy gateways. A specific embodiment of the method comprises the following steps: intercepting a service request sent by a client, and obtaining proxy configuration information corresponding to the service request; analyzing a plurality of plug-ins for processing the service request and a first sequence dependency relationship among the plurality of plug-ins from proxy configuration information; processing the service request based on the first sequence dependency relationship to obtain a target service request, and forwarding the target service request to the server; and receiving first response information of the server for the target service request, and sending the first response information to the client. According to the embodiment of the invention, the service request is processed by configuring the plug-in data and the execution sequence, so that the flexibility and expansibility of the proxy service are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of proxy gateway, and in particular to a method, device and system for processing a request. BACKGROUND

[0002] With the increasing complexity of Internet application functions, the requirements for background data processing of Internet applications are also increasing. In a background architecture, a proxy gateway can be used to process data interaction between a client and a server.

[0003] The proxy gateway in the existing system usually adopts a centralized or micro-service architecture setting mode. However, the centralized proxy gateway can cause a data bottleneck, and has the problems of low processing efficiency and scalability. The proxy gateway of the micro-service architecture needs to split the proxy business, which leads to an increase in the complexity of the micro-service system and a decrease in the processing efficiency. In addition, whether the centralized or micro-service architecture needs to develop additional code for the proxy gateway, which leads to the problems of low flexibility and strong code coupling of the proxy gateway. SUMMARY

[0004] Therefore, the embodiments of the present application provide a method, device and system for processing a request, which can intercept a business request sent by a client, obtain proxy configuration information corresponding to the business request, parse a plurality of plug-ins for processing the business request and a first order dependency relationship between the plurality of plug-ins from the proxy configuration information, process the business request based on the first order dependency relationship to obtain a target business request, and forward the target business request to a server. The first response information of the target business request from the server is received, and the first response information is sent to the client. The embodiments of the present application improve the flexibility and scalability of the proxy service by configuring plug-in data and processing the business request according to the execution order, and improve the configuration flexibility of the system by non-invasive integration of the proxy component.

[0005] To achieve the above object, according to an aspect of the embodiments of the present application, a method for processing a request is provided, characterized in that it comprises: intercepting a business request sent by a client, and obtaining proxy configuration information corresponding to the business request; parsing a plurality of plug-ins for processing the business request from the proxy configuration information, and obtaining a first order dependency relationship of the plurality of plug-ins; processing the business request by using the plurality of plug-ins according to the first order dependency relationship to obtain a target business request, and forwarding the target business request to a server; receiving first response information of the target business request from the server, and sending the first response information to the client.

[0006] Optionally, receiving the first response information from the server in response to the target business request and sending the first response information to the client includes: obtaining the second order dependency relationship of multiple plugins; wherein the second order dependency relationship is the reverse of the execution order of the multiple plugins defined in the first order dependency relationship; using the multiple plugins to process the first response information according to the second order dependency relationship to obtain the processed second response information; and forwarding the second response information to the client.

[0007] Optionally, multiple plugins are used to process business requests according to a first sequential dependency relationship to obtain the target business request, including: for each plugin, the following steps are executed: N1: Determine whether the plugin is at the beginning of the first sequential dependency relationship. If so, execute N2; otherwise, execute N3; N2: Use the plugin's business logic to process the business request to obtain a first processing result, and send the first processing result to the next adjacent plugin based on the first sequential dependency relationship; N3: Receive the first processing result of the previous adjacent plugin in the first sequential dependency relationship, use the plugin's business logic to process the first processing result to obtain a second processing result, and send the second processing result to the next adjacent plugin based on the first sequential dependency relationship; N4: Determine whether the plugin is at the end of the first sequential dependency relationship. If so, use the second processing result obtained by the plugin as the target business request; otherwise, execute step N2.

[0008] Optionally, the method for processing the request further includes: providing a configuration page for proxy configuration information, receiving an edit request for the proxy configuration information corresponding to the business request through the configuration page; performing one or more editing operations, such as adding, modifying, or deleting plugins in the proxy configuration information, according to the edit request; and / or performing an edit operation for a first or second order dependency relationship of multiple plugins.

[0009] Optionally, the process of obtaining the target business request by using multiple plugins to process business requests in a first-order dependency relationship further includes: for each plugin, performing the following steps: obtaining the processing status of the plugin's business request; in response to an anomaly in the processing status, obtaining the anomaly information matching the plugin's business logic; and sending the anomaly information to the client.

[0010] Optionally, multiple plugins for handling business requests are parsed from the proxy configuration information, including: for each plugin, obtaining the plugin's usage permissions from the proxy configuration information; in response to the plugin's usage permissions being enabled, determining that the plugin is a plugin capable of handling business requests; obtaining the first-order dependency relationship of the multiple plugins for handling business requests, including: directly obtaining the first-order dependency relationship of the multiple plugins from the proxy configuration information; or, obtaining the priority settings for the multiple plugins, determining the first-order dependency relationship of the multiple plugins based on the priority settings, so that the plugin with higher priority is placed earlier in the first-order dependency relationship.

[0011] To achieve the above objectives, according to a second aspect of the present invention, an apparatus for processing requests is provided, characterized in that it includes: an information parsing module, a request processing module, and a response processing module; wherein,

[0012] The parsing module is used to intercept business requests sent by the client, obtain the proxy configuration information corresponding to the business request, parse out multiple plugins that handle the business request from the proxy configuration information, and obtain the first order dependency relationship of multiple plugins.

[0013] The request processing module is used to process business requests using multiple plugins according to their first-order dependencies, obtain the target business request, and forward the target business request to the server.

[0014] The response processing module is used to receive the first response information from the server in response to the target business request and send the first response information to the client.

[0015] Optionally, the device for processing the request is configured to receive first response information from the server in response to the target business request, and send the first response information to the client, including: obtaining a second sequential dependency relationship of multiple plugins; wherein the second sequential dependency relationship is the reverse of the execution order of the multiple plugins defined in the first sequential dependency relationship; processing the first response information using the multiple plugins according to the second sequential dependency relationship to obtain the processed second response information; and forwarding the second response information to the client.

[0016] Optionally, the device for processing requests is configured to process business requests using multiple plugins according to a first sequential dependency relationship to obtain a target business request, including: for each plugin, performing the following steps: N1: determining whether the plugin is at the beginning of the first sequential dependency relationship; if so, performing N2; otherwise, performing N3; N2: processing the business request using the plugin's business logic to obtain a first processing result, and sending the first processing result to the next adjacent plugin based on the first sequential dependency relationship; N3: receiving the first processing result from the previous adjacent plugin in the first sequential dependency relationship, processing the first processing result using the plugin's business logic to obtain a second processing result, and sending the second processing result to the next adjacent plugin based on the first sequential dependency relationship; N4: determining whether the plugin is at the end of the first sequential dependency relationship; if so, using the second processing result obtained by the plugin as the target business request; otherwise, performing step N2.

[0017] Optionally, the device for processing the request is further configured to provide a configuration page for proxy configuration information, receive an edit request for the proxy configuration information corresponding to the business request through the configuration page; perform one or more editing operations such as adding, modifying, or deleting plugins in the proxy configuration information according to the edit request; and / or perform an edit operation for a first or second order dependency relationship of multiple plugins.

[0018] Optionally, the device for processing the request, used to process the business request using multiple plugins in a first-order dependency relationship to obtain the target business request, further includes: for each plugin, performing the following steps: obtaining the processing status of the plugin's processing of the business request; in response to an anomaly in the processing status, obtaining an anomaly information matching the plugin's business logic; and sending the anomaly information to the client.

[0019] Optionally, the device for processing the request is configured to parse multiple plugins for processing the business request from the proxy configuration information, including: for each plugin, obtaining the plugin's usage permission from the proxy configuration information; in response to the plugin's usage permission being enabled, determining that the plugin is a plugin capable of processing the business request; obtaining the first order dependency relationship of the multiple plugins for processing the business request, including: directly obtaining the first order dependency relationship of the multiple plugins from the proxy configuration information; or, obtaining the priority settings for the multiple plugins, determining the first order dependency relationship of the multiple plugins based on the priority settings, so that the plugin with higher priority is placed earlier in the first order dependency relationship.

[0020] To achieve the above objectives, according to a third aspect of the present invention, a system for processing requests is provided, comprising: a client, a proxy component, and a server for deploying the proxy component; wherein the proxy component implements any of the methods described above for processing requests.

[0021] To achieve the above objectives, according to a fourth aspect of the present invention, an electronic device for processing requests is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the methods described above for processing requests.

[0022] To achieve the above objectives, according to a fifth aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements any of the methods described above for processing requests.

[0023] To achieve the above objectives, according to a sixth aspect of the present invention, a computer program product is provided, comprising a computer program, characterized in that, when executed by a processor, the computer program implements any of the methods described above for processing requests.

[0024] One embodiment of the above invention has the following advantages or beneficial effects: it can intercept business requests sent by clients using a proxy component, obtain proxy configuration information corresponding to the business requests; parse multiple plugins for processing business requests and the first order dependency relationships between the multiple plugins from the proxy configuration information; each plugin processes the business request based on the first order dependency relationship to obtain the target business request, and forwards the target business request to the server; receives the first response information from the server for the target business request, and sends the first response information to the client. This embodiment of the invention improves the flexibility and scalability of the proxy service by configuring plugin data and processing business requests in an execution order, and improves the system's configuration flexibility through the non-intrusive integration of the proxy component.

[0025] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0026] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0027] Figure 1 This is a flowchart illustrating a method for processing requests according to an embodiment of the present invention;

[0028] Figure 2 This is a schematic diagram of a system structure for processing requests according to an embodiment of the present invention;

[0029] Figure 3 This is a schematic diagram of a process for handling requests using a plugin, provided in one embodiment of the present invention;

[0030] Figure 4 This is a schematic diagram of the structure of a request processing device provided in one embodiment of the present invention;

[0031] Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0032] Figure 6 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

[0033] 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.

[0034] It should be noted that the collection, use, storage, sharing and transfer of user personal information involved in the technical solution of the present invention all comply with the provisions of relevant laws and regulations, and require notification to users and obtaining their consent or authorization. When applicable, user personal information is subjected to de-identification and / or anonymization and / or encryption technical processing.

[0035] The existing gateway service processing solutions include the following, and these solutions have the following drawbacks:

[0036] For centralized proxy mode: all requests must go through a centralized proxy, which can lead to performance bottlenecks in high-concurrency scenarios. If the gateway has a problem, the entry point of the entire system will be affected. Furthermore, as the complexity of the system increases, the scalability of centralized proxy may be limited.

[0037] For microservice architectures: While splitting the gateway into multiple microservices can improve flexibility, it also increases system complexity, including service management, monitoring, and debugging. Communication between services can introduce additional latency, especially with a large number of microservices. Maintaining configuration consistency across multiple microservices can also be challenging.

[0038] For custom middleware: developers need to develop and maintain the middleware themselves, which increases the complexity and development cost of the project. Too much customization may make the system difficult to understand and maintain, and custom middleware design may have a negative impact on performance.

[0039] For event-driven architectures: The asynchronous nature of event-driven architectures can increase the difficulty of debugging and monitoring problems, and also increase the difficulty of managing the consistency and order of event processing. Especially in distributed systems, the dependencies between events can make system design and management more complex.

[0040] In view of this, such as Figure 1 As shown, this embodiment of the invention provides a method for processing requests, which may include the following steps:

[0041] The request processing method in this embodiment of the invention is applied to a proxy component. The proxy component in this embodiment can be implemented based on a sidecar program.

[0042] Step S101: Intercept the business request sent by the client, obtain the proxy configuration information corresponding to the business request; parse out the multiple plugins that handle the business request from the proxy configuration information, and obtain the first order dependency relationship of the multiple plugins.

[0043] Specifically, when the proxy component intercepts a business request sent by the client, it uses multiple plugins contained in the proxy component to automatically process the business request. The business has corresponding proxy configuration information, which includes the configuration information of the plugins and the execution order of each plugin (i.e., the first-order dependency relationship).

[0044] The following examples illustrate several plugins for processing order transactions on an e-commerce platform. For instance, the following functional requirements exist during the order request processing process:

[0045] a. Authentication and Authorization: Used to verify user identity and check their permissions to ensure that only authorized users can submit orders.

[0046] b. Access rate limiting: Used to limit the request rate for each user or each IP address.

[0047] c. Request Conversion: Convert order request data from different clients into a unified format for subsequent processing.

[0048] d. Log recording: Record relevant information about order requests for subsequent auditing and analysis.

[0049] Furthermore, based on the functional requirements a~d above, plugins and their first-order dependencies are constructed; for example, using a bypass proxy pattern, a proxy component (API gateway) containing each plugin is deployed between the server and the client, while a plugin management module and a plugin chain (i.e., plugins with sequential dependencies) management module are introduced to achieve flexible plugin extension and customization capabilities; furthermore, the corresponding plugins include:

[0050] 1) Authentication and Authorization Plugin: This plugin is responsible for verifying the user's identity and checking their permissions. Different authentication methods can be selected, such as JWT-based token verification or OAuth-based authorization code flow.

[0051] 2) Data Rate Limiting Plugin: This plugin limits the request rate for each user or IP address to prevent malicious requests or overload. For example, it allows setting the maximum number of requests per second, per minute, or per hour.

[0052] 3) Data Conversion Plugin: This plugin is responsible for converting requests from different clients into a unified format for subsequent processing. For example, it converts client requests into the data structure format required by the server.

[0053] 4) Logging Plugin: This plugin is responsible for recording request-related information, such as request time, user ID, and request path. Logs can be recorded to local files or sent to a remote log server for centralized management.

[0054] Assume the first order of dependencies is as follows: "Authentication and Authorization Plugin -> Rate Limiting Plugin -> Data Transformation Plugin -> Logging Plugin".

[0055] In embodiments of the present invention, a proxy information configuration page is provided, allowing users to configure plugins, the number of plugins, and the execution order of plugins for tasks; each plugin has a name and corresponding configuration parameters. The configuration file can be modified according to specific needs, adding, deleting, or modifying plugins to meet different business requirements and scenarios; this improves the flexibility and scalability of using the proxy component to handle business requests. Specifically, a configuration page for proxy configuration information is provided, through which editing requests for proxy configuration information corresponding to business requests are received; based on the editing requests, one or more editing operations are performed on adding, modifying, or deleting plugins in the proxy configuration information; and / or, editing operations are performed on the first or second order dependencies of multiple plugins. The present invention does not limit the specific content and format of the proxy configuration information.

[0056] More preferably, the operations for configuring proxy information may also include setting plugin priorities and configuring plugin usage permissions. The priority setting ensures that plugins with higher priorities appear earlier in the first order dependency relationship. Specifically, parsing multiple plugins that handle business requests from the proxy configuration information includes: for each plugin, obtaining its usage permissions from the proxy configuration information; if the plugin's usage permissions are enabled, the plugin is determined to be capable of handling business requests; obtaining the first order dependency relationship of the multiple plugins handling business requests includes: directly obtaining the first order dependency relationship of multiple plugins from the proxy configuration information; or, obtaining the priority settings for multiple plugins, and determining the first order dependency relationship of multiple plugins based on the priority settings, so that plugins with higher priorities appear earlier in the first order dependency relationship. This further improves the flexibility and scalability of configuring plugins.

[0057] Step S102: Use multiple plugins to process business requests according to the first order of dependencies, obtain the target business request, and forward the target business request to the server.

[0058] Specifically, in the embodiments of the present invention, the various plugins in the proxy component process business requests according to a first sequential dependency relationship. For example, for order business, the first sequential dependency relationship is: "Authentication and Authorization Plugin -> Rate Limiting Plugin -> Data Conversion Plugin -> Log Recording Plugin". For a business request sent by the client, the authentication and authorization plugin first performs identity authentication and authorization for the business request. This plugin forwards the processing result to the next plugin in the first sequential dependency relationship (the rate limiting plugin), which can perform rate limiting on the request. Then, this plugin forwards the processing result to the next plugin in the first sequential dependency relationship (the data conversion plugin), which can perform format conversion and processing on the request to meet the server's requirements. Finally, this plugin forwards the processing result to the next plugin in the first sequential dependency relationship (the log recording plugin), which records relevant information about the request for convenient subsequent monitoring and analysis. After processing by each plugin, the target business request is obtained and forwarded to the server.

[0059] Furthermore, in embodiments of the present invention, a communication mechanism is established between plugins to perform the transmission and interaction of business data or response data. The processing results obtained by each plugin can be stored in a context or event bus for adjacent plugins to access. For example, after verifying identity in the authentication and authorization plugin, the authentication result (such as user information) can be passed to the rate limiting plugin via the context or event bus, allowing subsequent rate limiting plugins to make corresponding processing or decisions based on the authentication result. Similarly, the data conversion plugin may need to perform format conversion on the requested data, while the log plugin can report the collected information. The data conversion plugin is used to convert the client's data structure into a unified data structure required by the server, for example:

[0060] When the client is a mobile device, the data structure of the sent request is as follows:

[0061] { "userId": "12345",

[0062] "items": [{ "productId": "abc", "quantity": 2},

[0063] { "productId": "def","quantity": 1}],

[0064] "deliveryAddress": {

[0065] "street": "123 Main St", "city": "Anytown",

[0066] "zipCode": "12345"}}

[0067] When the client is a web application, the data structure of the sent request is as follows:

[0068] { "user": {"id": "12345"},

[0069] "orderDetails": [{"id": "abc","qty": 2},

[0070] { "id": "def","qty": 1},

[0071] "address": { "line1": "123 Main St","city": "Anytown",

[0072] "postalCode": "12345"}}

[0073] After conversion, the data structure conforming to the server's unified structure is as follows:

[0074] { "userId": "12345",

[0075] "orderItems": [{ "productId": "abc", "quantity": 2},

[0076] { "productId": "def", "quantity": 1}],

[0077] "shippingAddress": {"streetAddress": "123 Main St",

[0078] "cityName": "Anytown",

[0079] "postalCode": "12345"}}

[0080] It is understood that the conversion strategy is related to the specific business scenario, and this invention does not limit the specific data conversion strategy.

[0081] Through the communication mechanism between plugins in the proxy component, data can be transferred and interacted, enabling plugins to work collaboratively to complete complex request processing tasks. Furthermore, this plugin chain (plugins with sequential dependencies) construction and configuration method, along with the communication mechanism between plugins, improves the system's configurability and scalability. Plugins can be flexibly configured and combined according to specific business needs and scenarios to meet different business processing requirements.

[0082] Step S103: Receive the first response information from the server in response to the target business request, and send the first response information to the client.

[0083] Specifically, in embodiments of the present invention, each plugin is used to process the first response message returned by the server in response to the client's business request to obtain a second response message, and then the second response message is sent to the client. This completes the overall process of request and response between the client and the server.

[0084] In this process, the order in which each plugin receives the second response message from the first response message returned by the server in response to the client's business request is the reverse of the order in which the business request was processed. That is, the second order dependency relationship of multiple plugins is obtained; the second order dependency relationship is the reverse of the running order of multiple plugins defined in the first order dependency relationship; the first response information is processed by multiple plugins according to the second order dependency relationship to obtain the processed second response information; and the second response information is forwarded to the client.

[0085] Taking the order processing plugin as an example, after the server returns a response to a business request, the response passes through the plugin chain management module, which manages all plugins. The response information (i.e., the first response information) is first passed to the logging plugin, which records relevant information for subsequent monitoring and analysis. Then, the response information is passed to the data transformation plugin, which converts and processes the response information to meet the client's format requirements. Further, the response information is passed to the rate limiting plugin, which monitors response traffic and subsequent system stability. Finally, the second response information, obtained through the third plugin, is returned to the client.

[0086] Preferably, in embodiments of the present invention, an exception handling mechanism is provided to monitor the exception status of each plugin in the congestion monitoring proxy component and return specific exception information to the client or server. Specifically, the method of using multiple plugins to process business requests according to a first-order dependency relationship to obtain the target business request further includes: for each plugin, performing the following steps: obtaining the processing status of the plugin's business request; in response to an exception in the processing status, obtaining exception information matching the plugin's business logic; and sending the exception information to the client.

[0087] Taking order processing plugins as an example: authentication and authorization plugin, rate limiting plugin, data transformation plugin, and logging plugin; embodiments of the present invention perform corresponding monitoring and processing of abnormal information for different plugins:

[0088] 1) Exception types for different plugins:

[0089] Authentication / Authorization Plugin Error: When user authentication fails or permissions are insufficient, the proxy component returns the corresponding authentication or authorization error message, such as 401 Unauthorized or 403 Forbidden.

[0090] Request rate limiting plugin error: When it is determined that the request frequency exceeds the rate limiting threshold, the proxy component can return a 429 Too Many Requests status code to notify the client to retry later or take other measures.

[0091] Data conversion plugin error: If the requested format is incorrect or cannot be parsed during the data conversion process, a 400 Bad Request status code will be returned along with the corresponding error message.

[0092] Server-side errors: If the server fails or becomes unavailable, the proxy component can return the corresponding 5xx status code, such as 500 Internal Server Error, along with the corresponding error message.

[0093] 2) Exception handling strategy:

[0094] Global exception handling: The proxy component can be configured with a global exception handling mechanism to capture and handle all possible exceptions. Global exception handling logic can be implemented through middleware or interceptors to uniformly handle various exceptional situations.

[0095] Error message return: For captured exceptions, the proxy component should return clear and unambiguous error messages to the client so that the client can understand and take appropriate action. The error message should include the error code, error description, and possible solutions.

[0096] Exception logging: The proxy component can log information related to exception events, including exception type, occurrence time, request parameters, etc., to facilitate subsequent troubleshooting and problem analysis. Logs can be stored in local files or sent to a remote log server for centralized management.

[0097] Anomaly recovery mechanism: For certain anomalies, the proxy component can attempt to restore the state before the anomaly occurred, such as reconnecting to the backend service or resending the request. This improves the system's fault tolerance and reduces the impact of anomalies on the system. Through the anomaly handling mechanism, the proxy component can effectively handle various abnormal situations, ensuring the stability and reliability of the system, and improving user experience and service quality.

[0098] like Figure 2 As shown in the figure, an embodiment of the present invention provides a schematic diagram of a request processing system structure; as Figure 2 As shown, the system includes: server 201, client 203 and proxy component 202; wherein the proxy component can be deployed (integrated) on the server and does not need to be deployed separately on the gateway, achieving the beneficial effect of non-intrusive integration.

[0099] like Figure 2 As shown, the proxy component can intercept business requests sent by the client, obtain the proxy configuration information corresponding to the business request, parse out multiple plugins (plugin 1 to plugin n) that handle the business request from the proxy configuration information, and obtain the first order dependency relationship of the multiple plugins; use the multiple plugins to process the business request according to the first order dependency relationship to obtain the target business request, and forward the target business request to the server; further, receive the first response information of the server for the target business request, and send the first response information to the client. Specifically, receiving the first response information of the server for the target business request and sending the first response information to the client includes: obtaining the second order dependency relationship of the multiple plugins; wherein the second order dependency relationship is the reverse of the execution order of the multiple plugins defined in the first order dependency relationship; using the multiple plugins to process the first response information according to the second order dependency relationship to obtain the processed second response information; and forwarding the second response information to the client.

[0100] Specifically, the steps for processing the client's business requests according to the first-order dependency relationship of each plugin, and for processing the server's response information according to the second-order dependency relationship of multiple plugins, are consistent with the description of steps S101 to S103, and will not be repeated here. That is, a request processing system includes: a client, a proxy component, and a server that deploys the proxy component; wherein, the proxy component is used to intercept the business requests sent by the client, obtain the proxy configuration information corresponding to the business requests; parse out multiple plugins for processing the business requests from the proxy configuration information, and obtain the first-order dependency relationship of the multiple plugins; process the business requests using the multiple plugins according to the first-order dependency relationship to obtain the target business request, and forward the target business request to the server; receive the server's first response information for the target business request, and send the first response information to the client.

[0101] This invention provides a plugin interface and extension mechanism for plugin customization, enabling developers to write custom plugins to meet specific business needs. Plugins can be enabled or disabled as needed, and their execution order can be controlled through priority settings. Dynamic loading and unloading of plugins is also supported, facilitating system expansion and maintenance. Developers can manage plugins according to actual needs, improving system flexibility and scalability, allowing the system handling requests to flexibly build and adjust functions and processing flows based on business requirements.

[0102] In the business request and response information processing flow, business requests are intercepted by the proxy component and passed to the plugin chain management module. The plugin chain management module, according to the configured first-order dependency relationship, sequentially passes the requests to the plugins for processing. This process ensures that business requests are processed by each plugin in sequence, and the processed requests are then sent to the server. After the server returns response information, the response information passes through the plugin chain management module, which then sequentially passes the requests to the plugins for processing according to the second-order dependency relationship. The embodiments of this invention can flexibly control the processing logic of requests and responses and can easily add, delete, or modify plugins to meet different business needs and scenarios. The entire process ensures the orderly processing of requests and responses and can achieve complex processing logic through plugin collaboration and data transmission.

[0103] The proxy component (bypass proxy program) provided in this embodiment of the invention can be integrated with a distributed API gateway to form a new architecture pattern, which belongs to the distributed gateway architecture and overcomes the problems of poor flexibility, scalability and low data processing efficiency of centralized gateways.

[0104] like Figure 3 As shown in the figure, this embodiment of the invention provides a flowchart for processing requests using a plugin; the method may include the following steps;

[0105] Step S301: Intercept the business request sent by the client, obtain the proxy configuration information corresponding to the business request; parse out the multiple plugins that handle the business request from the proxy configuration information, and obtain the first order dependency relationship of the multiple plugins.

[0106] Step S302: Determine whether the plugin is at the beginning of the first order dependency. If yes, proceed to step S303; otherwise, proceed to step S304.

[0107] Step S303: Use the plugin's business logic to process the business request to obtain the first processing result, and based on the first sequential dependency relationship, send the first processing result to the next adjacent plugin.

[0108] Step S304: Receive the first processing result of the previous adjacent plugin in the first sequential dependency relationship, process the first processing result using the plugin's business logic to obtain the second processing result, and pass the second processing result to the next adjacent plugin based on the first sequential dependency relationship.

[0109] Step S305: Determine whether the plugin is located at the end of the first sequential dependency relationship. If yes, proceed to step S306; otherwise, proceed to step S303.

[0110] Step S306: Use the second processing result obtained by the plugin as the target business request.

[0111] Steps S301 to S306 are described as follows: Multiple plugins are used to process business requests according to a first sequential dependency relationship to obtain the target business request. This includes: For each plugin, the following steps are executed: N1: Determine if the plugin is at the beginning of the first sequential dependency relationship. If so, execute N2; otherwise, execute N3. N2: Use the plugin's business logic to process the business request and obtain a first processing result. Based on the first sequential dependency relationship, send the first processing result to the next adjacent plugin. N3: Receive the first processing result from the previous adjacent plugin in the first sequential dependency relationship, use the plugin's business logic to process the first processing result and obtain a second processing result. Based on the first sequential dependency relationship, send the second processing result to the next adjacent plugin. N4: Determine if the plugin is at the end of the first sequential dependency relationship. If so, use the second processing result obtained by the plugin as the target business request; otherwise, execute step N2.

[0112] In the order processing scenario, the description of the multiple plugins with a first-order dependency relationship—"Authentication and Authorization Plugin -> Rate Limiting Plugin -> Data Transformation Plugin -> Logging Plugin"—is consistent with the description in step S102 and will not be repeated here. By automatically running the business logic for processing requests according to the first-order dependency relationship among each plugin, the flexibility of using multiple plugins to process requests is improved. It is understandable that the process for processing response messages using the second-order dependency relationship is similar to steps S301 to S306.

[0113] like Figure 4 As shown, this embodiment of the invention provides a request processing apparatus 400, including: an information parsing module 401, a request processing module 402, and a response processing module 403; wherein,

[0114] The parsing information module 401 is used to intercept business requests sent by the client, obtain the proxy configuration information corresponding to the business request, parse out multiple plugins that handle the business request from the proxy configuration information, and obtain the first order dependency relationship of the multiple plugins.

[0115] The request processing module 402 is used to process business requests using multiple plugins according to the first order of dependencies, obtain the target business request, and forward the target business request to the server.

[0116] The response processing module 403 is used to receive the first response information from the server in response to the target business request and send the first response information to the client.

[0117] This invention also provides an electronic device for processing requests, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in any of the above embodiments.

[0118] This invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in any of the above embodiments.

[0119] This invention also provides a computer program product, including a computer program, characterized in that the program, when executed by a processor, implements the method provided in any of the above embodiments.

[0120] Figure 5 An exemplary system architecture 500 is shown, in which a method or apparatus for processing requests can be applied according to embodiments of the present invention.

[0121] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0122] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, and 503, such as e-commerce client applications, web browser applications, search applications, instant messaging tools, and email clients.

[0123] Terminal devices 501, 502, and 503 can be various electronic devices with displays and supporting various client applications, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0124] Server 505 can be a server that provides various services, such as a backend management server that supports client applications used by users through terminal devices 501, 502, and 503. The backend management server can process received business requests and send response information back to the terminal devices.

[0125] It should be noted that the method for processing requests provided in the embodiments of the present invention is generally executed by server 505, and correspondingly, the device for processing requests is generally located in server 505.

[0126] It should be understood that Figure 5 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.

[0127] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device of the present invention. Figure 6 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.

[0128] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0129] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0130] 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 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0131] 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.

[0132] 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.

[0133] The modules and / or units described in the embodiments of the present invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor. For example, a processor can be described as including an information parsing module, a request processing module, and a response processing module. The names of these modules do not necessarily limit the module itself; for example, the information parsing module can also be described as a "module for intercepting business requests sent by a client." As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments or may exist independently and not assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: intercepting a business request sent by a client; obtaining proxy configuration information corresponding to the business request; parsing multiple plugins for processing the business request from the proxy configuration information and obtaining a first order dependency relationship among the multiple plugins; processing the business request using the multiple plugins according to the first order dependency relationship to obtain a target business request and forwarding the target business request to the server; receiving a first response information from the server for the target business request and sending the first response information to the client.

[0134] Embodiments of the present invention can intercept business requests sent by clients, obtain proxy configuration information corresponding to the business requests, parse multiple plugins for processing business requests and the first order dependency relationships between the plugins from the proxy configuration information, process the business requests based on the first order dependency relationships to obtain the target business request, and forward the target business request to the server; receive the server's first response information for the target business request, and send the first response information to the client. Embodiments of the present invention improve the flexibility and scalability of the proxy service by configuring plugin data and processing business requests in an execution order, and improve the system's configuration flexibility through the non-intrusive integration of proxy components.

[0135] 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 method of processing a request, characterized by, The application is applied to a proxy component, comprising: intercepting a service request sent by a client, obtaining proxy configuration information corresponding to the service request; parsing a plurality of plug-ins for processing the service request from the proxy configuration information, and obtaining a first order dependency relationship of the plurality of plug-ins; processing the service request by using the plurality of plug-ins according to the first order dependency relationship to obtain a target service request, and forwarding the target service request to a server; receiving a first response information of the server for the target service request, and sending the first response information to the client.

2. The method of claim 1, wherein the receiving the first response information of the server for the target service request, and sending the first response information to the client comprises: obtaining a second order dependency relationship of the plurality of plug-ins; wherein the second order dependency relationship is opposite to the running order of the plurality of plug-ins defined in the first order dependency relationship; processing the first response information by using the plurality of plug-ins according to the second order dependency relationship to obtain a second response information processed; forwarding the second response information to the client.

3. The method of claim 1, wherein the processing the service request by using the plurality of plug-ins according to the first order dependency relationship to obtain a target service request comprises: for each plug-in, performing the following steps: N1: judging whether the plug-in is located at the head of the first order dependency relationship, if yes, performing N2, otherwise performing N3; N2: processing the service request by using the business logic of the plug-in to obtain a first processing result, and sending the first processing result to the next adjacent plug-in based on the first order dependency relationship; N3: receiving a first processing result of the last adjacent plug-in in the first order dependency relationship, processing the first processing result by using the business logic of the plug-in to obtain a second processing result, and sending the second processing result to the next adjacent plug-in based on the first order dependency relationship; N4: judging whether the plug-in is located at the tail of the first order dependency relationship, if yes, taking the second processing result obtained by the plug-in as the target service request, otherwise performing the step of N2. further comprising: providing a configuration page for proxy configuration information, receiving an editing request for the proxy configuration information corresponding to the service request through the configuration page; 4. The method according to claim 1 or 2, characterized in that, performing one or more editing operations of adding, modifying, and deleting the plug-in in the proxy configuration information according to the editing request; and / or, performing editing operations on the first order dependency relationship or the second order dependency relationship of the plurality of plug-ins.

5. The method of claim 1, wherein the processing the service request by using the plurality of plug-ins according to the first order dependency relationship to obtain a target service request further comprises: for each plug-in, performing the following steps: obtaining a processing condition of the plug-in processing the service request; in response to an exception existing in the processing condition, obtaining exception information matched by the business logic of the plug-in; ​ ​ ​ sending the exception information to the client.

6. The method of claim 1, wherein, the parsing, from the proxy configuration information, a plurality of plugins for processing the service request comprises: for each plugin, obtaining, from the proxy configuration information, a usage permission of the plugin, and in response to the usage permission of the plugin being enabled, determining that the plugin is a plugin capable of processing the service request; the obtaining of a first order dependency relationship of a plurality of the plugins for processing service requests comprises: directly obtaining, from the proxy configuration information, the first order dependency relationship of a plurality of the plugins, or obtaining a priority setting for a plurality of the plugins, and determining the first order dependency relationship of a plurality of the plugins based on the priority setting, so that a plugin with a higher priority has a more advanced order in the first order dependency relationship.

7. An apparatus for processing a request, the apparatus comprising: comprising: an information parsing module, a request processing module, and a response processing module; wherein the information parsing module is configured to intercept a service request sent by a client, obtain proxy configuration information corresponding to the service request, parse a plurality of plugins for processing the service request from the proxy configuration information, and obtain a first order dependency relationship of a plurality of the plugins; the request processing module is configured to process the service request using a plurality of the plugins according to the first order dependency relationship, obtain a target service request, and forward the target service request to a server; the response processing module is configured to receive first response information of the target service request from the server, and send the first response information to the client.

8. A system for processing requests, characterized by comprising: a client, a proxy component, and a server for deploying the proxy component; wherein the proxy component implements the method of any one of claims 1-6.

9. An electronic device, comprising: comprising: one or more processors; a 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 of any one of claims 1-6.

10. A computer readable medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6.

11. A computer program product comprising a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Intelligent gateway system for automatically distributing service requests

    CN109618347A

  • Gateway routing plug-in arrangement and execution system based on Spring Cloud Gateway in credential environment

    CN115883353A

  • Plug-in management method and device for micro-service architecture gateway, medium and computing equipment

    CN118227180A

  • Dynamically reordering plugin execution order at an API gateway of a microservices application

    US11520605B1