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

By automatically handling data requests and responses through a proxy platform, the problem of front-end developers frequently changing proxy addresses is solved, enabling efficient front-end and back-end integration testing and simplifying interface configuration and data response processing.

CN118631903BActive Publication Date: 2026-04-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2024-05-24
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In a front-end and back-end separation development model, front-end developers need to frequently change proxy addresses to adapt to different back-ends, resulting in low efficiency of integration testing.

Method used

The proxy platform automatically determines the proxy address of the proxy server and performs format conversion and processing on the data processing response to generate a target data processing response that is easy for developers to understand, simplifying the generation and updating of interface configuration files.

Benefits of technology

It improves the efficiency of integration testing, reduces the frequency of developers modifying proxy addresses, simplifies front-end and back-end integration operations, and improves the readability and usability of data processing responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631903B_ABST
    Figure CN118631903B_ABST
Patent Text Reader

Abstract

This disclosure provides a request processing method applicable to the field of computer technology. The request processing method includes: in response to receiving a data processing request from a front-end server, forwarding the data processing request to a target back-end server matching the data processing request, so that the target back-end server performs a data processing operation according to the data processing request; in response to receiving a data processing response from the target back-end server, processing the response body data in the data processing response to obtain target response body data, wherein the data processing response is issued by the target back-end server in response to the data processing request; determining a target data processing response based on the target response body data and the response header data in the data processing response; and sending the target data processing response to the front-end server. This disclosure also provides a request processing apparatus, device, storage medium, and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically to a request processing method, apparatus, device, medium, and program product. Background Technology

[0002] In the front-end and back-end separation development model, front-end developers and back-end developers work independently on front-end and back-end development. After development is completed, the project is realized through joint debugging and testing of the front-end and back-end.

[0003] During front-end and back-end integration testing, requests from the front-end are typically sent to the back-end via a proxy server. However, when a front-end corresponds to multiple back-ends, the front-end developer needs to change the proxy address multiple times to adapt to different back-ends, resulting in low efficiency of integration testing. Summary of the Invention

[0004] In view of the above problems, this disclosure provides a request processing method, apparatus, device, medium and program product.

[0005] According to a first aspect of this disclosure, a request processing method is provided, comprising: in response to receiving a data processing request from a front-end server, forwarding the data processing request to a target back-end server matching the data processing request, so that the target back-end server performs a data processing operation according to the data processing request; in response to receiving a data processing response from the target back-end server, processing the response body data in the data processing response to obtain target response body data, wherein the data processing response is issued by the target back-end server in response to the data processing request; determining a target data processing response based on the target response body data and the response header data in the data processing response; and sending the target data processing response to the front-end server.

[0006] According to embodiments of this disclosure, the above-mentioned processing of the response body data of the data processing response to obtain target response body data includes: converting the format of the response body data to obtain first response body data; and deleting duplicate data in the first response body data to obtain target response body data.

[0007] According to embodiments of this disclosure, the above-mentioned format conversion of the response body data to obtain the first response body data includes: if the format of the response body data is determined to be an encoded format, performing a decoding operation on the response body data to obtain the first response body data; or if the format of the response body data is determined to be a data exchange format, converting the format of the response body data from the data exchange format to a script format to obtain the first response body data.

[0008] According to embodiments of this disclosure, the method further includes: obtaining interface definition files for a plurality of backend servers, wherein the interface definition files are used to define interface information for a plurality of interfaces of the backend servers; configuring a server identifier for each backend server; configuring an interface identifier for each interface; and generating an interface configuration file for each interface, wherein the interface configuration file includes the interface identifier of the interface and the server identifier of the backend server corresponding to the interface.

[0009] According to an embodiment of this disclosure, sending the data processing request to a target backend server matching the data processing request includes: obtaining the interface identifier of the target interface to be called by the frontend service from the data processing request; determining a target interface configuration file matching the interface identifier from a plurality of interface configuration files based on the interface identifier; determining the server identifier of the target backend server corresponding to the target interface from the target interface configuration file; and sending the data processing request to the target backend server based on the server identifier, so that the target backend server parses the data processing request through the target interface.

[0010] According to embodiments of this disclosure, the method further includes: periodically obtaining the latest interface definition file of each of the backend servers, and obtaining the latest interface information of each of the interfaces from the plurality of latest interface definition files; for each of the interfaces, if it is determined that the latest interface information of the interface does not match the interface configuration file of the interface, updating the interface configuration file based on the latest interface information.

[0011] According to an embodiment of this disclosure, sending the data processing request to the target backend server based on the target server identifier includes: obtaining the frontend domain name information of the frontend server and the backend domain name information of the backend server; if it is determined that the frontend domain name information and the backend domain name information do not match, creating a proxy server based on the frontend domain name information, wherein the proxy domain name information of the proxy server is the same as the frontend domain name information; and sending the data processing request and the target server identifier to the proxy server, so that the proxy server sends the data processing request to the target backend server.

[0012] A second aspect of this disclosure provides a request processing apparatus, comprising: a first sending module, configured to, in response to receiving a data processing request from a front-end server, forward the data processing request to a target back-end server matching the data processing request, so that the target back-end server performs a data processing operation according to the data processing request; a processing module, configured to, in response to receiving a data processing response from the target back-end server, process the response body data in the data processing response to obtain target response body data, wherein the data processing response is issued by the target back-end server in response to the data processing request; a determining module, configured to determine a target data processing response based on the target response body data and the response header data in the data processing response; and a second sending module, configured to send the target data processing response to the front-end server.

[0013] A third aspect of this disclosure provides an electronic device, comprising: one or more processors; and a memory 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 perform the request processing method.

[0014] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described request processing method.

[0015] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described request processing method.

[0016] According to embodiments of this disclosure, the proxy platform automatically determines the proxy address of the proxy server based on the data processing request, and forwards the data processing request through the proxy server. This eliminates the need for developers to frequently modify the proxy address, improving work efficiency. At the same time, the proxy platform also processes data processing responses with complex formats to obtain target data processing responses that are easy to use and read, and returns the target data processing responses to the front-end server, making it easier for developers to analyze the target data processing responses, thereby improving the efficiency of joint debugging and testing. Attached Figure Description

[0017] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0018] Figure 1 The illustrations depict application scenarios of request processing methods, apparatus, devices, media, and program products according to embodiments of the present disclosure.

[0019] Figure 2A flowchart illustrating a request processing method according to an embodiment of the present disclosure is shown schematically.

[0020] Figure 3 The diagram illustrates a joint testing scenario according to a specific embodiment of the present disclosure.

[0021] Figure 4 This schematically illustrates a data flow diagram for generating a target data processing response according to an embodiment of the present disclosure;

[0022] Figure 5 A flowchart illustrating a request processing method according to a specific embodiment of the present disclosure is shown schematically.

[0023] Figure 6 A schematic block diagram of a request processing apparatus according to an embodiment of the present disclosure is shown; and

[0024] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a request processing method according to an embodiment of the present disclosure. Detailed Implementation

[0025] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0028] When using expressions such as "at least one of A, B, and C", the expression should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0029] The front-end and back-end separation development model divides the front-end and back-end into two independent modules, each developed, tested, deployed, and maintained by different teams. The front-end is responsible for the development of the presentation layer, including page design and interactive effects; the back-end is responsible for the development of the business and persistence layers, including data processing and API development. The two communicate through API technology, thereby achieving decoupling and efficient collaboration between the front-end and back-end.

[0030] During front-end and back-end integration testing, the back-end response is typically sent directly to the front-end, and front-end developers determine the test results based on the response. However, due to the complex format of the back-end response, front-end developers need to process it before determining the results. This application processes the back-end response directly on a proxy platform and returns the processed response to the front-end, facilitating analysis by front-end developers.

[0031] Embodiments of this disclosure provide a request processing method, which, in response to receiving a data processing request from a front-end server, forwards the data processing request to a target back-end server matching the data processing request, so that the target back-end server performs a data processing operation according to the data processing request; in response to receiving a data processing response from the target back-end server, processes the response body data in the data processing response to obtain target response body data, wherein the data processing response is issued by the target back-end server in response to the data processing request; determines a target data processing response based on the target response body data and the response header data in the data processing response; and sends the target data processing response to the front-end server.

[0032] Figure 1 The illustration shows an application scenario diagram of the request processing method according to an embodiment of the present disclosure.

[0033] like Figure 1 As shown, application scenario 100 according to this embodiment may include a front-end server 101, a first back-end server 111, a second back-end server 112, and a network 120. The network 120 serves as a medium for providing communication links between the front-end server 101, the first back-end server 111, and the second back-end server 112. The network 120 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0034] The front-end server 101 interacts with the first back-end server 111 and the second back-end server 112 via the network 120 to receive or send messages, etc.

[0035] Front-end server 101 can be responsible for displaying pages and interactive effects, while the first back-end server 111 and the second back-end server 112 can be used for data processing.

