An XML message comparison method and system, a storage medium and an electronic device

By automatically comparing XML messages from different message sources, generating a preset format and performing the comparison within a preset time range, the problem of low efficiency of manual comparison is solved, and efficient and accurate XML message comparison is achieved, ensuring the transparency of data source switching and the continuity of data consumers.

CN119849469BActive Publication Date: 2025-10-17TRAVELSKY TECHNOLOGY LIMITED
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411908522.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-10-17
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

In the existing technology, the manual comparison method of XML messages is inefficient and cannot guarantee the transparency of data source switching and the continuity of data consumers. Especially when the message volume is large, there are many scenarios and many fields, it cannot meet the project commissioning time requirements.

Method used

By receiving system messages from different message sources, determining the business primary key, comparing the updated data with the initial data, generating XML messages in a preset format, and automatically comparing XML messages with the same business primary key within a preset time range, the system can automatically compare them.

Benefits of technology

It realizes automated XML message comparison, saves labor costs, avoids omissions of differences or misjudgments, improves the efficiency and accuracy of comparison work, clearly locates the positions of difference fields, and improves the transparency and accuracy of data source switching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849469B_ABST
    Figure CN119849469B_ABST
Patent Text Reader

Abstract

The present disclosure belongs to the technical field of data processing, and provides an XML message comparison method and system, a storage medium and an electronic device. The method comprises receiving system messages of different message sending sources, determining a business primary key and corresponding update data; determining initial data corresponding to the business primary key, comparing the update data with the corresponding initial data, and determining whether the update data has a special event; generating an XML message in a preset format according to the update data with the special event and the corresponding business primary key; comparing the XML messages corresponding to the same business primary key and different message sending sources within a preset time range, and determining a comparison result. The XML message is automatically generated when the special event occurs, the XML messages corresponding to different message sending sources are automatically compared, the manual cost is saved, and missing or incorrect judgment is avoided; the difference field position in the XML message can be clearly and accurately located, and the efficiency and accuracy of the message comparison work are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure belongs to the technical field of data processing, and particularly relates to an XML message comparison method and system, a storage medium and an electronic device. BACKGROUND

[0002] The foreign host system that the enterprise as an information service provider once relied on has been unable to meet the growing business needs and changes in the times. At the same time, with the process of software localization, improving independent research and development capabilities, and fully utilizing new technologies to develop and build new open systems that meet market demand.

[0003] In the process of eliminating dependence on foreign host systems and shifting to open system construction, the instant data service software will receive different data sources, and different data sources are sent from the host system and the open system respectively. In this process, the data service software not only needs to ensure that the XML (eXtensible Markup Language) message generated according to the binary message of the host system is consistent with the content of the XML message generated according to the JSON (JavaScript Object Notation) message of the open system; it also needs to make the data consumer have no awareness of the data consumption process and use after the data source is switched. Therefore, a large amount of message comparison work needs to be done before the data source is switched from the host system to the open system for formal production, in order to ensure the transparency of data switching and the continuity and accuracy of data use by the data consumer.

[0004] In the prior art, when comparing the XML message generated by the binary message of the host system and the XML message generated by the JSON message of the open system, the two XML messages corresponding to different data sources are pulled down from the server by manual random sampling, the compare plug-in function provided by the text compiler is used, and the inconsistent content of each field is manually checked one by one, and the cause analysis and optimization scheme design are performed. This comparison method is not suitable for the case of large message volume, multiple business scenarios and multiple fields. Not only is the scene coverage not comprehensive, but also the manual comparison work efficiency is very low, and the project production time and data source switching transparency cannot be guaranteed. SUMMARY

[0005] To solve the above problems, the present disclosure provides an XML message comparison method, system, storage medium and electronic device, which adopts system messages of different message sending sources, determines a service primary key, compares update data and initial data corresponding to the same service primary key, judges whether there is a special event according to the comparison result of the update data and the initial data, and generates an XML message when the special event exists; the XML messages corresponding to the same service primary key and different message sending sources within a preset time range are compared to determine a comparison result, so that the system can automatically compare the XML messages.

[0006] The present application is implemented by the following technical solutions:

[0007] In a first aspect, the present disclosure provides an XML message comparison method, which comprises:

[0008] Receiving system messages of different message sending sources, determining a service primary key and corresponding update data;

[0009] Determining initial data corresponding to the service primary key, comparing the update data with the corresponding initial data, and determining whether the update data has a special event;

[0010] Generating an XML message in a preset format according to the update data with the special event and the corresponding service primary key;

[0011] Comparing the XML messages corresponding to the same service primary key and different message sending sources within a preset time range to determine a comparison result.

[0012] Further,

[0013] Receiving a first system message, parsing the received first system message, determining a service primary key and corresponding first message data and a first timestamp, and storing the first message data and the first timestamp corresponding to the service primary key to a first database;

[0014] Receiving a second system message, parsing the received second system message, determining a service primary key and corresponding second message data and a second timestamp, and storing the second message data and the second timestamp corresponding to the service primary key to a second database;

[0015] Wherein, the first system message and the second system message correspond to different message sending sources.

[0016] Further,

