CN113794771B - Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message - Google Patents
Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message Download PDFInfo
- Publication number
- CN113794771B CN113794771B CN202111074409.4A CN202111074409A CN113794771B CN 113794771 B CN113794771 B CN 113794771B CN 202111074409 A CN202111074409 A CN 202111074409A CN 113794771 B CN113794771 B CN 113794771B
- Authority
- CN
- China
- Prior art keywords
- message
- tcp request
- target
- request message
- service type
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/63—Routing a service request depending on the request content or context
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a transaction distribution method, a transaction distribution gateway and a device based on a TCP (Transmission control protocol) request. Therefore, on one hand, the transaction distribution gateway achieves the purpose of directly distributing the TCP request, and on the other hand, the transaction distribution gateway achieves the purpose of distributing the TCP request to the corresponding back-end system according to the characteristics of the TCP, so that the transaction processing service can be decoupled, and the system expansibility can be improved.
Description
Technical Field
The invention relates to the field of data, in particular to a transaction distribution method, a transaction distribution system and a transaction distribution method based on a TCP (Transmission control protocol) request.
Background
When different service systems communicate with each other, data interaction is usually performed in a message manner, and there are various types of message requests, for example: http requests, TCP requests, and the like, generally, different systems need to perform message interaction through a transaction distribution gateway, in the prior art, the transaction distribution gateway generally aims at http requests, rarely aims at TCP requests, and in the prior art, distribution of TCP requests according to a characteristic manner cannot be realized.
Disclosure of Invention
In view of this, the embodiment of the present invention discloses a transaction distribution method, a transaction distribution gateway and a device based on a TCP request, which achieve the purpose that the transaction distribution gateway directly distributes the TCP request on one hand, and achieve the purpose that the TCP request is distributed to a corresponding back-end system according to the characteristics of the TCP on the other hand.
The embodiment of the invention discloses a transaction distribution method based on a TCP (Transmission control protocol) request, which comprises the following steps:
after a TCP request message sent by a front-end system is received, analyzing the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message;
acquiring a target service type corresponding to the first characteristic of the TCP request message through a preset second configuration table;
and sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the analyzing the TCP request packet based on the preset first configuration table to obtain the characteristics of the TCP request packet includes:
acquiring the format of the TCP request message;
acquiring a first characteristic corresponding to the format of the TCP request message based on the first configuration table;
the first configuration table includes a correspondence between a message format and a first characteristic.
Optionally, the obtaining, by using a preset second configuration table, a target service type corresponding to a feature of the TCP request packet includes:
determining a candidate service type corresponding to the first characteristic based on the preset second configuration table;
judging whether the first characteristic meets the distribution rule of the candidate service type or not according to the priority of the candidate service when a plurality of candidate service types exist;
when the TCP request message is detected to meet a first candidate service type, taking the first candidate service type as a target service type; the first candidate service type is any one of the candidate service types.
Optionally, the sending the TCP request packet to the backend system corresponding to the target service type includes:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue and sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the method further includes:
acquiring first identification information of a front-end system which sends the TCP message;
recording the first characteristic and the first identification information.
Optionally, the method further includes:
after receiving a feedback message sent by a back-end system, analyzing the feedback message based on a preset first configuration table to obtain a second characteristic of the feedback message;
acquiring a target front-end system corresponding to the second characteristic;
and sending the second message to the target front-end system.
Optionally, the sending the second packet to the front-end system includes:
writing the second message into a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
Optionally, the method further includes:
acquiring a first target communication mode and a first parameter of a back-end system corresponding to the target type from a preset third configuration table;
and establishing connection with the back-end system through the first target communication mode and the first parameter.
Optionally, the method further includes:
when a request for establishing connection sent by a target system is received, acquiring a second target communication mode and a second parameter which are adapted to the target system from a preset third configuration file; the target system is a front-end system or a back-end system, and the second parameter is a parameter required for establishing communication connection with the target system;
and establishing connection with the target system through the second target communication mode and the second parameter.
The embodiment of the invention discloses a transaction distribution gateway, which comprises:
the device comprises a front-end processing module and a rear-end processing module;
the front-end processing module is used for receiving a TCP request message sent by a front-end system, analyzing the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message, and acquiring a target service type corresponding to the characteristic of the TCP request message through a preset second configuration table;
and the back-end processing module is used for sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the front-end processing module includes a plurality of thread pools, and each thread pool is configured to process a TCP request packet sent by a front-end system or a packet received by the front-end system.
Optionally, the backend system includes a plurality of thread pools, and each thread pool is configured to process a packet sent by one backend system or a received TCP request packet.
Optionally, the front-end processing module is further configured to:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue, and sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the back-end processing module is further configured to:
after a second message fed back by a back-end system is received, analyzing the second message based on a preset first configuration table to obtain the characteristics of the second message;
acquiring a target front-end system corresponding to the characteristics of the second message;
and sending the second message to the target front-end system.
Optionally, the backend system further includes:
sending the second message to a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
The embodiment of the invention discloses a transaction distribution device based on a TCP (Transmission control protocol) request, which comprises:
the analysis unit is used for analyzing the TCP request message based on a preset first configuration table after receiving the TCP request message sent by the front-end system, so as to obtain a first characteristic of the TCP request message;
an obtaining unit, configured to obtain, through a preset second configuration table, a target service type corresponding to a feature of the TCP request packet;
and the sending unit is used for sending the TCP request message to a back-end system corresponding to the target service type.
The embodiment of the invention discloses a transaction distribution method, a transaction distribution gateway and a device based on a TCP (Transmission control protocol) request. Therefore, on one hand, the transaction distribution gateway achieves the purpose of directly distributing the TCP request, and on the other hand, the transaction distribution gateway achieves the purpose of distributing the TCP request to the corresponding back-end system according to the characteristics of the TCP, so that the transaction processing service can be decoupled, and the system expansibility can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating a transaction distribution method based on TCP requests according to embodiment 1 of the present invention;
fig. 2 is a schematic flowchart illustrating a transaction distribution method based on a TCP request packet according to embodiment 2 of the present invention;
fig. 3 is a schematic structural diagram of a transaction distribution gateway provided in an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a transaction distribution gateway for performing transaction distribution according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram illustrating a transaction distribution apparatus based on TCP requests according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1
Referring to fig. 1, a schematic flowchart of a transaction distribution method based on a TCP request according to an embodiment of the present invention is shown, in this embodiment, the method includes:
s101: after a TCP request message sent by a front-end system is received, analyzing the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message;
in this embodiment, the first configuration table includes: the corresponding relation between the message format and the message characteristics; wherein, the message characteristics can be represented as message domain information.
The message characteristics in the first configuration table may be a single domain or a combined domain, where the combined domain represents a result of combining multiple domains, and which domain information is specifically adopted may be set based on a requirement.
The process of analyzing the TCP request packet based on the preset first configuration table includes:
acquiring the format of the TCP request message;
acquiring a first characteristic corresponding to the format of the TCP request message based on the first configuration table;
the first configuration table includes a correspondence between a message format and a first characteristic.
By way of example: referring to table 1, for one example of a first configuration table:
the domain corresponding to the message format 8583 is a combined domain, and the characteristics of the message format json are for a single domain.
In this embodiment, the transaction gateway may receive many TCP request packets at the same time, and in order to ensure that each request can be processed in time, in this embodiment, data is processed in a multi-thread manner, specifically, S101 includes:
after receiving a TCP request message sent by a front-end system, a first target thread in a first thread pool analyzes the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message.
S102: acquiring a target service type corresponding to the first characteristic of the TCP request message through a preset second configuration table;
in this embodiment, the preset second configuration table includes: and the corresponding relation between the TCP request message characteristics and the service types.
In this embodiment, characteristics of a TCP request packet may correspond to multiple service types, and further determination is required to uniquely determine the service type corresponding to the characteristics of the TCP request packet, specifically, S102 includes:
determining a candidate service type corresponding to the characteristics of the TCP request message based on the preset second configuration table;
when a plurality of candidate service types exist, judging whether the first characteristic meets the distribution rule of the candidate service types or not according to the priority of the candidate service;
and when the TCP request message is detected to meet a first candidate service type, taking the first candidate service type as a target service type.
In order to determine the target service type of the TCP request packet pair through the above steps, in this embodiment, the second configuration table includes: system identification, characteristics of TCP request messages, service types, distribution rules and matching priority.
Wherein the system identification is information that uniquely characterizes a certain system.
By way of example: as shown in table 2 below, the second configuration table includes:
further, the method also comprises the following steps:
after a target thread in the first thread pool reads a TCP request message, analyzing the TCP request message based on a preset first configuration table;
and the target thread acquires a target service type corresponding to the characteristics of the TCP request message through a preset second configuration table.
S103: and sending the TCP request message to a back-end system corresponding to the target service type.
In this embodiment, the method for sending the TCP request packet to the backend system corresponding to the target service type includes multiple types, which is not limited in this embodiment.
In this embodiment, a number of TCP request packets that need to be sent to a backend system corresponding to a target service type may be included, and in order to enable all TCP request packets to be executed in order, preferably, S103 includes:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue and sending the TCP request message to a back-end system corresponding to the target service type.
Specifically, S103 includes:
a first target thread in a first thread pool writes the TCP request message into a first message queue corresponding to the target service type;
and a second target thread in the second thread pool reads the first target message queue from the first message queue and sends the read TCP request message to a back-end system corresponding to the target type.
It should be noted that the TCP request message is a request message.
In this embodiment, the first characteristic of the TCP request packet is obtained by analyzing the TCP request packet, and the target service type matched with the first characteristic is obtained based on the preset second configuration table, so that the TCP request packet is sent to the backend system that processes the target service type. Therefore, on one hand, the transaction distribution gateway achieves the purpose of directly distributing the TCP request, and on the other hand, the transaction distribution gateway achieves the purpose of distributing the TCP request to the corresponding back-end system according to the characteristics of the TCP, so that the transaction processing service can be decoupled, and the system expansibility can be improved.
In addition, in order to ensure the consistency of message interaction between the front-end system and the back-end system, that is, to ensure that the message fed back by the back-end system can be fed back to the corresponding front-end system, the method further comprises the following steps:
acquiring first identification information of a front-end system which sends the TCP request message;
recording the first characteristic and the first identification information.
The first identification information is related information representing a front-end system.
By way of example: the first identification information and the first feature may be expressed in terms of a key: and writing a value into the cache, wherein the key represents the characteristic, and the value represents the identification information of the front-end system.
In this embodiment, different systems have different communication modes, and in order to adapt to the communication modes of different front-end systems and back-end systems, when the transaction gateway performs packet interaction with the front-end system or the back-end system, the transaction gateway supports multiple communication modes, specifically, the communication modes of the transaction distribution gateway with the front-end system and the back-end system may be preconfigured, so as to perform communication with the front-end system or the back-end system according to the preconfigured communication modes, specifically, sending the TCP request packet to the back-end system corresponding to the target service type further includes:
acquiring a first target communication mode and a first parameter of a back-end system corresponding to the target type;
and establishing connection with the back-end system through the first target communication mode and the first parameter.
The first parameters are all parameters needed by the back-end system corresponding to the target type to establish connection.
Or:
when a request for establishing connection sent by a target system is received, acquiring a second target communication mode and a second parameter adapted to the target system; the target system is a front-end system or a back-end system, and the second parameter is a parameter required for establishing communication connection with the target system;
and establishing connection with the target system through the second target communication mode and the second parameter.
In addition, different front-end systems and back-end systems have upper limits of traffic, and when the upper limit of the traffic is reached and then the traffic limit is reached, the request is discarded.
The detection of whether the flow limitation is satisfied may be performed before the TCP request packet is sent to the backend system when the TCP request packet sent by the front-end system is received.
In this embodiment, in order to implement the detection of the communication connection and the flow restriction, a third configuration table is preset, and the third configuration table includes: information about parameters and flow restrictions for establishing connections with different systems, for example, the following table 3 shows an example of a third configuration table:
example 2:
referring to fig. 2, a schematic flow chart of a transaction distribution method based on a TCP request packet according to embodiment 2 of the present invention is shown, in this embodiment, the method includes:
s201: after receiving a feedback message sent by a back-end system, analyzing the feedback message based on a preset first configuration table to obtain a second characteristic of the feedback message;
wherein the first configuration table comprises: the corresponding relation of message format and characteristics.
S202: acquiring a target front-end system corresponding to the second characteristic;
in this embodiment, the method for acquiring the target front-end system corresponding to the second characteristic includes multiple methods, which are not limited in this embodiment.
As can be seen from the above description, before the TCP request packet is sent to the back-end system, the characteristics of the TCP request packet and the identification information of the front-end system that sent the TCP request packet are recorded, and then the information is based on the pre-recorded information.
It should be noted that the characteristics of the interactive messages between the front-end system and the back-end system are the same, and then the characteristics of the TCP request message sent by the front-end system and the feedback message sent by the back-end system are the same, so that the target front-end system receiving the feedback message can be determined based on the relationship between the characteristics of the TCP request message and the identification information of the front-end system, which are recorded in advance.
S203: and sending the second message to the target front-end system.
In this embodiment, in order to improve efficiency and improve throughput, S203 includes:
sending the second message to a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
In this embodiment, after receiving a feedback message sent by a backend system, analyzing the feedback message based on a preset first configuration table to obtain a second characteristic of the feedback message; acquiring a target front-end system corresponding to the second characteristic; and sending the second message to the target front-end system. Therefore, the purpose of returning the original path of the message fed back by the back-end system to the front-end system is achieved.
Example 3:
referring to fig. 3, a schematic structural diagram of a transaction distribution gateway provided in an embodiment of the present invention is shown, and in this embodiment, the transaction distribution gateway includes:
a front-end processing module 301 and a back-end processing module 302;
the front-end processing module is used for receiving a TCP request message sent by a front-end system, analyzing the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message, and acquiring a target service type corresponding to the characteristic of the TCP request message through a preset second configuration table;
and the back-end processing module is used for sending the TCP request message to a back-end system corresponding to the target service type.
The front-end processing module comprises a plurality of thread pools, and each thread pool is used for processing a TCP request message sent by a front-end system or a message received by the front-end system.
Optionally, the backend system includes a plurality of thread pools, and each thread pool is configured to process a packet sent by one backend system or a received TCP request packet.
Optionally, the front-end processing module is further configured to:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue, and sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the back-end processing module is further configured to:
after a second message fed back by a back-end system is received, analyzing the second message based on a preset first configuration table to obtain the characteristics of the second message;
acquiring a target front-end system corresponding to the characteristics of the second message;
and sending the second message to the target front-end system.
Optionally, the backend system further includes:
sending the second message to a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
Optionally, the method further includes:
when the front-end processing module receives a request for establishing connection sent by a front-end system, acquiring a second target communication mode and a second parameter adaptive to a target system from a preset third configuration file;
and establishing connection with the front-end system through the second target communication mode and the second parameters.
Optionally, the method further includes:
the back-end system acquires a first target communication mode and a first parameter of the back-end system corresponding to the target type;
and establishing connection with the back-end system through the first target communication mode and the first parameter.
Example 4:
referring to fig. 4, a schematic diagram of a transaction distribution gateway for performing transaction distribution according to an embodiment of the present invention is shown, and in this embodiment, the transaction distribution gateway includes:
the transaction distribution gateway includes: a front-end processing module and a back-end processing module;
for the front-end processing module:
the configuration of each system in the third configuration table in the front-end processing module corresponds to two thread pools, one thread pool is responsible for reading requests, and the other thread pool is responsible for writing requests.
The front-end processing module processing mechanism comprises:
after receiving a connection request sent by a front-end system, the front-end processing module acquires a communication connection mode and related parameters based on a preset third configuration table;
establishing TCP connection to a front-end system based on the communication connection mode and the related parameters;
wherein, the TCP connection includes: long connections and short connections.
After receiving a TCP request message sent by a front-end system, a front-end processing module analyzes the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message;
acquiring a target service type corresponding to the first characteristic of the TCP request message through a preset second configuration table;
writing the TCP request message into a first message queue corresponding to the target service type;
for example, the following steps are carried out: as shown in fig. 4, if the characteristics of the request message sent by the first front-end system satisfy the distribution rule of the class a service, the request message sent by the first front-end system is sent to the message queue corresponding to the class a service, and if the characteristics of the request message sent by the first front-end system satisfy the distribution rule of the class B service, the request message sent by the first front-end system is sent to the message queue corresponding to the class B service; and if the characteristics of the request message sent by the second front-end system meet the distribution rule of the AA-type service, sending the request message sent by the second front-end system to a message queue corresponding to the A-type service, and if the characteristics of the request message sent by the second front-end system meet the distribution rule of the C-type service, sending the request message sent by the second front-end system to a message queue corresponding to the C-type service.
For the back-end processing module:
specifically, for each configuration of the system in the third configuration table, two thread pools are corresponding, one thread pool is responsible for a read request, and the other thread pool is responsible for a write request. Thus, two thread pools are configured in the back-end processing module for each back-end system, one thread pool being responsible for read requests and one thread pool being responsible for write requests.
The processing mechanism of the back-end processing module:
and the back-end processing module reads the TCP request message from the first message queue and sends the TCP request message to a back-end system corresponding to the target service type.
The method comprises the steps that before a TCP request is sent to a back-end system corresponding to a target service type, the back-end system obtains a first target communication mode and a first parameter of the back-end system corresponding to the target type from a preset third configuration table; establishing connection with the back-end system through the first target communication mode and the first parameter; and establishing connection with the back-end system through the first target communication mode and the first parameter.
For example, the following steps are carried out: the back-end system corresponding to the type A service and the type C service supports TCP connection, the back-end system corresponding to the type B service supports HTTP connection, and different parameters are adopted to connect with the back-end system based on the corresponding parameters and the connection mode under different connection modes of different back-end systems.
In addition, when the back-end system feeds back the message to the front-end system:
the back-end system analyzes the feedback message based on a preset first configuration table to obtain a second characteristic of the feedback message, and a target front-end system corresponding to the second characteristic is obtained;
writing the feedback message into a second message queue corresponding to the target front-end system;
and the front-end processing module reads the feedback message from the second message queue and sends the feedback message to the front-end system.
For example, the following steps are carried out: as shown in fig. 4: the message fed back to the first front end is written into a message queue corresponding to the first front end, and the message fed back to the second front end is written into a message queue corresponding to the second front end.
Example 5:
referring to fig. 5, a schematic structural diagram of a transaction distribution apparatus based on TCP request according to an embodiment of the present invention is shown, in this embodiment, the apparatus includes:
a first parsing unit 501, configured to, after receiving a TCP request packet sent by a front-end system, parse the TCP request packet based on a preset first configuration table to obtain a first feature of the TCP request packet;
a first obtaining unit 502, configured to obtain, through a preset second configuration table, a target service type corresponding to a characteristic of the TCP request packet;
a first sending unit 503, configured to send the TCP request packet to a backend system corresponding to the target service type.
Optionally, the first parsing unit includes:
a first obtaining subunit, configured to obtain a format of the TCP request packet;
a second obtaining subunit, configured to obtain, based on the first configuration table, a first feature corresponding to a format of the TCP request packet;
the first configuration table includes a correspondence between a message format and a first characteristic.
Optionally, the obtaining unit includes:
a first determining subunit, configured to determine, based on the preset second configuration table, a candidate service type corresponding to the first feature;
the judging subunit is configured to, when multiple candidate service types exist, judge whether the first feature satisfies a distribution rule of the candidate service type according to a priority of the candidate service;
a second determining subunit, configured to, when it is detected that the TCP request packet satisfies a first candidate service type, take the first candidate service type as a target service type; the first candidate service type is any one of the candidate service types.
Optionally, the sending unit includes:
a first writing subunit, configured to write the TCP request packet into a first message queue corresponding to the target service type;
and the reading and sending subunit is used for reading the TCP request message in the first message queue and sending the TCP request message to a back-end system corresponding to the target service type.
Optionally, the method further includes:
the second acquisition unit is used for acquiring first identification information of a front-end system which sends the TCP message;
and the recording unit is used for recording the first characteristic and the first identification information.
Optionally, the method further includes:
the second analysis unit is used for analyzing the feedback message based on a preset first configuration table after receiving the feedback message sent by the back-end system, so as to obtain a second characteristic of the feedback message;
the third acquisition unit is used for acquiring a target front-end system corresponding to the second characteristic;
and the second sending unit is used for sending the second message to the target front-end system.
Optionally, the second sending unit includes:
the second writing subunit is configured to write the second packet into a second message queue corresponding to the target front-end system;
and the second reading subunit is configured to read a second packet in the second message queue, and send the second packet to the target front-end system.
Optionally, the method further includes:
a first connecting unit for
Acquiring a first target communication mode and a first parameter of a back-end system corresponding to the target type from a preset third configuration table;
and establishing connection with the back-end system through the first target communication mode and the first parameter.
Optionally, the method further includes:
a second connection unit for:
when a request for establishing connection sent by a target system is received, a second target communication mode and a second parameter adaptive to the target system are obtained from a preset third configuration file; the target system is a front-end system or a back-end system, and the second parameter is a parameter required for establishing communication connection with the target system;
and establishing connection with the target system through the second target communication mode and the second parameter.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (14)
1. A transaction distribution method based on TCP requests is characterized by comprising the following steps:
after a TCP request message sent by a front-end system is received, analyzing the TCP request message based on a preset first configuration table to obtain a first characteristic of the TCP request message;
acquiring a target service type corresponding to the first characteristic of the TCP request message through a preset second configuration table;
sending the TCP request message to a back-end system corresponding to the target service type;
analyzing the TCP request message based on a preset first configuration table to obtain the characteristics of the TCP request message, wherein the analyzing comprises the following steps:
acquiring the format of the TCP request message;
acquiring a first characteristic corresponding to the format of the TCP request message based on the first configuration table;
the first configuration table comprises a corresponding relation between a message format and a first characteristic;
the obtaining, by using a preset second configuration table, a target service type corresponding to a characteristic of the TCP request packet includes:
determining a candidate service type corresponding to the first characteristic based on the preset second configuration table;
judging whether the first characteristic meets the distribution rule of the candidate service type or not according to the priority of the candidate service when a plurality of candidate service types exist;
when the TCP request message is detected to meet a first candidate service type, taking the first candidate service type as a target service type; the first candidate service type is any one of the candidate service types.
2. The method according to claim 1, wherein the sending the TCP request packet to the backend system corresponding to the target service type includes:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue and sending the TCP request message to a back-end system corresponding to the target service type.
3. The method of claim 1, further comprising:
acquiring first identification information of a front-end system which sends the TCP request message;
recording the first characteristic and the first identification information.
4. The method of claim 1, further comprising:
after a second message fed back by a back-end system is received, analyzing the second message based on a preset first configuration table to obtain a second characteristic of the second message;
acquiring a target front-end system corresponding to the second characteristic;
and sending the second message to the target front-end system.
5. The method of claim 4, wherein sending the second message to the head-end system comprises:
writing the second message into a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
6. The method of claim 1, further comprising:
acquiring a first target communication mode and a first parameter of a back-end system corresponding to the target service type from a preset third configuration table;
and establishing connection with the back-end system through the first target communication mode and the first parameter.
7. The method of claim 1, further comprising:
when a request for establishing connection sent by a target system is received, acquiring a second target communication mode and a second parameter which are adapted to the target system from a preset third configuration file; the target system is a front-end system or a back-end system, and the second parameter is a parameter required for establishing communication connection with the target system;
and establishing connection with the target system through the second target communication mode and the second parameter.
8. A transaction distribution gateway, comprising:
the front-end processing module and the back-end processing module;
the front-end processing module is used for analyzing a TCP request message sent by a front-end system based on a preset first configuration table to obtain a first characteristic of the TCP request message, and acquiring a target service type corresponding to the characteristic of the TCP request message through a preset second configuration table;
the back-end processing module is used for sending the TCP request message to a back-end system corresponding to the target service type;
analyzing the TCP request message based on a preset first configuration table to obtain the characteristics of the TCP request message, wherein the analyzing comprises the following steps:
acquiring the format of the TCP request message;
acquiring a first characteristic corresponding to the format of the TCP request message based on the first configuration table;
the first configuration table comprises a corresponding relation between a message format and a first characteristic;
the obtaining, by a preset second configuration table, a target service type corresponding to a characteristic of the TCP request packet includes:
determining a candidate service type corresponding to the first characteristic based on the preset second configuration table;
judging whether the first characteristic meets the distribution rule of the candidate service type or not according to the priority of the candidate service when a plurality of candidate service types exist;
when the TCP request message is detected to meet a first candidate service type, taking the first candidate service type as a target service type; the first candidate service type is any one of the candidate service types.
9. The transaction distribution gateway of claim 8, wherein the front-end processing module comprises a plurality of thread pools, each thread pool being configured to process a TCP request packet sent by a front-end system or a packet received by a front-end system.
10. The transaction distribution gateway of claim 8, wherein the backend system comprises a plurality of thread pools, each thread pool configured to process a packet sent by one backend system or a received TCP request packet.
11. The transaction distribution gateway of claim 8, wherein the front-end processing module is further configured to:
writing the TCP request message into a first message queue corresponding to the target service type;
and reading the TCP request message in the first message queue and sending the TCP request message to a back-end system corresponding to the target service type.
12. The transaction distribution gateway of claim 8, wherein the back-end processing module is further configured to:
after a second message fed back by a back-end system is received, analyzing the second message based on a preset first configuration table to obtain the characteristics of the second message;
acquiring a target front-end system corresponding to the characteristics of the second message;
and sending the second message to the target front-end system.
13. The transaction distribution gateway of claim 12, wherein the backend system is further configured to:
sending the second message to a second message queue corresponding to the target front-end system;
and reading a second message in the second message queue, and sending the second message to the target front-end system.
14. A transaction distribution apparatus based on TCP request, comprising:
the analysis unit is used for analyzing the TCP request message based on a preset first configuration table after receiving the TCP request message sent by a front-end system, so as to obtain a first characteristic of the TCP request message;
an obtaining unit, configured to obtain, through a preset second configuration table, a target service type corresponding to a first feature of the TCP request packet;
a sending unit, configured to send the TCP request packet to a backend system corresponding to the target service type;
the analyzing the TCP request message based on the preset first configuration table to obtain the characteristics of the TCP request message includes:
acquiring the format of the TCP request message;
acquiring a first characteristic corresponding to the format of the TCP request message based on the first configuration table;
the first configuration table comprises a corresponding relation between a message format and a first characteristic;
the obtaining, by a preset second configuration table, a target service type corresponding to a characteristic of the TCP request packet includes:
determining a candidate service type corresponding to the first characteristic based on the preset second configuration table;
judging whether the first characteristic meets the distribution rule of the candidate service type or not according to the priority of the candidate service when a plurality of candidate service types exist;
when the TCP request message is detected to meet a first candidate service type, taking the first candidate service type as a target service type; the first candidate service type is any one of the candidate service types.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111074409.4A CN113794771B (en) | 2021-09-14 | 2021-09-14 | Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111074409.4A CN113794771B (en) | 2021-09-14 | 2021-09-14 | Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113794771A CN113794771A (en) | 2021-12-14 |
CN113794771B true CN113794771B (en) | 2023-01-20 |
Family
ID=79183289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111074409.4A Active CN113794771B (en) | 2021-09-14 | 2021-09-14 | Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113794771B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327939A (en) * | 2021-12-21 | 2022-04-12 | 中国农业银行股份有限公司 | Message distribution method and device, electronic equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106533973A (en) * | 2016-11-04 | 2017-03-22 | 华为技术有限公司 | Method and system for distributing service message, and equipment |
CN107493254A (en) * | 2016-06-12 | 2017-12-19 | 中兴通讯股份有限公司 | The methods, devices and systems of TCP message forwarding |
CN109246188A (en) * | 2018-08-03 | 2019-01-18 | 银联数据服务有限公司 | A method of supporting the system traded by all kinds of means and by all kinds of means trading processing |
CN110147984A (en) * | 2019-04-28 | 2019-08-20 | 中国银行股份有限公司 | A kind of business transmission target processing method and processing device |
CN110336702A (en) * | 2019-07-11 | 2019-10-15 | 上海金融期货信息技术有限公司 | A kind of system and implementation method of message-oriented middleware |
CN110392066A (en) * | 2018-04-16 | 2019-10-29 | 华为技术有限公司 | A kind of method and apparatus of access service |
-
2021
- 2021-09-14 CN CN202111074409.4A patent/CN113794771B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107493254A (en) * | 2016-06-12 | 2017-12-19 | 中兴通讯股份有限公司 | The methods, devices and systems of TCP message forwarding |
CN106533973A (en) * | 2016-11-04 | 2017-03-22 | 华为技术有限公司 | Method and system for distributing service message, and equipment |
CN110392066A (en) * | 2018-04-16 | 2019-10-29 | 华为技术有限公司 | A kind of method and apparatus of access service |
CN109246188A (en) * | 2018-08-03 | 2019-01-18 | 银联数据服务有限公司 | A method of supporting the system traded by all kinds of means and by all kinds of means trading processing |
CN110147984A (en) * | 2019-04-28 | 2019-08-20 | 中国银行股份有限公司 | A kind of business transmission target processing method and processing device |
CN110336702A (en) * | 2019-07-11 | 2019-10-15 | 上海金融期货信息技术有限公司 | A kind of system and implementation method of message-oriented middleware |
Also Published As
Publication number | Publication date |
---|---|
CN113794771A (en) | 2021-12-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10116791B2 (en) | Methods and apparatus for transmitting data | |
US7113774B2 (en) | System and method of providing mobile phone broadcasting service utilizing CBS | |
US20100009655A1 (en) | Prompt method and apparatus of short message splitting | |
RU2005120695A (en) | LIGHTED INPUT / OUTPUT PROTOCOL | |
CN102665109A (en) | Transmitting and receiving method of multimedia video data and corresponding devices | |
CN102036058A (en) | Method, server, terminal and system for switching videos in video monitoring system | |
CN109963171A (en) | Transmitting of Multi-media Information method, transmission device and storage medium | |
CN104883618A (en) | Method, device, and system for tentatively watching living programs | |
CN113794771B (en) | Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message | |
CN108228625B (en) | Push message processing method and device | |
US20090222890A1 (en) | Method and apparatus for providing streaming service based on p2p and streaming service system using the same | |
JP2008311947A (en) | Contents distribution system, contents server, terminal, contents distribution method, program and recording medium | |
CN113225570B (en) | Playing processing method based on global virtual data view and related equipment | |
CN114827533A (en) | Method and device for playing video stream of security camera device in webpage | |
CN115002083A (en) | Method, equipment and storage medium for transmitting real-time streaming media data | |
CN102025730B (en) | Data transmission device based on HTTP protocol and implementation method thereof | |
CN111064768B (en) | Printer data transmission control method, device, equipment and storage medium | |
US20140032744A1 (en) | Method of comparing outputs in a plurality of information systems | |
CN109586979B (en) | Message transmission method and device | |
CN110471776B (en) | Application data communication method, device and system | |
CN111726260B (en) | Method, device and system for testing format conversion of network request reply information | |
CN111083067B (en) | Method and device for splicing data streams, storage medium and terminal equipment | |
CN104348701A (en) | Method and device for performing file transmission in instant communication tool | |
CN102523485A (en) | Information distribution method and system | |
KR100979873B1 (en) | Method and apparatus for providing a personalized advertisement to a user's mobile communication terminal by using a wireless network |
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 |