Request processing method and apparatus, computer device, readable storage medium, and program product

By encoding and decoding client request information, the limitations of API gateways in Dubbo protocol processing are resolved, enabling efficient support for Dubbo services and improving the gateway's versatility.

CN119544789BActive Publication Date: 2026-02-10CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411723109.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2026-02-10
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

When processing requests related to the Dubbo protocol, API gateways have limitations in data return format and data serialization protocol, which prevents them from mounting Dubbo services and affects their versatility and applicability in complex distributed service systems.

Method used

By parsing the client request information, performing parameter encoding processing to generate Dubbo request data, sending it to the Dubbo server, and receiving the response data, performing parameter decoding processing, and feeding it back to the client, efficient support for Dubbo services is achieved.

Benefits of technology

It improves the versatility of the API gateway, meets the needs of various distributed service systems, and achieves efficient support for Dubbo services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544789B_ABST
    Figure CN119544789B_ABST
Patent Text Reader

Abstract

The application relates to a request processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: analyzing request information submitted by a client to obtain request analysis data; performing parameter encoding processing on the request analysis data to obtain Dubbo request data; sending the Dubbo request data to a Dubbo server and receiving Dubbo response data; performing parameter decoding processing on the Dubbo response data to obtain request response data; and feeding back the request response data to the client. The application encodes the request information submitted by the client to convert the request information into Dubbo request data that can be directly processed by the Dubbo server, then submits the Dubbo request data to the Dubbo server for processing, decodes the Dubbo response data of the Dubbo server into corresponding request response data and then performs data feedback, thereby achieving efficient support for the Dubbo service at a gateway interface of a request, meeting the needs of various distributed service systems and improving the universality of the gateway.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a cloud private line multicast method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] With the development of computer technology, micro-service technology has emerged. Micro-service (or micro-service architecture) is a cloud-native architecture method that contains numerous loosely coupled and individually deployable small components or services in a single application. These services usually have their own technology stack, including databases and data management models. API (Application Programming Interface) gateways play a crucial role in micro-service architecture, responsible for request routing, protocol conversion and security control.

[0003] Currently, API gateways have certain limitations in data return format and data serialization protocol when processing Dubbo protocol-related requests, which results in the inability to mount Dubbo services to API gateways in some application scenarios. These limitations affect the generality and applicability of API gateways when processing complex distributed service systems. SUMMARY

[0004] Therefore, it is necessary to provide a request processing method, device, computer equipment, computer readable storage medium and computer program product capable of improving the generality of API gateways to solve the above technical problems.

[0005] In a first aspect, the present application provides a request processing method, comprising:

[0006] parsing request information submitted by a client to obtain request parsing data;

[0007] performing parameter encoding processing on the request parsing data to obtain Dubbo request data corresponding to the request parsing data;

[0008] sending the Dubbo request data to a Dubbo server and receiving Dubbo response data of the Dubbo request data from the Dubbo server;

[0009] performing parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data;

[0010] feeding back the request response data to the client.

[0011] In one embodiment, the parsing of the request information submitted by the client to obtain the request parsing data comprises:

[0012] parsing the request information submitted by the client to obtain a uniform resource locator and request body information in the request information;

[0013] performing parsing processing on the uniform resource locator and request body information to obtain request parsing data, the request parsing data including a service name, version, method name, and parameter.

[0014] In one embodiment, the parameter encoding processing on the request parsing data to obtain Dubbo request data corresponding to the request parsing data includes:

[0015] obtaining Dubbo service parameters of a Dubbo server;

[0016] performing parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0017] In one embodiment, the parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data includes:

[0018] identifying a protocol type parameter in the Dubbo service parameters;

[0019] performing parameter encoding processing of a protocol type corresponding to the protocol type parameter based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0020] In one embodiment, the parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data includes:

[0021] identifying a response data format type of the Dubbo response data;

[0022] finding a data parsing rule of the response data format type;

[0023] performing parameter decoding processing on the Dubbo response data based on the data parsing rule to obtain request response data corresponding to the Dubbo response data.

[0024] In one embodiment, the sending of the Dubbo request data to a Dubbo server includes:

[0025] extracting a service name and service version in the request parsing data;

[0026] finding address information of a Dubbo server corresponding to the service name and the service version;

[0027] Based on the address information, a target service instance in the Dubbo service end is identified through a load balancing strategy;

[0028] The Dubbo request data is sent to the target service instance.

[0029] In a second aspect, the present application further provides a request processing apparatus, comprising:

[0030] A request processing module is configured to parse request information submitted by a client to obtain request analysis data;

[0031] A Dubbo encoding module is configured to perform parameter encoding processing on the request analysis data to obtain Dubbo request data corresponding to the request analysis data;

[0032] A request routing module is configured to send the Dubbo request data to a Dubbo service end and receive Dubbo response data of the Dubbo request data from the Dubbo service end;

[0033] A Dubbo decoding module is configured to perform parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data;

[0034] A response feedback module is configured to feed back the request response data to the client.

[0035] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0036] Parsing request information submitted by a client to obtain request analysis data;

[0037] Performing parameter encoding processing on the request analysis data to obtain Dubbo request data corresponding to the request analysis data;

[0038] Sending the Dubbo request data to a Dubbo service end and receiving Dubbo response data of the Dubbo request data from the Dubbo service end;

[0039] Performing parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data;

[0040] Feeding back the request response data to the client.

[0041] In a fourth aspect, the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the following steps:

[0042] parsing the request information submitted by the client to obtain request parsing data;

[0043] performing parameter encoding processing on the request parsing data to obtain Dubbo request data corresponding to the request parsing data;

[0044] sending the Dubbo request data to a Dubbo server and receiving Dubbo response data of the Dubbo request data from the Dubbo server;

[0045] performing parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data;

[0046] feeding back the request response data to the client.

[0047] In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:

[0048] parsing the request information submitted by the client to obtain request parsing data;

[0049] performing parameter encoding processing on the request parsing data to obtain Dubbo request data corresponding to the request parsing data;

[0050] sending the Dubbo request data to a Dubbo server and receiving Dubbo response data of the Dubbo request data from the Dubbo server;

[0051] performing parameter decoding processing on the Dubbo response data to obtain request response data corresponding to the Dubbo response data;

[0052] feeding back the request response data to the client.

[0053] The aforementioned request processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product parse the request information submitted by the client to obtain request parsing data; perform parameter encoding processing on the request parsing data to obtain the corresponding Dubbo request data; send the Dubbo request data to the Dubbo server and receive the Dubbo response data from the Dubbo server; perform parameter decoding processing on the Dubbo response data to obtain the corresponding request response data; and feed back the request response data to the client. This application, by encoding the request information submitted by the client to transform it into Dubbo request data that can be directly processed by the Dubbo server before submitting it to the Dubbo server for processing, and decoding the Dubbo response data from the Dubbo server into the corresponding request response data before executing the data feedback, achieves efficient support for Dubbo services at the request gateway interface, meets the needs of various distributed service systems, and improves the versatility of the gateway. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is an application environment diagram of a request processing method in one embodiment;

[0056] Figure 2 This is a flowchart illustrating a request processing method in one embodiment;

[0057] Figure 3 This is a flowchart illustrating the parameter decoding process in one embodiment;

[0058] Figure 4 This is a schematic diagram of an API system architecture based on a Dubbo service plugin in one embodiment;

[0059] Figure 5 This is a flowchart illustrating the request processing method in another embodiment;

[0060] Figure 6 This is a structural block diagram of a request processing device in one embodiment;

[0061] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0063] The request processing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, client 102 communicates with API gateway 104 via a network, and API gateway can communicate with Dubbo server 106. A data storage system can store the data that Dubbo server 106 needs to process. The data storage system can be integrated on server 106 or placed on the cloud or other network servers. When a user needs to execute related data, they can send corresponding request information to API gateway 104. API gateway parses the request information submitted by the client to obtain request parsing data; it performs parameter encoding processing on the request parsing data to obtain the corresponding Dubbo request data; it sends the Dubbo request data to Dubbo server 106 and receives Dubbo response data from Dubbo server 106; it performs parameter decoding processing on the Dubbo response data to obtain the corresponding request response data; and it feeds back the request response data to client 102. Client 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0064] In one exemplary embodiment, such as Figure 2 As shown, a request processing method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the process of API gateway 104, including steps 201 to 209.