[0017] Inquiring the service primary key in the first database, if the service primary key is not inquired in the first database, establishing the service primary key in the first database, the first message data is determined as first initial data, the first time stamp is determined as first initial time stamp, and the first initial data and the first initial time stamp corresponding to the service primary key are stored in the first database;

[0018] Inquiring the service primary key in the second database, if the service primary key is not inquired in the second database, establishing the service primary key in the second database, the second message data is determined as second initial data, the second time stamp is determined as second initial time stamp, and the second initial data and the second initial time stamp corresponding to the service primary key are stored in the second database.

[0019] Further,

[0020] Inquiring the service primary key in the first database, if the service primary key corresponding first initial data and first initial time stamp are inquired in the first database, the first message data is determined as first update data, the first time stamp is determined as first update time stamp, and the first update data and the first update time stamp corresponding to the service primary key are stored in the first database.

[0021] Inquiring the service primary key in the second database, if the service primary key corresponding second initial data and second initial time stamp are inquired in the second database, the second message data is determined as second update data, the second time stamp is determined as second update time stamp, and the second update data and the second update time stamp corresponding to the service primary key are stored in the second database.

[0022] Further,

[0023] Determining the first initial data and first initial time stamp corresponding to the service primary key through the first database, if the first update time stamp and the first initial time stamp conform to time sequence, comparing the first initial data and first update data, and judging whether the first update data exists special event;

[0024] Determining the second initial data and second initial time stamp corresponding to the service primary key through the second database, if the second update time stamp and the second initial time stamp conform to time sequence, comparing the second initial data and second update data, and judging whether the second update data exists special event.

[0025] Further,

[0026] After the first initial data and the first update data are compared, the first update data is reserved in the first database, and the first initial data is deleted.

[0027] After the comparison of the second initial data and the second update data is completed, the first update data is retained in the second database, and the second initial data is deleted.

[0028] Further,

[0029] A preset format of the first XML message and the second XML message is set, and the preset format includes a message structure and a field naming; wherein the first XML message and the second XML message correspond to different message sending sources;

[0030] If the first update data exists a special event, the first XML message in the preset format is generated according to the first update data and a corresponding business primary key; if the second update data exists a special event, the second XML message in the preset format is generated according to the second update data and a corresponding business primary key;

[0031] The generated first XML message and second XML message are subjected to correctness and integrity check.

[0032] Further,

[0033] A preset time range is determined, the preset time range includes a preset regular time and a preset supplementary time, the preset supplementary time is later than the preset regular time, and the preset supplementary time and the preset regular time are continuous;

[0034] If in the preset regular time, there exists corresponding first XML message and second XML message of the same business primary key, the first XML message and the second XML message are extracted, and the extracted first XML message and second XML message are used for comparison;

[0035] If in the preset regular time, there exists only one XML message of one of the message sending sources corresponding to the same business primary key, in the preset supplementary time, it is determined whether there exists another XML message of another of the message sending sources corresponding to the business primary key.

[0036] Further,

[0037] In the preset time range, there exists corresponding one of the first XML message and one of the second XML message of the same business primary key, the first XML message and the second XML message are extracted, and the extracted first XML message and second XML message are used for comparison;

[0038] In a preset time range, the same business primary key has a plurality of the first XML messages and / or a plurality of the second XML messages corresponding thereto, the last generated first XML message and the last generated second XML message in time sequence are extracted, and the extracted first XML message and the extracted second XML message are used for comparison.

[0039] Further,

[0040] The comparison results of the XML messages are stored and summarized, and the comparison results of the XML messages are displayed.

[0041] In a second aspect, the embodiments of the present disclosure provide an XML message comparison system, which comprises a data analysis module, a data storage module, a message structuring module and a message comparison module.

[0042] The data analysis module is configured to receive system messages of different message sending sources, determine a business primary key and corresponding update data.

[0043] The data storage module is configured to determine initial data corresponding to the business primary key, compare the update data with the corresponding initial data, and determine whether the update data has a special event.

[0044] The message structuring module is configured to generate an XML message in a preset format according to the update data having the special event and the corresponding business primary key.

[0045] The message comparison module is configured to compare XML messages corresponding to the same business primary key and different message sending sources in a preset time range, and determine a comparison result.

[0046] In a third aspect, based on the same inventive concept, the embodiments of the present disclosure also provide a computer readable storage medium, which stores one or more programs, when the one or more programs are executed, the XML message comparison method described above can be implemented.

[0047] In a fourth aspect, based on the same inventive concept, the embodiments of the present disclosure also provide an electronic device, which comprises a processor, a communication interface, the computer readable storage medium described above and a communication bus. The processor, the communication interface and the computer readable storage medium communicate with each other through the communication bus. The processor is configured to execute the program stored in the computer readable storage medium.

[0048] Compared with the prior art, the present disclosure has the following advantages:

[0049] 1. Automatically generate XML messages when a special event occurs, and compare the XML messages corresponding to different message sending sources within a preset time range, to realize automatic comparison of XML messages, save labor costs, and avoid missing or incorrect judgment of differences in the manual comparison process;

