CN112214967B - Message format conversion method and device - Google Patents
Message format conversion method and device Download PDFInfo
- Publication number
- CN112214967B CN112214967B CN202011083940.3A CN202011083940A CN112214967B CN 112214967 B CN112214967 B CN 112214967B CN 202011083940 A CN202011083940 A CN 202011083940A CN 112214967 B CN112214967 B CN 112214967B
- Authority
- CN
- China
- Prior art keywords
- message
- version
- target
- converting
- request message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000006243 chemical reaction Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000006870 function Effects 0.000 claims description 14
- 238000012545 processing Methods 0.000 claims description 13
- 230000002776 aggregation Effects 0.000 claims description 6
- 238000004220 aggregation Methods 0.000 claims description 6
- 239000012634 fragment Substances 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000004590 computer program Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000009472 formulation Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/151—Transformation
- G06F40/154—Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/40—Business processes related to the transportation industry
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Artificial Intelligence (AREA)
- Economics (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Primary Health Care (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides a message format conversion method and a message format conversion device, which are used for obtaining a version of a request message and at least one navigation mark by analyzing the request message sent by a third party user platform, converting the version of the request message into a target message version corresponding to the navigation mark, obtaining a version of a return message and the third party user platform mark by analyzing a return message fed back by the target navigation mark, converting the version of the return message into a message version corresponding to the third party user platform mark, realizing the conversion of messages based on various versions of an aggregator system in new distribution capacity, and improving the compatibility of the aggregator system in the new distribution capacity.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for converting a message format.
Background
The new distribution capability (New Distribution Capability, abbreviated as NDC) standard is a new distribution industry standard which is forced in recent years by the international air transport association IATA. The NDC mainly establishes a unified data transmission standard based on XML format messages, and the data interaction between the airlines and the partners can be carried out through the unified standard.
In recent years, with the establishment of NDC of airlines, airlines channel is in diversified development trend, more and more airlines release own NDC sales interfaces, but because the NDC interfaces are updated iteratively and quickly, different airlines select different versions of NDC interfaces, and even more, the situation that JSON format messages are used as interface messages occurs. Therefore, there is a need for an NDC aggregator that is compatible with XML and JSON message formats to access messages of different formats.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
A message format conversion method for use in an aggregator system in new distribution capability, the method comprising:
receiving a request message sent by a third party user platform;
Analyzing the request message to obtain a version of the request message and at least one navigation mark;
Converting the version of the request message into a target message version corresponding to the navigation mark, and sending the target message version to a target navigation corresponding to the navigation mark;
Receiving a return message fed back by the target navigation system;
Analyzing the returned message to obtain a version of the returned message and a third party user platform identifier;
And converting the version of the returned message into a message version corresponding to the third party user platform identifier, and sending the message version to the third party user platform.
A message format conversion apparatus for use in an aggregator system in new distribution capability, the apparatus comprising:
the request message receiving unit is used for receiving a request message sent by the third party user platform;
The request message analysis unit is used for analyzing the request message to obtain a version of the request message and at least one navigation mark;
The first format conversion unit is used for converting the version of the request message into a target message version corresponding to the navigation mark and sending the target message version to a target navigation corresponding to the navigation mark;
The return message receiving unit is used for receiving the return message fed back by the target navigation system;
The return message analysis unit is used for analyzing the return message to obtain the version of the return message and the third party user platform identification;
And the second format conversion unit is used for converting the version of the returned message into a message version corresponding to the third party user platform identifier and sending the message version to the third party user platform.
Compared with the prior art, the invention has the following beneficial effects:
The invention discloses a message format conversion method, which is characterized in that a request message sent by a third party user platform is analyzed to obtain a version of the request message and at least one navigation mark, the version of the request message is converted into a target message version corresponding to the navigation mark, a return message fed back by the target navigation mark is analyzed to obtain a version of the return message and the third party user platform mark, the version of the return message is converted into a message version corresponding to the third party user platform mark, the conversion of messages based on various versions of an aggregator system in new distribution capacity is realized, and the compatibility of the aggregator system in the new distribution capacity is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a message format conversion method according to an embodiment of the present invention;
Fig. 2 is a flow chart of a method for converting between json format messages according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for converting XML format messages according to an embodiment of the present invention;
Fig. 4 is a flow chart of a method for converting json format message and XML format message according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a message format conversion device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The invention discloses a message format conversion method, which is applied to an aggregator system in new distribution capability, referring to fig. 1, and specifically comprises the following steps:
S101: receiving a request message sent by a third party user platform;
the request message may be an XML format message, such as 19.1, 18.2, 18.1, 17.2 messages conforming to the NDC standard, or a json format message.
S102: analyzing the request message to obtain a version of the request message and at least one navigation mark;
Analyzing the request message, taking the request message as an XML format as an example, analyzing each XML message node and attribute of the request message, for example, judging which version the request message belongs to according to PayloadAttributes/version number (AGG) system request message version number node, wherein the request XML contains MessageDoc/Name (request navigation Name) node airlines of the request.
The airline logo represents a target airline (i.e., target airline) to which the request message is to be sent, and the airline logo may be an airline two-code.
The request message may correspond to one or more of the department identifiers, that is, the request message may be sent to one department or to more than one department.
S103: converting the version of the request message into a target message version corresponding to the navigation mark, and sending the target message version to a target navigation corresponding to the navigation mark;
specifically, the system stores the corresponding relation between the navigation mark and the message version in advance, namely the message version supported by each navigation mark, and determines the target message version corresponding to the navigation mark in the request message according to the corresponding relation.
The message format conversion method disclosed by the embodiment supports conversion among XML messages of different versions, conversion among XML messages and json messages, and conversion among json messages of different versions.
S104: receiving a return message fed back by the target navigation system;
S105: analyzing the returned message to obtain a version of the returned message and a third party user platform identifier;
s106: and converting the version of the returned message into a message version corresponding to the third party user platform identifier, and sending the message version to the third party user platform.
The method for determining the message version corresponding to the third party user platform identifier comprises the following steps: the system stores the corresponding relation between the different third party user platform identifications and the message versions in advance, and determines the message version corresponding to the third party user platform identifications according to the corresponding relation.
Another method for determining the message version corresponding to the third party user platform identifier is as follows: after receiving the request message sent by the third party user platform, recording the version of the request message sent by the third party user platform, and after receiving the return message, obtaining the third party user platform identification by analyzing the return message, thus determining the message version corresponding to the third party user platform identification.
The version of the return message is converted into a message version corresponding to the third party user platform identifier, and the conversion between XML messages of different versions, the conversion between XML messages and json messages and the conversion between json messages of different versions are supported in the same way as the conversion of the version of the request message into the target version corresponding to the navigation identifier.
Three different message format conversion scenarios are presented below:
Scene one
The request message sent by the third party user platform is oriented to a single navigation, and the aggregator system in the new distribution capability receives the json message and sends the json message to the external navigation. And the third party user platform sends the JSON format request message conforming to the aviation letter formulation rule to an aggregator system in the new distribution capability, the aggregator system in the new distribution capability analyzes the requested JSON message in a series, converts the request JSON message into the JSON message format message required by the aviation letter to be sent to the aviation letter through a JSON message conversion component, successfully receives the aviation letter and returns the JSON message, converts the JSON message through the JSON message conversion component, and converts the JSON message into the JSON format of the aviation letter formulation rule to be sent to the third party user platform.
Referring to fig. 2, the method for converting json format messages based on the json message conversion component includes the following steps:
s201: splitting the request message according to a preset rule to obtain a plurality of fields;
specifically, the request message is split according to the format of the json message.
S202: converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
S203: and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
Scene two
The request message sent by the third party user platform is directed to a single navigation, and the aggregator system in the new distribution capability receives the XML message and sends the XML message to the external navigation. And the third party platform sends the NDC XML message which accords with the IATA standard and is formulated by the navigation message to an aggregator system in the new distribution capability, the aggregator system in the new distribution capability can analyze the version of the request XML, and then converts the request message from the XML into an NDC XML version required by the navigation through an extensible style sheet conversion language xslt and sends the NDC XML version required by the navigation message to the corresponding navigation. And successfully receiving the navigation returning XML message, analyzing the navigation message through xslt messages, converting the navigation message into an NDC standard XML message conforming to the navigation rule, and transmitting the NDC standard XML message to a third party user platform.
In the process of converting the XML format message, an aggregator system in new distribution capacity performs XML conversion by calling xslt, but in the case of XML conversion, the definition of some nodes is not the same as that of the navigation, the embodiment performs function processing on a part of nodes, designs a mode of calling java method by xslt mixed by XML and json, can process the mode of self-defining java function when converting the XML message by xslt, and transmits part of message fragments to the java method through json format parameters, returns the returned nodes or message fragments to the current position after a series of logic processing, and then performs xslt conversion. Specifically, referring to fig. 3, the method for converting the xml format message is as follows:
s301: converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version by a mode of a user-defined Java function to obtain a message to be converted;
s302: and converting the message to be converted into a target message version by using the extensible style sheet conversion language xslt.
Scene three
The request message sent by the third party user platform is oriented to a plurality of avionics, the aggregator system in the new distribution capability receives the XML request message, and the XML request message is also sent to the external avionics. The third party user platform sends an NDC XML message formulated by the air letter conforming to the IATA standard to the system, the system analyzes the two-code of the air letter in the request XML, and analyzes the NDC version number in the request message, and then processes the two-code of the air letter having three air letters in the request message, for example, the NDC version in the request message is 18.2 (the NDC XML message conforming to the IATA standard of the air letter rule), the aggregator system in the new distribution capability processes the request message into the message format required by three air letters, the message required by the a air letter is 17.2 version XML, the B air letter is JSON, and the C air letter is 18.1 version XML. Then 18.2XML messages need to be converted into 17.2XML messages for the a voyage, 18.2XML messages need to be converted into JSON messages for the B voyage, and 18.2XML messages need to be converted into 18.1XML messages for the C voyage. And the message is distributed to each airline company to obtain a correct airline department return message, then the return 17.2XML message of the A airline department is converted into an 18.2XML message, the B airline department JSON format message is converted into an 18.2XML message, and the C airline department 18.1XML message is converted into an 18.2XML message. And finally, carrying out aggregation treatment on all 18.2 version XML messages to obtain a total returned message, and then sending the total returned message to a third party user platform.
When the request message is in json format and the target message version is in XML format, please refer to fig. 4, the method for converting the version of the request message into the target message version corresponding to the navigation identifier includes the following steps:
s401: splitting the request message according to a preset rule to obtain a plurality of fields;
specifically, the request message is split according to the format of the json message.
S402: carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
s403: and converting the message to be converted into a target message version by using the extensible style sheet conversion language xslt.
According to the message format conversion method disclosed by the embodiment, the request message sent by the third party user platform is analyzed to obtain the version of the request message and at least one navigation mark, the version of the request message is converted into the target message version corresponding to the navigation mark, the version of the return message and the third party user platform mark are obtained by analyzing the return message fed back by the target navigation mark, the version of the return message is converted into the message version corresponding to the third party user platform mark, the conversion of messages based on various versions of the aggregator system in the new distribution capacity is realized, and the compatibility of the aggregator system in the new distribution capacity is improved.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Based on the method for converting a message format disclosed in the above embodiment, the present embodiment correspondingly discloses a device for converting a message format, please refer to fig. 5, which includes:
a request message receiving unit 100, configured to receive a request message sent by a third party user platform;
a request message parsing unit 200, configured to parse the request message to obtain a version of the request message and at least one navigation identifier;
a first format conversion unit 300, configured to convert the version of the request message into a target message version corresponding to the department identifier, and send the target message version to a target department corresponding to the department identifier;
A return message receiving unit 400, configured to receive a return message fed back by the target navigation;
a return message parsing unit 500, configured to parse the return message to obtain a version of the return message and a third party user platform identifier;
And the second format conversion unit 600 is configured to convert the version of the return message into a message version corresponding to the identifier of the third party user platform, and send the message version to the third party user platform.
Optionally, when the request message is in json format and the target message version is in XML format, the first format conversion unit 300 is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
Carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in XML format and the target message version is also in XML format, the first format conversion unit 300 is specifically configured to:
converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version by a mode of a user-defined Java function to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in json format and the target message version is also in json format, the first format conversion unit 300 is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
Optionally, in the case of receiving a return message of multiple target navigation feedback, the second format conversion unit 600 is specifically configured to:
Converting each version of the returned message into a message version corresponding to the third party user platform identifier;
Carrying out aggregation treatment on the converted messages to obtain a total returned message;
and sending the total returned message to the third party user platform.
According to the message format conversion device disclosed by the embodiment, the request message sent by the third party user platform is analyzed to obtain the version of the request message and at least one navigation mark, the version of the request message is converted into the target message version corresponding to the navigation mark, the version of the return message and the third party user platform mark are obtained by analyzing the return message fed back by the target navigation mark, the version of the return message is converted into the message version corresponding to the third party user platform mark, the conversion of messages based on various versions of the aggregator system in the new distribution capacity is realized, and the compatibility of the aggregator system in the new distribution capacity is improved.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
According to one or more embodiments of the present disclosure, there is provided a message format conversion method, including:
receiving a request message sent by a third party user platform;
Analyzing the request message to obtain a version of the request message and at least one navigation mark;
Converting the version of the request message into a target message version corresponding to the navigation mark, and sending the target message version to a target navigation corresponding to the navigation mark;
Receiving a return message fed back by the target navigation system;
Analyzing the returned message to obtain a version of the returned message and a third party user platform identifier;
And converting the version of the returned message into a message version corresponding to the third party user platform identifier, and sending the message version to the third party user platform.
Optionally, when the request message is in json format and the target message version is in XML format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
Splitting the request message according to a preset rule to obtain a plurality of fields;
Carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in XML format and the target message version is also in XML format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version by a mode of a user-defined Java function to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in json format and the target message version is also in json format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
Splitting the request message according to a preset rule to obtain a plurality of fields;
converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
Optionally, in the case of receiving a return message fed back by a plurality of target navigation units, the converting the version of the return message into a message version corresponding to the identifier of the third party user platform, and sending the message version to the third party user platform includes:
Converting each version of the returned message into a message version corresponding to the third party user platform identifier;
Carrying out aggregation treatment on the converted messages to obtain a total returned message;
and sending the total returned message to the third party user platform.
According to one or more embodiments of the present disclosure, there is provided a message format conversion apparatus including:
the request message receiving unit is used for receiving a request message sent by the third party user platform;
The request message analysis unit is used for analyzing the request message to obtain a version of the request message and at least one navigation mark;
The first format conversion unit is used for converting the version of the request message into a target message version corresponding to the navigation mark and sending the target message version to a target navigation corresponding to the navigation mark;
The return message receiving unit is used for receiving the return message fed back by the target navigation system;
The return message analysis unit is used for analyzing the return message to obtain the version of the return message and the third party user platform identification;
And the second format conversion unit is used for converting the version of the returned message into a message version corresponding to the third party user platform identifier and sending the message version to the third party user platform.
Optionally, when the request message is in json format and the target message version is in XML format, the first format conversion unit is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
Carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in XML format and the target message version is also in XML format, the first format conversion unit is specifically configured to:
converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version by a mode of a user-defined Java function to obtain a message to be converted;
and converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt.
Optionally, when the request message is in json format and the target message version is also in json format, the first format conversion unit is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
Optionally, in the case of receiving a return message fed back by a plurality of target navigation, the second format conversion unit is specifically configured to:
Converting each version of the returned message into a message version corresponding to the third party user platform identifier;
Carrying out aggregation treatment on the converted messages to obtain a total returned message;
and sending the total returned message to the third party user platform.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.
While several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (4)
1. A method of message format conversion for an aggregator system in a new distribution capability, the method comprising:
receiving a request message sent by a third party user platform;
Analyzing the request message to obtain a version of the request message and at least one navigation mark;
Converting the version of the request message into a target message version corresponding to the navigation mark, and sending the target message version to a target navigation corresponding to the navigation mark;
Receiving a return message fed back by the target navigation system;
Analyzing the returned message to obtain a version of the returned message and a third party user platform identifier;
converting the version of the returned message into a message version corresponding to the third party user platform identifier, and sending the message version to the third party user platform;
when the request message is in an XML format and the target message version is also in an XML format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
Transmitting part of message fragments to a Java method through json format parameters in a self-defined Java function mode, carrying out logic processing and returning a processing result, and converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version to obtain a message to be converted;
Converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt;
when the request message is in json format and the target message version is in XML format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
Splitting the request message according to a preset rule to obtain a plurality of fields;
Carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
Converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt;
When the request message is in json format and the target message version is also in json format, the converting the version of the request message into the target message version corresponding to the navigation identifier includes:
Splitting the request message according to a preset rule to obtain a plurality of fields;
converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
2. The method according to claim 1, wherein in the case of receiving a return message fed back by a plurality of target navigation units, the converting the version of the return message into a message version corresponding to the identifier of the third party user platform, and sending the message version to the third party user platform includes:
Converting each version of the returned message into a message version corresponding to the third party user platform identifier;
Carrying out aggregation treatment on the converted messages to obtain a total returned message;
and sending the total returned message to the third party user platform.
3. A message format conversion apparatus for use in an aggregator system in a new distribution capability, the apparatus comprising:
the request message receiving unit is used for receiving a request message sent by the third party user platform;
The request message analysis unit is used for analyzing the request message to obtain a version of the request message and at least one navigation mark;
The first format conversion unit is used for converting the version of the request message into a target message version corresponding to the navigation mark and sending the target message version to a target navigation corresponding to the navigation mark;
The return message receiving unit is used for receiving the return message fed back by the target navigation system;
The return message analysis unit is used for analyzing the return message to obtain the version of the return message and the third party user platform identification;
The second format conversion unit is used for converting the version of the return message into a message version corresponding to the third party user platform identifier and sending the message version to the third party user platform;
when the request message is in an XML format and the target message version is also in an XML format, the first format conversion unit is specifically configured to:
Transmitting part of message fragments to a Java method through json format parameters in a self-defined Java function mode, carrying out logic processing and returning a processing result, and converting the definition mode of each node in the request message into the definition mode of the corresponding node in the target message version to obtain a message to be converted;
Converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt;
when the request message is in json format and the target message version is in XML format, the first format conversion unit is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
Carrying out logic processing on each field, and converting each field into a field in an XML format to obtain a message to be converted;
Converting the message to be converted into the target message version by using an extensible style sheet conversion language xslt;
when the request message is in json format and the target message version is also in json format, the first format conversion unit is specifically configured to:
Splitting the request message according to a preset rule to obtain a plurality of fields;
converting each field into a field format corresponding to the target message version to obtain a field to be assembled;
and assembling the field to be assembled according to the target message version to obtain the message of the target message version.
4. The apparatus of claim 3, wherein, in a case where a return message of a plurality of target navigation feedback is received, the second format conversion unit is specifically configured to:
Converting each version of the returned message into a message version corresponding to the third party user platform identifier;
Carrying out aggregation treatment on the converted messages to obtain a total returned message;
and sending the total returned message to the third party user platform.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011083940.3A CN112214967B (en) | 2020-10-12 | 2020-10-12 | Message format conversion method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011083940.3A CN112214967B (en) | 2020-10-12 | 2020-10-12 | Message format conversion method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112214967A CN112214967A (en) | 2021-01-12 |
CN112214967B true CN112214967B (en) | 2024-08-02 |
Family
ID=74053249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011083940.3A Active CN112214967B (en) | 2020-10-12 | 2020-10-12 | Message format conversion method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112214967B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113329024A (en) * | 2021-06-01 | 2021-08-31 | 中国民航信息网络股份有限公司 | Method, device, equipment and storage medium for data message conversion |
CN113783860B (en) * | 2021-09-01 | 2023-11-28 | 建信金融科技有限责任公司 | Message processing method, device, equipment and storage medium based on visual configuration |
CN114070886A (en) * | 2021-11-17 | 2022-02-18 | 深圳壹账通智能科技有限公司 | Message conversion method, device, equipment and medium |
CN114328587B (en) * | 2021-12-30 | 2024-08-09 | 中国民航信息网络股份有限公司 | NDC message distributed analysis system architecture integration method and device |
CN114385263A (en) * | 2022-01-11 | 2022-04-22 | 中国民航信息网络股份有限公司 | Interface calling method and device, electronic equipment and storage medium |
CN114817398A (en) * | 2022-04-02 | 2022-07-29 | 中国民航信息网络股份有限公司 | Method and related device for replying message by substituting for frontier inspection system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107483592A (en) * | 2017-08-22 | 2017-12-15 | 中国银行股份有限公司 | A kind of transaction processing method based on General Front End Processor and a kind of General Front End Processor |
CN108075972A (en) * | 2017-11-17 | 2018-05-25 | 中国银行股份有限公司 | A kind of automatic route system of integrated layer and method |
CN110730181A (en) * | 2019-10-21 | 2020-01-24 | 中国民航信息网络股份有限公司 | Message conversion method, device and adapter |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20160016234A (en) * | 2014-08-04 | 2016-02-15 | 한국전자통신연구원 | Method and apparatus for tansforming packet format |
CN107040613B (en) * | 2017-06-05 | 2020-03-31 | 上海艾融软件股份有限公司 | Message transmission method and system |
CN110290127A (en) * | 2019-06-20 | 2019-09-27 | 云南电网有限责任公司电力科学研究院 | A kind of message forwarding method and message converting system |
-
2020
- 2020-10-12 CN CN202011083940.3A patent/CN112214967B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107483592A (en) * | 2017-08-22 | 2017-12-15 | 中国银行股份有限公司 | A kind of transaction processing method based on General Front End Processor and a kind of General Front End Processor |
CN108075972A (en) * | 2017-11-17 | 2018-05-25 | 中国银行股份有限公司 | A kind of automatic route system of integrated layer and method |
CN110730181A (en) * | 2019-10-21 | 2020-01-24 | 中国民航信息网络股份有限公司 | Message conversion method, device and adapter |
Also Published As
Publication number | Publication date |
---|---|
CN112214967A (en) | 2021-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112214967B (en) | Message format conversion method and device | |
CN110022289B (en) | Data transmission method, device and system | |
US20160277335A1 (en) | Method and system for providing private chat within a group chat | |
CN112527528A (en) | Data transmission method, device and storage medium based on message queue | |
US11868707B2 (en) | Information interaction method and apparatus, server, system, and storage medium | |
CN107169069B (en) | Distributed hierarchical extraction multi-application method and data extraction applicator | |
CN111338812A (en) | Data processing method and device | |
CN111338693B (en) | Model construction-based target file generation method, server and storage medium | |
CN112417016B (en) | Data exchange method, system, equipment and storage medium | |
GB2580421A (en) | Electronic message translation management | |
CN111046245A (en) | Multi-source heterogeneous data source fusion calculation method, system, equipment and storage medium | |
US20140068048A1 (en) | Managing remote devices | |
CN114443905A (en) | Interface document updating method and device, electronic equipment and readable storage medium | |
EP4280564A1 (en) | Message sending method and apparatus | |
CN111597156B (en) | Civil aviation data processing method and device, electronic equipment and storage medium | |
CN112291312A (en) | ETL data synchronization method and device, electronic equipment and storage medium | |
CN112988218A (en) | Configurable information flow management method and system | |
CN105281976A (en) | Method and apparatus for monitoring transmission of proxy service data | |
CN112230891A (en) | Interface document integration method and device, server and computer storage medium | |
CN110830912A (en) | Method, device, equipment and storage medium for extracting base station position information | |
CN108809900B (en) | Framework and method for unified resource access | |
CN113079055A (en) | Method and device for dynamically acquiring AGV (automatic guided vehicle) running data | |
CN117272236B (en) | Multi-source arrival time fusion method and system based on flight time sequence | |
US11799982B2 (en) | Message push method, apparatus, device and medium | |
CN116862604A (en) | Data processing method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |