CN114025015A - Message transmission method and device - Google Patents

Message transmission method and device Download PDF

Info

Publication number
CN114025015A
CN114025015A CN202111435418.1A CN202111435418A CN114025015A CN 114025015 A CN114025015 A CN 114025015A CN 202111435418 A CN202111435418 A CN 202111435418A CN 114025015 A CN114025015 A CN 114025015A
Authority
CN
China
Prior art keywords
message
target
request
service
access
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.)
Pending
Application number
CN202111435418.1A
Other languages
Chinese (zh)
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.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software 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 Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202111435418.1A priority Critical patent/CN114025015A/en
Publication of CN114025015A publication Critical patent/CN114025015A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/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/22Parsing or analysis of headers

Landscapes

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

Abstract

The application discloses a message transmission method and a device thereof, wherein the message transmission method comprises the following steps: determining a first target preset script from a plurality of first preset scripts to analyze the access message according to the message type of the access message so as to obtain a plurality of target request message fields of the access message; converting the obtained multiple target request message fields into a first request message in a target message format; identifying the type of a target service request of an access message; converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the plurality of service request types and the plurality of service standard format files to form a second request message; and sending the second request message to the receiving end to request the target service indicated by the target service request type from the receiving end. The method can flexibly convert the message according to different message formats, thereby increasing the transmission efficiency of the message and meeting various service requirements.

Description