[0050] 2. The difference field position in the XML message can be clearly and accurately located, the difference reason classification and analysis are better, and the efficiency and accuracy of the message comparison work are greatly improved.

[0051] Other features and advantages of the present disclosure will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or will be learned by practice of the present disclosure. The objects and other advantages of the present disclosure can be achieved and obtained by the structure indicated in the specification, claims and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0053] Figure 1 A flow chart of an XML message comparison method provided by the embodiment of the present disclosure;

[0054] Figure 2 Another flow chart of an XML message comparison method provided by the embodiment of the present disclosure;

[0055] Figure 3 A block diagram of an XML message comparison system provided by the embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described in the following with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some embodiments of the present disclosure, not all embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present disclosure.

[0057] In a first aspect, Figure 1 A flow chart of an XML message comparison method provided by the embodiment of the present disclosure is shown in Figure 1 The embodiment of the present disclosure provides an XML message comparison method, which comprises:

[0058] S1: receiving system messages of different message sending sources, determining a service primary key and corresponding update data.

[0059] S2: determining initial data corresponding to the service primary key, comparing the update data with the corresponding initial data, and determining whether the update data has a special event.

[0060] S3: generating an XML message in a preset format according to the update data having the special event and the corresponding service primary key.

[0061] S4: comparing XML messages corresponding to the same service primary key and different message sending sources within a preset time range, and determining a comparison result.

[0062] In the embodiments of the present disclosure, system messages of different message sending sources are received, a service primary key is determined, update data and initial data corresponding to the same service primary key are compared, and whether a special event exists is determined according to a comparison result of the update data and the initial data. When the special event exists, an XML message is generated. XML messages corresponding to the same service primary key and different message sending sources within a preset time range are compared, and a comparison result is determined, so as to realize automatic comparison of the XML messages by the system.

[0063] In some examples, system messages of different message sending sources are received, a service primary key and corresponding update data are determined, and the specific steps include:

[0064] S11: receiving a first system message, parsing the received first system message, determining a service primary key and corresponding first message data and a first timestamp; receiving a second system message, parsing the received second system message, and determining the service primary key and corresponding second message data and a second timestamp.

[0065] Specifically, the message sending sources include a host system and an open system. In the disclosure, the host system mainly refers to a foreign system, and the open system mainly refers to a system independently constructed in China. The first system message is a binary format departure flight message provided by the host system, and the second system message is a JSON format departure flight message provided by the open system. The analysis of the first system message and the second system message mainly includes parsing the first system message and the second system message into data objects available under the same definition; a business primary key in the database only corresponds to the same flight on the same flight day, and correspondingly, the same flight on the same flight day only corresponds to one business primary key. Therefore, the business primary key and the same flight on the same flight day have a corresponding relationship in the database. Understandably, one business primary key in the database can also only correspond to one passenger and passenger related information data, and one business primary key in the database can also only correspond to one passenger and passenger related information data. In the embodiment of the disclosure, the same flight on the same flight day is mainly taken as an example for description.

[0066] Further, the database is specifically divided into a first database and a second database. The first message data and the first timestamp corresponding to the business primary key are stored in the first database, and the second message data and the second timestamp corresponding to the business primary key are stored in the second database.

[0067] In some examples, receiving system messages of different message sending sources, determining the business primary key and the corresponding update data further includes:

[0068] S12: Querying the business primary key in the first database, if the business primary key is not queried in the first database, establishing the business primary key in the first database, determining the first message data as first initial data, determining the first timestamp as a first initial timestamp, and storing the first initial data and the first initial timestamp corresponding to the business primary key in the first database.

[0069] S13: Querying the business primary key in the second database, if the business primary key is not queried in the second database, establishing the business primary key in the second database, determining the second message data as second initial data, determining the second timestamp as a second initial timestamp, and storing the second initial data and the second initial timestamp corresponding to the business primary key in the second database.

[0070] In some examples, receiving system messages of different message sending sources, determining the business primary key and the corresponding update data further includes:

[0071] S12': Querying the business primary key in the first database, if the business primary key corresponding to the first initial data and the first initial timestamp is queried in the first database, determining the first message data as first update data, determining the first timestamp as a first update timestamp, and storing the first update data and the first update timestamp corresponding to the business primary key in the first database.

[0072] S13': Query the business primary key in the second database. If the second initial data and the second initial timestamp corresponding to the business primary key are found in the second database, the second message data is determined as the second updated data, and the second timestamp is determined as the second updated timestamp. The business primary key corresponding to the second updated data and the second updated timestamp is stored in the second database.

[0073] It is understandable that the process of receiving the first system message and the second system message is a continuous process, which will update the first database and the second database in real time, generate a new business primary key, and update the message data corresponding to the business primary key.

[0074] In some examples, determining initial data corresponding to a business primary key, comparing updated data with the corresponding initial data, and determining whether a special event exists in the updated data specifically includes:

[0075] S21: Determine the first initial data and the first initial timestamp corresponding to the business primary key through the first database. If the first update timestamp and the first initial timestamp are in chronological order, compare the first initial data with the first update data to determine whether there is a special event in the first update data.