[0036] It should be noted that the request processing method provided in this embodiment can generally be executed by the front-end server 101. Correspondingly, the request processing apparatus provided in this embodiment can generally be located in the front-end server 101. The request processing method provided in this embodiment can also be executed by a server or server cluster that is different from the front-end server 101 and capable of communicating with the first back-end server 111, the second back-end server 112, and / or the front-end server 101. Correspondingly, the request processing apparatus provided in this embodiment can also be located in a server or server cluster that is different from the front-end server 101 and capable of communicating with the first back-end server 111, the second back-end server 112, and / or the front-end server 101.

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

[0038] The following will be based on Figure 1 The described scene, through Figures 2-5 The request processing method of the disclosed embodiments will be described in detail.

[0039] Figure 2 A flowchart illustrating a request processing method according to an embodiment of the present disclosure is shown schematically.

[0040] like Figure 2 As shown, the request processing method of this embodiment includes operations S210 to S240.

[0041] In operation S210, in response to receiving a data processing request from the front-end server, the data processing request is forwarded to the target back-end server that matches the data processing request, so that the target back-end server can perform data processing operations according to the data processing request.

[0042] According to embodiments of this disclosure, the front-end server can be a front-end server that needs to perform joint debugging tests with the back-end server. Front-end developers can initiate data processing requests to the back-end server through the front-end server to achieve joint debugging tests between the front-end server and the back-end server. The data processing request can be a request issued by the front-end server to call the back-end server to perform data processing.

[0043] According to embodiments of this disclosure, when a developer accesses a front-end server through a browser, if the domain name of the front-end server is different from that of the back-end server, the browser cannot directly send data processing requests generated by the front-end server to the back-end server. A proxy platform is needed to forward these data processing requests. Specifically, a proxy platform can be built on the front-end server or on servers other than the front-end and back-end servers. The proxy platform automatically creates proxy servers based on the front-end and back-end servers and utilizes these proxy servers to forward data processing requests.

[0044] In actual development, one front-end server can correspond to multiple back-end servers. Therefore, the proxy platform needs to determine the target back-end server that can handle data processing requests from multiple back-end servers and forward the data processing requests to the target back-end server.

[0045] In operation S220, in response to receiving a data processing response from the target backend server, the response body data in the data processing response is processed to obtain the target response body data.

[0046] According to embodiments of this disclosure, the data processing response is issued by the target backend server in response to the data processing request. After the proxy platform forwards the data processing request to the target backend server, the target backend server performs data processing operations according to the data processing request and returns the processing result as a data processing response to the proxy platform.

[0047] When conducting front-end and back-end integration testing, developers usually need to determine the test results based on the data processing response returned by the back-end. However, the format of the data processing response is usually quite complex, and developers also need to process the data processing response before they can further determine the integration test results, which reduces the efficiency of integration testing.

[0048] According to embodiments of this disclosure, data processing responses can be processed through a proxy platform to obtain responses that are easy for developers to understand and use. Specifically, a proxy server can be used to process the data processing responses.

[0049] According to embodiments of this disclosure, response header data is typically used to instruct the front-end server how to process the response body data, as well as information such as the response type, character encoding, and byte size. The response body data is usually the actual content sent by the back-end server to the front-end server; therefore, only the response body data can be processed to obtain the target response body data. Specifically, the format of the response body data can be processed into a format that is easier for developers to understand and use.

[0050] In operation S230, the target data processing response is determined based on the target response body data and the response header data in the data processing response.

[0051] According to embodiments of this disclosure, since the obtained target response body data is not a complete response, it is still necessary to instruct the front-end server to process the target response body data via the response header. Therefore, it is necessary to determine the target data processing response based on the target response body data and the response header data. Specifically, the target response body data can be appended to the response header using string concatenation to obtain the target data processing response.

[0052] According to another embodiment of this disclosure, a target data processing response can also be obtained by replacing the response body data in the data processing response with the processed target response body data.

[0053] According to embodiments of this disclosure, a joint debugging test report can also be generated based on the data processing request and the target data processing response, and stored in a database for easy reference by developers.

[0054] In operation S240, the target data processing response is sent to the front-end server.

[0055] According to embodiments of this disclosure, after the proxy platform receives the target data processing response, it needs to send the target data processing response to the front-end server so that the front-end server can perform operations such as rendering based on the target response body data.

