XML message comparison method and system, storage medium and electronic equipment

Through the method of automatically comparing XML messages, the problem of low manual comparison efficiency in the prior art is solved, and the transparency of data source switching and the sustainability and accuracy of data consumers are achieved.

CN119849469AActive Publication Date: 2025-04-18TRAVELSKY TECHNOLOGY LIMITED
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, XML packet comparison mainly relies on manual random sampling, which is inefficient and cannot guarantee the transparency of data source switching and the continuity and accuracy of data consumers.

Method used

By receiving system messages from different message sending sources, determine the service primary key, and compare the update data corresponding to the same service primary key with the initial data to determine whether there is a special event. Generate XML messages based on the comparison results, and compare XML messages from different messages sent from the same service primary key within the preset time range to realize automatic comparison.

Benefits of technology

It realizes that the system automatically compares XML messages, saves labor costs, avoids differences or misjudgment in manual comparison, and improves the efficiency and accuracy of comparison work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849469A_ABST
    Figure CN119849469A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and provides an XML message comparison method and system, a storage medium and electronic equipment, and the method comprises the steps: receiving system messages of different message sending sources, and determining a service main key and corresponding update data; determining initial data corresponding to the service primary key, comparing the updated data with the corresponding initial data, and determining whether the updated 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 service main key; and comparing the XML messages corresponding to different message sending sources of the same service primary key within a preset time range, and determining a comparison result. When a special event occurs, the XML message is automatically generated, the XML messages corresponding to different message sending sources are automatically compared, the labor cost is saved, and missing or wrong judgment is avoided; the position of the difference field in the XML message can be clearly and accurately positioned, and the efficiency and accuracy of message comparison work are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and in particular, relates to an XML message comparison method, system, storage medium and electronic device. Background Art

[0002] As an information service provider, the foreign mainframe systems that enterprises once relied on can no longer meet the growing business needs and changes in the times. At the same time, with the progress of software localization, we should enhance our independent research and development capabilities and make full use of new technologies to develop and build new open systems that meet market needs.

[0003] In the process of eliminating dependence on foreign host systems and shifting to open system construction, real-time data service software will receive different data sources, which are sent from the host system and the open system respectively. In this process, the data service software must not only ensure that the XML (eXtensible Markup Language) message generated from the binary message of the host system is consistent with the content of the XML message generated from the JSON (JavaScript Object Notation) message of the open system; it must also make data consumers unaware of the consumption process and use of data after the data source is switched. Therefore, before the data source is switched from the host system to the open system and officially goes into production, a large amount of message comparison work needs to be carried out to ensure the transparency of data switching and the continuity and accuracy of data consumers' use of data.

[0004] In the prior art, when comparing XML messages generated by binary messages of the host system and XML messages generated by JSON messages of the open system, the XML messages corresponding to the two different data sources are pulled down from the server mainly by manual random sampling, and the compare plug-in function provided by the text compiler is used to manually check the inconsistent content of each field one by one, and analyze the cause and design an optimization plan. This comparison method is not suitable for situations with large message volume, many business scenarios, and many fields. Not only is the scenario coverage incomplete, but the manual comparison work efficiency is extremely low, and it is impossible to guarantee the project's production time and the transparency of data source switching. Summary of the invention

[0005] To solve the above problems, the present invention provides an XML message comparison method, system, storage medium and electronic device, which receive system messages from different message sending sources, determine the business primary key, compare the updated data and initial data corresponding to the same business primary key, and judge whether there is a special event based on the comparison result of the updated data and the initial data. When a special event exists, an XML message is generated; the XML messages corresponding to different message sending sources with the same business primary key within a preset time range are compared to determine the comparison result, so that the system can automatically compare the XML messages.

[0006] The present invention is achieved through the following technical solutions:

[0007] In a first aspect, an embodiment of the present disclosure provides an XML message comparison method, the method comprising:

[0008] Receive system messages from different message sources, determine the business primary key and the corresponding update data;