[0076] S22: Determine the second initial data and the second initial timestamp corresponding to the business primary key through the second database. If the second update timestamp and the second initial timestamp are in chronological order, compare the second initial data and the second update data to determine whether there is a special event in the second update data.

[0077] Specifically, if the first update timestamp is later than the first initial timestamp, then the time sequence is met; if the second update timestamp is later than the second initial timestamp, then the time sequence is met. Special events refer to events triggered by business changes such as changes in the same flight / passenger from the host system and the open system during flight data processing. These events include changes in flight information (such as changes in flight number, takeoff time, landing time, aircraft model, etc.), changes in passenger information (such as changes in name, seat number, luggage information, etc.), and other key information changes related to flight operations. When a special event occurs, a corresponding XML message needs to be generated and fed back to the system user; in the present disclosure, the corresponding XML message is generated and also used for subsequent comparison and processing. The first initial data is compared with the first updated data, and the second initial data is compared with the second updated data. By comparing the differences determined, it is determined whether the differences meet the trigger conditions and standards, thereby determining whether the first updated data and the second updated data have a special event.

[0078] In some examples, after determining the initial data corresponding to the business primary key, comparing the updated data with the corresponding initial data, and determining whether a special event exists based on the comparison result of the updated data with the corresponding initial data, the following steps are further included:

[0079] S21 ′: After the first initial data and the first updated data are compared, the first updated data is retained in the first database and the first initial data is deleted.

[0080] Specifically, in the first database, only one complete data is retained for the same business primary key. Therefore, after the first initial data and the first updated data corresponding to the same business primary key are compared, the first initial data of the business primary key is deleted and the corresponding first updated data is retained.

[0081] S22 ′: After the second initial data and the second updated data are compared, the first updated data is retained in the second database and the second initial data is deleted.

[0082] Specifically, in the second database, only one complete data is retained for the same business primary key. Therefore, after the second initial data and the second updated data corresponding to the same business primary key are compared, the second initial data of the business primary key is deleted and the corresponding second updated data is retained.

[0083] In some examples, a preset format XML message is generated based on the update data of a special event and the corresponding business primary key, specifically including:

[0084] S31: Setting a preset format of the first XML message and the second XML message, where the preset format includes a message structure and field naming.

[0085] Specifically, the first XML message corresponds to the host system, and the second XML message corresponds to the open system.

[0086] S32: If a special event exists in the first updated data, a first XML message in a preset format is generated according to the first updated data and the corresponding business primary key; if a special event exists in the second updated data, a second XML message in a preset format is generated according to the second updated data and the corresponding business primary key.

[0087] Specifically, when the first XML message and the second XML message are generated, the first XML message timestamp and the second XML message timestamp are correspondingly generated and recorded in the system for subsequent extraction of the first XML message and the second XML message. Due to the existence of different special events, the first update data exists a special event, and when the first XML message in the preset format is generated according to the first update data and the corresponding business primary key, the corresponding first initial data can also be combined; correspondingly, the first update data exists a special event, and when the first XML message in the preset format is generated according to the first update data and the corresponding business primary key, the corresponding first initial data can also be combined.

[0088] S33: The correctness and integrity of the generated first XML message and the second XML message are checked.

[0089] In some examples, the XML messages corresponding to the same business primary key and different message sending sources in a preset time range are compared to determine the comparison result, specifically including:

[0090] S41: A preset time range is determined, the preset time range includes a preset regular time and a preset supplementary time, the preset supplementary time is later than the preset regular time, and the preset supplementary time and the preset regular time are continuous.

[0091] Specifically, the preset time range includes the preset regular time and the preset supplementary time, the preset supplementary time is set mainly to compensate for the possible hour difference when the host system and the open system push the message; the preset supplementary time should not be set too long, for example, the preset regular time is set to 1 hour, and the preset supplementary time is set to 10 minutes.

[0092] S42: If there are corresponding first XML messages and second XML messages for the same business primary key in the preset regular time, the first XML messages and the second XML messages are extracted, and the extracted first XML messages and the second XML messages are compared.

[0093] Specifically, in the preset regular time, the same business primary key exists corresponding first XML messages and second XML messages, which can be directly extracted for comparison. Understandably, there are also multiple first XML messages and / or multiple second XML messages corresponding to the same business primary key in the preset regular time, at this time, the last generated first XML message and the second XML message in the preset regular time need to be extracted for comparison.

[0094] S43: If there is only one message sending source XML message corresponding to the same business primary key in the preset regular time, it is determined whether there is another message sending source XML message corresponding to the business primary key in the preset supplementary time.

[0095] Specifically, in the preset regular time, only the first XML message exists for the same service primary key, and in the preset supplementary time, it is determined whether the second XML message corresponding to the service primary key exists. In the preset regular time, only the second XML message exists for the same service primary key, and in the preset supplementary time, it is determined whether the first XML message corresponding to the service primary key exists.

[0096] It can be understood that the first XML message is determined by the first system message sent by the host system, and the message sending source corresponding to the first XML message is the host system. The second XML message is determined by the second system message sent by the host system, and the message sending source corresponding to the second XML message is the open system.

[0097] In the embodiment of the present disclosure, in a preset time range, one first XML message and one second XML message corresponding to the same service primary key exist, then the first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are used for comparison. In the preset time range, multiple first XML messages and / or multiple second XML messages corresponding to the same service primary key exist, the last generated first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are used for comparison.

[0098] Specifically, in the entire preset time range, only one first XML message and one second XML message corresponding to the same service primary key exist, then the first XML message and the second XML message are directly extracted; if in the entire preset time range, multiple first XML messages and / or multiple second XML messages corresponding to the same service primary key exist, the last generated first XML message and the second XML message are extracted.

[0099] Further, in the preset regular time, only the first XML message exists for the same service primary key, then in the preset supplementary time, it is determined whether the second XML message corresponding to the service primary key exists, if the second XML message corresponding to the service primary key exists in the preset supplementary time, and a new first XML message corresponding to the service primary key also exists, then the first XML message and the second XML message in the preset supplementary time are extracted. Conversely, in the preset regular time, only the second XML message exists for the same service primary key, then in the preset supplementary time, it is determined whether the first XML message corresponding to the service primary key exists, if the first XML message corresponding to the service primary key exists in the preset supplementary time, and a new second XML message corresponding to the service primary key also exists, then the first XML message and the second XML message in the preset supplementary time are extracted.

[0100] In the embodiments of the present disclosure, the comparison of the XML messages mainly includes comparing the message format of the XML messages, comparing the message structure, identifying whether there are different fields, for example, a certain field exists in one XML message but does not exist in another XML message, and identifying the difference of the field values of the two XML messages.

[0101] In some examples, the XML message comparison method further includes:

[0102] S5: store and summarize the comparison results of the XML messages, and display the comparison results of the XML messages.

[0103] Specifically, the comparison results of the XML messages are summarized and stored, and the comparison results of the XML messages are displayed, realizing the visualization of the comparison results of the XML messages. The comparison results of the XML messages are summarized and displayed, including the comparison results of the XML messages corresponding to the host system and the open system, the difference comparison of the XML messages corresponding to the host system and the open system, the difference hotspot statistics, the difference proportion, and the like. By summarizing and displaying the comparison results of the XML messages, the differences and the parts prone to differences can be intuitively displayed to the project personnel, which helps the project personnel to evaluate the related systems.

[0104] Embodiment 1

[0105] In the embodiments of the present disclosure, the message sending source includes a host system and an open system, the first system message is a binary format departure flight message provided by the host system, and the second system message is a JSON format departure flight message provided by the open system. The first XML message is determined by the first system message sent by the host system, and the message sending source corresponding to the first XML message is the host system. The second XML message is determined by the second system message sent by the host system, and the message sending source corresponding to the second XML message is the open system. As shown in Figure 2 The flow of the XML message comparison method provided by the embodiments of the present disclosure includes:

[0106] S101: establish the business primary key of the same flight on the same flight day in the database.

[0107] The first system message of CA1234 flight with a flight date of June 16, 2024 is collected by ANT (host disk direct reading tool) provided by the host system, and the first system message is a binary format departure flight message provided by the host system. The first system message is received, and the received first system message is parsed to determine the business primary key and the corresponding first message data and first timestamp. The parsing of the first system message mainly includes parsing the first system message into available data objects under the same definition; a business primary key in the first database only corresponds to the same flight on the same flight day, and correspondingly, the same flight on the same flight day only corresponds to one business primary key, therefore, the business primary key and the same flight on the same flight day in the first database have a corresponding relationship.

[0108] The business primary key is queried in the first database, if the business primary key is not queried in the first database, the business primary key is established in the first database, the first message data is determined as the first initial data, the first timestamp is determined as the first initial timestamp, and the first initial data and the first initial timestamp corresponding to the business primary key are stored in the first database.

[0109] The second system message of CA1234 flight with a flight date of June 16, 2024 is received by MES (Micoservice Event Server, microservice message system) provided by the open system, and the second system message is a JSON format departure flight message provided by the open system. The second system message is received, and the received second system message is parsed to determine the business primary key and the corresponding second message data and second timestamp.

[0110] The business primary key is queried in the second database, if the business primary key is not queried in the second database, the business primary key is established in the second database, the second message data is determined as the second initial data, the second timestamp is determined as the second initial timestamp, and the second initial data and the second initial timestamp corresponding to the business primary key are stored in the second database.

[0111] S102: Obtain update data.

[0112] The first system message of CA1234 flight with a flight date of June 16, 2024 is collected by ANT provided by the host system, and the first system message is a binary format departure flight message provided by the host system. The first system message is received, and the received first system message is parsed to determine the business primary key and the corresponding first message data and first timestamp. If the business primary key corresponding to the first initial data and the first initial timestamp is queried in the first database, the first message data is determined as the first update data, and the first timestamp is determined as the first update timestamp.

[0113] The second system message of CA1234 flight on June 16, 2024 is received by the MES from the open system, and the second system message is the JSON format of the open system. The second system message is parsed to determine the business primary key and the corresponding second message data and second timestamp. If the second initial data and the second initial timestamp corresponding to the business primary key are queried in the second database, the second message data is determined as the second update data, and the second timestamp is determined as the second update timestamp.