Message transmission method and device
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for transmitting a packet.
Background
In the process of sending a message, the message sent by a third-party system often needs to be converted and then sent to a receiving end for identification processing, in the prior art, the message is generally converted and sent in a one-to-one conversion mode, when a plurality of third-party systems exist, the message sent by each third-party system needs to be converted into a format corresponding to the receiving end, and the one-to-one conversion mode needs to be realized on a code layer one by one, specifically, field-by-field mapping is used for realizing, but the conversion rule is mechanical and dead codes exist; when a plurality of third-party systems exist, when a third-party system is newly added, code development needs to be carried out again to be in butt joint with the newly added third-party system, so that the processing efficiency is low, and the development cost is high.
Disclosure of Invention
The embodiment of the application aims to provide a message transmission method and a message transmission device, and the method can convert different types of messages into a uniform message format through a preset script under the condition of receiving the different types of messages, so that the message transmission efficiency is improved.
In order to achieve the above purpose, the embodiments of the present application employ the following technical solutions:
in a first aspect, an embodiment of the present application provides a message transmission method, where an access message is acquired from a target service interface; determining a first target preset script from a plurality of first preset scripts according to the message type of the access message; analyzing the access message by using the first target preset script to obtain a plurality of target request message fields of the access message; converting the obtained multiple target request message fields into a first request message in a target message format; identifying the type of a target service request of an access message; converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the plurality of service request types and the plurality of service standard format files to form a second request message; and sending the second request message to the receiving end to request the target service indicated by the target service request type from the receiving end.
Optionally, the message type of the access message is determined by: determining a target port identifier of a target service interface for receiving an access message; determining a target message type corresponding to the target port identification according to the corresponding relation between the plurality of port identifications and the plurality of message types; and determining the type of the target message as the message type of the access message.
Optionally, the corresponding relationship between the plurality of port identifiers and the plurality of packet types is constructed in the following manner: binding the service interface with a corresponding third-party system in a plurality of third-party systems aiming at each service interface so as to configure the service interface as a transmission port special for message transmission with one third-party system; determining the message type of the message transmitted by each third-party system; and forming corresponding relations between a plurality of port identifications and a plurality of message types according to the port identification of each service interface and the message type of the message transmitted by the third-party system which has the binding relation with each service interface.
Optionally, each first preset script is a message parsing script which is written in advance and used for parsing one of multiple message types, where the step of parsing the access message by using the first target preset script to obtain multiple target request message fields of the access message includes: analyzing the access message to obtain an access message field of the access message; and converting the access message field into a plurality of target request message fields indicated by the first target preset script, wherein the plurality of target request message fields are message fields required by a target message format.
Optionally, the step of converting the obtained multiple target request message fields into the first request message in the target message format includes: packaging a plurality of target request message fields into java objects; and converting the java object into a first request message in a target message format.
Optionally, the step of identifying the target service request type of the access packet includes: acquiring request service identification fields in a plurality of target request message fields; and determining the target service request type of the access message according to the request service identification field.
Optionally, the second request packet is obtained by: determining a standard data structure of a target standard service format file corresponding to the target service request type of the first request message according to the mapping relation between the plurality of service request types and the plurality of standard service format files; and mapping the plurality of message fields of the first request message into a standard data structure one by one to obtain a second request message.
Optionally, the message transmission method further includes: receiving a first response message corresponding to the second request message from a receiving end; identifying a target response message service type of the first response message; and converting the first response message into a response message standard data structure file corresponding to the target response message service type according to the mapping relation between the plurality of response message service types and the plurality of response message standard data structure files to form a second response message.
Optionally, the message transmission method further includes: converting the second response message into a third response message, wherein the message format of the third response message is the same as that of the access message; and sending the third response message to the service request end through the target service interface so as to feed back the response message corresponding to the target service to the service request end.
In a second aspect, an embodiment of the present application further provides a packet transmission apparatus, including: the first receiving module is used for acquiring an access message from a target service interface; the determining module is used for determining a first target preset script from a plurality of first preset scripts according to the message type of the access message; the analysis module is used for analyzing the access message by utilizing the first target preset script so as to obtain a plurality of target request message fields of the access message; the first conversion module is used for converting the obtained multiple target request message fields into a first request message in a target message format; the first identification module is used for identifying the target service request type of the access message; the second conversion module is used for converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the plurality of service request types and the plurality of service standard format files so as to form a second request message; and the first sending module is used for sending the second request message to the receiving end so as to request the target service indicated by the target service request type from the receiving end.
The application discloses a message transmission method, which comprises the following steps: acquiring an access message from a target service interface; determining a first target preset script from a plurality of first preset scripts according to the message type of the access message; analyzing the access message by using the first target preset script to obtain a plurality of target message fields of the access message; converting the obtained multiple target message fields into a first request message in a target message format; identifying the service request type of the access message; converting the first request message into a second request message of a standard data structure indicated by a target service standard format file corresponding to the service request type according to the mapping relation between the service request types and the service standard format files; and sending the second request message to the receiving end to request the target service to the receiving end. The method can flexibly convert the message according to different message formats, thereby increasing the transmission efficiency of the message and meeting various service requirements.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 shows a first flowchart of a message transmission method provided in an embodiment of the present application;
fig. 2 shows a second flowchart of a message transmission method provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present application;
fig. 4 shows a schematic structural diagram ii of a message transmission apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present disclosure, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
In order to improve control convenience for a killing robot, the present application provides a control system for a killing robot, and referring to fig. 1, fig. 1 shows a first flow chart of a message transmission method provided in an embodiment of the present application, and specifically, as shown in fig. 1, the message transmission method includes:
s100, obtaining an access message from a target service interface.
Here, each third-party system corresponds to a service interface, each service interface corresponds to a different interface protocol, and the messages sent from different third-party systems are received through different interfaces, so that data interaction between the third-party systems and the receiving end is completed.
S200, determining a first target preset script from a plurality of first preset scripts according to the message type of the access message.
Here, different types of access messages need to be processed differently, each first preset script is a message parsing script that is written in advance and used for parsing one message type corresponding to a plurality of message types, and specifically, the message type of the access message can be determined in the following manner:
and determining the target port identification of the target service interface for receiving the access message.
In a preferred embodiment, different third-party systems use different service interfaces for message transmission, and different third-party systems have different corresponding service interfaces for message data interaction, and different port identifiers need to be configured for the service interfaces in advance, so that when a message is received from a certain service interface, a target port identifier of a target service interface for accessing the message can be directly determined.
And determining the target message type corresponding to the target port identification according to the corresponding relation between the plurality of port identifications and the plurality of message types.
Specifically, according to different interfaces used by a third-party system, a corresponding relation between a plurality of port identifiers and a plurality of message types is pre-established, when an access message is obtained, a port identifier corresponding to a service interface of the access message is determined as a target port identifier, and a target message type corresponding to the target port identifier is determined according to the pre-set corresponding relation between the plurality of port identifiers and the plurality of message types.
And determining the type of the target message as the message type of the access message.
Specifically, after the message type of the access message is determined, the corresponding relationship between the plurality of port identifiers and the plurality of message types is established in the following manner:
and binding the service interface with a corresponding third-party system in a plurality of third-party systems aiming at each service interface so as to configure the service interface as a transmission port specially used for carrying out message transmission with one third-party system.
In a specific embodiment, in order to receive messages sent by different third-party systems, the service interface needs to be bound with the third-party system corresponding to the interface in advance, that is, each third-party system performs message transmission through the preset corresponding service interface.
And determining the message type of the message transmitted by each third-party system.
In a specific embodiment, according to different third-party systems, interface protocol documents applied when the third-party systems perform message transmission are obtained in advance, the interface protocol documents indicate a transmission protocol, a message type of a transmission message and the like of each third-party system, and the message type of the message transmitted by each third-party system is determined according to the message type indicated by the interface protocol documents.
And forming corresponding relations between a plurality of port identifications and a plurality of message types according to the port identification of each service interface and the message type of the message transmitted by the third-party system which has the binding relation with each service interface.
In a specific embodiment, each service interface has a corresponding port identifier, and the third-party system transmits the packet to different service interfaces according to the packet type of the packet transmitted by the third-party system, that is, different packet types are transmitted through the service interfaces indicated by different port identifiers, thereby forming a corresponding relationship between a plurality of port identifiers and a plurality of packet types, where the accessed packet types include an XML packet format, a fixed-length packet format, a split character packet format, and a variable-length packet format.
In a preferred embodiment, after the message type of the access message is determined, a first target preset script corresponding to the access message is determined from the plurality of first preset scripts according to a mapping relationship between the message type and the plurality of first preset scripts, so as to analyze the access message.
S300, analyzing the access message by using the first target preset script to obtain a plurality of target request message fields of the access message.
Specifically, an interface protocol script of a service interface used by a third-party system may be obtained first, where the interface protocol script includes a protocol type, a message format, how to call a service interface, and the like, and a first preset script is created according to the interface protocol script, where a general format of an access message of the service interface is preset in the first preset script.
In a preferred embodiment, a plurality of target message fields of an access message are obtained by:
and analyzing the access message to obtain an access message field of the access message.
In a preferred embodiment, an access field in an access message is obtained first, where the access message field indicates a plurality of request messages, and when the access message is an XML format message, root node field information, message header field information, and message body field information in the access message need to be obtained.
And converting the access message field into a plurality of target message request fields indicated by the first target preset script.
Specifically, the plurality of target request message fields are message fields required by the target message format.
In a preferred embodiment, the target packet format is a packet format that can be recognized by the receiving end, for example, when the access packet is in an XML format and the receiving end can recognize that the target packet format is in a json format, the parsing field of each XML format of the access packet field needs to be iterated circularly, and each field of the XML format of the access packet is sequentially converted into a plurality of target request packet fields in the json format.
S400, converting the obtained multiple target request message fields into a first request message in a target message format.
In a preferred embodiment, the obtained plurality of target request message fields are converted into the first request message in the target message format by:
and packaging the target request message fields into java objects.
Specifically, the preset first target preset script comprises java objects composed of a plurality of preset request message fields corresponding to the plurality of target request message fields, and the obtained plurality of target request message fields are mapped to the java objects composed of the plurality of preset request message fields in the first target preset script one by one, so that the plurality of target request message fields are packaged into the java objects.
And converting the java object into a first request message in a target message format.
In a preferred embodiment, a message format that can be identified by a receiving end is obtained, the message format is determined to be a target message format, and a target java object encapsulated by a plurality of target request message fields is converted into a first request message of the target message format.
S500, identifying the target service request type of the access message.
Specifically, the message transmitted by the third-party system through the service interface indicates different service request types, for example, when the third-party system is a financial institution, the service request type may be account opening, account logout, loan, and the like.
In a preferred embodiment, the target service request type of the access packet is identified by:
and acquiring a target request service identification field in the plurality of target request message fields.
In a preferred embodiment, each access message includes a request service identification field indicating a request service type indicated by the access message, and after the access message is processed to obtain a plurality of target request message fields, the plurality of target request message fields include the request service identification field indicating the request service type corresponding to the access message.
And determining the target service request type of the access message according to the target request service identification field.
In a preferred embodiment, the target service request type corresponding to the target service request identification field of the access packet is determined according to the preset corresponding relationship between the multiple service request identification fields and the multiple service request types.
S600, converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the service request types and the service standard format files to form a second request message.
In a preferred embodiment, the plurality of target request packet fields may not be recognizable by the receiving end, and at this time, the plurality of target request packet fields need to be converted into standard data fields recognizable by the receiving end, specifically, the second request packet may be obtained by:
and determining a standard data structure of the target standard service format file corresponding to the target service request type of the first request message according to the mapping relation between the plurality of service request types and the plurality of standard service format files.
In a preferred embodiment, for the third-party system and the receiving end, different service requests correspond to different service request types, and for the first request packet of the target service request type received by the receiving end, the receiving end can only recognize the standard data structure corresponding to the target service request type, and the receiving end can only recognize the first request packet of the different service request types after the first request packet needs to be standardized by using different standard service format files, so that the receiving end needs to obtain a plurality of standard service format files corresponding to the different service request types from the receiving end in advance.
According to the mapping relation between the acquired multiple service request types and the multiple standard service format files, which standard service format file is specifically used for carrying out standardized processing on the multiple target request message fields can be determined according to the service request types.
And mapping the plurality of message fields of the first request message into a standard data structure one by one to obtain a second request message.
In a preferred embodiment, after the target standard service format file corresponding to the target service request type is acquired, the plurality of message fields of the first request message may be standardized using the standard data structure in the target standard service format file, that is, the plurality of message fields of the first request message are mapped to the standard data structure after a series of processes, and the manner of mapping the character strings in the plurality of message fields of the first request message to the standard data structure includes, but is not limited to, character string processing, mathematical operation processing, service conversion processing, unit conversion processing, time processing, and the like, namely, a plurality of message fields of the first request message are converted into a standard format which can be identified by a receiving end through a series of processing, and after the plurality of message fields of the first request message are all converted into standard data, the second request message which can be identified by the receiving end can be obtained.
S700, sending the second request message to the receiving end to request the target service indicated by the target service request type from the receiving end.
In an optional example, the second request message is a message that can be identified and processed by the receiving end, and after the receiving end obtains the second request message, the receiving end can perform the next data processing according to the target service indicated by the target service request type.
Referring to fig. 2, fig. 2 shows a second flowchart of a message transmission method provided in the embodiment of the present application, and as shown in fig. 2, the message transmission method of the present application further includes:
s800, receiving a first response message corresponding to the second request message from the receiving end.
In an optional example, after the receiving end obtains and processes the second request message, a first response message corresponding to the second request message is fed back, where the first response message indicates response information of a target service corresponding to the second request message.
S810, identifying the service type of the target response message of the first response message.
In an optional embodiment, after receiving the first response packet corresponding to the second request packet, a field indicating a response packet type of the first response packet in the first response packet is obtained, and the response packet type indicated by the field is determined as a target response packet type indicating to which second request packet the first response packet is specifically responded.
S820, according to the mapping relation between the plurality of response message service types and the plurality of response message standard data structure files, the first response message is converted into a response message standard data structure file corresponding to the target response message service type, so that a second response message is formed.
In an alternative embodiment, after receiving the first reply message, the first reply message needs to be processed, so that the first message is converted into a standard data structure corresponding to the response message, specifically, each response message service type needs to be converted into a standard data structure corresponding to the response message, therefore, the mapping relation between a plurality of response message service types and a plurality of response message standard data structure files is created in advance, which reply message standard data structure file is specifically used for processing is determined according to the service type of the reply message, for example, the request transaction code field in the first response message can be mapped and converted into a response transaction code in the response message standard data structure file according to the response message standard data structure file corresponding to the service type of the target response message, so that the first response message is converted into the second response message.
The message transmission method further comprises the following steps:
and S830, converting the second response message into a third response message, wherein the message format of the third response message is the same as the message format of the access message.
In an optional embodiment, the second response packet is response information for a certain second request packet, and therefore the second response packet includes a field indicating a response to the access packet, and according to the field, it is determined which access packet the second response packet specifically corresponds to, a target port identifier of a target service interface that receives the access packet is determined, according to a correspondence between a plurality of port identifiers and a plurality of packet types, a target packet type corresponding to the target port identifier is determined, and the second response packet is converted into a third response packet of the target packet type, that is, a packet format of the third response packet is the same as a packet format of the access packet.
And S840, sending the third response message to the service request end through the target service interface, so as to feed back a response message corresponding to the target service to the service request end.
In an optional embodiment, the target service interface is determined according to the target port identifier of the access packet corresponding to the third response packet, and the third response packet is sent to the service request end, that is, the target third-party system, through the target service interface, so that the target third-party system can obtain the response packet corresponding to the target service.
An embodiment of the present application further provides a message transmission apparatus, as shown in fig. 3 to 4, where fig. 3 shows a first structural schematic diagram of the message transmission apparatus provided in the embodiment of the present application, and fig. 4 shows a second structural schematic diagram of the message transmission apparatus provided in the embodiment of the present application, and the apparatus includes:
a first receiving module 910, configured to obtain an access packet from a target service interface.
The determining module 920 is configured to determine a first target preset script from the plurality of first preset scripts according to the message type of the access message.
The parsing module 930 is configured to parse the access packet by using the first target preset script to obtain a plurality of target request packet fields of the access packet.
A first conversion module 940, configured to convert the obtained multiple target request message fields into a first request message in a target message format.
The first identifying module 950 is configured to identify a target service request type of the access packet.
The second conversion module 960 is configured to convert the first request packet into a target service standard format file corresponding to the target service request type according to the mapping relationship between the plurality of service request types and the plurality of service standard format files, so as to form a second request packet.
The first sending module 970 is configured to send the second request message to the receiving end, so as to request the target service indicated by the target service request type to the receiving end.
Optionally, the determining module 920 is further configured to determine the message type of the access message by: determining a target port identifier of a target service interface for receiving an access message; determining a target message type corresponding to the target port identification according to the corresponding relation between the plurality of port identifications and the plurality of message types; and determining the type of the target message as the message type of the access message.
Optionally, the determining module 920 is further configured to construct a correspondence between the plurality of port identifiers and the plurality of packet types by: binding the service interface with a corresponding third-party system in a plurality of third-party systems aiming at each service interface so as to configure the service interface as a transmission port special for message transmission with one third-party system; determining the message type of the message transmitted by each third-party system; and forming corresponding relations between a plurality of port identifications and a plurality of message types according to the port identification of each service interface and the message type of the message transmitted by the third-party system which has the binding relation with each service interface.
Optionally, each first preset script is a message parsing script written in advance and used for parsing one of the multiple message types, and the parsing module 930 is further configured to parse the access message to obtain an access message field of the access message; and converting the access message field into a plurality of target request message fields indicated by the first target preset script, wherein the plurality of target message fields are message fields required by a target message format.
Optionally, the first conversion module 940 is further configured to encapsulate the multiple target request packet fields into java objects; and converting the java object into a first request message in a target message format.
Optionally, the first identifying module 950 is further configured to obtain a target request service identifier field in the multiple target request message fields; and determining the target service request type of the access message according to the target request service identification field.
Optionally, the second conversion module 960 is further configured to determine, according to a mapping relationship between the multiple service request types and the multiple standard service format files, a standard data structure of a target standard service format file corresponding to a target service request type of the first request packet; and mapping the plurality of message fields of the first request message into a standard data structure one by one to obtain a second request message.
Optionally, the message transmission apparatus further includes:
a second receiving module 980, configured to receive the first reply packet corresponding to the second request packet from the receiving end.
The second identifying module 990 is configured to identify a service type of the target response packet of the first response packet.
A third converting module 1000, configured to convert the first response packet into a response packet standard data structure file corresponding to the target response packet service type according to a mapping relationship between the multiple response packet service types and the multiple response packet standard data structure files, so as to form a second response packet.
Optionally, the message transmission apparatus further includes:
the fourth conversion module 1100 is configured to convert the second response packet into a third response packet, where a packet format of the third response packet is the same as a packet format of the access packet.
A second sending module 1200, configured to send the third response packet to the service request end through the target service interface, so as to feed back the response packet corresponding to the target service to the service request end.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Finally, it should be noted that: the above examples are only specific embodiments of the present application, and are not intended to limit the technical solutions of the present application, and the scope of the present application is not limited thereto, although the present application is described in detail with reference to the foregoing examples, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A message transmission method is characterized in that the message transmission method comprises the following steps:
acquiring an access message from a target service interface;
determining a first target preset script from a plurality of first preset scripts according to the message type of the access message;
analyzing the access message by using the first target preset script to obtain a plurality of target request message fields of the access message;
converting the obtained target request message fields into a first request message in a target message format;
identifying the target service request type of the access message;
converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the plurality of service request types and the plurality of service standard format files to form a second request message;
and sending the second request message to a receiving end to request the target service indicated by the target service request type from the receiving end.
2. The message transmission method according to claim 1, wherein the message type of the access message is determined by:
determining a target port identifier of a target service interface for receiving the access message;
determining a target message type corresponding to the target port identification according to the corresponding relation between the plurality of port identifications and the plurality of message types;
and determining the target message type as the message type of the access message.
3. The message transmission method according to claim 2, wherein the correspondence between the plurality of port identifiers and the plurality of message types is constructed by:
binding the service interface with a corresponding third-party system in a plurality of third-party systems aiming at each service interface so as to configure the service interface as a transmission port special for message transmission with the third-party system;
determining the message type of the message transmitted by each third-party system;
and forming corresponding relations between a plurality of port identifications and a plurality of message types according to the port identification of each service interface and the message type of the message transmitted by the third-party system which has the binding relation with each service interface.
4. The message transmission method according to claim 1, wherein each of the first predefined scripts is a message parsing script pre-programmed for parsing a corresponding one of the plurality of message types,
the step of analyzing the access message by using the first target preset script to obtain a plurality of target request message fields of the access message comprises the following steps:
analyzing the access message to obtain an access message field of the access message;
and converting the access message field into a plurality of target request message fields indicated by a first target preset script, wherein the plurality of target request message fields are message fields required by the target message format.
5. The message transmission method according to claim 4, wherein the step of converting the obtained plurality of destination request message fields into the first request message in the destination message format comprises:
packaging the target request message fields into java objects;
and converting the java object into a first request message in the target message format.
6. The message transmission method according to claim 1, wherein the step of identifying the target service request type of the access message comprises:
acquiring a request service identification field in the target request message fields;
and determining the target service request type of the access message according to the request service identification field.
7. The message transmission method according to claim 5, characterized in that the second request message is obtained by:
determining a standard data structure of a target standard service format file corresponding to the target service request type of the first request message according to the mapping relation between the plurality of service request types and the plurality of standard service format files;
and mapping the plurality of message fields of the first request message into the standard data structure one by one to obtain a second request message.
8. The message transmission method according to claim 1, wherein the message transmission method further comprises:
receiving a first response message corresponding to the second request message from the receiving end;
identifying the service type of the target response message of the first response message;
and converting the first response message into a response message standard data structure file corresponding to the target response message service type according to the mapping relation between the plurality of response message service types and the plurality of response message standard data structure files to form a second response message.
9. The message transmission method according to claim 8, wherein the message transmission method further comprises:
converting the second response message into a third response message, wherein the message format of the third response message is the same as that of the access message;
and sending the third response message to a service request end through the target service interface so as to feed back a response message corresponding to the target service to the service request end.
10. A message transmission apparatus, characterized in that the message transmission apparatus comprises:
the first receiving module is used for acquiring an access message from a target service interface;
the determining module is used for determining a first target preset script from a plurality of first preset scripts according to the message type of the access message;
the analysis module is used for analyzing the access message by using the first target preset script so as to obtain a plurality of target request message fields of the access message;
the first conversion module is used for converting the obtained target request message fields into a first request message in a target message format;
the first identification module is used for identifying the target service request type of the access message;
the second conversion module is used for converting the first request message into a target service standard format file corresponding to the target service request type according to the mapping relation between the plurality of service request types and the plurality of service standard format files so as to form a second request message;
and the first sending module is used for sending the second request message to a receiving end so as to request the target service indicated by the target service request type to the receiving end.
CN202111435418.1A 2021-11-29 2021-11-29 Message transmission method and device Pending CN114025015A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111435418.1A CN114025015A (en) 2021-11-29 2021-11-29 Message transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111435418.1A CN114025015A (en) 2021-11-29 2021-11-29 Message transmission method and device

Publications (1)

Publication Number Publication Date
CN114025015A true CN114025015A (en) 2022-02-08

Family

ID=80067021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111435418.1A Pending CN114025015A (en) 2021-11-29 2021-11-29 Message transmission method and device

Country Status (1)

Country Link
CN (1) CN114025015A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115103034A (en) * 2022-06-27 2022-09-23 京东科技信息技术有限公司 Message protocol conversion method and device
CN115118777A (en) * 2022-06-25 2022-09-27 平安银行股份有限公司 Message conversion method, device, equipment and storage medium based on service type
CN115757584A (en) * 2022-11-29 2023-03-07 广发银行股份有限公司 System access method based on query interface
CN116887197A (en) * 2022-05-26 2023-10-13 银联数据服务有限公司 Banking business processing method and device based on 5G message

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150161214A1 (en) * 2013-12-05 2015-06-11 Oracle International Corporation Pattern matching across multiple input data streams
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN112383533A (en) * 2020-11-10 2021-02-19 中国农业银行股份有限公司 Message format conversion method and device
CN113329099A (en) * 2021-06-29 2021-08-31 中国农业银行股份有限公司 Message parsing method, device, medium, equipment and program product

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150161214A1 (en) * 2013-12-05 2015-06-11 Oracle International Corporation Pattern matching across multiple input data streams
CN110445860A (en) * 2019-08-06 2019-11-12 深圳市金证科技股份有限公司 A kind of file transmitting method, device, terminal device and storage medium
CN112383533A (en) * 2020-11-10 2021-02-19 中国农业银行股份有限公司 Message format conversion method and device
CN113329099A (en) * 2021-06-29 2021-08-31 中国农业银行股份有限公司 Message parsing method, device, medium, equipment and program product

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887197A (en) * 2022-05-26 2023-10-13 银联数据服务有限公司 Banking business processing method and device based on 5G message
CN116887197B (en) * 2022-05-26 2024-02-02 银联数据服务有限公司 Bank based on 5G message service processing method and device
CN115118777A (en) * 2022-06-25 2022-09-27 平安银行股份有限公司 Message conversion method, device, equipment and storage medium based on service type
CN115103034A (en) * 2022-06-27 2022-09-23 京东科技信息技术有限公司 Message protocol conversion method and device
CN115757584A (en) * 2022-11-29 2023-03-07 广发银行股份有限公司 System access method based on query interface