[0056] According to embodiments of this disclosure, the proxy platform automatically determines the proxy address of the proxy server based on the data processing request, and forwards the data processing request through the proxy server. This eliminates the need for developers to frequently modify the proxy address, improving work efficiency. At the same time, the proxy platform also processes data processing responses with complex formats to obtain target data processing responses that are easy to use and read, and returns the target data processing responses to the front-end server, making it easier for developers to analyze the target data processing responses, thereby improving the efficiency of joint debugging and testing.

[0057] According to the embodiments of this disclosure, since the backend server processes data processing requests through an interface, an interface configuration file needs to be configured in the proxy platform before joint debugging and testing, so that the proxy platform can determine the corresponding target backend server based on the interface configuration file.

[0058] According to embodiments of this disclosure, the method for generating an interface configuration file includes: obtaining interface definition files for multiple backend servers; and generating an interface configuration file for each interface.

[0059] According to embodiments of this disclosure, each front-end server corresponds to multiple back-end servers, and each back-end server includes multiple interfaces. Therefore, it is necessary to obtain the interface information of each interface by acquiring the interface definition files of each of the multiple back-end servers. Specifically, static code analysis tools or custom scripts can be used to extract the interface information from the interface definition files.

[0060] In traditional front-end and back-end integration testing methods, developers need to manually modify the interface configuration file according to the target interface every time they switch targets, resulting in low integration testing efficiency.

[0061] According to embodiments of this disclosure, server identifiers and interface identifiers can be configured for multiple backend servers and multiple interfaces respectively to distinguish different servers and interfaces, making it easier for the proxy platform to forward data processing requests to the corresponding target backend server.

[0062] According to embodiments of this disclosure, the interface configuration file includes an interface identifier for the interface and a server identifier for the corresponding backend server. By configuring an interface configuration file for each interface separately, the interface configuration file can include the association between the interface identifier and the server identifier. This allows the proxy platform to determine the corresponding target backend server through the interface identifier, enabling the target backend server to process data processing requests through the target interface.

[0063] According to embodiments of this disclosure, the interface configuration file may also include the address of a proxy server that matches the interface, and the proxy platform generates a proxy server based on the proxy server address in the interface configuration file.

[0064] According to embodiments of this disclosure, after generating the interface configuration file, the interface configuration file can be stored in a database.

[0065] According to embodiments of this disclosure, an interface configuration file is automatically generated by a proxy platform, and the target interface configuration file is directly obtained by the interface identifier when forwarding data processing requests. This avoids developers manually modifying the interface configuration file multiple times, thus simplifying the front-end and back-end integration operation and improving the efficiency of front-end and back-end integration.

[0066] According to embodiments of this disclosure, sending a data processing request to a target backend server that matches the data processing request includes: obtaining an interface identifier of a target interface to be called by a frontend service from the data processing request; determining a target interface configuration file that matches the interface identifier from a plurality of interface configuration files based on the interface identifier; determining a server identifier of a target backend server corresponding to the target interface from the target interface configuration file; and sending the data processing request to the target backend server based on the server identifier, so that the target backend server parses the data processing request through the target interface.

[0067] According to embodiments of this disclosure, when a developer initiates a data processing request through a front-end server, they can set the interface identifier of the target interface to be called in the data processing request. The proxy platform obtains the interface identifier of the target interface from the data processing request and determines the target interface configuration file that matches the interface identifier from the interface configuration file.

[0068] According to embodiments of this disclosure, since the interface configuration file stores the backend server identifier associated with the interface, the proxy platform can obtain the server identifier of the target backend server through the target interface configuration file.

[0069] According to embodiments of this disclosure, the proxy platform identifies a target backend server from multiple backend servers using a server identifier and forwards the data processing request to the target backend server. The target backend server parses the data processing request through a target interface and calls the database based on the parsed result to perform data processing operations. Specifically, the target backend server can verify the validity of the request body data in the data processing request, extract key information from the request body data, query the database to obtain data according to the data processing request, and generate a data processing response based on the data processing result.

[0070] According to embodiments of this disclosure, the proxy platform can obtain the request body data of the data processing request through a request body extraction function such as the fetch function, or through a Hypertext Transfer Protocol request function such as the XMLHttpRequest function.

[0071] According to embodiments of this disclosure, if the backend server supports the request body data format, the request body data can be directly passed to the backend. If the backend server needs to process the request body data, it can convert the request body data format into a script format or an array format, and then pass the converted request body data to the backend server through a data return function such as the body function.

[0072] According to embodiments of this disclosure, data processing requests are forwarded through an interface configuration file, thereby improving the forwarding efficiency of data processing requests and thus improving the efficiency of joint debugging and testing.