[0114] It can be understood that receiving the first system message and the second system message is a continuous process; the first update data and the first update timestamp corresponding to the business primary key are stored in the first database; and the second update data and the second update timestamp corresponding to the business primary key are stored in the second database.

[0115] S103: The update data is compared with the corresponding initial data.

[0116] After determining the first update data and the first update timestamp, the corresponding first initial data and the first initial timestamp are determined by the business primary key. It is judged whether the first initial timestamp and the first update timestamp conform to the time sequence. If the first update timestamp is later than the first initial timestamp, it conforms to the time sequence. For example, the first initial timestamp is 202406160124987, and the first update timestamp is 202406160126664. The first update timestamp is greater than the first initial timestamp, so the first update timestamp is later than the first initial timestamp, which conforms to the time sequence. The first initial data and the first update data are compared to determine whether there is a special event.

[0117] After determining the second update data and the second update timestamp, the corresponding second initial data and the second initial timestamp are determined by the business primary key. It is judged whether the second initial timestamp and the second update timestamp conform to the time sequence. If the second update timestamp is later than the second initial timestamp, it conforms to the time sequence. The first initial data and the first update data are compared to determine whether there is a special event.

[0118] The special event refers to an event triggered by a same flight / passenger business change from a host system and an open system in a flight data processing process. The event includes a change of flight information (such as a change of a flight number, a takeoff time, a landing time, a model, etc.), a change of passenger information (such as a change of a name, a seat number, baggage information, etc.), and other changes of key information related to flight operation. When the special event occurs, a corresponding XML message needs to be generated, and the XML message is fed back to a system user; in the present disclosure, the corresponding XML message is also used for subsequent comparison and processing. The comparison of the first initial data and the first update data, the comparison of the second initial data and the second update data, the difference determined by the comparison, the judgment of whether the difference meets a trigger condition and a standard, and the determination of whether the first update data and the second update data exist the special event.

[0119] In the first database, only one complete data is retained for a same business primary key, and therefore, after the comparison of the first initial data and the first update data corresponding to the same business primary key is completed, the first initial data of the business primary key is deleted, and the first update data is correspondingly retained. Similarly, in the second database, only one complete data is retained for a same business primary key, and therefore, after the comparison of the second initial data and the second update data corresponding to the same business primary key is completed, the second initial data of the business primary key is deleted, and the second update data is correspondingly retained.

[0120] S104: An XML message in a preset format is generated.

[0121] The preset format of the first XML message and the second XML message is set, and the preset format includes a message structure and a field naming. If the first update data exists the special event, the first XML message in the preset format is generated according to the first update data and a corresponding business primary key; if the second update data exists the special event, the second XML message in the preset format is generated according to the second update data and a corresponding business primary key; the first XML message corresponds to the host system, and the second XML message corresponds to the open system. When the first XML message and the second XML message are generated, a first XML message timestamp and a second XML message timestamp are correspondingly generated and recorded in the system, and are used for subsequent extraction of the first XML message and the second XML message. The generated first XML message and the second XML message are subjected to correctness and integrity checking.

[0122] S105: The XML messages corresponding to a same business primary key and different message sending sources are compared.

[0123] The preset time range includes a preset regular time and a preset supplementary time. The preset supplementary time is set mainly for making up the possible time difference between the host system and the open system when pushing the message. The preset supplementary time should not be set too long. In the embodiment of the present disclosure, the preset regular time is set to 1 hour, and the preset supplementary time is set to 10 minutes. The preset time range is one hour and ten minutes continuously in time.

[0124] In one hour, the same business primary key has a corresponding first XML message and a second XML message, and then the first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are compared. In one hour, the same business primary key has only an XML message of one message sending source, and then within 10 minutes after one hour, it is determined whether there is an XML message of another message sending source corresponding to the business primary key. For example, the CA1234 flight with the flight date of June 16, 2024 has flight information change, and the flight model is changed. The flight information change belongs to a special event, and then the first XML message and the second XML message are generated. The first XML message is generated between 23:00 and 24:00 on June 14, and the first XML message timestamp is 202406142357986. There is no corresponding second XML message between 23:00 and 24:00 on June 14. The second XML message is generated at 00:01 on June 15, and the second XML message timestamp is 202406150001562. At this time, the first XML message and the second XML are within the preset time range, the first XML message is within the preset regular time, and the second XML message is within the preset supplementary time, and the first XML message and the second XML message can be compared.

[0125] In the embodiment of the present disclosure, in the preset time range, the same business primary key has a corresponding first XML message and a second XML message, and then the first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are compared. In the preset time range, the same business primary key has a plurality of first XML messages and / or a plurality of second XML messages, and then the last generated first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are compared.

[0126] Specifically, in the entire preset time range, the same business primary key corresponds to only one first XML message and one second XML message, and then the first XML message and the second XML message are directly extracted. If in the entire preset time range, the same business primary key corresponds to a plurality of first XML messages and / or a plurality of second XML messages, then the last generated first XML message and the second XML message are extracted.