[0009] 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;

[0010] Generate an XML message in a preset format according to the update data of the special event and the corresponding business primary key;

[0011] 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.

[0012] Furthermore,

[0013] Receive a first system message, parse the received first system message, determine a business primary key and corresponding first message data and a first timestamp; store the first message data and the first timestamp corresponding to the business primary key in a first database;

[0014] Receive a second system message, parse the received second system message, determine a business primary key and corresponding second message data and a second timestamp; store the second message data and the second timestamp corresponding to the business primary key in a second database;

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

[0016] Furthermore,

[0017] querying the first database for a business primary key, and 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;

[0018] 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.

[0019] Furthermore,

[0020] querying the business primary key in the first database, if first initial data and 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 first updated timestamp, and storing the business primary key corresponding to the first updated data and the first updated timestamp in the first database;

[0021] 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.

[0022] Furthermore,

[0023] Determine, 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 time sequence, compare the first initial data with the first update data to determine whether there is a special event in the first update data;

[0024] The second initial data and the second initial timestamp corresponding to the business primary key are determined through the second database. If the second update timestamp and the second initial timestamp are in time sequence, the second initial data and the second update data are compared to determine whether there is a special event in the second update data.

[0025] Furthermore,

[0026] 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;

[0027] 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.

[0028] Furthermore,

[0029] 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;

[0030] 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;

[0031] The first XML message and the second XML message generated are verified for correctness and integrity.

[0032] Furthermore,

[0033] Determine a preset time range, 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, during the preset regular time, the same business primary key has a corresponding first XML message and a corresponding second XML message, extracting the first XML message and the second XML message, and using the extracted first XML message and the second XML message for comparison;

[0035] If, during the preset regular time, the same service primary key only has an XML message from one of the message sending sources corresponding to it, then during the preset supplementary time, it is determined whether there is an XML message from another of the message sending sources corresponding to the service primary key.

[0036] Furthermore,

[0037] If, within a preset time range, there exists a corresponding first XML message and a 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;

[0038] Within a preset time range, there are multiple corresponding first XML messages and / or multiple second XML messages for 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.

[0039] Furthermore,