[0065] in:

[0066] Step 201: Parse the request information submitted by the client to obtain the request parsing data.

[0067] Among them, the client is Figure 1In the solution of this application, the request information sent by client 102 enters the system through API gateway 104 and is processed. The request information is the specific request content sent by client 102 to the API gateway. Data parsing processing refers to extracting various types of information contained in the complete request information, such as the service name, version, method name, and parameters requested by the request information.

[0068] For example, this application is specifically applied to an API gateway in a distributed service system. When a user wants to request a service from the distributed service system, they can edit the corresponding request information on the client 102 and then upload the request information to the distributed service system via the network. The request information first enters the API gateway 104 for processing. In one embodiment, the request information can specifically be an HTTP (Hypertext Transfer Protocol) request. The user can edit the request on the client and set information such as service name, version, method name, and parameters, then generate the corresponding HTTP request, and then submit the HTTP request to the API gateway 104 for corresponding data processing.

[0069] Step 203: Perform parameter encoding on the request parsing data to obtain the Dubbo request data corresponding to the request parsing data.

[0070] Parameter encoding refers to the process of encoding the data information in the request parsing data into the Dubbo protocol format. Only after the request parsing data is encoded into Dubbo request data in the Dubbo protocol format can the corresponding request be processed by the Dubbo server. Dubbo is a high-performance, lightweight, open-source Java RPC (Remote Procedure Call) framework, primarily used to provide distributed service governance solutions. The Dubbo service plays a crucial role in this framework.

[0071] For example, in a distributed service system, some service functions need to be implemented by the Dubbo server. When the request information submitted by client 102 involves related processing by the Dubbo server, in order to ensure the efficiency and accuracy of processing, the request information submitted by the client needs to be converted into information that can be recognized and processed by the Dubbo server at the API gateway. At this time, parameter encoding processing can be performed on the request parsing data to encode the data information in the request parsing data into data in the Dubbo protocol format, thus obtaining the Dubbo request data corresponding to the request parsing data.

[0072] Step 205: Send the Dubbo request data to the Dubbo server and receive the Dubbo response data from the Dubbo server.

[0073] For example, after receiving Dubbo request data, the API gateway 104 can forward the Dubbo request data to the Dubbo server 106 in the distributed service system for processing. The forwarding process can be implemented through the request routing module in the API gateway 104, which can perform load balancing during request forwarding to ensure efficient processing of the Dubbo request data. After receiving the Dubbo request data, the Dubbo server 106 will parse the request information, execute the corresponding Dubbo service processing, and send the processed Dubbo response data to the API gateway 104, where the API gateway 104 will perform subsequent data feedback processing.

[0074] Step 207: Perform parameter decoding on the Dubbo response data to obtain the request response data corresponding to the Dubbo response data.

[0075] Step 209: Send the request response data back to the client.

[0076] For example, parameter decoding refers to the process of converting Dubbo response data into data that can be read by the client. After receiving the Dubbo response data, in order to send the corresponding processing result back to the client, the Dubbo response data sent back by the Dubbo server needs to be converted into a general type of data that can be read by the client. At this time, parameter decoding processing is required on the Dubbo response data. For example, in the case of an HTTP request, the Dubbo response data can be parsed and decoded into HTTP response data. After the conversion is complete, the resulting request-response data can be sent to client 102 for processing.

[0077] The aforementioned request processing method parses the request information submitted by the client to obtain request parsing data; encodes the request parsing data to obtain the corresponding Dubbo request data; sends the Dubbo request data to the Dubbo server and receives the Dubbo response data from the Dubbo server; decodes the Dubbo response data to obtain the corresponding request response data; and then sends the request response data back to the client. This application encodes the request information submitted by the client to transform it into Dubbo request data that can be directly processed by the Dubbo server before submitting it to the Dubbo server for processing. It also decodes the Dubbo response data from the Dubbo server into the corresponding request response data before executing the data feedback. This achieves efficient support for Dubbo services at the request gateway interface, meets the needs of various distributed service systems, and improves the gateway's versatility.

[0078] In an exemplary embodiment, step 201 includes: parsing the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; parsing the URL and request body information to obtain request parsing data, which includes the service name, version, method name, and parameters.