[0073] According to embodiments of this disclosure, sending a data processing request to a target backend server based on a target server identifier includes: obtaining frontend domain name information of a frontend server and backend domain name information of a backend server; if it is determined that the frontend domain name information and the backend domain name information do not match, creating a proxy server based on the frontend domain name information; and sending the data processing request and the server identifier of the target server to the proxy server, so that the proxy server sends the data processing request to the target backend server.

[0074] According to embodiments of this disclosure, when the front-end domain name information and the back-end domain name information are different, the request sent by the front-end server to the target back-end server is a cross-domain request. Since browsers intercept cross-domain requests, they cannot directly send the data processing request to the target back-end server; therefore, a proxy server is needed to forward the data processing request.

[0075] According to embodiments of this disclosure, the proxy domain information of the proxy server is the same as the front-end domain information. Because the proxy domain information is identical to the front-end domain information, when a data processing request from the front-end server is sent to the proxy server, the browser no longer intercepts the data processing request. The interaction between the proxy server and the target back-end server is a server-to-server interaction, requiring no browser, and therefore there are no cross-domain restrictions, enabling the proxy server to forward data processing requests.

[0076] According to embodiments of this disclosure, a proxy server can determine a target backend server from multiple backend servers based on a server identifier and forward data processing requests to the target backend server.

[0077] According to embodiments of this disclosure, by creating a proxy server and using the proxy server to forward cross-domain requests, developers do not need to manually change the proxy address, thus improving the efficiency of joint debugging and testing.

[0078] Figure 3 The diagram illustrates a joint debugging test according to a specific embodiment of the present disclosure.

[0079] like Figure 3 As shown, during joint debugging and testing, one front-end server 10 corresponds to back-end servers 30_1, 30_2, ..., 30_N. Back-end server 30_1 includes interface 1_1, interface 1_2, ..., interface 1_X; back-end server 30_2 includes interface 2_1, interface 2_2, ..., interface 2_Y; and back-end server 30_N includes interface N_1, interface N_2, ..., interface N_Z.

[0080] According to the embodiments of this disclosure, the proxy platform 20 generates interface configuration files for each interface, resulting in interface configuration file 1_1, interface configuration file 1_2, ..., interface configuration file 1_X, interface configuration file 2_1, interface configuration file 2_2, ..., interface configuration file 2_Y, ..., interface configuration file N_1, interface configuration file N_2, ..., interface configuration file N_Z.

[0081] According to an embodiment of this disclosure, in response to receiving a data processing request from the front-end server 10, the proxy platform 20 determines a target interface configuration file from multiple interface configuration files and forwards the data processing request to the target back-end server based on the target interface configuration file.

[0082] According to embodiments of this disclosure, the proxy platform can only correctly forward data processing requests when the interface configuration file matches the interface definition file. Therefore, the proxy platform needs to update the interface configuration file in a timely manner according to the interface definition file.

[0083] According to embodiments of this disclosure, the interface configuration file update method includes: periodically obtaining the latest interface definition file of each backend server, and obtaining the latest interface information of each interface from multiple latest interface definition files; for each interface, if it is determined that the latest interface information of the interface does not match the interface configuration file of the interface, updating the interface configuration file based on the latest interface information.

[0084] According to embodiments of this disclosure, the latest interface information can be obtained by periodically acquiring the latest interface definition file, and then the latest interface information can be compared with the interface configuration file.

[0085] According to embodiments of this disclosure, when the latest interface information does not match the interface configuration file, the interface configuration file is updated based on the latest interface information to avoid errors in forwarding data processing requests due to failure to update the interface configuration file in a timely manner.

[0086] According to embodiments of this disclosure, the interface configuration file is updated using the latest interface definition file, thus ensuring the interface configuration file is up-to-date.

[0087] According to embodiments of this disclosure, processing the response body data of a data processing response to obtain target response body data includes: converting the format of the response body data to obtain first response body data; and deleting duplicate data in the first response body data to obtain target response body data.

[0088] According to embodiments of this disclosure, since the data processing response returned by the backend server may not be convenient for developers to analyze, the response body data can be processed through a proxy platform.

[0089] According to embodiments of this disclosure, the format of the response body data can be converted into a format that is easy for developers to read and use, to obtain first response body data, such as by decompression.

[0090] According to the embodiments of this disclosure, after obtaining the first response body data, a deduplication operation can be performed on the first response body data, that is, to remove duplicate data in the first response body data. For example, when the target backend server calls the database to perform a query, the network delay may cause duplicate queries, which in turn may result in duplicate data in the response body data.

