CN114157714A - Method, system and storage device for realizing financial system protocol communication based on Netty - Google Patents

Method, system and storage device for realizing financial system protocol communication based on Netty Download PDF

Info

Publication number
CN114157714A
CN114157714A CN202111452107.6A CN202111452107A CN114157714A CN 114157714 A CN114157714 A CN 114157714A CN 202111452107 A CN202111452107 A CN 202111452107A CN 114157714 A CN114157714 A CN 114157714A
Authority
CN
China
Prior art keywords
request
protocol
target
message
service parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111452107.6A
Other languages
Chinese (zh)
Other versions
CN114157714B (en
Inventor
张汀勇
叶章明
侯祥钦
刘元
陈天宇
郑建华
林杰
王敏力
林东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Bosi Digital Technology Co ltd
Original Assignee
Fujian Bosi Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Bosi Digital Technology Co ltd filed Critical Fujian Bosi Digital Technology Co ltd
Priority to CN202111452107.6A priority Critical patent/CN114157714B/en
Publication of CN114157714A publication Critical patent/CN114157714A/en
Application granted granted Critical
Publication of CN114157714B publication Critical patent/CN114157714B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets

Abstract

The invention relates to the technical field of financial systems, in particular to a method, a system and storage equipment for realizing financial system protocol communication based on Netty. The method for realizing the financial system protocol communication based on the Netty comprises the following steps: acquiring a request side protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target side protocol; sending a message to a target side according to different request modes; and returning the acquired response according to the request side protocol. By the method, when the types of the target side protocol and the request side protocol are different, the target side protocol and the request side protocol can also carry out mutual conversion, including mutual conversion between the ISO protocol and the http protocol, and when the target side protocol and the request side protocol are the same protocol, decoding is not needed due to the corresponding relation between the target protocol and the container, so that the message is not bloated.

Description

Method, system and storage device for realizing financial system protocol communication based on Netty
Technical Field
The invention relates to the technical field of financial systems, in particular to a method, a system and storage equipment for realizing financial system protocol communication based on Netty.
Background
A communication protocol commonly used in an ISO system in a financial system is a non-plaintext ASCII or binary message, and is developed through common Socket communication, which is mainly based on a blocking io (blocking io) code (or frame) -referred to as BIO in the following; or Non-blocking IO (Non-blocking IO) -hereinafter referred to as NIO.
2. While the conventional service system is developed by mostly using json format based on Http protocol or other XML and WebSocket protocol messages.
The existing NIO framework, Netty, encapsulates only communications. The service for realizing the centralized processing of the conversion between the two protocols can be greatly convenient for development and solve the problem of service dispersion.
The prior patents using the Netty protocol include:
CN201610357751 financial message processing System based on Netty
The invention discloses a system for realizing financial message processing based on Netty, which adopts Netty as a bottom layer framework for sending, receiving and forwarding messages, and realizes the conversion of the multi-format configuration of the messages by customizing and converting the formats of every two messages including ISO8583, XML, management symbols, placeholders, indefinite lengths, TLVs, COPs, internal nesting and combined messages in the project application. The application realizes the format conversion processing of messages including ISO8583, XML, management symbols, placeholders, indefinite length types, TLVs, COPs, internal nesting and combined messages. But does not realize the mutual conversion between the ISO and the common Http protocol.
CN 201711115075: a multi-protocol service communication method, a device and an electronic device are provided:
the embodiment of the invention provides a multi-protocol service communication method, a device and electronic equipment, wherein the method comprises the following steps: receiving a communication protocol request sent by a client, and decoding the communication protocol request to obtain target data; mapping the target data into a corresponding target container according to the type of a target protocol corresponding to the target data and the corresponding relation between each container and each protocol, and analyzing the target data in the target container to obtain target information corresponding to the target data; and sending the target information to the client through the target protocol. The corresponding relation between the target protocol and the container needs to be obtained in the decoded target data, which causes waste for transmission among the same protocols and on the other hand causes the bloated message.
In addition, the existing NIO framework-Netty has the functions of a disconnection-free reconnection mechanism, synchronous request, idle client connection recovery and the like. There is a lack of a system that will work with the ISO protocol and continually expand new protocols.
Disclosure of Invention
In view of the above problems, the present application provides a method for implementing a financial system protocol communication based on Netty, which is used to solve the technical problems that the existing financial system communication protocol does not implement the inter-conversion between the ISO and http protocols, and the existing financial system communication protocol has no disconnection reconnection mechanism. The specific technical scheme is as follows:
a method for realizing financial system protocol communication based on Netty comprises the following steps:
acquiring a request side protocol type, and analyzing a request message to obtain a service parameter;
packaging the service parameters according to the type of the target side protocol;
sending a message to a target side according to different request modes;
and returning the acquired response according to the request side protocol.
Further, the acquiring of the request side protocol type and the parsing of the request message obtain the service parameters; packaging the service parameters according to the type of the target side protocol; ", further comprises the steps of:
if the respective message protocols of the request side and the target side are known, the request message is directly analyzed according to the request side protocol specification to obtain service parameters;
and acquiring a target side message protocol according to the corresponding relation between the request side and the target side configured in the container, and packaging the service parameters into a message which can be analyzed by the target side.
Further, the acquiring of the request side protocol type and the parsing of the request message obtain the service parameters; packaging the service parameters according to the type of the target side protocol; ", further comprises the steps of:
if the message is a self-defined message protocol, acquiring a request side identifier in the request message, and acquiring a target side identifier;
inquiring a corresponding request and an accepted protocol standard in the container according to the request side identifier and the target side identifier;
analyzing the service parameters of the request message;
and encapsulating the service parameters according to a target side protocol.
Further, the "sending a message to a target side according to different request modes" specifically includes the following steps:
if the request is an asynchronous request, directly sending a message to a target side;
if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request.
Further, before the obtaining of the request-side protocol type, the method further includes the steps of:
the method comprises the steps that a request side and a target side establish Socket connection through adaptation service;
when the connection between the request side and the target side is disconnected, a reconnection mechanism is triggered;
the request side protocol types include: http protocol or ISO protocol, the target side protocol types include: ISO protocol or http protocol;
the http protocol is based on a Spring framework, and the ISO protocol is based on a Netty framework;
when the request side protocol type is http protocol, the request side includes: a server;
when the target side protocol type is an ISO protocol, the target side comprises: POS machine and/or union pay.
In order to solve the technical problem, a system for realizing financial system protocol communication based on Netty is also provided, and the specific technical scheme is as follows:
a system for implementing financial system protocol communications based on Netty, comprising: the system comprises a request end, a target end and an adaptive server end;
the adaptive server is respectively connected with the request end and the target end;
the adaptation server is used for: acquiring a request end protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target end protocol; sending the message to a target terminal according to different request modes; and returning the acquired response according to the request end protocol.
Further, the adaptation server is further configured to:
if the respective message protocols of the request end and the target end are known, directly analyzing the request message according to the request end protocol specification to obtain service parameters; acquiring a target end message protocol according to the corresponding relation between a request end and a target end configured in the container, and packaging the service parameters into a message which can be analyzed by the target end;
if the message is a self-defined message protocol, acquiring a request end identifier in the request message and acquiring a target end identifier; inquiring a corresponding request and an accepted protocol standard in the container according to the request end identification and the target end identification; analyzing the service parameters of the request message; and encapsulating the service parameters according to a target end protocol.
Further, the adaptation server is further configured to:
if the request is an asynchronous request, directly sending a message to a target end;
if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request.
Further, the adaptation server is further configured to:
before the protocol type of a request end is obtained, the request end and a target end establish Socket connection through adaptation service;
when the connection between the request end and the target end is disconnected, a reconnection mechanism is triggered;
the request end protocol types comprise: http protocol or ISO protocol, the target end protocol types include: ISO protocol or http protocol;
the http protocol is based on a Spring framework, and the ISO protocol is based on a Netty framework;
when the request end protocol type is http protocol, the request end includes: a server;
when the target end protocol type is an ISO protocol, the target end comprises: POS machine and/or union pay.
In order to solve the technical problem, the storage device is further provided, and the specific technical scheme is as follows:
a storage device having stored therein a set of instructions for performing: any of the above mentioned steps of a method for carrying out financial system protocol communication based on Netty.
The invention has the beneficial effects that: a method for realizing financial system protocol communication based on Netty comprises the following steps: acquiring a request side protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target side protocol; sending a message to a target side according to different request modes; and returning the acquired response according to the request side protocol. By the method, communication among multiple protocols is integrated, and the problem of message transfer between the request side and the target side is solved in a configuration mode. The method comprises the mutual conversion between the ISO protocol and the http protocol, and when the ISO protocol and the http protocol are the same, decoding is not needed due to the corresponding relation between the target protocol and the container, so that the message is not overstaffed.
Furthermore, high-concurrency and high-stability Socket communication is realized based on the Netty framework, and a disconnection reconnection mechanism and a synchronous request are added in the connection process of the target side and the request side, so that the ISO protocol based on the Netty framework can support more functions.
The above description of the present invention is only an overview of the technical solutions of the present application, and in order to make the technical solutions of the present application more clearly understood by those skilled in the art, the present invention may be further implemented according to the content described in the text and drawings of the present application, and in order to make the above objects, other objects, features, and advantages of the present application more easily understood, the following description is made in conjunction with the detailed description of the present application and the drawings.
Drawings
The drawings are only for purposes of illustrating the principles, implementations, applications, features, and effects of particular embodiments of the present application, as well as others related thereto, and are not to be construed as limiting the application.
In the drawings of the specification:
FIG. 1 is a flow chart of a method for implementing financial system protocol communications based on Netty, in accordance with an embodiment;
fig. 2 is a flowchart of respective message protocols of a known request side and a known target side according to the specific embodiment;
FIG. 3 is a flow chart of a custom message protocol according to an exemplary embodiment;
FIG. 4 is a diagram illustrating a request-side http protocol and a target-side ISO853 protocol according to an exemplary embodiment;
FIG. 5 is a block diagram of a system for implementing financial system protocol communications based on Netty, in accordance with an embodiment;
FIG. 6 is a block diagram of a memory device according to an embodiment;
fig. 7 is a schematic diagram of a union pay ISO interface according to the embodiment.
The reference numerals referred to in the above figures are explained below:
500. a system for implementing financial system protocol communications based on Netty,
501. at the request side, the request side sends a request,
502. the server is adapted to the server side,
503. at the end of the target,
600. a storage device.
Detailed Description
In order to explain in detail possible application scenarios, technical principles, practical embodiments, and the like of the present application, the following detailed description is given with reference to the accompanying drawings in conjunction with the listed embodiments. The embodiments described herein are merely for more clearly illustrating the technical solutions of the present application, and therefore, the embodiments are only used as examples, and the scope of the present application is not limited thereby.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase "an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or related to other embodiments specifically defined. In principle, in the present application, the technical features mentioned in the embodiments can be combined in any manner to form a corresponding implementable technical solution as long as there is no technical contradiction or conflict.
Unless defined otherwise, technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the use of relational terms herein is intended only to describe particular embodiments and is not intended to limit the present application.
In the description of the present application, the term "and/or" is a expression for describing a logical relationship between objects, meaning that three relationships may exist, for example a and/or B, meaning: there are three cases of A, B, and both A and B. In addition, the character "/" herein generally indicates that the former and latter associated objects are in a logical relationship of "or".
In this application, terms such as "first" and "second" are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Without further limitation, in this application, the use of "including," "comprising," "having," or other similar expressions in phrases and expressions of "including," "comprising," or "having," is intended to cover a non-exclusive inclusion, and such expressions do not exclude the presence of additional elements in a process, method, or article that includes the recited elements, such that a process, method, or article that includes a list of elements may include not only those elements but also other elements not expressly listed or inherent to such process, method, or article.
As is understood in the examination of the guidelines, the terms "greater than", "less than", "more than" and the like in this application are to be understood as excluding the number; the expressions "above", "below", "within" and the like are understood to include the present numbers. In addition, in the description of the embodiments of the present application, "a plurality" means two or more (including two), and expressions related to "a plurality" similar thereto are also understood, for example, "a plurality of groups", "a plurality of times", and the like, unless specifically defined otherwise.
Referring to fig. 1 to 4, in this embodiment, a method for implementing financial system protocol communication based on Netty is applicable to a system for implementing financial system protocol communication based on Netty, where the system for implementing financial system protocol communication based on Netty includes: the system comprises a request end, a target end and an adaptive server end.
In the field of financial systems, ISO protocols are often used for POS, on the one hand because they are safer and on the other hand because they save more traffic. The server for communicating with the POS machine uses http protocol, so in the field of financial systems, it is very important to implement the inter-conversion between ISO protocol and http protocol.
The following will explain a method for implementing financial system protocol communication based on Netty with reference to the accompanying drawings:
step S101: and acquiring the protocol type of the request side, and analyzing the request message to obtain the service parameters.
Step S102: and encapsulating the service parameters according to the type of the target side protocol.
Step S101 and step S102 are also discussed in two different cases, the first case is a packet protocol of a known request side and a known target side, please refer to fig. 2:
step S201: if the respective message protocols of the request side and the target side are known, the request message is directly analyzed according to the request side protocol specification to obtain the service parameters.
Step S201: and acquiring a target side message protocol according to the corresponding relation between the request side and the target side configured in the container, and packaging the service parameters into a message which can be analyzed by the target side.
The second is a self-defined message protocol, where the request message carries the identifier of the request side and the identifier of the target side, and contains a specific service message, so that the communication between the two ends is more flexible, and the protocol can be changed according to configuration, see fig. 3:
step S301: and if the message protocol is the self-defined message protocol, acquiring a request side identifier in the request message and acquiring a target side identifier. The request-side identity may be denoted as srcId and the target-side identity may be denoted as desId, for example.
Step S302: and inquiring the corresponding request and accepted protocol standard in the container according to the request side identification and the target side identification.
Step S303: and analyzing the service parameters of the request message.
Step S304: and encapsulating the service parameters according to a target side protocol.
After the service parameters are encapsulated according to the target side protocol type, step S103 and step S104 are executed:
step S103: and sending the message to a target side according to different request modes.
Step S104: and returning the acquired response according to the request side protocol.
The request mode corresponding to step S103 may be an asynchronous request or a synchronous request, and if the request mode is an asynchronous request, the message is directly sent to the target side; if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request. The following description will be made in conjunction with fig. 4.
In fig. 4, the request side is taken as an http protocol platform and is based on a Spring framework, the target side is taken as an ISO8583 protocol, and the description is expanded by taking a Netty framework as an example:
the method comprises the steps that a request side and a target side establish Socket connection through adaptation service;
when the connection between the request side and the target side is disconnected, a reconnection mechanism is triggered;
when the request is an asynchronous request, the http protocol platform sends a service request of the http protocol to the adaptation service, the adaptation service converts the service request into an ISO8583 message, if the connection between the adaptation service and the adaptation service exists, the usability of the connection is checked, if the connection is available, the message is sent, the ISO8583 protocol platform carries out service processing on the received message, the ISO8583 message is responded to the adaptation service, the adaptation service analyzes the message, the message is converted into the format of the http protocol, and the response of the http protocol is returned to the http protocol platform.
When the request is a synchronous request, the http protocol platform sends a service request of the http protocol, hangs call-back, the adaptation service converts the request into an ISO8583 message, the sync Id is used as a transparent transmission field of the synchronous request, the sync Id is stored in a cache, if the connection between the sync Id and the sync Id exists, the usability of the connection is checked, if the connection is available, a message with a sync Id parameter is sent, the ISO8583 protocol platform carries out service processing on the received message, the adaptation service responds to the ISO8583 message and attaches the sync Id, the adaptation service analyzes the message, the message is converted into an http protocol format, the cache is checked according to the sync Id, a call-back method is taken out, and a response of the http protocol is returned to the http protocol platform.
A method for realizing financial system protocol communication based on Netty comprises the following steps: acquiring a request side protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target side protocol; sending a message to a target side according to different request modes; and returning the acquired response according to the request side protocol. By the method, communication among multiple protocols is integrated, and the problem of message transfer between the request side and the target side is solved in a configuration mode. The method comprises the mutual conversion between the ISO protocol and the http protocol, and when the ISO protocol and the http protocol are the same, decoding is not needed due to the corresponding relation between the target protocol and the container, so that the message is not overstaffed.
Furthermore, high-concurrency and high-stability Socket communication is realized based on the Netty framework, and a disconnection reconnection mechanism and a synchronous request are added in the connection process of the target side and the request side, so that the ISO protocol based on the Netty framework can support more functions.
Referring to fig. 4 to 5, in the present embodiment, a system 500 for implementing a financial system protocol communication based on Netty includes: a request terminal 501, a target terminal 503 and an adaptation service terminal 502;
the adaptation server 502 is respectively connected with the request terminal 501 and the target terminal 503;
the adaptation server 502 is configured to: acquiring the protocol type of a request terminal 501, and analyzing the request message to obtain service parameters; the service parameters are packaged according to the protocol type of the target terminal 503; sending the message to the target 503 according to different request modes; and transmitting the acquired response back according to the protocol of the request terminal 501.
Further, the adaptation server 502 is further configured to:
if the respective message protocols of the request terminal 501 and the target terminal 503 are known, the request message is directly analyzed according to the protocol specification of the request terminal 501 to obtain service parameters; acquiring a message protocol of a target terminal 503 according to a corresponding relation between a request terminal 501 and the target terminal 503 configured in a container, and packaging the service parameters into a message which can be analyzed by the target terminal 503;
if the message protocol is a self-defined message protocol, acquiring a request terminal 501 identifier in a request message, and acquiring a target terminal 503 identifier; inquiring the corresponding request and accepted protocol standard in the container according to the request terminal 501 identifier and the target terminal 503 identifier; analyzing the service parameters of the request message; and encapsulating the service parameters according to a protocol of a target terminal 503.
Further, the adaptation server 502 is further configured to:
if the request is an asynchronous request, the message is directly sent to the target end 503;
if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request.
Further, the adaptation server 502 is further configured to:
before acquiring the protocol type of the request terminal 501, the request terminal 501 and the target terminal 503 establish Socket connection through adaptation service;
when the connection between the request terminal 501 and the target terminal 503 is disconnected, a reconnection mechanism is triggered;
the protocol types of the requesting end 501 include: http protocol or ISO protocol, the target 503 protocol types include: ISO protocol or http protocol;
the http protocol is based on a Spring framework, and the ISO protocol is based on a Netty framework;
when the protocol type of the request terminal 501 is http protocol, the request terminal 501 includes: a server;
when the protocol type of the target 503 is an ISO protocol, the target 503 includes: POS machine and/or union pay. The union pay also has an interface based on the ISO protocol, see corresponding links: https:// download. csdn. net/download/jiehu3156/9599561utm _ source ═ iteye _ new, and fig. 7.
The following is expanded in conjunction with fig. 4:
taking the request terminal 501 as an http protocol platform and based on a Spring framework, the target terminal 503 is an ISO8583 protocol and based on a Netty framework as an example to develop an explanation:
the request terminal 501 and the target terminal 503 establish Socket connection through the adaptation service terminal 502;
when the connection between the request terminal 501 and the target terminal 503 is disconnected, a reconnection mechanism is triggered;
when the request is an asynchronous request, the http protocol platform sends a service request of the http protocol to the adaptation server 502, the adaptation server 502 converts the service request into an ISO8583 message, if the connection between the adaptation server and the adaptation server exists, the usability of the connection is checked, if the connection is usable, the message is sent, the ISO8583 protocol platform carries out service processing on the received message, the ISO8583 message is responded to the adaptation server 502, the adaptation server 502 analyzes the message, converts the message into the format of the http protocol, and returns a response of the http protocol to the http protocol platform.
When the request is a synchronous request, the http protocol platform sends a service request of the http protocol, hangs call-back, the adaptation service end 502 converts the request into an ISO8583 message, the sync Id is used as a transparent transmission field of the synchronous request, the sync Id is stored in a cache, if the connection between the sync Id and the sync Id exists, the usability of the connection is checked, if the connection is available, a message with a sync Id parameter is sent, the ISO8583 protocol platform performs service processing on the received message, responds to the ISO8583 message to the adaptation service end 502, attaches the sync Id, the adaptation service end 502 analyzes the message, converts the message into an http protocol format, checks the cache according to the sync Id, takes out the call-back method, and returns a response of the http protocol to the http protocol platform.
A system 500 for implementing financial system protocol communications based on Netty, comprising: a request terminal 501, a target terminal 503 and an adaptation service terminal 502; the adaptation server 502 is respectively connected with the request terminal 501 and the target terminal 503; the adaptation server 502 is configured to: acquiring the protocol type of a request terminal 501, and analyzing the request message to obtain service parameters; the service parameters are packaged according to the protocol type of the target terminal 503; sending the message to the target 503 according to different request modes; and transmitting the acquired response back according to the protocol of the request terminal 501. Through the system, a plurality of inter-protocol communication are integrated, and the problem of message transfer between the request terminal 501 and the target terminal 503 is solved in a configuration mode. The method comprises the mutual conversion between the ISO protocol and the http protocol, and when the ISO protocol and the http protocol are the same, decoding is not needed due to the corresponding relation between the target protocol and the container, so that the message is not overstaffed.
Furthermore, high-concurrency and high-stability Socket communication is realized based on the Netty framework, and a disconnection reconnection mechanism and a synchronous request are added in the connection process of the target terminal 503 and the request terminal 501, so that the ISO protocol based on the Netty framework can support more functions.
Referring to fig. 6, in the present embodiment, a memory device 600 is implemented as follows:
a storage device 600 having stored therein a set of instructions for performing: and acquiring the protocol type of the request side, and analyzing the request message to obtain the service parameters.
And encapsulating the service parameters according to the type of the target side protocol.
The above is also discussed in two cases, the first is the respective message protocol of the known request side and the known target side:
if the respective message protocols of the request side and the target side are known, the request message is directly analyzed according to the request side protocol specification to obtain the service parameters.
And acquiring a target side message protocol according to the corresponding relation between the request side and the target side configured in the container, and packaging the service parameters into a message which can be analyzed by the target side.
The second is a self-defined message protocol, the request message carries the identification of the request side and the target side, and contains a specific service message, so that the communication between the two ends is more flexible, and the protocol can be replaced according to the configuration:
and if the message protocol is the self-defined message protocol, acquiring a request side identifier in the request message and acquiring a target side identifier. The request-side identity may be denoted as srcId and the target-side identity may be denoted as desId, for example.
And inquiring the corresponding request and accepted protocol standard in the container according to the request side identification and the target side identification.
And analyzing the service parameters of the request message.
And encapsulating the service parameters according to a target side protocol. After the service parameters are encapsulated according to the protocol type of the target side, sending a message to the target side according to different request modes; and returning the acquired response according to the request side protocol.
The corresponding request mode may be asynchronous request or synchronous request, if the request mode is asynchronous request, the message is directly sent to the target side; if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request. The following description will be made in conjunction with fig. 4.
In fig. 4, the request side is taken as an http protocol platform and is based on a Spring framework, the target side is taken as an ISO8583 protocol, and the description is expanded by taking a Netty framework as an example:
the method comprises the steps that a request side and a target side establish Socket connection through adaptation service;
when the connection between the request side and the target side is disconnected, a reconnection mechanism is triggered;
when the request is an asynchronous request, the http protocol platform sends a service request of the http protocol to the adaptation service, the adaptation service converts the service request into an ISO8583 message, if the connection between the adaptation service and the adaptation service exists, the usability of the connection is checked, if the connection is available, the message is sent, the ISO8583 protocol platform carries out service processing on the received message, the ISO8583 message is responded to the adaptation service, the adaptation service analyzes the message, the message is converted into the format of the http protocol, and the response of the http protocol is returned to the http protocol platform.
When the request is a synchronous request, the http protocol platform sends a service request of the http protocol, hangs call-back, the adaptation service converts the request into an ISO8583 message, the sync Id is used as a transparent transmission field of the synchronous request, the sync Id is stored in a cache, if the connection between the sync Id and the sync Id exists, the usability of the connection is checked, if the connection is available, a message with a sync Id parameter is sent, the ISO8583 protocol platform carries out service processing on the received message, the adaptation service responds to the ISO8583 message and attaches the sync Id, the adaptation service analyzes the message, the message is converted into an http protocol format, the cache is checked according to the sync Id, a call-back method is taken out, and a response of the http protocol is returned to the http protocol platform.
A storage device 600 having stored therein a set of instructions for performing: acquiring a request side protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target side protocol; sending a message to a target side according to different request modes; and returning the acquired response according to the request side protocol. Through the storage device 600, a plurality of inter-protocol communications are integrated, and the problem of message transfer between a request side and a target side is solved in a configuration mode. The method comprises the mutual conversion between the ISO protocol and the http protocol, and when the ISO protocol and the http protocol are the same, decoding is not needed due to the corresponding relation between the target protocol and the container, so that the message is not overstaffed.
Furthermore, high-concurrency and high-stability Socket communication is realized based on the Netty framework, and a disconnection reconnection mechanism and a synchronous request are added in the connection process of the target side and the request side, so that the ISO protocol based on the Netty framework can support more functions.
Finally, it should be noted that, although the above embodiments have been described in the text and drawings of the present application, the scope of the patent protection of the present application is not limited thereby. All technical solutions which are generated by replacing or modifying the equivalent structure or the equivalent flow according to the contents described in the text and the drawings of the present application, and which are directly or indirectly implemented in other related technical fields, are included in the scope of protection of the present application.

Claims (10)

1. A method for realizing financial system protocol communication based on Netty is characterized by comprising the following steps:
acquiring a request side protocol type, and analyzing a request message to obtain a service parameter;
packaging the service parameters according to the type of the target side protocol;
sending a message to a target side according to different request modes;
and returning the acquired response according to the request side protocol.
2. The method of claim 1, wherein the step of obtaining the type of the request-side protocol and parsing the request message to obtain the service parameters; packaging the service parameters according to the type of the target side protocol; ", further comprises the steps of:
if the respective message protocols of the request side and the target side are known, the request message is directly analyzed according to the request side protocol specification to obtain service parameters;
and acquiring a target side message protocol according to the corresponding relation between the request side and the target side configured in the container, and packaging the service parameters into a message which can be analyzed by the target side.
3. The method of claim 1, wherein the step of obtaining the type of the request-side protocol and parsing the request message to obtain the service parameters; packaging the service parameters according to the type of the target side protocol; ", further comprises the steps of:
if the message is a self-defined message protocol, acquiring a request side identifier in the request message, and acquiring a target side identifier;
inquiring a corresponding request and an accepted protocol standard in the container according to the request side identifier and the target side identifier;
analyzing the service parameters of the request message;
and encapsulating the service parameters according to a target side protocol.
4. The method for achieving financial system protocol communication based on Netty as claimed in any one of claims 1 to 3, wherein the step of sending messages to the target side according to different request modes further comprises the steps of:
if the request is an asynchronous request, directly sending a message to a target side;
if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request.
5. The method of any of claims 1-4, wherein said obtaining a request-side protocol type is preceded by the step of:
the method comprises the steps that a request side and a target side establish Socket connection through adaptation service;
when the connection between the request side and the target side is disconnected, a reconnection mechanism is triggered;
the request side protocol types include: http protocol or ISO protocol, the target side protocol types include: ISO protocol or http protocol;
the http protocol is based on a Spring framework, and the ISO protocol is based on a Netty framework;
when the request side protocol type is http protocol, the request side includes: a server;
when the target side protocol type is an ISO protocol, the target side comprises: POS machine and/or union pay.
6. A system for implementing financial system protocol communications based on Netty, comprising: the system comprises a request end, a target end and an adaptive server end;
the adaptive server is respectively connected with the request end and the target end;
the adaptation server is used for: acquiring a request end protocol type, and analyzing a request message to obtain a service parameter; packaging the service parameters according to the type of the target end protocol; sending the message to a target terminal according to different request modes; and returning the acquired response according to the request end protocol.
7. The system of claim 6, wherein the network-based financial system protocol communication,
the adaptation server is further configured to:
if the respective message protocols of the request end and the target end are known, directly analyzing the request message according to the request end protocol specification to obtain service parameters; acquiring a target end message protocol according to the corresponding relation between a request end and a target end configured in the container, and packaging the service parameters into a message which can be analyzed by the target end;
if the message is a self-defined message protocol, acquiring a request end identifier in the request message and acquiring a target end identifier; inquiring a corresponding request and an accepted protocol standard in the container according to the request end identification and the target end identification; analyzing the service parameters of the request message; and encapsulating the service parameters according to a target end protocol.
8. The method of claim 6 or 7, wherein the network-based financial system protocol communication,
the adaptation server is further configured to:
if the request is an asynchronous request, directly sending a message to a target end;
if the request is a synchronous request, a preset field is used as a transparent transmission field of the synchronous request.
9. The method of any of claims 6 to 8, wherein the network-based financial system protocol communication,
the adaptation server is further configured to:
before the protocol type of a request end is obtained, the request end and a target end establish Socket connection through adaptation service;
when the connection between the request end and the target end is disconnected, a reconnection mechanism is triggered;
the request end protocol types comprise: http protocol or ISO protocol, the target end protocol types include: ISO protocol or http protocol;
the http protocol is based on a Spring framework, and the ISO protocol is based on a Netty framework;
when the request end protocol type is http protocol, the request end includes: a server;
when the target end protocol type is an ISO protocol, the target end comprises: POS machine and/or union pay.
10. A storage device having a set of instructions stored therein, the set of instructions being operable to perform: the method of any of claims 1 to 5, wherein the method is based on Netty implementation of financial system protocol communication.
CN202111452107.6A 2021-12-01 2021-12-01 Method, system and storage device for realizing financial system protocol communication based on Netty Active CN114157714B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111452107.6A CN114157714B (en) 2021-12-01 2021-12-01 Method, system and storage device for realizing financial system protocol communication based on Netty

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111452107.6A CN114157714B (en) 2021-12-01 2021-12-01 Method, system and storage device for realizing financial system protocol communication based on Netty

Publications (2)

Publication Number Publication Date
CN114157714A true CN114157714A (en) 2022-03-08
CN114157714B CN114157714B (en) 2024-02-13

Family

ID=80455224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111452107.6A Active CN114157714B (en) 2021-12-01 2021-12-01 Method, system and storage device for realizing financial system protocol communication based on Netty

Country Status (1)

Country Link
CN (1) CN114157714B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055577A (en) * 2023-01-28 2023-05-02 东方合智数据科技(广东)有限责任公司 Protocol conversion method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004056071A1 (en) * 2002-12-17 2004-07-01 Sema Communication method between servers with data format conversion and device therefor
CN106027534A (en) * 2016-05-26 2016-10-12 浪潮(苏州)金融技术服务有限公司 System for implementing financial message processing based on Netty
CN107835178A (en) * 2017-11-13 2018-03-23 北京奇艺世纪科技有限公司 A kind of multi-protocols communication for service method, apparatus and electronic equipment
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111641528A (en) * 2020-05-29 2020-09-08 山东浪潮通软信息科技有限公司 Device management method, device, storage medium and computer readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004056071A1 (en) * 2002-12-17 2004-07-01 Sema Communication method between servers with data format conversion and device therefor
CN106027534A (en) * 2016-05-26 2016-10-12 浪潮(苏州)金融技术服务有限公司 System for implementing financial message processing based on Netty
CN107835178A (en) * 2017-11-13 2018-03-23 北京奇艺世纪科技有限公司 A kind of multi-protocols communication for service method, apparatus and electronic equipment
CN110971614A (en) * 2019-12-17 2020-04-07 软通动力信息技术(集团)有限公司 Internet of things adaptation method and system, computer equipment and storage medium
CN111641528A (en) * 2020-05-29 2020-09-08 山东浪潮通软信息科技有限公司 Device management method, device, storage medium and computer readable medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055577A (en) * 2023-01-28 2023-05-02 东方合智数据科技(广东)有限责任公司 Protocol conversion method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114157714B (en) 2024-02-13

Similar Documents

Publication Publication Date Title
AU2002351015B2 (en) Method and device for defining objects allowing to establish a device management tree for mobile communication devices
US7103676B2 (en) User-identifier translator and linking apparatus for XML-based services and corresponding method
WO2015081786A1 (en) Method and apparatus for implementing subscription notification
CN105763619B (en) The method and device that client and server-side are communicated
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
CN101521615B (en) Communication method for different networks and internetwork for smart machine
WO2012088906A1 (en) Intercommunication method and system for internet of things terminals
CN101631127A (en) File transfer method and clients
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN112688952A (en) Message processing method, device, radio remote unit and medium
CN114157714A (en) Method, system and storage device for realizing financial system protocol communication based on Netty
US10645184B2 (en) Information transmission method, gateway, and controller
CN108446105A (en) A kind of Lightweight AP I Server Development Frameworks and development approach
WO2016110070A1 (en) Data acquiring method and device, and storage medium
CN105656760B (en) Communication means and system between software package
CN110557321A (en) Information transmission method, network equipment and terminal
CN101465783B (en) Connection method, device and connection network bridge for isomery household network appliances
US20100049804A1 (en) Instant Messaging
CN101030927B (en) Interface telecommunication between OSS subsystems based on middleware
CN111865957A (en) Frame structure and method and system thereof
CN214067774U (en) Data acquisition self-adaptive system structure based on enterprise service bus
CN112383924B (en) Base station equipment management method, device and system
US7110364B1 (en) Optical link adjacency discovery protocol and an optical network therefor
CN112333574B (en) Method and system for rapidly discovering and managing communication access terminal product
CN111711563B (en) Medical internet of things gateway

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