[0079] The Uniform Resource Locator (URL) is a concise representation of the location and access method of a resource available on the internet; it's the address of a standard resource on the internet. Every file on the internet has a unique URL, containing information indicating the file's location and how the browser should handle it. The request information can specifically be an HTTP request, which may contain information related to the URL. The request body is part of the HTTP request and is used to pass data within the request. It's typically used in methods like POST, PUT, and PATCH that require data. The request body can contain various data types, such as JSON, XML, form data, and binary files.

[0080] For example, this application can be used to process HTTP requests. Upon receiving an HTTP request, the Uniform Resource Locator (URL) and request body information can be parsed from the request. Then, information extraction processing is performed to obtain various relevant information about the service requested, specifically including the service name, version, method name, and parameters. The parsed data can then be used for corresponding processing. In this embodiment, request parsing processing can locate various types of request parsing data, such as the package name, version, protocol, method name, and method parameters of the requested Dubbo service, thereby improving the efficiency of subsequent request processing. By dynamically assembling the HTTP return result, the problem of converting Dubbo service results to HTTP protocol responses is solved.

[0081] In an exemplary embodiment, step 203 includes: obtaining Dubbo service parameters from the Dubbo server; performing parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0082] For example, the Dubbo service parameters specifically refer to the Dubbo protocol format. This application can support request processing based on different Dubbo protocol formats. By providing a general encoding interface, it supports multiple Dubbo protocol formats, including but not limited to Hessian2 and Trip. The protocol type parameter in the Dubbo service parameters is identified; based on the Dubbo service parameters, parameter encoding processing corresponding to the protocol type parameter is performed to obtain the Dubbo request data corresponding to the request parsing data. Therefore, when parameter encoding is required to convert it into Dubbo request data, the protocol type corresponding to the Dubbo server needs to be identified first, and then the corresponding parameter encoding processing is performed. Specifically, the corresponding encoding function, such as ngx_dubbo_hessian2_encode_str or ngx_trip_encode_str, can be called according to the request's protocol type to perform parameter encoding processing and obtain the Dubbo request data corresponding to the request parsing data. In this embodiment, by obtaining the Dubbo service parameters to perform the corresponding parameter encoding processing, the operation of various types of Dubbo protocols can be supported, ensuring the general performance of the solution and improving the versatility of API request processing.

[0083] In one exemplary embodiment, such as Figure 3 As shown, step 207 includes:

[0084] Step 302: Identify the response data format type of Dubbo response data.

[0085] Step 304: Find the data parsing rules for the response data format type.

[0086] Step 306: Based on the data parsing rules, perform parameter decoding on the Dubbo response data to obtain the request response data corresponding to the Dubbo response data.

[0087] For example, this application can preset different data parsing rules for different response data formats. When parameter decoding processing is required, the response data format type of the Dubbo response data can be identified first, and then the corresponding data parsing rule for that data format can be found. Based on the data parsing rule, the corresponding parameter decoding processing can be performed. In a specific embodiment, the data parsing rule can include specific result parsing rules and general rules for parsing MAP data in a specific format. When the result is MAP data in a specific format, it includes fields such as status and body. The status and body are parsed into the HTTP response code and body, respectively, and other non-fixed fields are parsed into headers. If parsing cannot be performed according to the above rules, the returned result is parsed into the HTTP response body, and the response code is fixed at 200. In this embodiment, performing parameter decoding processing based on the response data format type and pre-stored data parsing rules can effectively improve the efficiency and accuracy of the parameter decoding process.

[0088] In an exemplary embodiment, step 209 includes: extracting the service name and service version from the request parsing data; finding the address information of the Dubbo server corresponding to the service name and service version; identifying the target service instance in the Dubbo server based on the address information through a load balancing strategy; and sending the Dubbo request data to the target service instance.

[0089] For example, this application also handles the routing process for sending Dubbo request data, thereby routing the transformed Dubbo request data to the corresponding Dubbo service for efficient processing based on the request information. During routing, the first step is to locate the Dubbo service specified in the request information, extracting the service name and service version from the parsed request data; then, the address information of the Dubbo server corresponding to the service name and service version is located. After determining the address information, to ensure request processing efficiency, load balancing can be performed on the request. Specifically, based on the address information, a load balancing strategy is used to identify the target service instance among the Dubbo servers, thus finding the service instance with the lowest current load as the target service instance. Finally, the Dubbo request data is sent to the target service instance so that the target service instance can perform the relevant service processing, ensuring processing efficiency.

[0090] In one embodiment, this application can be added to the API gateway system as a Dubbo service plugin, which is part of the API gateway. The system architecture diagram in this case can be referred to... Figure 4 As shown, it includes a request processing module, a Dubbo encoding module, a Dubbo decoding module, a connection management module, and a request routing module. The specific flowchart for handling HTTP requests based on the API network management system can be found here. Figure 5As shown, the request processing module is responsible for receiving HTTP requests from clients and parsing the request information. During this process, it needs to pass in Dubbo service-related parameters as required, including name, protocol, and input parameters. The Dubbo encoding module provides a general encoding interface, supporting multiple Dubbo protocol formats. It calls the corresponding encoding function to assemble the Dubbo request based on the request's protocol type. Specifically, the Dubbo request needs to be constructed based on the passed parameters; the key parameter is the Dubbo service protocol, supporting Dubbo2, Hessian2, Trip, and other protocol types. The request routing module routes the request to the corresponding Dubbo service based on the request information. The Dubbo decoding module provides a general decoding interface, supporting multiple Dubbo protocol formats. It calls the corresponding decoding function based on the response's protocol type. Finally, the decoded response information needs to be fed back to the client, completing one round of request processing.

[0091] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0092] Based on the same inventive concept, this application also provides a request processing apparatus for implementing the request processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more request processing apparatus embodiments provided below can be found in the limitations of the request processing method described above, and will not be repeated here.

[0093] In one exemplary embodiment, such as Figure 6 As shown, a request processing apparatus is provided, comprising:

[0094] The request processing module 601 is used to parse the request information submitted by the client and obtain the request parsing data.

[0095] The Dubbo encoding module 603 is used to perform parameter encoding processing on the request parsing data to obtain the Dubbo request data corresponding to the request parsing data.

[0096] The request routing module 605 is used to send Dubbo request data to the Dubbo server and receive Dubbo response data from the Dubbo server in response to the Dubbo request data.

[0097] The Dubbo decoding module 607 is used to perform parameter decoding processing on Dubbo response data to obtain the request response data corresponding to the Dubbo response data.

[0098] The response feedback module 609 is used to send request response data back to the client.

[0099] The aforementioned request processing device parses the request information submitted by the client to obtain request parsing data; performs parameter encoding processing on the request parsing data to obtain the corresponding Dubbo request data; sends the Dubbo request data to the Dubbo server and receives the Dubbo response data from the Dubbo server; performs parameter decoding processing on the Dubbo response data to obtain the corresponding request response data; and feeds back the request response data to the client. This application, by encoding the request information submitted by the client to transform it into Dubbo request data that can be directly processed by the Dubbo server before submitting it to the Dubbo server for processing, and decoding the Dubbo response data from the Dubbo server into the corresponding request response data before executing the data feedback, achieves efficient support for Dubbo services at the request gateway interface, meets the needs of various distributed service systems, and improves the gateway's versatility.

[0100] In one embodiment, the request processing module 601 is specifically used to: parse the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; and parse the URL and request body information to obtain request parsing data, which includes the service name, version, method name, and parameters.

[0101] In one embodiment, the Dubbo encoding module 603 is specifically used to: obtain Dubbo service parameters from the Dubbo server; and perform parameter encoding processing based on the Dubbo service parameters to obtain the Dubbo request data corresponding to the request parsing data.

[0102] In one embodiment, the Dubbo encoding module 603 is specifically used to: identify the protocol type parameter in the Dubbo service parameters; perform parameter encoding processing based on the protocol type parameter corresponding to the protocol type parameter to obtain the Dubbo request data corresponding to the request parsing data.

[0103] In one embodiment, the Dubbo decoding module 607 is specifically used to: identify the response data format type of the Dubbo response data; find the data parsing rules for the response data format type; and perform parameter decoding processing on the Dubbo response data based on the data parsing rules to obtain the request response data corresponding to the Dubbo response data.

