CN113452703A - Combined communication request response method and device, electronic equipment and readable storage medium - Google Patents

Combined communication request response method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113452703A
CN113452703A CN202110719440.2A CN202110719440A CN113452703A CN 113452703 A CN113452703 A CN 113452703A CN 202110719440 A CN202110719440 A CN 202110719440A CN 113452703 A CN113452703 A CN 113452703A
Authority
CN
China
Prior art keywords
request
sub
http
combined
end service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110719440.2A
Other languages
Chinese (zh)
Other versions
CN113452703B (en
Inventor
吴锦
赵阳
朱琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202110719440.2A priority Critical patent/CN113452703B/en
Publication of CN113452703A publication Critical patent/CN113452703A/en
Application granted granted Critical
Publication of CN113452703B publication Critical patent/CN113452703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention relates to a network protocol technology, and discloses a combined communication request response method, which comprises the following steps: acquiring a combined request of a calling party, and splitting the combined request into sub-request sets; classifying the sub-request sets to obtain an HTTP sub-request set and a TCP sub-request set; distributing the HTTP sub-request set to a first back-end service cluster by using a transmission protocol and acquiring a first return result returned by the first back-end service cluster; distributing the TCP sub-request set to a second back-end service cluster by using a transmission protocol and acquiring a second return result returned by the second back-end service cluster; and aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller. The invention also provides a combined communication request response device, equipment and a computer readable storage medium. In addition, the invention also relates to a block chain technology, and the link log can be stored in the block chain node. The invention can improve the response efficiency of the combined communication request.

Description

Combined communication request response method and device, electronic equipment and readable storage medium
Technical Field
The present invention relates to the field of network protocol technologies, and in particular, to a combined communication request response method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The communication gateway is a device for performing communication between computers, and is widely applied to interconnection operations between computers, communication requests between computers processed by the communication gateway can be roughly divided into HTTP types and TCP types, and with the development of computer applications, most of computer communication requests at the present stage include combined requests of both HTTP types and TCP types.
At present, in a processing mode for a combined request in computer communication, gateway devices for HTTP type communication requests and gateway devices for TCP type communication requests need to be deployed respectively to respond to the combined communication by using two sets of deployed gateway devices in turn, and this method may cause gradual flow of the combined request between different gateway devices, resulting in low response efficiency for the combined request.
Disclosure of Invention
The invention provides a combined communication request response method, a combined communication request response device, electronic equipment and a computer readable storage medium, and mainly aims to improve the response efficiency of a combined communication request.
In order to achieve the above object, the present invention provides a combined communication request response method, including:
acquiring a combined request of a calling party, and splitting the combined request into sub-request sets;
classifying the sub-request sets according to request types to obtain HTTP sub-request sets and TCP sub-request sets;
distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol, and acquiring a first return result returned by the first back-end service cluster;
distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol, and acquiring a second return result returned by the second back-end service cluster;
and aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller.
Optionally, the splitting the combined request into sub-request sets includes:
traversing and identifying split characters in the combined request;
and splitting the combined request into a plurality of sub-requests according to the split characters, and collecting the sub-requests into a sub-request set.
Optionally, the classifying the sub-request set according to the request type includes:
extracting a request type field of each sub-request in the sub-request set;
when the request type field is consistent with a preset standard HTTP request field, determining the request type of the sub-request to be an HTTP request;
and when the request type field is consistent with a preset standard TCP request field, determining that the request type of the sub-request is a TCP request.
Optionally, the distributing the HTTP sub-request set to the first backend service cluster by using a preset transport protocol includes:
acquiring HTTP transmission parameters;
compiling the HTTP transmission parameters into a first connection statement by using a preset transmission protocol;
establishing a short connection between the caller and the first back-end service cluster according to the first connection statement;
and distributing the HTTP sub-request set to a first back-end service cluster by using the short connection.
Optionally, the distributing the HTTP sub-request set to a first backend service cluster using the short connection includes:
extracting target request addresses of all HTTP sub-requests in the HTTP sub-request set;
acquiring a service address of each back-end service in the first back-end service cluster;
and sending each HTTP sub-request in the HTTP sub-request set to a back-end service with the service address same as the target request address by using the short connection.
Optionally, the aggregating the first returned result and the second returned result into an overall request result includes:
performing HTTP decoding on the first return result to obtain first decoding data;
performing TCP decoding on the second return result to obtain second decoding data;
and uniformly coding the first decoding data and the second decoding data to obtain a total request result.
Optionally, the uniformly encoding the first decoded data and the second decoded data to obtain a total request result includes:
obtaining a byte vector set corresponding to the first decoding data and the second decoding data, wherein the byte vector set comprises byte vectors of the first decoding data and the second decoding data;
respectively encoding byte vectors in byte vector sets corresponding to the first decoding data and the second decoding data to obtain encoded byte sets;
and splicing the encoding bytes in the encoding byte set to obtain a total request result.
In order to solve the above problem, the present invention also provides a combined communication request responding apparatus, including:
the request splitting module is used for acquiring a combined request of a calling party and splitting the combined request into a sub-request set;
the classification module is used for classifying the sub-request sets according to the request types to obtain HTTP sub-request sets and TCP sub-request sets;
the first request module is used for distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol and acquiring a first return result returned by the first back-end service cluster;
the second request module is used for distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol and acquiring a second return result returned by the second back-end service cluster;
and the aggregation module is used for aggregating the first return result and the second return result into a total request result and sending the total request result to the caller.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
a processor executing a computer program stored in the memory to implement the combined communication request response method of any of the above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program when executed by a processor implements a combined communication request response method as described in any of the above.
The combined request is divided into the sub-request sets by obtaining the combined request of a calling party, the sub-request sets are classified into the HTTP sub-request set and the TCP sub-request set according to the request types, the HTTP sub-request set is distributed to the first back-end service cluster by using a transmission protocol and a first return result returned by the first back-end service cluster is obtained, the TCP sub-request set is distributed to the second back-end service cluster by using the transmission protocol and a second return result returned by the second back-end service cluster is obtained, the split of one combined request into a plurality of sub-requests is realized, and the sub-requests of different types are sent to the corresponding back-end service centers to obtain the return results of the requests of different types, the synchronous response of different requests in the combined request is realized, the gradual response of the combined request is avoided, and the corresponding efficiency in the combined request is improved; and aggregating the first return result and the second return result into a total request result, sending the total request result to the caller, and aggregating the results returned by different sub-requests into the total request result, so that the request result is aggregated, and the efficiency of the caller for obtaining the combined request result is facilitated. Therefore, the combined communication request response method, the combined communication request response device and the computer readable storage medium can track the state of the link node in the distributed system and improve the portability of the link tracking method.
Drawings
Fig. 1 is a flowchart illustrating a combined communication request response method according to an embodiment of the present invention;
fig. 2 is a block diagram of a combined communication request response apparatus according to an embodiment of the present invention;
fig. 3 is a schematic internal structural diagram of an electronic device implementing a combined communication request response method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a combined communication request response method. The execution subject of the combined communication request response method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the combined communication request response method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a flowchart illustrating a combined communication request response method according to an embodiment of the present invention. In this embodiment, the combined communication request response method includes:
s1, obtaining the combined request of the caller, and splitting the combined request into sub-request sets.
In the embodiment of the present invention, the caller includes any computer or computer cluster that can perform computer communication, and the caller sends a communication request to other computers or computer clusters except the caller to implement communication between the caller and the other computers or computer clusters.
For example, there are a computer a and a computer B, and if the computer a sends a communication request to the computer B in order to acquire data in the computer B, the computer a is a caller.
In detail, the combined request is one of the communication requests, the combined request includes a plurality of communication requests, and the request types of the plurality of communication requests included in the combined request may be the same or different.
In particular, the request types of the communication request include, but are not limited to, HTTP requests and TCP requests.
In this embodiment of the present invention, the splitting the combined request into sub-request sets includes:
traversing and identifying split characters in the combined request;
and splitting the combined request into a plurality of sub-requests according to the split characters, and collecting the sub-requests into a sub-request set.
In detail, the split character is a character used for separating different requests in the combined request, for example, there is a combined request of: request 1< request 2< request 3< request 4, where "<" is a split character used to separate the four requests in a combined request.
In particular, the split character may be given by the requestor.
In the embodiment of the present invention, traversing and identifying the split character in the combined request, and splitting the combined request into a plurality of sub-requests according to the split character, for example, the combined request includes: request 1< request 2< request 3< request 4, where "<" is a split character, the combined request may be split into request 1, request 2, request 3, and request 4 by the split character.
And collecting the sub-requests obtained by splitting the combined request to obtain a sub-request set.
The embodiment of the invention can split the combined request into a plurality of sub-requests by splitting the combined request, avoids sending the combined request to different gateway equipment for response, ensures that the sub-requests obtained by splitting can be processed simultaneously subsequently, and is beneficial to improving the efficiency of responding the combined request.
S2, classifying the sub-request sets according to the request types to obtain an HTTP sub-request set and a TCP sub-request set.
In this embodiment of the present invention, the classifying the sub-request sets according to request types includes:
extracting a request type field of each sub-request in the sub-request set;
when the request type field is consistent with a preset standard HTTP request field, determining the request type of the sub-request to be an HTTP request;
and when the request type field is consistent with a preset standard TCP request field, determining that the request type of the sub-request is a TCP request.
In detail, the embodiment of the present invention may extract a request type field of each sub-request in the sub-request set by using a python statement having a field extraction function, where the request type field is a field carried in the sub-request and used for identifying a request type of the sub-request.
Specifically, the extracted request type field is compared with a preset standard HTTP request field and a preset standard TCP request field, when the request type field is consistent with the preset standard HTTP request field, the request type of the sub-request is determined to be an HTTP request, and when the request type field is consistent with the preset standard TCP request field, the request type of the sub-request is determined to be a TCP request.
The embodiment of the invention extracts the request type field of each sub-request in the sub-request set and classifies the sub-requests in the sub-request set according to the request type field, thereby being beneficial to the subsequent processing of responding to the sub-requests of different types.
S3, distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol, and acquiring a first return result returned by the first back-end service cluster.
In this embodiment of the present invention, the distributing the HTTP sub-request set to the first backend service cluster by using a preset transport protocol includes:
acquiring HTTP transmission parameters;
compiling the HTTP transmission parameters into a first connection statement by using a preset transmission protocol;
establishing a short connection between the caller and the first back-end service cluster according to the first connection statement;
and distributing the HTTP sub-request set to a first back-end service cluster by using the short connection.
In detail, the embodiment of the present invention may utilize a python statement with a data fetching function to obtain the HTTP transmission parameters from a database for storing the HTTP transmission parameters, where the database includes, but is not limited to, a mysql database and an Oracle database.
In the embodiment of the present invention, the transmission protocol is a protocol for data transmission between computers, for example, a Telnet protocol, an FTP protocol, an SMTP protocol, an HTTP protocol, a DNS protocol, a TCP protocol, and the like.
Specifically, the transmission protocol includes a transmission rule of communication between user computers, HTTP transmission parameters can be compiled into a first connection statement according to the transmission rule, and the establishment of short connection between the caller and the first back-end service cluster can be realized by executing the first connection statement.
Further, the distributing the HTTP sub-request set to a first backend service cluster using the short connection includes:
extracting target request addresses of all HTTP sub-requests in the HTTP sub-request set;
acquiring a service address of each back-end service in the first back-end service cluster;
and sending each HTTP sub-request in the HTTP sub-request set to a back-end service with the service address same as the target request address by using the short connection.
In the embodiment of the invention, the target request address of each HTTP sub-request in the HTTP sub-request set and the service address of each backend service in the first backend service cluster can be extracted by using the pre-edited java statement.
After the target request address of each HTTP sub-request in the HTTP sub-request set and the service address of each back-end service in the first back-end service cluster are obtained, each HTTP sub-request in the HTTP sub-request set is sent to the back-end service with the same service address as the target request address by utilizing the short connection established between the caller and the first back-end service cluster, and a first return result returned by the first back-end service cluster is received.
S4, distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol, and acquiring a second return result returned by the second back-end service cluster.
In this embodiment of the present invention, the step of distributing the TCP sub-request set to the second backend service cluster by using the preset transport protocol and obtaining the second return result returned by the second backend service cluster is consistent with the step of distributing the HTTP sub-request set to the first backend service cluster by using the preset transport protocol and obtaining the first return result returned by the first backend service cluster in S3, which is not described herein again.
S5, aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller.
In this embodiment of the present invention, the aggregating the first returned result and the second returned result into a total request result includes:
performing HTTP decoding on the first return result to obtain first decoding data;
performing TCP decoding on the second return result to obtain second decoding data;
and uniformly coding the first decoding data and the second decoding data to obtain a total request result.
In detail, in the embodiment of the present invention, an HTTP decoder may perform HTTP decoding on the first return result to obtain first decoded data, and a TCP decoder may perform TCP decoding on the second return result to obtain first decoded data, where the HTTP decoder includes an AC-3 decoder, an HDCD decoder, and the like, and the TCP decoder includes a DTS decoder, and the like.
Further, the uniformly encoding the first decoded data and the second decoded data to obtain a total request result includes:
obtaining a byte vector set corresponding to the first decoding data and the second decoding data, wherein the byte vector set comprises byte vectors of the first decoding data and the second decoding data;
respectively encoding byte vectors in byte vector sets corresponding to the first decoding data and the second decoding data to obtain encoded byte sets;
and splicing the encoding bytes in the encoding byte set to obtain a total request result.
In the embodiment of the invention, the byte vector sets corresponding to the first decoding data and the second decoding data can be obtained from the database in which the byte vector sets are stored in advance by utilizing the python statement with the data grabbing function.
In detail, a uniform encoder may be used to encode the byte vectors in the byte vector sets corresponding to the first decoded data and the second decoded data, respectively, to obtain encoded byte sets.
Because the obtained first return result and the second return result are obtained by sending different types of communication requests to different back-end service clusters, the data types of the first return result and the second return result may be inconsistent, and therefore, the embodiment of the present invention decodes the first return result and the second return result and then uniformly encodes the first return result and the second return result, so that the data types of the first return result and the second return result can be uniformly realized, so as to aggregate the first return result and the second return result into a total request result, and then send the total request result to the caller.
The combined request is divided into the sub-request sets by obtaining the combined request of a calling party, the sub-request sets are classified into the HTTP sub-request set and the TCP sub-request set according to the request types, the HTTP sub-request set is distributed to the first back-end service cluster by using a transmission protocol and a first return result returned by the first back-end service cluster is obtained, the TCP sub-request set is distributed to the second back-end service cluster by using the transmission protocol and a second return result returned by the second back-end service cluster is obtained, the split of one combined request into a plurality of sub-requests is realized, and the sub-requests of different types are sent to the corresponding back-end service centers to obtain the return results of the requests of different types, the synchronous response of different requests in the combined request is realized, the gradual response of the combined request is avoided, and the corresponding efficiency in the combined request is improved; and aggregating the first return result and the second return result into a total request result, sending the total request result to the caller, and aggregating the results returned by different sub-requests into the total request result, so that the request result is aggregated, and the efficiency of the caller for obtaining the combined request result is facilitated. Therefore, the combined communication request response method provided by the invention can track the state of the link node in the distributed system and improve the portability of the link tracking method.
Fig. 2 is a schematic block diagram of a combined communication request responding apparatus according to the present invention.
The combined communication request responding apparatus 100 according to the present invention may be installed in an electronic device. Depending on the implemented functionality, the combined communication request responding means may comprise a request splitting module 101, a classification module 102, a first request module 103, a second request module 104 and an aggregation module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the request splitting module 101 is configured to obtain a combined request of a caller, and split the combined request into a sub-request set;
in the embodiment of the present invention, the caller includes any computer or computer cluster that can perform computer communication, and the caller sends a communication request to other computers or computer clusters except the caller to implement communication between the caller and the other computers or computer clusters.
For example, there are a computer a and a computer B, and if the computer a sends a communication request to the computer B in order to acquire data in the computer B, the computer a is a caller.
In detail, the combined request is one of the communication requests, the combined request includes a plurality of communication requests, and the request types of the plurality of communication requests included in the combined request may be the same or different.
In particular, the request types of the communication request include, but are not limited to, HTTP requests and TCP requests.
In this embodiment of the present invention, the request splitting module 101 is specifically configured to:
traversing and identifying split characters in the combined request;
and splitting the combined request into a plurality of sub-requests according to the split characters, and collecting the sub-requests into a sub-request set.
In detail, the split character is a character used for separating different requests in the combined request, for example, there is a combined request of: request 1< request 2< request 3< request 4, where "<" is a split character used to separate the four requests in a combined request.
In particular, the split character may be given by the requestor.
In the embodiment of the present invention, traversing and identifying the split character in the combined request, and splitting the combined request into a plurality of sub-requests according to the split character, for example, the combined request includes: request 1< request 2< request 3< request 4, where "<" is a split character, the combined request may be split into request 1, request 2, request 3, and request 4 by the split character.
And collecting the sub-requests obtained by splitting the combined request to obtain a sub-request set.
The embodiment of the invention can split the combined request into a plurality of sub-requests by splitting the combined request, avoids sending the combined request to different gateway equipment for response, ensures that the sub-requests obtained by splitting can be processed simultaneously subsequently, and is beneficial to improving the efficiency of responding the combined request.
The classification module 102 is configured to classify the sub-request sets according to request types to obtain an HTTP sub-request set and a TCP sub-request set.
In an embodiment of the present invention, the classification module 102 is specifically configured to:
extracting a request type field of each sub-request in the sub-request set;
when the request type field is consistent with a preset standard HTTP request field, determining the request type of the sub-request to be an HTTP request;
and when the request type field is consistent with a preset standard TCP request field, determining that the request type of the sub-request is a TCP request.
In detail, the embodiment of the present invention may extract a request type field of each sub-request in the sub-request set by using a python statement having a field extraction function, where the request type field is a field carried in the sub-request and used for identifying a request type of the sub-request.
Specifically, the extracted request type field is compared with a preset standard HTTP request field and a preset standard TCP request field, when the request type field is consistent with the preset standard HTTP request field, the request type of the sub-request is determined to be an HTTP request, and when the request type field is consistent with the preset standard TCP request field, the request type of the sub-request is determined to be a TCP request.
The embodiment of the invention extracts the request type field of each sub-request in the sub-request set and classifies the sub-requests in the sub-request set according to the request type field, thereby being beneficial to the subsequent processing of responding to the sub-requests of different types.
The first request module 103 is configured to distribute the HTTP sub-request set to a first backend service cluster by using a preset transmission protocol, and obtain a first return result returned by the first backend service cluster.
In this embodiment of the present invention, the first request module 103 is specifically configured to:
acquiring HTTP transmission parameters;
compiling the HTTP transmission parameters into a first connection statement by using a preset transmission protocol;
establishing a short connection between the caller and the first back-end service cluster according to the first connection statement;
and distributing the HTTP sub-request set to a first back-end service cluster by using the short connection.
In detail, the embodiment of the present invention may utilize a python statement with a data fetching function to obtain the HTTP transmission parameters from a database for storing the HTTP transmission parameters, where the database includes, but is not limited to, a mysql database and an Oracle database.
In the embodiment of the present invention, the transmission protocol is a protocol for data transmission between computers, for example, a Telnet protocol, an FTP protocol, an SMTP protocol, an HTTP protocol, a DNS protocol, a TCP protocol, and the like.
Specifically, the transmission protocol includes a transmission rule of communication between user computers, HTTP transmission parameters can be compiled into a first connection statement according to the transmission rule, and the establishment of short connection between the caller and the first back-end service cluster can be realized by executing the first connection statement.
Further, the distributing the HTTP sub-request set to a first backend service cluster using the short connection includes:
extracting target request addresses of all HTTP sub-requests in the HTTP sub-request set;
acquiring a service address of each back-end service in the first back-end service cluster;
and sending each HTTP sub-request in the HTTP sub-request set to a back-end service with the service address same as the target request address by using the short connection.
In the embodiment of the invention, the target request address of each HTTP sub-request in the HTTP sub-request set and the service address of each backend service in the first backend service cluster can be extracted by using the pre-edited java statement.
After the target request address of each HTTP sub-request in the HTTP sub-request set and the service address of each back-end service in the first back-end service cluster are obtained, each HTTP sub-request in the HTTP sub-request set is sent to the back-end service with the same service address as the target request address by utilizing the short connection established between the caller and the first back-end service cluster, and a first return result returned by the first back-end service cluster is received.
The second request module 104 is configured to distribute the TCP sub-request set to a second back-end service cluster by using a preset transport protocol, and obtain a second return result returned by the second back-end service cluster.
In this embodiment of the present invention, the step of distributing the TCP sub-request set to the second backend service cluster by using the preset transmission protocol, and obtaining the second return result returned by the second backend service cluster is consistent with the step of distributing the HTTP sub-request set to the first backend service cluster by using the preset transmission protocol in the first request module 103, and obtaining the first return result returned by the first backend service cluster, which is not described herein again.
The aggregation module 105 is configured to aggregate the first return result and the second return result into a total request result, and send the total request result to the caller.
In an embodiment of the present invention, the aggregation module 105 is specifically configured to:
performing HTTP decoding on the first return result to obtain first decoding data;
performing TCP decoding on the second return result to obtain second decoding data;
uniformly coding the first decoding data and the second decoding data to obtain a total request result;
and sending the total request result to the caller.
In detail, in the embodiment of the present invention, an HTTP decoder may perform HTTP decoding on the first return result to obtain first decoded data, and a TCP decoder may perform TCP decoding on the second return result to obtain first decoded data, where the HTTP decoder includes an AC-3 decoder, an HDCD decoder, and the like, and the TCP decoder includes a DTS decoder, and the like.
Further, the uniformly encoding the first decoded data and the second decoded data to obtain a total request result includes:
obtaining a byte vector set corresponding to the first decoding data and the second decoding data, wherein the byte vector set comprises byte vectors of the first decoding data and the second decoding data;
respectively encoding byte vectors in byte vector sets corresponding to the first decoding data and the second decoding data to obtain encoded byte sets;
and splicing the encoding bytes in the encoding byte set to obtain a total request result.
In the embodiment of the invention, the byte vector sets corresponding to the first decoding data and the second decoding data can be obtained from the database in which the byte vector sets are stored in advance by utilizing the python statement with the data grabbing function.
In detail, a uniform encoder may be used to encode the byte vectors in the byte vector sets corresponding to the first decoded data and the second decoded data, respectively, to obtain encoded byte sets.
Because the obtained first return result and the second return result are obtained by sending different types of communication requests to different back-end service clusters, the data types of the first return result and the second return result may be inconsistent, and therefore, the embodiment of the present invention decodes the first return result and the second return result and then uniformly encodes the first return result and the second return result, so that the data types of the first return result and the second return result can be uniformly realized, so as to aggregate the first return result and the second return result into a total request result, and then send the total request result to the caller.
The combined request is divided into the sub-request sets by obtaining the combined request of a calling party, the sub-request sets are classified into the HTTP sub-request set and the TCP sub-request set according to the request types, the HTTP sub-request set is distributed to the first back-end service cluster by using a transmission protocol and a first return result returned by the first back-end service cluster is obtained, the TCP sub-request set is distributed to the second back-end service cluster by using the transmission protocol and a second return result returned by the second back-end service cluster is obtained, the split of one combined request into a plurality of sub-requests is realized, and the sub-requests of different types are sent to the corresponding back-end service centers to obtain the return results of the requests of different types, the synchronous response of different requests in the combined request is realized, the gradual response of the combined request is avoided, and the corresponding efficiency in the combined request is improved; and aggregating the first return result and the second return result into a total request result, sending the total request result to the caller, and aggregating the results returned by different sub-requests into the total request result, so that the request result is aggregated, and the efficiency of the caller for obtaining the combined request result is facilitated. Therefore, the combined communication request response device provided by the invention can track the state of the link node in the distributed system and improve the portability of the link tracking method.
Fig. 3 is a schematic structural diagram of an electronic device implementing a combined communication request response method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a combined communication request response program 12, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the combined communication request response program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., a combined communication request response program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 3 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The combined communication request response program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, may implement:
acquiring a combined request of a calling party, and splitting the combined request into sub-request sets;
classifying the sub-request sets according to request types to obtain HTTP sub-request sets and TCP sub-request sets;
distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol, and acquiring a first return result returned by the first back-end service cluster;
distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol, and acquiring a second return result returned by the second back-end service cluster;
and aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 3, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a combined request of a calling party, and splitting the combined request into sub-request sets;
classifying the sub-request sets according to request types to obtain HTTP sub-request sets and TCP sub-request sets;
distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol, and acquiring a first return result returned by the first back-end service cluster;
distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol, and acquiring a second return result returned by the second back-end service cluster;
and aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for responding to a combined communication request, the method comprising:
acquiring a combined request of a calling party, and splitting the combined request into sub-request sets;
classifying the sub-request sets according to request types to obtain HTTP sub-request sets and TCP sub-request sets;
distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol, and acquiring a first return result returned by the first back-end service cluster;
distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol, and acquiring a second return result returned by the second back-end service cluster;
and aggregating the first return result and the second return result into a total request result, and sending the total request result to the caller.
2. The combined communication request response method of claim 1, wherein said splitting the combined request into a set of sub-requests comprises:
traversing and identifying split characters in the combined request;
and splitting the combined request into a plurality of sub-requests according to the split characters, and collecting the sub-requests into a sub-request set.
3. The combined communication request response method according to claim 1, wherein said classifying the sub-request sets by request type comprises:
extracting a request type field of each sub-request in the sub-request set;
when the request type field is consistent with a preset standard HTTP request field, determining the request type of the sub-request to be an HTTP request;
and when the request type field is consistent with a preset standard TCP request field, determining that the request type of the sub-request is a TCP request.
4. The combined communication request response method according to claim 1, wherein the distributing the HTTP sub-request set to the first back-end service cluster using a preset transport protocol comprises:
acquiring HTTP transmission parameters;
compiling the HTTP transmission parameters into a first connection statement by using a preset transmission protocol;
establishing a short connection between the caller and the first back-end service cluster according to the first connection statement;
and distributing the HTTP sub-request set to a first back-end service cluster by using the short connection.
5. The combined communication request response method of claim 4, wherein said distributing the set of HTTP sub-requests to the first back-end service cluster using the short connection comprises:
extracting target request addresses of all HTTP sub-requests in the HTTP sub-request set;
acquiring a service address of each back-end service in the first back-end service cluster;
and sending each HTTP sub-request in the HTTP sub-request set to a back-end service with the service address same as the target request address by using the short connection.
6. The combined communication request response method according to any one of claims 1 to 5, wherein said aggregating the first return result and the second return result into an overall request result comprises:
performing HTTP decoding on the first return result to obtain first decoding data;
performing TCP decoding on the second return result to obtain second decoding data;
and uniformly coding the first decoding data and the second decoding data to obtain a total request result.
7. The combined communication request response method according to claim 6, wherein said uniformly encoding said first decoded data and said second decoded data to obtain an overall request result comprises:
obtaining a byte vector set corresponding to the first decoding data and the second decoding data, wherein the byte vector set comprises byte vectors of the first decoding data and the second decoding data;
respectively encoding byte vectors in byte vector sets corresponding to the first decoding data and the second decoding data to obtain encoded byte sets;
and splicing the encoding bytes in the encoding byte set to obtain a total request result.
8. A combined communication request response apparatus, characterized in that the apparatus comprises:
the request splitting module is used for acquiring a combined request of a calling party and splitting the combined request into a sub-request set;
the classification module is used for classifying the sub-request sets according to the request types to obtain HTTP sub-request sets and TCP sub-request sets;
the first request module is used for distributing the HTTP sub-request set to a first back-end service cluster by using a preset transmission protocol and acquiring a first return result returned by the first back-end service cluster;
the second request module is used for distributing the TCP sub-request set to a second back-end service cluster by using a preset transmission protocol and acquiring a second return result returned by the second back-end service cluster;
and the aggregation module is used for aggregating the first return result and the second return result into a total request result and sending the total request result to the caller.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the combined communication request response method of any of claims 1 to 7.
10. A computer-readable storage medium comprising a storage data area storing created data and a storage program area storing a computer program; wherein the computer program when executed by a processor implements the combined communication request response method according to any of claims 1 to 7.
CN202110719440.2A 2021-06-28 2021-06-28 Combined communication request response method and device, electronic equipment and readable storage medium Active CN113452703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110719440.2A CN113452703B (en) 2021-06-28 2021-06-28 Combined communication request response method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110719440.2A CN113452703B (en) 2021-06-28 2021-06-28 Combined communication request response method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113452703A true CN113452703A (en) 2021-09-28
CN113452703B CN113452703B (en) 2022-09-02

Family

ID=77813360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110719440.2A Active CN113452703B (en) 2021-06-28 2021-06-28 Combined communication request response method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113452703B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004002107A1 (en) * 2002-06-20 2003-12-31 Essential Viewing Limited Method, network, server and client for distributing data via a data communications network
CN102868608A (en) * 2012-09-04 2013-01-09 江苏大学 Message mechanism-based enterprise service bus system
CN103997509A (en) * 2013-02-20 2014-08-20 中国移动通信集团北京有限公司 Service oriented architecture-based service processing method and apparatus
CN109218339A (en) * 2017-06-29 2019-01-15 北京京东尚科信息技术有限公司 request processing method and device
US10374968B1 (en) * 2016-12-30 2019-08-06 EMC IP Holding Company LLC Data-driven automation mechanism for analytics workload distribution
CN110769027A (en) * 2019-09-10 2020-02-07 北京百度网讯科技有限公司 Service request processing method and device, computer equipment and storage medium
CN111935210A (en) * 2020-06-28 2020-11-13 平安银行股份有限公司 Data service method, device, server and storage medium
CN112667949A (en) * 2020-12-31 2021-04-16 苏州思必驰信息科技有限公司 Data processing method and device for front-end gateway

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004002107A1 (en) * 2002-06-20 2003-12-31 Essential Viewing Limited Method, network, server and client for distributing data via a data communications network
CN102868608A (en) * 2012-09-04 2013-01-09 江苏大学 Message mechanism-based enterprise service bus system
CN103997509A (en) * 2013-02-20 2014-08-20 中国移动通信集团北京有限公司 Service oriented architecture-based service processing method and apparatus
US10374968B1 (en) * 2016-12-30 2019-08-06 EMC IP Holding Company LLC Data-driven automation mechanism for analytics workload distribution
CN109218339A (en) * 2017-06-29 2019-01-15 北京京东尚科信息技术有限公司 request processing method and device
CN110769027A (en) * 2019-09-10 2020-02-07 北京百度网讯科技有限公司 Service request processing method and device, computer equipment and storage medium
CN111935210A (en) * 2020-06-28 2020-11-13 平安银行股份有限公司 Data service method, device, server and storage medium
CN112667949A (en) * 2020-12-31 2021-04-16 苏州思必驰信息科技有限公司 Data processing method and device for front-end gateway

Also Published As

Publication number Publication date
CN113452703B (en) 2022-09-02

Similar Documents

Publication Publication Date Title
CN112671921A (en) Data transmission method and device, electronic equipment and readable storage medium
CN112653760A (en) Cross-server file transmission method and device, electronic equipment and storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN112733531A (en) Virtual resource allocation method and device, electronic equipment and computer storage medium
CN113806434A (en) Big data processing method, device, equipment and medium
CN112702228A (en) Service current limiting response method and device, electronic equipment and readable storage medium
CN112464619B (en) Big data processing method, device and equipment and computer readable storage medium
CN114640707A (en) Message asynchronous processing method and device, electronic equipment and storage medium
CN113452703B (en) Combined communication request response method and device, electronic equipment and readable storage medium
CN115409041B (en) Unstructured data extraction method, device, equipment and storage medium
CN114598731B (en) Cluster log acquisition method, device, equipment and storage medium
CN115174555A (en) File transmission method and device, electronic equipment and storage medium
CN114840388A (en) Data monitoring method and device, electronic equipment and storage medium
CN114448930A (en) Short address generation method and device, electronic equipment and computer readable storage medium
CN114547011A (en) Data extraction method and device, electronic equipment and storage medium
CN114185588A (en) Incremental package generation method, device, equipment and storage medium
CN113918517A (en) Multi-type file centralized management method, device, equipment and storage medium
CN115002100B (en) File transmission method and device, electronic equipment and storage medium
CN115174698B (en) Market data decoding method, device, equipment and medium based on table entry index
CN113206843B (en) Network conference control method and device, electronic equipment and storage medium
CN113672483B (en) Device log storage method and device, electronic device and medium
CN116610465A (en) Event notification-based message sending method and device, electronic equipment and medium
CN112528332A (en) Data acquisition method and device, electronic equipment and computer storage medium
CN113868285A (en) Data reading method and device, electronic equipment and storage medium
CN114942855A (en) Interface calling method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant