Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message

文档序号:1966033 发布日期:2021-12-14 浏览:28次 中文

阅读说明:本技术 基于tcp请求报文的交易分发方法、交易分发网关和装置 (Transaction distribution method, transaction distribution gateway and device based on TCP (Transmission control protocol) request message ) 是由 罗丹 陈玮 李靖 马金秀 于 2021-09-14 设计创作,主要内容包括:本发明公开了一种基于TCP请求的交易分发方法、交易分发网关和装置,通过对TCP请求报文进行解析,得到TCP请求报文的第一特征,并基于预设的第二配置表获取与该第一特征相匹配的目标业务类型,从而将该TCP请求报文发送到处理目标业务类型的后端系统。由此,一方面实现了交易分发网关对TCP请求进行直接分发的目的,另一方面实现了按照TCP的特征将TCP请求分发给对应的后端系统的目的,由此可以实现交易处理服务的解耦,提升系统扩展性。(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.)

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;

and sending the TCP request message to a back-end system corresponding to the target service type.

2. The method according to claim 1, wherein the parsing the TCP request packet based on a 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.

3. The method according to claim 1, wherein the obtaining, through 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.

4. 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.

5. The method of claim 1, further comprising:

acquiring first identification information of a front-end system which sends the TCP message;

recording the first characteristic and the first identification information.

6. The method of claim 1, further comprising:

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.

7. The method of claim 6, 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.

8. 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 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.

9. The method of claim 1, further comprising:

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.

10. A transaction distribution gateway, comprising:

the front-end processing module and the back-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.

11. The transaction distribution gateway of claim 10, 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.

12. The transaction distribution gateway of claim 10, wherein the backend system comprises a plurality of thread pools, each thread pool for processing a packet sent by a backend system or a received TCP request packet.

13. The transaction distribution gateway of claim 10, 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.

14. The transaction distribution gateway of claim 10, 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.

15. The transaction distribution gateway of claim 14, 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.

16. 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 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.

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, 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.

The embodiment of the invention discloses a transaction distribution gateway, which comprises:

the front-end processing module and the back-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 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 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 flow diagram 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.

For example, the following steps are carried out: 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;

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;

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.

For example, the following steps are carried out: 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 methods, which are 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.

For example, the following steps are carried out: 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 different communication modes of a front-end system and a back-end system, 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 and 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 an upper limit on traffic, and when the upper limit on traffic is reached, the traffic limit is reached, and 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, as shown in table 3 below, 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, where 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 includes: the corresponding relation between the message format and the 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 messages interacted between the front-end system and the back-end system are the same, and then the characteristics of the message requesting TCP 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 pre-recorded characteristics of the TCP request message and the identification information of the front-end system.

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, a second target communication mode and a second parameter adaptive to a target system are obtained 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 packet sent by the first front-end system satisfy the distribution rule of the class a service, the request packet 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 packet sent by the first front-end system satisfy the distribution rule of the class B service, the request packet 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 one 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.

Before sending the TCP request to a back-end system corresponding to a target service type, the back-end system acquires 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 feature 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:

the first acquiring subunit is used for acquiring the format of the TCP request message;

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.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种远程访问终端设备内置页面的方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类