[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, an embodiment of the present disclosure provides an XML message comparison system, the system comprising: a data parsing module, a data storage module, a message structuring module and a message comparison module;

[0042] 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;

[0043] The data storage module is used to 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;

[0044] 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;

[0045] 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 to determine the comparison result.

[0046] On the third aspect, based on the same inventive concept, the embodiments of the present disclosure also provide a computer-readable storage medium storing one or more programs, which, when executed, can implement the aforementioned XML message comparison method.

[0047] In a fourth aspect, based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, including a processor, a communication interface, the aforementioned computer-readable storage medium, and a communication bus. The processor, the communication interface, and the computer-readable storage medium communicate with each other via the communication bus. The processor is used to execute the program stored in the aforementioned computer-readable storage medium.

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

[0049] 1. When a special event occurs, XML messages are automatically generated, and XML messages corresponding to different message sending sources within a preset time range are compared, so that XML messages can be automatically compared, saving labor costs and avoiding omissions or misjudgments of differences during manual comparison;

[0050] 2. It can clearly and accurately locate the difference fields in XML messages, better classify and analyze the causes of differences, and thus greatly improve the efficiency and accuracy of message comparison.

[0051] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by implementing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

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

[0054] Figure 2 A flow chart of another XML message comparison method provided in an embodiment of the present disclosure;

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

[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0057] First, Figure 1 A flow chart of an XML message comparison method provided by the embodiment of the present disclosure, such as Figure 1 As shown, the embodiment of the present disclosure provides an XML message comparison method, including:

[0058] S1: Receive system messages from different message sources, and determine the business primary key and the corresponding update data.

[0059] S2: 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.

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

[0061] S4: Compare the XML messages corresponding to different message sending sources of the same business primary key within a preset time range to determine the comparison result.

[0062] In the disclosed embodiment, system messages from different message sending sources are received, a business primary key is determined, updated data corresponding to the same business primary key and initial data are compared, and it is determined whether a special event exists based on the comparison result of the updated data and the initial data. When a special event exists, an XML message is generated; the XML messages corresponding to different message sending sources with the same business primary key within a preset time range are compared, and the comparison result is determined, thereby enabling the system to automatically compare the XML messages.

[0063] In some examples, receiving system messages from different message sending sources and determining a service primary key and corresponding update data specifically include:

[0064] S11: Receive a first system message, parse the received first system message, determine the business primary key and the corresponding first message data, and the first timestamp; receive a second system message, parse the received second system message, determine the business primary key and the corresponding second message data, and the second timestamp.

[0065] Specifically, the message sending source includes a host system and an open system. In the present disclosure, the host system mainly refers to a foreign system, and the open system mainly refers to a domestic independently built 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. Parsing 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 accordingly, the same flight on the same flight day only corresponds to one business primary key, so there is a corresponding relationship between the business primary key and the same flight on the same flight day in the database. It can be understood that a business primary key in the database can also correspond to only one passenger and passenger-related information data, and a business primary key in the database can also correspond to only one passenger and passenger-related information data. In the present embodiment, the same flight corresponding to the same flight day is mainly described as an example.

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

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

[0068] S12: Query the business primary key in the first database. If the business primary key is not found in the first database, establish the business primary key in the first database, determine the first message data as the first initial data, determine the first timestamp as the first initial timestamp, and store the business primary key corresponding to the first initial data and the first initial timestamp in the first database.

[0069] S13: Query the business primary key in the second database. If the business primary key is not found in the second database, establish the business primary key in the second database, determine the second message data as the second initial data, determine the second timestamp as the second initial timestamp, and store the business primary key corresponding to the second initial data and the second initial timestamp in the second database.

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

[0071] S12': Query the business primary key in the first database. If the first initial data and the first initial timestamp corresponding to the business primary key are found in the first database, the first message data is determined as the first updated data, and the first timestamp is determined as the first updated timestamp. The business primary key corresponding to the first updated data and the first updated timestamp is stored 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 the initial data corresponding to the business primary key, comparing the updated data with the corresponding initial data, and determining whether there is a special event 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 time sequence, 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 conform to the time sequence, 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, it complies with the time sequence; if the second update timestamp is later than the second initial timestamp, it complies with the time sequence. Special events refer to events triggered by business changes such as the same flight / passenger from the host system and the open system during the flight data processing process. These events include changes in flight information (such as changes in flight number, take-off 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, it is necessary to generate a corresponding XML message and feed the XML message back to the system user; in the present disclosure, the corresponding XML message is generated and also used for subsequent comparison and processing. Comparison between the first initial data and the first update data, and comparison between the second initial data and the second update data, by comparing the determined differences, it is determined whether the differences meet the triggering conditions and standards, thereby determining whether there is a special event in the first update data and the second update data.

[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 judging whether a special event exists based on the comparison result of the updated data with the corresponding initial data, the following further includes:

[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, an XML message in a preset format is generated according to 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 update data, a first XML message in a 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, a second XML message in a preset format is generated according to the second update 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 generated accordingly 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 has a special event, and when the first XML message of 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; accordingly, when the first update data has a special event, when the first XML message of 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: Check the correctness and integrity of the generated first XML message and the second XML message.

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

[0090] S41: Determine a preset time range, where 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 a preset regular time and a preset supplementary time. The preset supplementary time is set mainly to compensate for the possible time difference between the host system and the open system when pushing messages. The preset supplementary time should not be set too long. For example, if the preset regular time is set to 1 hour, the preset supplementary time is set to 10 minutes.

[0092] S42: If, within the preset regular time, the same business primary key has a corresponding first XML message and a corresponding second XML message, 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.

[0093] Specifically, in the preset regular time, the same business primary key has a corresponding first XML message and a second XML message, and the first XML message and the second XML message can be directly extracted for comparison. It is understandable that in the preset regular time, the same business primary key may correspond to multiple first XML messages and / or multiple second XML messages. In this case, it is necessary to extract the first XML message and the second XML message generated last in the preset regular time for comparison.

[0094] S43: If, during the preset regular time, the same service primary key only has an XML message from one message sending source, then during the preset supplementary time, it is determined whether there is an XML message from another message sending source corresponding to the service primary key.

[0095] Specifically, if only a first XML message exists for the same business primary key during the preset regular time, then in the preset supplementary time, determine whether a second XML message corresponding to the business primary key exists. If only a second XML message exists for the same business primary key during the preset regular time, then in the preset supplementary time, determine whether a first XML message corresponding to the business 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, if there is a corresponding first XML message and a second XML message for the same business primary key within a preset time range, 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. If there are multiple first XML messages and / or multiple second XML messages corresponding to the same business primary key within a preset time range, 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.

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

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

[0100] In the disclosed embodiment, the comparison of XML messages mainly includes comparing the message format of the XML messages; the message structure; identifying whether there are different fields, for example, a field exists in one XML message but not in another XML message; identifying the difference in field values ​​of two XML messages, etc.

[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 XML message comparison results are summarized and stored, and the XML message comparison results are displayed to realize the visualization of the XML message comparison results. The XML message comparison results are summarized and displayed, including: the summary of the XML message comparison results 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 hot spot statistics, the difference ratio, etc. By summarizing the comparison results of the XML messages and displaying them, the differences and the parts that are prone to differences can be intuitively displayed to the project personnel, which helps the project personnel to evaluate the relevant systems.

[0104] Embodiment 1:

[0105] In the disclosed embodiment, 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; Figure 2 As shown, the process of the XML message comparison method provided by the embodiment of the present disclosure includes:

[0106] S101: Create a business primary key for the same flight on the same flight day in the database.

[0107] The first system message of flight CA1234 with a flight date of June 16, 2024, provided by the host system is collected through ANT (host disk direct reading tool). The first system message is a departure flight message in binary format 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 the first timestamp. The parsing of the first system message mainly includes parsing the first system message into data objects available under the same definition; a business primary key in the first database only corresponds to the same flight on the same flight day, and accordingly, the same flight on the same flight day only corresponds to one business primary key. Therefore, there is a corresponding relationship between the business primary key and the same flight on the same flight day in the first database.

[0108] The business primary key is queried in the first database. If the business primary key is not found 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 business primary key corresponding to the first initial data and the first initial timestamp is stored in the first database.

[0109] The second system message of flight CA1234 with a flight date of June 16, 2024 provided by the open system is received through MES (Microservice Event Server). The second system message is a departure flight message in JSON format 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 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 business primary key corresponding to the second initial data and the second initial timestamp is stored in the second database.

[0111] S102: Acquire update data.

[0112] The first system message of flight CA1234 with a flight date of June 16, 2024 provided by the host system is collected through ANT. 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 first initial data and the first initial timestamp corresponding to the business primary key are queried in the first database, the first message data is determined as the first updated data, and the first timestamp is determined as the first updated timestamp.

[0113] The second system message of flight CA1234 with a flight date of June 16, 2024 provided by the open system is received through MES. The second system message is a departure flight message in JSON format 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. 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.

[0114] It is understandable 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; the second update data and the second update timestamp corresponding to the business primary key are stored in the second database.

[0115] S103: Compare the updated data with the corresponding initial data.

[0116] After determining the first update data and the first update timestamp, determine the corresponding first initial data and the first initial timestamp through the business primary key. Determine whether the first initial timestamp and the first update timestamp are in time sequence. If the first update timestamp is later than the first initial timestamp, then the time sequence is in line. For example, the first initial timestamp is 202406160124987, the first update timestamp is 202406160126664, and the first update timestamp is greater than the first initial timestamp. Therefore, the first update timestamp is later than the first initial timestamp, which is in time sequence. Compare the first initial data and the first update data to determine whether there is a special event.

[0117] After determining the second updated data and the second updated timestamp, determine the corresponding second initial data and the second initial timestamp through the business primary key. Determine whether the second initial timestamp and the second updated timestamp are in time sequence. If the second updated timestamp is later than the second initial timestamp, then the time sequence is in time sequence. Compare the first initial data and the first updated data to determine whether there is a special event.

[0118] Special events refer to events triggered by business changes such as the same flight / passenger from the host system and the open system during the flight data processing. These events include changes in flight information (such as changes in flight number, take-off 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, it is necessary to generate a corresponding XML message and feed the XML message 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 determined differences, it is determined whether the differences meet the triggering conditions and standards, thereby determining whether there is a special event in the first updated data and the second updated data.

[0119] 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 first updated data is retained. Similarly, 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 second updated data is retained.

[0120] S104: Generate an XML message in a preset format.

[0121] Set a preset format for the first XML message and the second XML message, the preset format includes the message structure and field naming. If there is a special event in the first update data, generate a first XML message in a preset format according to the first update data and the corresponding business primary key; if there is a special event in the second update data, generate a second XML message in a preset format according to the second update data and the corresponding business primary key; the first XML message corresponds to the host system, and the second XML message corresponds to the open system. When generating the first XML message and the second XML message, the first XML message timestamp and the second XML message timestamp will be generated accordingly, and recorded in the system for subsequent extraction of the first XML message and the second XML message. Perform correctness and integrity checks on the generated first XML message and the second XML message.

[0122] S105: Compare the XML messages corresponding to different message sending sources with the same business primary key.

[0123] The preset time range includes a preset regular time and a preset supplementary time. The preset supplementary time is set mainly to compensate for the possible time difference between the host system and the open system when pushing messages. 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 continuous in time.

[0124] If there is a corresponding first XML message and a second XML message for the same business primary key within an hour, the first XML message and the second XML message are extracted and compared with the extracted first XML message and the second XML message. If there is only an XML message from one message sending source corresponding to the same business primary key within an hour, then within 10 minutes after the hour, determine whether there is an XML message from another message sending source corresponding to the business primary key. For example: The flight information of CA1234 flight with a flight date of June 16, 2024 has changed, specifically the model of the flight. The change in flight information is a special event, and the first XML message and the second XML message are generated at this time. The first XML message is generated between 23:00 and 24:00 on June 14, and the timestamp of the first XML message 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 timestamp of the second XML message 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 used for comparison.

[0125] In the embodiment of the present disclosure, if there is a corresponding first XML message and a second XML message for the same business primary key within a preset time range, 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. If there are multiple first XML messages and / or multiple second XML messages corresponding to the same business primary key within a preset time range, 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.

[0126] Specifically, within the entire preset time range, if the same business primary key corresponds to only one first XML message and one second XML message, the first XML message and the second XML message are directly extracted; if within the entire preset time range, the same business primary key corresponds to multiple first XML messages and / or multiple second XML messages, the last generated first XML message and second XML message are extracted.

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

[0128] In the disclosed embodiment, the comparison of XML messages mainly includes comparing the message format of the XML messages; the message structure; identifying whether there are different fields, for example, a field exists in one XML message but not in another XML message; identifying the difference in field values ​​of two XML messages, etc.

[0129] S106: Display the comparison result of the XML message.

[0130] The XML message comparison results are summarized and stored, and the XML message comparison results are displayed to realize the visualization of the XML message comparison results. The XML message comparison results are summarized and displayed, including: the summary of the XML message comparison results 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 hot spot statistics, the difference ratio, etc. By summarizing the comparison results of the XML messages and displaying them, the differences and the parts that are prone to differences can be intuitively displayed to the project personnel, which helps the project personnel to evaluate the relevant systems.

[0131] Second, Figure 3 A block diagram of an XML message comparison system provided in an embodiment of the present disclosure, such as Figure 3As shown, based on the same inventive concept, the embodiment of the present disclosure also provides an XML message comparison system, and the system includes: a data parsing 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 used to 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. The message structuring module is used to generate an XML message in a preset format based on the updated data with special events and the corresponding business primary key. The message comparison module is used to compare the XML messages corresponding to different message sending sources with the same business primary key within a preset time range, and determine the comparison result.

[0132] In some examples, the XML message comparison system also includes: a visualization module: used to store and summarize the comparison results of the XML messages, and display the comparison results of the XML messages. The XML message comparison results are summarized and stored, and the XML message comparison results are displayed to achieve visualization of the XML message comparison results. The XML message comparison results are summarized and displayed, including: a summary of the comparison results of the XML messages corresponding to the host system and the open system, a difference comparison of the XML messages corresponding to the host system and the open system, a difference hotspot statistics, a difference ratio, etc. By summarizing the comparison results of the XML messages and displaying them, the differences and the parts that are prone to differences can be intuitively displayed to project personnel, which helps project personnel evaluate related systems.

[0133] On the third aspect, based on the same inventive concept, the embodiments of the present disclosure also provide a computer-readable storage medium storing one or more programs, which, when executed, can implement the aforementioned XML message comparison method.

[0134] In a fourth aspect, based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, including a processor, a communication interface, the aforementioned computer-readable storage medium, and a communication bus. The processor, the communication interface, and the computer-readable storage medium communicate with each other via the communication bus. 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 units does not necessarily mean the connection between lines. An indirect connection method can be applied to the embodiments of the present disclosure as long as the purpose of the present disclosure is achieved.

[0136] Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions 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, 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 update 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: Receive a first system message, parse the received first system message, determine a business primary key and corresponding first message data and a first timestamp; store the first message data and the first timestamp corresponding to the business primary key in a first database; Receive a second system message, parse the received second system message, determine a business primary key and corresponding second message data and a second timestamp; store the second message data and the second timestamp corresponding to the business primary key 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 also includes: querying the first database for a business primary key, and 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: Receiving system messages from different message sources, determining the business primary key and the corresponding update data, and also including: querying the business primary key in the first database, if first initial data and 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 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, characterized in that The determining of the initial data corresponding to the business primary key, comparing the updated data with the corresponding initial data, and determining whether there is a special event in the updated data includes: Determine, 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 time sequence, compare the first initial data with the first update data to determine whether there is a special event in the first update data; The second initial data and the second initial timestamp corresponding to the business primary key are determined through the second database. If the second update timestamp and the second initial timestamp are in time sequence, the second initial data and the second update data are compared 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 there is a special event 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 method generates an XML message in a preset format according to the update 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 first XML message and the second XML message generated are verified for correctness and integrity.

8. The method according to claim 1, characterized in that The step of comparing the XML messages corresponding to different message sending sources of the same business primary key within a preset time range to determine the comparison result includes: Determine a preset time range, 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; If, during the preset regular time, the same business primary key has a corresponding first XML message and a corresponding second XML message, extracting the first XML message and the second XML message, and using the extracted first XML message and the second XML message for comparison; If, during the preset regular time, the same service primary key only has an XML message from one of the message sending sources corresponding to it, then during the preset supplementary time, it is determined whether there is an XML message from another of the message sending sources corresponding to the service primary key.

9. The method according to claim 8, characterized in that The step of comparing the XML messages corresponding to different message sending sources of the same business primary key within a preset time range to determine the comparison result also includes: If there is a corresponding first XML message and a second XML message for the same business primary key within a preset time range, 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 corresponding first XML messages and / or multiple second XML messages for 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 comprises: 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 used to 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; 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 the XML messages corresponding to the same business primary key and different message sending sources within a preset time range to determine the 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 described in 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 of 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

  • System and method and apparatus for using UML tools for defining web service bound component applications

    US20070198968A1

  • Limited lifespan for outgoing data at a mobile device

    US20080026776A1