[0091] According to embodiments of this disclosure, when removing duplicate data from the first response body data, duplicate data in the first response body data can be determined by sequentially comparing adjacent data in the first response body data.

[0092] According to embodiments of this disclosure, when the target response body data is stored in the form of key-value pairs, the target response body data can also be classified or filtered according to the key name, further improving the usability of the target response body data.

[0093] According to embodiments of this disclosure, target response body data is obtained by processing the response body data, making the target response body data highly readable and easy to use, facilitating reading and analysis by developers.

[0094] According to embodiments of this disclosure, format conversion of response body data to obtain first response body data includes: if the format of the response body data is determined to be an encoded format, performing a decoding operation on the response body data to obtain the first response body data; or if the format of the response body data is determined to be a data exchange format, converting the format of the response body data from the data exchange format to a script format to obtain the first response body data.

[0095] According to embodiments of this disclosure, when the response body data is in an encoded format, such as GZIP encoding, developers need to manually decode the GZIP file to obtain the response body data, thereby reducing their workload. Therefore, if the response body data is determined to be in an encoded format, the first response body data can be obtained directly by decoding the encoded response body data in the proxy platform, thereby reducing the workload of developers and improving the efficiency of integration testing.

[0096] According to embodiments of this disclosure, when the response body data is in a data exchange format such as Lightweight Data Exchange Format (JavaScript Object Notation, JSON), the format of the response body data can be converted into a first response body data in script format, which is easy for developers to read.

[0097] According to embodiments of this disclosure, the first response body data is obtained by converting the format of the data processing response, thereby improving the readability and usability of the response body data.

[0098] Figure 4A schematic diagram illustrating the data flow for generating a target data processing response according to an embodiment of the present disclosure is shown.

[0099] like Figure 4 As shown, response body data 402 is obtained from data processing response 401.

[0100] According to embodiments of this disclosure, since the readability and usability of the response body data 402 are poor, the response body data 402 can be decoded or its format converted to obtain the first response body data 403. If the format of the response body data 402 is an encoded format, a decoding operation is performed on the response body data 402; if the format of the response body data 402 is a data exchange format, the format of the response body data 402 is converted from the data exchange format to a script format.

[0101] like Figure 4 As shown, duplicate data in the first response body data 403 is deleted to obtain the target response body data 404. Based on the target response body data 404 and the response header data 405 in the data processing response 401, the target data processing response 406 is obtained. Specifically, the response header data 405 is used as the response header of the target data processing response 406, and the target response body data 404 is used as the response body of the target data processing response 406.

[0102] Figure 5 A flowchart illustrating a request processing method according to a specific embodiment of the present disclosure is shown.

[0103] like Figure 5 As shown, the request processing method includes operations S501 to S509.

[0104] When operating S501, the front-end server sends a data processing request.

[0105] When operating S502, the proxy platform obtains the interface identifier of the target interface to be called by the front-end server.

[0106] According to an embodiment of this disclosure, in response to receiving a data processing request, the proxy platform obtains the interface identifier of the target interface to be called by the front-end server from the data processing request.

[0107] When operating S503, the proxy platform obtains the server identifier of the target server.

[0108] According to embodiments of this disclosure, the proxy platform obtains the server identifier of the target server from the target interface configuration file that matches the interface identifier, based on the interface identifier.

[0109] When operating S504, the proxy platform creates a proxy server.

[0110] According to embodiments of this disclosure, the proxy platform creates a proxy server based on the front-end domain name information of the front-end server and the back-end domain name information of the target back-end server.

[0111] When operating S505, the proxy platform forwards data processing requests to the target backend server through the proxy server.

[0112] According to embodiments of this disclosure, the proxy platform forwards data processing requests to the target backend server through a proxy server based on the server identifier of the target server.

[0113] When operating S506, the target backend server performs data processing operations.

[0114] According to embodiments of this disclosure, the target backend server parses the data processing request through the target interface and then calls the database to perform data processing operations.

[0115] When operating S507, the target backend server displays the results of data processing operations and receives a data processing response.

[0116] According to embodiments of this disclosure, the target backend server obtains a data processing response based on the result of the data processing operation and returns it to the proxy platform.

[0117] When operating S508, the agent platform processes the data processing response to obtain the target data processing response.

[0118] According to an embodiment of this disclosure, the proxy platform responds to the received data processing response, processes the data processing response, obtains the target data processing response, and returns it to the front-end server.