Similar Documents

Publication Publication Date Title
CN114025015A (en) Message transmission method and device
US8381201B2 (en) Processing of expressions
CN109670081B (en) Method and device for processing service request
CN110730181A (en) Message conversion method, device and adapter
CN102624700A (en) Method and system for user identification based on specific information
CN111552568B (en) Cloud service calling method and device
CN108347095B (en) Simulation test method and system for background monitoring system of transformer substation
CN110769009B (en) User identity authentication method and system
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN107728497B (en) Communication method for man-machine interaction
CN105359487A (en) Monitoring NAT behaviors through URI dereferences in web browsers
CN112804338A (en) Method for remote communication between Web front end and Internet of things equipment
CN113360301A (en) Message transmission system and method
US8027435B2 (en) Method and system for protocol embedded automated test control
CN105099769A (en) Method, device and system for processing abnormal operations of service platform
CN110830466B (en) Method and device for framing DL/T645 protocol message based on XML
CN114172929A (en) Communication method, device and gateway
CN107040613B (en) Message transmission method and system
CN111901384B (en) System, method, electronic device and readable storage medium for processing message
EP1471712B1 (en) Analysis of operations relating to network services
CN114257623B (en) Internet of things equipment communication method based on stream processing
CN113765722B (en) Configurable multi-protocol message processing method and device and electronic equipment
CN111107080B (en) Error information pushing method, device and equipment and readable storage medium
CN113765872B (en) Method and system for converting and adapting self-adaptive data format
CN112769741B (en) Message communication method and electronic equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220208