[0127] Further, in the preset regular time, only the first XML message exists for the same service primary key, then in the preset supplementary time, it is determined whether the second XML message corresponding to the service primary key exists, if the second XML message corresponding to the service primary key exists in the preset supplementary time, and a new first XML message corresponding to the service primary key also exists, then the first XML message and the second XML message in the preset supplementary time are extracted. Conversely, in the preset regular time, only the second XML message exists for the same service primary key, then in the preset supplementary time, it is determined whether the first XML message corresponding to the service primary key exists, if the first XML message corresponding to the service primary key exists in the preset supplementary time, and a new second XML message corresponding to the service primary key also exists, then the first XML message and the second XML message in the preset supplementary time are extracted.

[0128] In the embodiments of the present disclosure, the comparison of the XML messages mainly includes comparing the message format of the XML messages, the message structure, identifying whether there are different fields, for example, a certain field exists in one XML message but does not exist in another XML message, identifying the difference of the field values of the two XML messages, etc.

[0129] S106: The comparison result of the XML message is displayed.

[0130] The comparison result of the XML message is summarized and stored, and the comparison result of the XML message is displayed, realizing the visualization of the comparison result of the XML message. The summary and display of the comparison result of the XML message include: the comparison result summary of the XML messages corresponding to the host system and the open system, the difference comparison of the XML messages corresponding to the host system and the open system, the difference hotspot statistics, the difference proportion, etc. By summarizing and displaying the comparison result of the XML message, the differences and the parts prone to differences can be intuitively displayed to the project personnel, which helps the project personnel to evaluate the related system.

[0131] In a second aspect, Figure 3 A system block diagram of the XML message comparison system provided by the embodiments of the present disclosure is as follows: Figure 3As shown, based on the same inventive concept, the embodiment of the disclosure also provides an XML message comparison system, which comprises a data analysis module, a data storage module, a message structuring module and a message comparison module. The data analysis module is used to receive system messages of different message sending sources, determine the business primary key and the corresponding update data. The data storage module is used to determine the initial data corresponding to the business primary key, compare the update data with the corresponding initial data, and determine whether the update data exists special event. The message structuring module is used to generate XML messages in a preset format according to the update data with special event and the corresponding business primary key. The message comparison module is used to compare the XML messages corresponding to the same business primary key and different message sending sources within a preset time range, and determine the comparison result.

[0132] In some examples, the XML message comparison system further comprises a visualization module for storing and summarizing the comparison results of the XML messages, and displaying the comparison results of the XML messages. The comparison results of the XML messages are summarized and stored, and the comparison results of the XML messages are displayed, realizing the visualization of the comparison results of the XML messages. The comparison results of the XML messages are summarized and displayed, including the comparison results of the XML messages corresponding to the host system and the open system, the difference comparison of the XML messages corresponding to the host system and the open system, the difference hotspot statistics, the difference proportion and the like. By summarizing and displaying the comparison results of the XML messages, the differences and the parts prone to differences can be intuitively displayed to the project personnel, which helps the project personnel to evaluate the related system.

[0133] In a third aspect, based on the same inventive concept, the embodiment of the disclosure also provides a computer readable storage medium, which stores one or more programs, when the one or more programs are executed, the XML message comparison method described above can be implemented.

[0134] In a fourth aspect, based on the same inventive concept, the embodiment of the disclosure also provides an electronic device, which comprises a processor, a communication interface, the aforementioned computer readable storage medium and a communication bus. Wherein, the processor, the communication interface and the computer readable storage medium communicate with each other through the communication bus. Wherein, the processor is used to execute the program stored in the aforementioned computer readable storage medium.

[0135] It should be noted that the electrical connection between the above-mentioned various units does not necessarily mean the connection between the lines, the indirect connection mode, as long as the purpose of the disclosure can be achieved and is applicable to the embodiment of the disclosure.

[0136] Although the present disclosure is explained in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. An XML message comparison method, characterized in that: The method comprises: Receive system messages from different message sources and determine the business primary key and the corresponding update data; Determine the initial data corresponding to the business primary key, compare the updated data with the corresponding initial data, and determine whether there is a special event in the updated data; Generate an XML message in a preset format according to the updated data of the special event and the corresponding business primary key; The XML messages corresponding to different message sending sources with the same business primary key within a preset time range are compared to determine a comparison result.

2. The method according to claim 1, characterized in that The receiving system messages from different message sending sources and determining the service primary key and the corresponding update data includes: Receiving a first system message, parsing the received first system message, determining a business primary key and corresponding first message data and a first timestamp; storing the business primary key corresponding to the first message data and the first timestamp in a first database; Receiving a second system message, parsing the received second system message, determining a business primary key and corresponding second message data and a second timestamp; storing the business primary key corresponding to the second message data and the second timestamp in a second database; The first system message and the second system message correspond to different message sending sources.