[0119] When operating S509, the front-end server receives the target data processing response.

[0120] Based on the above request processing method, this disclosure also provides a request processing apparatus. The following will be combined with... Figure 6 The device is described in detail.

[0121] Figure 6 A schematic block diagram of a request processing apparatus according to an embodiment of the present disclosure is shown.

[0122] like Figure 6 As shown, the request processing device 600 of this embodiment includes a first sending module 610, a processing module 620, a determining module 630, and a second sending module 640.

[0123] The first sending module 610 is used to forward a data processing request to a target backend server that matches the data processing request in response to receiving a data processing request from the frontend server, so that the target backend server can perform data processing operations according to the data processing request. In one embodiment, the first sending module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0124] The processing module 620 is used to process the response body data in the received data processing response from the target backend server to obtain the target response body data. The data processing response is issued by the target backend server in response to the data processing request. In one embodiment, the processing module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0125] The determining module 630 is used to determine the target data processing response based on the target response body data and the response header data in the data processing response. In one embodiment, the determining module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0126] The second sending module 640 is used to send the target data processing response to the front-end server. In one embodiment, the second sending module 630 can be used to perform the operation S240 described above, which will not be repeated here.

[0127] According to embodiments of this disclosure, the processing module 620 includes a conversion submodule and a deduplication submodule.

[0128] The conversion submodule is used to convert the format of the response body data to obtain the first response body data.

[0129] The deduplication submodule is used to remove duplicate data from the first response body data to obtain the target response body data.

[0130] According to embodiments of this disclosure, the conversion submodule includes a decoding unit and a conversion unit.

[0131] The decoding unit is used to perform a decoding operation on the response body data when it is determined that the format of the response body data is an encoded format, so as to obtain the first response body data.

[0132] The conversion unit is used to convert the format of the response body data from the data exchange format to the script format when it is determined that the format of the response body data is the data exchange format, so as to obtain the first response body data.

[0133] According to embodiments of this disclosure, the request processing apparatus 600 further includes an acquisition module, a first configuration module, a second configuration module, and a generation module.

[0134] The acquisition module is used to acquire the interface definition files of multiple backend servers. The interface definition files are used to define the interface information of each of the multiple interfaces of the backend servers.

[0135] The first configuration module is used to configure the server identifier for each backend server.

[0136] The second configuration module is used to configure the interface identifier for each interface.

[0137] The generation module is used to generate an interface configuration file for each interface. The interface configuration file includes the interface identifier of the interface and the server identifier of the backend server corresponding to the interface.

[0138] According to embodiments of this disclosure, the first sending module 610 includes an identifier acquisition submodule, a file determination submodule, an identifier determination submodule, and a request sending submodule.

[0139] The identifier acquisition submodule is used to obtain the interface identifier of the target interface to be called by the front-end service from the data processing request.

[0140] The file determination submodule is used to determine the target interface configuration file that matches the interface identifier from multiple interface configuration files based on the interface identifier.

[0141] The identifier determination submodule is used to determine the server identifier of the target backend server corresponding to the target interface from the target interface configuration file.

[0142] The request sending submodule is used to send data processing requests to the target backend server based on the server identifier, so that the target backend server can parse the data processing request through the target interface.

[0143] According to embodiments of this disclosure, the request processing apparatus 600 further includes an information acquisition module and a configuration update module.

[0144] The information acquisition module is used to periodically acquire the latest interface definition file of each backend server and obtain the latest interface information of each interface from multiple latest interface definition files.

[0145] The configuration update module is used to update the interface configuration file based on the latest interface information for each interface if the latest interface information of the interface does not match the interface configuration file.

[0146] According to embodiments of this disclosure, the request sending module includes a domain name acquisition submodule, a proxy creation submodule, and a request sending submodule.

[0147] The domain name retrieval submodule is used to retrieve the front-end domain name information of the front-end server and the back-end domain name information of the target back-end server.

[0148] The proxy creation submodule is used to create a proxy server based on the front-end domain information when it is determined that the front-end domain information and the back-end domain information do not match. The proxy domain information of the proxy server is the same as the front-end domain information.

[0149] The request sending submodule is used to send the data processing request and the server identifier of the target server to the proxy server, so that the proxy server will send the data processing request to the target backend server.

[0150] According to embodiments of this disclosure, any plurality of modules among the first transmitting module 610, processing module 620, determining module 630, and second transmitting module 640 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first transmitting module 610, processing module 620, determining module 630, and second transmitting module 640 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these methods. Alternatively, at least one of the first sending module 610, the processing module 620, the determining module 630, and the second sending module 640 may be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0151] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a request processing method according to an embodiment of the present disclosure.