[0104] In one embodiment, the request routing module 605 is specifically used to: extract the service name and service version from the request parsing data; find the address information of the Dubbo server corresponding to the service name and service version; identify the target service instance in the Dubbo server based on the address information and through a load balancing strategy; and send the Dubbo request data to the target service instance.

[0105] Each module in the aforementioned request processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can invoke and execute the operations corresponding to each module.

[0106] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores request processing data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a request processing method.

[0107] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0108] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0109] Parse the request information submitted by the client to obtain the request parsing data;

[0110] The request parsing data is processed by parameter encoding to obtain the Dubbo request data corresponding to the request parsing data.

[0111] Send Dubbo request data to the Dubbo server and receive Dubbo response data from the Dubbo server in response to the Dubbo request data;

[0112] Perform parameter decoding on the Dubbo response data to obtain the corresponding request and response data.

[0113] The request response data is sent back to the client.

[0114] In one embodiment, when the processor executes the computer program, it further performs the following steps: parsing the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; parsing the URL and request body information to obtain request parsing data, which includes the service name, version, method name, and parameters.

[0115] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining Dubbo service parameters from the Dubbo server; and performing parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0116] In one embodiment, when the processor executes the computer program, it further performs the following steps: identifying the protocol type parameter in the Dubbo service parameters; performing parameter encoding processing based on the protocol type parameter corresponding to the protocol type parameter to obtain the Dubbo request data corresponding to the request parsing data.

[0117] In one embodiment, when the processor executes the computer program, it further performs the following steps: identifying the response data format type of the Dubbo response data; finding the data parsing rules for the response data format type; and performing parameter decoding processing on the Dubbo response data based on the data parsing rules to obtain the request response data corresponding to the Dubbo response data.

[0118] In one embodiment, when the processor executes the computer program, it further performs the following steps: extracting the service name and service version from the request parsing data; finding the address information of the Dubbo server corresponding to the service name and service version; identifying the target service instance in the Dubbo server based on the address information through a load balancing strategy; and sending the Dubbo request data to the target service instance.

[0119] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0120] Parse the request information submitted by the client to obtain the request parsing data;

[0121] The request parsing data is processed by parameter encoding to obtain the Dubbo request data corresponding to the request parsing data.

[0122] Send Dubbo request data to the Dubbo server and receive Dubbo response data from the Dubbo server in response to the Dubbo request data;

[0123] Perform parameter decoding on the Dubbo response data to obtain the corresponding request and response data.

[0124] The request response data is sent back to the client.

[0125] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: parsing the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; parsing the URL and request body information to obtain request parsing data, which includes the service name, version, method name, and parameters.

[0126] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining Dubbo service parameters from the Dubbo server; and performing parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0127] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: identifying the protocol type parameter in the Dubbo service parameters; performing parameter encoding processing based on the protocol type parameter corresponding to the protocol type parameter to obtain the Dubbo request data corresponding to the request parsing data.

[0128] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: identifying the response data format type of the Dubbo response data; finding the data parsing rules for the response data format type; and performing parameter decoding processing on the Dubbo response data based on the data parsing rules to obtain the request response data corresponding to the Dubbo response data.

[0129] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: extracting the service name and service version from the request parsing data; finding the address information of the Dubbo server corresponding to the service name and service version; identifying the target service instance in the Dubbo server based on the address information through a load balancing strategy; and sending the Dubbo request data to the target service instance.

[0130] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0131] Parse the request information submitted by the client to obtain the request parsing data;

[0132] The request parsing data is processed by parameter encoding to obtain the Dubbo request data corresponding to the request parsing data.

[0133] Send Dubbo request data to the Dubbo server and receive Dubbo response data from the Dubbo server in response to the Dubbo request data;

[0134] Perform parameter decoding on the Dubbo response data to obtain the corresponding request and response data.

[0135] The request response data is sent back to the client.

[0136] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: parsing the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; parsing the URL and request body information to obtain request parsing data, which includes the service name, version, method name, and parameters.

[0137] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining Dubbo service parameters from the Dubbo server; and performing parameter encoding processing based on the Dubbo service parameters to obtain Dubbo request data corresponding to the request parsing data.

[0138] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: identifying the protocol type parameter in the Dubbo service parameters; performing parameter encoding processing based on the protocol type parameter corresponding to the protocol type parameter to obtain the Dubbo request data corresponding to the request parsing data.