3. The method according to claim 2, characterized in that The receiving of system messages from different message sending sources and determining the service primary key and the corresponding update data further includes: querying the first database for a business primary key; if the business primary key is not found in the first database, establishing the business primary key in the first database, determining the first message data as first initial data, determining the first timestamp as a first initial timestamp, and storing the first initial data and the first initial timestamp in the first database corresponding to the business primary key; The business primary key is queried in the second database. If the business primary key is not found in the second database, the business primary key is established in the second database, the second message data is determined as the second initial data, the second timestamp is determined as the second initial timestamp, and the second initial data and the second initial timestamp are stored in the second database corresponding to the business primary key.

4. The method according to claim 2, characterized in that Receive system messages from different message sources, determine the business primary key and the corresponding update data, and also include: querying the first database for a business primary key; if first initial data and a first initial timestamp corresponding to the business primary key are found in the first database, determining the first message data as first updated data, determining the first timestamp as a first updated timestamp, and storing the business primary key corresponding to the first updated data and the first updated timestamp in the first database; The business primary key is queried in the second database. If the second initial data and the second initial timestamp corresponding to the business primary key are queried in the second database, the second message data is determined as the second updated data, and the second timestamp is determined as the second updated timestamp. The business primary key corresponding to the second updated data and the second updated timestamp is stored in the second database.

5. The method according to claim 1, wherein Determining the initial data corresponding to the business primary key, comparing the updated data with the corresponding initial data, and determining whether a special event occurs in the updated data, includes: Determining, through the first database, first initial data and a first initial timestamp corresponding to the business primary key; and if the first update timestamp and the first initial timestamp are in chronological order, comparing the first initial data with the first update data to determine whether a special event occurs in the first update data; Through the second database, determine the second initial data and the second initial timestamp corresponding to the business primary key. If the second update timestamp and the second initial timestamp are in chronological order, compare the second initial data and the second update data to determine whether there is a special event in the second update data.

6. The method according to claim 5, characterized in that After determining the initial data corresponding to the business primary key, comparing the updated data with the corresponding initial data, and determining whether a special event exists in the updated data, the method further includes: After the first initial data and the first updated data are compared, the first updated data is retained in the first database and the first initial data is deleted; After the second initial data and the second updated data are compared, the first updated data is retained in the second database and the second initial data is deleted.

7. The method according to claim 1, characterized in that The XML message in a preset format is generated based on the updated data of the special event and the corresponding business primary key, including Setting a preset format of a first XML message and a second XML message, wherein the preset format includes a message structure and field naming; wherein the first XML message and the second XML message correspond to different message sending sources; If a special event exists in the first update data, the first XML message of the preset format is generated according to the first update data and the corresponding business primary key; if a special event exists in the second update data, the second XML message of the preset format is generated according to the second update data and the corresponding business primary key; The generated first XML message and second XML message are verified for correctness and integrity.

8. The method according to claim 1, characterized in that The step of comparing XML messages corresponding to different message sending sources with the same business primary key within a preset time range and determining a comparison result includes: Determine a preset time range, the preset time range including a preset regular time and a preset supplementary time, the preset supplementary time is later than the preset regular time, and the preset supplementary time and the preset regular time are continuous; If, during the preset regular time, a corresponding first XML message and a corresponding second XML message exist for the same business primary key, extracting the first XML message and the second XML message, and performing a comparison using the extracted first XML message and the second XML message; If, during the preset regular time, the same service primary key only exists in an XML message from one of the message sending sources, then during the preset supplementary time, it is determined whether there exists an XML message from another message sending source corresponding to the service primary key.

9. The method according to claim 8, characterized in that The comparing of XML messages corresponding to different message sending sources with the same business primary key within a preset time range to determine the comparison result further includes: If, within a preset time range, there exists a corresponding first XML message and a corresponding second XML message for the same business primary key, the first XML message and the second XML message are extracted, and the extracted first XML message and the second XML message are used for comparison; Within a preset time range, there are multiple first XML messages and / or multiple second XML messages corresponding to the same business primary key. The first XML message and the second XML message generated last in time sequence are extracted, and the extracted first XML message and the second XML message are used for comparison.

10. The method according to claim 1, characterized in that The XML message comparison method further includes: The comparison results of the XML messages are stored and summarized, and the comparison results of the XML messages are displayed.

11. An XML message comparison system, characterized in that: The system includes: a data analysis module, a data storage module, a message structuring module and a message comparison module; The data parsing module is used to receive system messages from different message sending sources and determine the business primary key and the corresponding update data; The data storage module is configured to determine the initial data corresponding to the business primary key, compare the updated data with the corresponding initial data, and determine whether a special event exists in the updated data; The message structuring module is used to generate an XML message in a preset format according to the update data of the special event and the corresponding business primary key; The message comparison module is used to compare XML messages corresponding to different message sending sources with the same business primary key within a preset time range to determine a comparison result.

12. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed, the XML message comparison method according to any one of claims 1 to 10 can be implemented.

13. An electronic device comprising a processor, a communication interface, the computer-readable storage medium according to claim 12, and a communication bus; wherein: The processor, the communication interface, and the computer-readable storage medium communicate with each other via a communication bus; It is characterized in that The processor is configured to execute a program stored in a computer-readable storage medium.

Citation Information

Patent Citations

  • Method and system for generating and updating XML message template

    CN110222236A

  • Aircraft fault information real-time subscription system

    CN112702386A