[0152] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0153] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0154] According to embodiments of this disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0155] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0156] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.

[0157] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the item recommendation method provided in the embodiments of this disclosure.

[0158] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0159] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0160] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0161] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0162] 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 this disclosure. 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.

[0163] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0164] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A request processing method, characterized in that, The method includes: In response to receiving a data processing request from a front-end server, the data processing request is forwarded to a target back-end server that matches the data processing request, so that the target back-end server performs a data processing operation according to the data processing request. The front-end server and the target back-end server perform joint debugging tests. The data processing request includes a request to call the database using the target back-end server to query data. In response to receiving a data processing response from the target backend server, the response body data in the data processing response is processed to obtain target response body data, wherein the data processing response is issued by the target backend server in response to the data processing request; The target data processing response is determined based on the target response body data and the response header data in the data processing response; and The target data processing response is sent to the front-end server; The process of processing the response body data of the data processing response to obtain the target response body data includes: The response body data is format-converted to obtain first response body data; and Delete duplicate data from the first response body data to obtain the target response body data. The duplicate data is generated due to network latency during the process of the target backend server calling the database to query data.

2. The method according to claim 1, characterized in that, The step of converting the format of the response body data to obtain the first response body data includes: If the format of the response body data is determined to be an encoded format, the response body data is decoded to obtain the first response body data; or If the format of the response body data is determined to be a data exchange format, the format of the response body data is converted from the data exchange format to a script format to obtain the first response body data.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the interface definition files for each of the multiple backend servers, wherein the interface definition files are used to define the interface information of each of the multiple interfaces of the backend servers; and For each of the interfaces, an interface configuration file is generated for that interface, wherein the interface configuration file includes the interface identifier of the interface and the server identifier of the backend server corresponding to the interface.

4. The method according to claim 3, characterized in that, Sending the data processing request to the target backend server that matches the data processing request includes: Obtain the interface identifier of the target interface to be called by the front-end service from the data processing request; Based on the interface identifier, a target interface configuration file that matches the interface identifier is determined from a plurality of interface configuration files; Determine the server identifier of the target backend server corresponding to the target interface from the target interface configuration file; and Based on the server identifier, the data processing request is sent to the target backend server, so that the target backend server can parse the data processing request through the target interface.

5. The method according to claim 3, characterized in that, The method further includes: The latest interface definition file of each of the backend servers is periodically retrieved, and the latest interface information of each interface is obtained from multiple latest interface definition files; For each of the interfaces, if it is determined that the latest interface information of the interface does not match the interface configuration file of the interface, the interface configuration file is updated based on the latest interface information.

6. The method according to claim 4, characterized in that, Sending the data processing request to the target backend server based on the server identifier includes: Obtain the front-end domain name information of the front-end server and the back-end domain name information of the target back-end server; If it is determined that the front-end domain information and the back-end domain information do not match, a proxy server is created based on the front-end domain information, wherein the proxy domain information of the proxy server is the same as the front-end domain information; and The data processing request and the server identifier of the target server are sent to the proxy server, so that the proxy server sends the data processing request to the target backend server.

7. A request processing apparatus, characterized in that, The device includes: The first sending module is used to respond to receiving a data processing request from the front-end server and forward the data processing request to a target back-end server that matches the data processing request, so that the target back-end server performs data processing operations according to the data processing request. The front-end server and the target back-end server perform joint debugging tests. The data processing request includes a request to use the target back-end server to call the database to query data. The processing module is configured to, in response to receiving a data processing response from the target backend server, process the response body data in the data processing response to obtain target response body data, wherein the data processing response is issued by the target backend server in response to the data processing request; The determination module is used to determine the target data processing response based on the target response body data and the response header data in the data processing response; and The second sending module is used to send the target data processing response to the front-end server; The processing module includes: A conversion submodule is used to convert the format of the response body data to obtain first response body data; and The deduplication submodule is used to delete duplicate data in the first response body data to obtain the target response body data. The duplicate data is generated due to network latency during the process of the target backend server calling the database to query data.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and device, storage medium and electronic device

    CN109857391A

  • Joint debugging system, joint debugging method, computer equipment and storage medium

    CN110427324A

  • Front-end and back-end joint debugging method and device, proxy equipment and storage medium

    CN112671574A

  • Business processing method and device, electronic equipment and storage medium

    CN115268851A