[0139] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: identifying the response data format type of the Dubbo response data; finding the data parsing rules for the response data format type; and performing parameter decoding processing on the Dubbo response data based on the data parsing rules to obtain the request response data corresponding to the Dubbo response data.

[0140] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: extracting the service name and service version from the request parsing data; finding the address information of the Dubbo server corresponding to the service name and service version; identifying the target service instance in the Dubbo server based on the address information through a load balancing strategy; and sending the Dubbo request data to the target service instance.

[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0142] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0143] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0144] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A request processing method, characterized in that, The method includes: Parse the request information submitted by the client to obtain the request parsing data; The request parsing data is processed by parameter encoding to obtain the Dubbo request data corresponding to the request parsing data; The Dubbo request data is sent to the Dubbo server, and the Dubbo response data from the Dubbo server is received in response to the Dubbo request data. Identify the response data format type of the Dubbo response data; find the data parsing rule for the response data format type; perform parameter decoding processing on the Dubbo response data based on the data parsing rule to obtain the request response data corresponding to the Dubbo response data; The request response data is sent back to the client. The step of performing parameter decoding processing on the Dubbo response data based on the data parsing rules to obtain the request-response data corresponding to the Dubbo response data includes: When the Dubbo response data is MAP data in a specific format, the status and body are parsed as the HTTP response code and body, respectively, and other non-fixed fields are parsed as headers; when it cannot be parsed according to the specific format, the returned result is parsed as the HTTP response body.

2. The method according to claim 1, characterized in that, The parsing of the request information submitted by the client yields request parsing data including: Parse the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information from the request information; The Uniform Resource Locator (URL) and request body information are parsed to obtain request parsing data, which includes service name, version, method name, and parameters.

3. The method according to claim 1, characterized in that, The step of performing parameter encoding processing on the request parsing data to obtain the Dubbo request data corresponding to the request parsing data includes: Get Dubbo service parameters from the Dubbo server; Based on the Dubbo service parameters, parameter encoding processing is performed to obtain the Dubbo request data corresponding to the request parsing data.

4. The method according to claim 3, characterized in that, The parameter encoding process based on the Dubbo service parameters to obtain the Dubbo request data corresponding to the request parsing data includes: Identify the protocol type parameter in the Dubbo service parameters; Based on the Dubbo service parameters, parameter encoding processing corresponding to the protocol type parameter is performed to obtain the Dubbo request data corresponding to the request parsing data.

5. The method according to claim 1, characterized in that, The step of sending the Dubbo request data to the Dubbo server includes: Extract the service name and service version from the request parsing data; Find the address information of the Dubbo server corresponding to the service name and the service version; Based on the address information, the target service instance in the Dubbo server is identified through a load balancing strategy. The Dubbo request data is sent to the target service instance.

6. A request processing apparatus, characterized in that, The device includes: The request processing module is used to parse the request information submitted by the client and obtain the request parsing data; The Dubbo encoding module is used to perform parameter encoding processing on the request parsing data to obtain the Dubbo request data corresponding to the request parsing data. The request routing module is used to send the Dubbo request data to the Dubbo server and receive the Dubbo response data from the Dubbo server in response to the Dubbo request data. The Dubbo decoding module is used to identify the response data format type of the Dubbo response data; find the data parsing rule for the response data format type; and perform parameter decoding processing on the Dubbo response data based on the data parsing rule to obtain the request response data corresponding to the Dubbo response data. The response feedback module is used to send the request response data back to the client; The Dubbo decoding module is specifically used to: when the Dubbo response data is MAP data in a specific format, parse the status and body into HTTP response codes and body respectively, and parse other non-fixed fields into headers; when it cannot be parsed according to a specific format, parse the returned result into the body of an HTTP response.

7. The apparatus according to claim 6, characterized in that, The request processing module is specifically used to: parse the request information submitted by the client to obtain the Uniform Resource Locator (URL) and request body information in the request information; and parse the URL and request body information to obtain request parsing data, which includes service name, version, method name, and parameters.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Gateway service method, device and system based on cross-protocol communication

    CN115473881A

  • Multi-protocol service calling method and device, equipment and medium

    CN117119079A