Message comparison method and device, equipment, storage medium and program product
By detecting the target field type in the message and applying the corresponding comparison method, the automation and efficiency of message comparison are realized, the problem of low message comparison efficiency in the existing technology is solved, and the flexibility and accuracy are improved.
Patent Information
- Application Number
- CN202410768733.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-30
AI Technical Summary
The existing message comparison method is time-consuming, labor-intensive, inefficient and increases labor costs, making it difficult to meet the needs of a large number of message comparisons.
By obtaining the message to be compared and the comparison configuration information, it detects whether the target field is an ignored field or a preset field, and automatically compares the field value based on the detection result, and uses matching comparison methods to perform message comparison, including date comparison and conversion comparison. , sorting comparison and script comparison, etc.
It achieves fast and accurate message comparison, reduces manual participation, improves efficiency and flexibility, and meets different needs.
Smart Images

Figure CN118568519A
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to a message comparison method, apparatus, device, storage medium and program product. Background Art
[0002] With the rapid development of computer technology, it is usually necessary to compare the field values of the same field in two messages to determine whether there are difference fields with different contents in the two messages, so that R&D personnel can perform difference analysis based on the difference fields.
[0003] At present, the R&D personnel usually manually compare the two messages to determine the difference fields in the two messages. However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] The existing manual comparison method is time-consuming and labor-intensive, and a large number of messages need to be compared, which greatly reduces the efficiency of message comparison and increases labor costs. Summary of the invention
[0005] The embodiments of the present invention provide a message comparison method, device, equipment, storage medium and program product to achieve rapid message comparison without the need for worker participation, thereby improving message comparison efficiency, meeting different message comparison requirements and improving the flexibility and accuracy of message comparison.
[0006] In a first aspect, an embodiment of the present invention provides a message comparison method, including:
[0007] Acquire a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison mode corresponding to the preset field;
[0008] Based on the comparison configuration information, a detection is performed on whether the target field is an ignored field or a preset field, and based on the detection result, the first field value and the second field value are compared to obtain a field value comparison result of the target field.
[0009] In a second aspect, an embodiment of the present invention further provides a message comparison device, including:
[0010] A message information acquisition module, used to acquire a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison mode corresponding to the preset field;
[0011] The field value comparison module is used to detect whether the target field is an ignored field or a preset field based on the comparison configuration information, and compare the first field value and the second field value based on the detection result to obtain the field value comparison result of the target field.
[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0013] one or more processors;
[0014] A memory for storing one or more programs;
[0015] When one or more programs are executed by one or more processors, the one or more processors implement the message comparison method provided by any embodiment of the present invention.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a message comparison method as provided in any embodiment of the present invention.
[0017] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements a message comparison method as provided in any embodiment of the present invention.
[0018] One embodiment of the above invention has the following advantages or beneficial effects:
[0019] By obtaining a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison method corresponding to the preset field; based on the comparison configuration information, it is detected whether the target field is an ignored field or a preset field, and based on the detection result, the first field value and the second field value can be automatically compared using a matching comparison method to quickly and accurately determine the field value comparison result corresponding to the target field, and the entire process does not require human participation, thereby improving the efficiency of message comparison, and based on the preset comparison methods in the ignored field configuration information and the preset field configuration information, the message comparison can be performed more flexibly and accurately to meet different message comparison requirements, thereby improving the flexibility and accuracy of message comparison. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a flow chart of a message comparison method provided by an embodiment of the present invention;
[0022] Figure 2 is a flow chart of another message comparison method provided by an embodiment of the present invention;
[0023] Figure 3 It is a structural schematic diagram of a message comparison device provided by an embodiment of the present invention;
[0024] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0026] It should be noted that in the technical solution of the present disclosure, the collection / collection, update, analysis, use, transmission, storage and other aspects of user personal information involved (such as the collection and use of messages, etc.) are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes. They are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by restricting or even prohibiting data collection and / or deleting data.
[0027] Figure 1 This is a flow chart of a message comparison method provided by an embodiment of the present invention. This embodiment is applicable to the case where two messages generated for the same service function are compared. The method can be executed by a message comparison device, which can be implemented by software and / or hardware and integrated in an electronic device. Figure 1 As shown, the method specifically comprises the following steps:
[0028] S110. Obtain a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison method corresponding to the preset field.
[0029] Among them, a message may refer to a data message transmitted in a network. For example, a message may refer to a request message or a response message. The first message and the second message may refer to two messages that currently need to be compared. The first message and the second message may be two messages generated for the same business function. The fields (i.e., target fields) contained in the first message and the second message are the same, but the field values may be the same or different. The number of target fields may be one or more, and the specific number is set based on business requirements. For example, the first message and the second message both refer to warehousing request messages, and the warehousing request message may include one or more warehousing request fields. The first field value refers to the specific field content corresponding to the target field in the first message. The second field value refers to the specific field content corresponding to the target field in the second message.
[0030] The comparison configuration information may be obtained by pre-configuration based on the comparison requirements of each field in the first message and the second message. The ignored field configuration information may be used to characterize the fields that are allowed to be ignored during the message comparison process, that is, the ignored fields default to the same fields, not the difference fields. The ignored field configuration information includes pre-configured ignored fields that are allowed to be ignored. The ignored field may refer to a field whose field values in the two messages are definitely different. The number of ignored fields may be one or more. For example, the ignored fields may be: order number, order creation time, etc. If each field in the message cannot be ignored, there is no need to configure the ignored field, that is, the ignored field configuration information is empty information.
[0031] Since there will be a large number of interference items in the message comparison process, some fields need to be specially processed to improve the efficiency, accuracy and flexibility of the message comparison. The preset field may refer to a pre-configured field that needs to be feature processed. The preset comparison method may refer to a special processing method for the preset field. The number of preset fields may be one or more. Each preset field may correspond to one or more preset processing methods, so that the same preset field can be compared and processed using one or more preset processing methods. For example, if multiple field values of a field represent the same meaning, the field can be configured as a preset field, and the corresponding preset processing method can be that when the first field value and the second field value of the field are two different field values with the same meaning, the first field value and the second field value are identified as the same field value, that is, the field is the same field, thereby avoiding misidentification and ensuring the accuracy of message comparison.
[0032] Specifically, two messages whose contents need to be compared to see if they are the same can be obtained in any scenario, namely, a first message and a second message, and comparison configuration information pre-configured based on the field comparison requirements in the first message and the second message can be obtained, thereby improving the flexibility and accuracy of message comparison.
[0033] Exemplarily, "obtaining the first message and the second message to be compared" in S110 may include: obtaining the first message and the second message corresponding to the same business node in the first system and the second system through data embedding points pre-set in the business nodes in the first system and the business nodes in the second system, wherein the second system is the switching system of the first system.
[0034] Among them, the first system and the second system may be systems that implement the same business. Each system may include multiple business nodes. Each business node may refer to a link in the system processing process. For example, the first system and the second system are both complex order processing systems for undertaking customers, warehouses and distribution. The system may include business nodes such as inventory pre-occupancy, distribution, warehouse, warehouse management system feedback, transportation system feedback and merchant feedback. The second system may be a new system obtained by optimizing the business and technical levels on the basis of the first system. In other words, the first system may be the old system before priority. The second system may be the new system after optimization. When switching the first system to the second system for use, it is necessary to compare whether the messages generated by each business node in the first system and the second system are the same, so as to achieve seamless switching of the system without affecting the actual use of users.
[0035] Specifically, data embedding points are pre-set at each business node (or important business node) in the business execution process of the first system, and the pre-set data embedding points can automatically collect the request messages and response messages generated in the first system, and store the request and response messages generated at each node in the first database in the form of a message queue, thereby avoiding the impact of the embedding points on the first system. Similarly, data embedding points are pre-set at each business node (or important business node) in the business execution process of the second system, and the pre-set data embedding points are used to collect the request messages and response messages generated in the second system, and store the request and response messages generated at each node in the second database. The first message generated by the first system is used as a comparison message of the second message generated at the same business node in the second system, so that the difference fields with different contents in the two systems can be determined by comparing the first message and the second message.
[0036] S120: Detect whether the target field is an ignored field or a preset field based on the comparison configuration information, and compare the first field value and the second field value based on the detection result to obtain a field value comparison result of the target field.
[0037] The field value comparison result may include an identical result or a different result. An identical result means that the first field value is exactly the same as or essentially the same as the second field value, that is, the target field in the first message and the second message is the same field with the same content. A different result means that the first field value is different from the second field value and cannot be ignored, that is, the target field in the first message and the second message is a different field with different content.
[0038] Specifically, for each target field in the first message and the second message, it is possible to detect whether the target field is an ignored field based on the ignored field configuration information, and to detect whether the target field is a preset field based on the preset field configuration information. In response to the target field being an ignored field, the first field value and the second field value are compared based on the ignored comparison method corresponding to the ignored field, and a field value comparison result corresponding to the target field is obtained. In response to the target field being not an ignored field but a preset field, the first field value and the second field value are compared based on the preset comparison method corresponding to the preset field, and a field value comparison result corresponding to the target field is obtained. In response to the target field being neither an ignored field nor a preset field, the first field value and the second field value can be directly compared to see whether the contents are the same, and a field value comparison result corresponding to the target field is obtained. For example, the first message can be loaded into MapA, and the second message can be loaded into MapB, each key value in MapA and MapB is a target field, and the corresponding value values are the first field value and the second field value of the target field, respectively. By looping each key value in MapA and MapB, the field value comparison result corresponding to each target field in the first message and the second message is determined based on the operation loop of step S120.
[0039] Exemplarily, “comparing the first field value and the second field value based on the detection result to obtain a field value comparison result of the target field” in S120 may include:
[0040] In response to the target field being an ignored field, determining that a comparison result of field values corresponding to the target field is the same result; in response to the target field being a preset field, comparing the first field value and the second field value based on at least one preset comparison method corresponding to the target field, and obtaining a comparison result of field values corresponding to the target field; in response to the target field being neither an ignored field nor a preset field, comparing the first field value and the second field value based on the field type corresponding to the target field, and obtaining a comparison result of field values corresponding to the target field.
[0041] Specifically, when it is determined that the target field is an ignored field based on the ignored field configuration information, it indicates that the content comparison of the target field can be ignored, and at this time, it is directly determined that the field value comparison result corresponding to the target field is the same result. When it is determined that the target field is a preset field based on the preset configuration information, all preset comparison methods corresponding to the preset field are used as all preset comparison methods of the target field, and according to each preset comparison method, the first field value and the second field value are gradually specially compared to obtain the field value comparison result corresponding to the target field. When it is determined that the target field is neither an ignored field nor a preset field based on the ignored field configuration information and the preset field configuration information, a comparison method matching the field type is determined based on the field type corresponding to the target field, and based on the comparison method, the first field value and the second field value are compared to obtain the field value comparison result corresponding to the target field. By executing different comparison methods based on different detection results, different message comparison requirements are met, and the flexibility and accuracy of message comparison are improved.
[0042] The technical solution of this embodiment is to obtain a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to the target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison method corresponding to the preset field; based on the comparison configuration information, it is detected whether the target field is an ignored field or a preset field, and based on the detection result, the first field value and the second field value can be automatically compared using a matching comparison method to quickly and accurately determine the field value comparison result corresponding to the target field, and the entire process does not require human participation, thereby improving the efficiency of message comparison, and based on the preset comparison methods in the ignored field configuration information and the preset field configuration information, the message comparison can be performed more flexibly and accurately to meet different message comparison requirements, thereby improving the flexibility and accuracy of message comparison.
[0043] Based on the above technical solution, the preset comparison method corresponding to each preset field in the preset field configuration information may include: at least one of a date comparison method, a conversion comparison method, a sorting comparison method and a script comparison method corresponding to the preset field.
[0044] The date comparison method means ignoring the field value differences generated by the preset field before the end date configured for the preset field is reached. For example, before the message comparison, it has been determined that a certain field has a program error bug and needs to be repaired. At this time, you can set the field as a preset field and set an end date for the field based on the R&D progress, such as 2023-10-10, to indicate that there is no need to pay attention to the differences generated by the field before 2023-10-10, thereby saving time for subsequent message comparison and analysis.
[0045] The conversion comparison method refers to the conversion of the field value of the preset field based on the character conversion relationship configured for the preset field, and then the field value is compared. If the field value of a field is consistent after conversion, the field is set as a preset field, and the character conversion relationship is configured for the field. For example, when the field value contains an escape character or amount data displayed in character format, such as "10.000" and "10.00" have the same meaning, the character conversion relationship is set to: "000:00". The conversion comparison method can avoid the situation where different field values caused by escape characters and other reasons are recognized as differences, thereby improving the accuracy of message comparison.
[0046] Among them, the sorting and comparison method refers to sorting the field values of the preset fields based on the list sorting fields configured for the preset fields and then comparing the field values. Among them, the type of the preset field is a list type. The list sorting field can refer to the column field used for sorting in the list. If the field value of a field is a list, the field is set to a preset field, and the sorting field based on which the sorting is configured for the field, for example, the sorting field is the first column field A in the list, which represents that each list is sorted in the order of field A and then compared row by row, thereby avoiding misidentification due to wrong row comparison, thereby improving the accuracy of message comparison.
[0047] Among them, the script comparison method refers to comparing the field values of preset fields based on the logic script configured for the preset fields. Among them, the logic script can be an execution statement written in a scripting language for implementing the comparison logic. When the comparison logic of the field value is more complex, a quick comparison can be performed by executing the logic script to further improve the efficiency and flexibility of message comparison. For example, when the field value of a field in the new and old systems is the same, the comparison of other fields can be ignored, that is, the field values of other fields are assumed to be the same.
[0048] On the basis of the above technical solution, after S120, it may also include: in response to the field value comparison result corresponding to the target field being a difference result, determining the target description information corresponding to the target field based on the field description configuration information; determining the difference display data corresponding to the target field based on the field name, target description information, first field value and second field value of the target field.
[0049] The field description configuration information may include: the field name of at least one field and the description information corresponding to each field. Field names are usually represented by numbers and / or letters, which makes it impossible for users to identify their specific business meanings based on the field names alone. The description information is used to describe the business meaning represented by the field name. For example, the field name is: "carrierNo", and its corresponding description information is: "carrier code".
[0050] Specifically, the description information of the fields that need to explain the business meaning is configured in advance to obtain the field description configuration information. After determining the field value comparison result corresponding to each target field in the first message and the second message, all target fields whose field value comparison results are difference results can be determined, and these target fields can be defined as difference fields. Based on the field description configuration information and the field name of each target field whose field value comparison result is a difference result, the target description information corresponding to each target field is determined, and the field name, target description information, first field value and second field value of each target field are combined to obtain the difference display data corresponding to each target field, and these difference display data are displayed, so that relevant personnel can quickly analyze the difference field, determine whether it is a program error bug, and perform corresponding repair processing after determining that it is a program error bug. In this embodiment, the field that needs to be repaired can be used as a preset field, and the end date in the date comparison method corresponding to the field is configured as the repair completion date, so that the difference generated by the field can be ignored during the repair period, thereby eliminating the difference interference in the subsequent comparison, and improving the efficiency and accuracy of the message comparison.
[0051] Figure 2 A flowchart of another message comparison method provided for an embodiment of the present invention. Based on the above embodiments, this embodiment optimizes the step "comparing the first field value and the second field value based on at least one preset comparison method corresponding to the target field to obtain a field value comparison result corresponding to the target field" when the target field is a preset field. In addition, when the target field is neither an ignored field nor a preset field, the step "comparing the first field value and the second field value based on the field type corresponding to the target field to obtain a field value comparison result corresponding to the target field" is also optimized. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0052] See also Figure 2 Another message comparison method provided in this embodiment specifically includes the following steps:
[0053] S210: Acquire a first message and a second message to be compared and comparison configuration information.
[0054] S220. Based on the comparison configuration information, detect whether the target field is an ignored field or a preset field. In response to detecting that the target field is an ignored field, execute the operation of step S230; in response to detecting that the target field is a preset field, execute the operation of steps S240, S250, S260 or S270; in response to detecting that the target field is neither an ignored field nor a preset field, execute the operation of steps S280, S290 or S291.
[0055] S230: Determine whether the comparison result of the field values corresponding to the target field is the same.
[0056] Specifically, when it is detected that the target field is an ignored field, it indicates that the content comparison of the target field can be ignored. In this case, it is directly determined that the field value comparison result corresponding to the target field is the same result.
[0057] S240: In response to the preset comparison method corresponding to the target field including a date comparison method and the current date being less than the end date in the date comparison method, determining that the field value comparison result corresponding to the target field is the same result.
[0058] Specifically, when it is determined that the target field is a preset field, and the preset comparison method corresponding to the target field includes a date comparison method, it can be detected whether the current date is less than the end date configured in the date comparison method. When it is detected that the current date is less than the end date in the date comparison method, it indicates that the current date has not yet reached the end date, and the comparison can continue to be ignored. At this time, it can be directly determined that the field value comparison result corresponding to the target field is the same result. When it is detected that the current date is greater than or equal to the end date configured in the date comparison method, it indicates that the current date has reached the end date and cannot be ignored. At this time, it is necessary to continue to compare the field values. For example, when the preset comparison method corresponding to the target field includes other comparison methods in addition to the date comparison method, such as at least one of the conversion comparison method, the sorting comparison method and the script comparison method, based on the other comparison methods, the first field value and the second field value are continued to be compared to determine the field value comparison result corresponding to the target field. The specific implementation process can refer to the operations of the following steps S250, S260 and S270. Alternatively, when the preset comparison method corresponding to the target field only includes the date comparison method and does not include other comparison methods, the first field value and the second field value can be compared based on the field type corresponding to the target field to determine the field value comparison result corresponding to the target field. The specific implementation process can refer to the operations of the following steps S280, S290 and S291.
[0059] For example, the target field is the preset field "thirdDistributionInfo", and the configuration information of the date comparison method corresponding to the preset field is: "ignoreEndDate":"2023-10-11", where 2023-10-11 represents the end date.
[0060] S250, in response to the preset comparison method corresponding to the target field including a conversion comparison method, performing character conversion on the first field value and the second field value according to the character conversion relationship in the conversion comparison method, and comparing the converted first field value and the second field value to obtain a field value comparison result corresponding to the target field.
[0061] Specifically, when it is determined that the target field is a preset field, and the preset comparison method corresponding to the target field includes a conversion comparison method, and the field type corresponding to the target field is a string type, the first field value and the second field value can be converted according to the character conversion relationship configured in the conversion comparison method to obtain the first field value and the second field value expressed in the same way after conversion, and then the converted first field value and the second field value are compared to see whether they are the same. If they are the same, it is determined that the field value comparison result corresponding to the target field is the same result, otherwise it is determined to be a difference result. It should be noted that, when the preset comparison method corresponding to the target field only includes the conversion comparison method, the final field value comparison result of the target field can be directly determined according to the above description, and when the preset comparison method corresponding to the target field includes other comparison methods in addition to the conversion comparison method, it is necessary to use other comparison methods to continue to compare until the field value comparison results under all comparison methods are the same result, the final field value comparison result of the target field is determined to be the same result, otherwise the final field value comparison result of the target field is determined to be a difference result.
[0062] For example, the target field is the preset field "siteName", and the configuration information of the conversion comparison method corresponding to the preset field is: "escape":["\n:\"\""], where \n:\"\"" represents the character conversion relationship.
[0063] S260. In response to the preset comparison method corresponding to the target field including a sorting comparison method, the first field value and the second field value are sorted according to the list sorting field in the sorting comparison method, and the sorted first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field.
[0064] Specifically, when it is determined that the target field is a preset field, and the preset comparison method corresponding to the target field includes a sorting comparison method, and the field type corresponding to the target field is a list type, the first field value and the second field value can be sorted according to the list sorting field configured in the sorting comparison method, that is, the two lists are sorted according to the same field, and the sorted first field value and the second field value are lists with the same order. At this time, the two lists can be compared row by row and column by column. If all the columns in at least one row have the same content, the field value comparison result corresponding to the target field is determined to be the same result, otherwise it is determined to be a difference result. It should be noted that, when the preset comparison method corresponding to the target field only includes a sorting comparison method, the final field value comparison result of the target field can be directly determined according to the above description, and when the preset comparison method corresponding to the target field includes other comparison methods in addition to the sorting comparison method, it is necessary to use other comparison methods to continue to compare until the field value comparison results under all comparison methods are the same result, the final field value comparison result of the target field is determined to be the same result, otherwise the final field value comparison result of the target field is determined to be a difference result.
[0065] Exemplarily, "comparing the sorted first field value and the second field value row by row to obtain a field value comparison result corresponding to the target field" in S260 may include: by running the summation logic script in the script comparison method, summing the field value of the preset column field in the sorted first field value and the field value of the preset column field in the second field value, respectively, to obtain the first summation result and the second summation result corresponding to the preset column field; determining the field value comparison result corresponding to the preset column field based on the first summation result and the second summation result; comparing the other column fields in the sorted first field value and the second field value except the preset column field, to obtain the field value comparison result corresponding to the other column fields in the target field.
[0066] Among them, the preset column field may refer to the column field that needs to be summed in the list. The preset column field in the list may have multiple field values, and the summation is to add all the field values of the preset column field. The first summation result is obtained by summing all the field values corresponding to the preset column field in the first field value (i.e., the first list). The second summation result is obtained by summing all the field values corresponding to the preset column field in the second field value (i.e., the second list). The summation logic script includes the preset column fields that need to be summed in the list.
[0067] Specifically, when the field type corresponding to the target field is a list type, and the preset comparison method corresponding to the target field includes a script comparison method in addition to a sorting comparison method, the preset column fields in the sorted list are summed by running the summation logic script in the script comparison method, and the first summation result and the second summation result after summation are compared to see whether they are the same, so as to determine the field value comparison result corresponding to the preset column field. If the first summation result is the same as the second summation result, it is determined that the field value comparison result corresponding to the preset column field is the same result. If the first summation result is different from the second summation result, it is determined that the field value comparison result corresponding to the preset column field is a difference result. Continue to compare the other column fields except the preset column field in the sorted first field value and the second field value. If the field value comparison of the other column fields is the same, it is determined that the field value comparison results corresponding to the other column fields are the same result, otherwise it is determined to be a difference result. By using the summation logic script, the sum value comparison of the column field can be realized, avoiding the situation where the comparison is different due to the single value comparison, thereby improving the accuracy of data comparison.
[0068] For example, the target field is the preset field "odOrderDetailList[]", which is configured with a sorting comparison method and a script comparison method. The configuration information of the sorting comparison method is: "sort":"productId,goodsGrade", where productId and goodsGrade represent the two list sorting fields based on which the sorting is based, that is, the comparison key fields. The configuration information of the script comparison method is: "scripts":["return Sum(actual.quantity)==Sum(expect.quantity)"], where the product quantity quantity in the first field value actual (that is, the preset column field) is summed, and the product quantity quantity in the second field value expect (that is, the preset column field) is summed. If the two summation results are the same, it means that the field values corresponding to the product quantity quantity are the same.
[0069] S270. In response to the preset comparison method corresponding to the target field including a script comparison method, a first field value and a second field value are compared by running a logic script in the script comparison method to obtain a field value comparison result corresponding to the target field.
[0070] Among them, the logic scripts in the script comparison method, in addition to the above-mentioned summation logic scripts, may also include but are not limited to reference field logic scripts and value normalization logic scripts. Among them, the summation logic script is used for list type comparison. The reference field logic script can be used for comparison of any field type. The value normalization logic script can be used for string type comparison. The reference field logic script determines the field value comparison result of the current field based on the field value comparison result of the reference field. For example, if the carrier field carrierNo is consistent, the comparison of the three-segment code field threeSegmentName can be ignored, and the three-segment code field can be directly determined to be consistent. The value normalization logic script refers to when multiple different field values are used to represent the same content, these field values are all regarded as the same field value. For example, the product codes sc-m-0025 and sc-m-0024 in the first system both represent the same product code, while in the second system, the same product code is uniformly represented by sc-m-0025. At this time, when comparing sc-m-0025 and sc-m-0024, they are regarded as the same field value, thereby avoiding misidentification due to different field values and improving comparison accuracy.
[0071] Specifically, when it is determined that the target field is a preset field, and the preset comparison method corresponding to the target field includes a script comparison method, the comparison operation of the field value can be quickly implemented by running the logic script configured in the script comparison method, thereby improving the comparison efficiency.
[0072] Exemplarily, step S270 may perform message comparison by at least one of the following logic scripts:
[0073] As an implementation method, step S270 may include: by running the reference field logic script in the script comparison method, detecting whether the field values corresponding to the reference fields in the first message and the second message are the same, and determining the field value comparison result corresponding to the target field based on the obtained detection result, wherein the first message and the second message each include at least two fields, and the reference field is different from the target field.
[0074] The reference field may refer to other fields in the message that are different from the target field. The reference field may refer to a column field when the target field is a list type.
[0075] Specifically, by running the reference field logic script, it is detected whether the field values corresponding to the reference field in the first message and the second message are the same, and in response to detecting that the field values corresponding to the reference field are the same, it is determined that the field value comparison result corresponding to the target field is the same result. In response to detecting that the field values corresponding to the reference field are different, it is determined that the field value comparison result corresponding to the target field is a difference result.
[0076] For example, the target field is threeSegmentName and the reference field is carrierNo. The configuration information of the reference field logic script is: "scripts": [return actual.carrierNo == expect.carrierNo"], which indicates that when the carrier field carrierNo is consistent, the field value comparison result of the three-segment code field threeSegmentName is determined to be the same.
[0077] For another example, the target field is odOrderDetailList[], and the reference field is the productId field in odOrderDetailList[], then the configuration information of the reference field logic script is: "scripts":[returnactual.productId==expect.productId].
[0078] As another implementation method, S270 may include: detecting whether the first field value is a preset field value or a second field value by running a numerical normalization logic script in a script comparison method, and determining a field value comparison result corresponding to the target field based on the obtained detection result.
[0079] The preset field value may refer to other field values having the same meaning as the second field value. If the first field value is the second field value, it indicates that the first field value and the second field value are the same. If the first field value is the preset field value, it also indicates that the first field value and the second field value are the same.
[0080] Specifically, by running the numerical normalization logic script, it is detected whether the first field value is the preset field value or the second field value. In response to the first field value being the preset field value or the second field value, it is determined that the field value comparison result corresponding to the target field is the same result. In response to the first field value being neither the preset field value nor the second field value, it is determined that the field value comparison result corresponding to the target field is a difference result.
[0081] For example, if the target field is productsCode, the first field value sc-m-0025 or sc-m-0024 both represent the same product code, and the second field value is uniformly represented as sc-m-0025. The configuration information of the value normalization logic script is: "scripts":[return expect.productsCode==\"sc-m-0024\"and actual.productsCode==\"sc-m-0025\""], which means that when the first field value is sc-m-0024 and the second field value is sc-m-0025, they represent the same field value, and at this time, the comparison result of the field value corresponding to productsCode is determined to be the same result.
[0082] S280. In response to the field type corresponding to the target field being a string type, a first field value and a second field value are detected to determine whether they are the same, and a field value comparison result corresponding to the target field is determined based on the obtained detection result.
[0083] Specifically, when it is determined that the target field is neither an ignored field nor a preset field, and the field type corresponding to the target field is a string type, the first field value and the second field value can be directly compared to see whether they are the same. In response to the first field value and the second field value being the same, it is determined that the field value comparison result corresponding to the target field is the same result; in response to the first field value and the second field value being different, it is determined that the field value comparison result corresponding to the target field is a difference result.
[0084] S290. In response to the field type corresponding to the target field being an object type or a JSON type, each subfield in the target field is detected to determine whether it is an ignored field or a preset field based on the comparison configuration information, and a first subfield value and a second subfield value corresponding to each subfield are compared based on the obtained detection result to obtain a subfield value comparison result corresponding to each subfield in the target field.
[0085] The object type refers to the actual object converted through JSON (JavaScript Object Notation) deserialization. The JSON type refers to the string format, but cannot be directly converted through deserialization. The fields corresponding to the object type and JSON type include multiple subfields.
[0086] Specifically, when it is determined that the target field is neither an ignored field nor a preset field, and the field type corresponding to the target field is an object type or a JSON type, the subfield value comparison result corresponding to each subfield in the target field can be determined in the same manner as the field value comparison result corresponding to the target field. For example, for each subfield in the target field, whether the subfield is an ignored field or a preset field is detected based on the comparison configuration information, and in response to the subfield being an ignored field, the field value comparison result corresponding to the subfield is determined to be the same result; in response to the subfield being not an ignored field but a preset field, the first subfield value and the second subfield value corresponding to the subfield are compared based on at least one preset comparison method corresponding to the subfield, and the subfield value comparison result corresponding to the subfield is obtained. In response to determining that the subfield is neither an ignored field nor a preset field, the first subfield value and the second subfield value corresponding to the subfield are compared based on the field type corresponding to the subfield, and the subfield value comparison result corresponding to the subfield is obtained.
[0087] S291. In response to the field type corresponding to the target field being a list type, the first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field.
[0088] Specifically, when it is determined that the target field is neither an ignored field nor a preset field, and the field type corresponding to the target field is a list type, the list can be looped to compare row by row and column by column to determine the field value comparison result corresponding to each row and column in the list. For example, the column field value comparison result corresponding to the column field of each row and column in the target field is determined recursively in the same manner as the above-mentioned determination of the field value comparison result corresponding to the target field.
[0089] It should be noted that: step S230 in this embodiment is a specific description of the comparison process when the target field is an ignored field, steps S240-S270 are specific descriptions of the comparison process when the target field is a preset field, and steps S280-S291 are specific descriptions of the comparison process when the target field is neither an ignored field nor a preset field. There is no causal relationship or strong correlation between the above steps, and all steps can be split and combined with the relevant contents of the above embodiments. This embodiment only combines the implementation steps in the above three cases as an exemplary embodiment, and does not limit the need for all implementation steps in the above three cases to exist at the same time.
[0090] The technical solution of this embodiment improves the efficiency and accuracy of field comparison by using at least one of the date comparison method, the conversion comparison method, the sorting comparison method and the script comparison method to compare special fields when the target field is a preset field. The accuracy of field comparison can be further improved by performing a matching field comparison process according to different field types when the target field is neither an ignored field nor a preset field.
[0091] The following is an embodiment of a message comparison device provided in an embodiment of the present invention. The device and the message comparison methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the message comparison device, reference can be made to the embodiment of the above-mentioned message comparison method.
[0092] Figure 3 This is a schematic diagram of the structure of a message comparison device provided by an embodiment of the present invention. This embodiment is applicable to the case where two messages generated by the same service function are compared. Figure 3 As shown, the device specifically includes: a message information acquisition module 310 and a field value comparison module 320.
[0093] Among them, the message information acquisition module 310 is used to obtain the first message and the second message to be compared and the comparison configuration information, wherein the first message includes a first field value corresponding to the target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of the ignored field configuration information and the preset field configuration information, and the preset field configuration information includes at least one preset comparison method corresponding to the preset field; the field value comparison module 320 is used to detect whether the target field is an ignored field or the preset field based on the comparison configuration information, and compare the first field value and the second field value based on the detection result to obtain the field value comparison result of the target field.
[0094] The technical solution of this embodiment is to obtain a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to the target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison method corresponding to the preset field; based on the comparison configuration information, it is detected whether the target field is an ignored field or a preset field, and based on the detection result, the first field value and the second field value can be automatically compared using a matching comparison method to quickly and accurately determine the field value comparison result corresponding to the target field, and the entire process does not require human participation, thereby improving the efficiency of message comparison, and based on the preset comparison methods in the ignored field configuration information and the preset field configuration information, the message comparison can be performed more flexibly and accurately to meet different message comparison requirements, thereby improving the flexibility and accuracy of message comparison.
[0095] Optionally, the preset comparison method includes: at least one of a date comparison method, a conversion comparison method, a sorting comparison method and a script comparison method corresponding to the preset field; wherein,
[0096] The date comparison method is to ignore the field value difference generated by the preset field before reaching the end date configured for the preset field;
[0097] The conversion comparison method refers to performing character conversion on the field value of the preset field and then performing field value comparison based on the character conversion relationship configured for the preset field;
[0098] The sorting and comparison method refers to sorting the field values of the preset fields based on the list sorting fields configured for the preset fields and then comparing the field values;
[0099] The script comparison method refers to comparing the field values of the preset fields based on the logic script configured for the preset fields.
[0100] Optionally, the field value comparison module 320 includes:
[0101] A first comparison submodule, configured to, in response to the target field being an ignored field, determine that a comparison result of field values corresponding to the target field is the same result;
[0102] a second comparison submodule, configured to, in response to the target field being the preset field, compare the first field value with the second field value based on at least one preset comparison method corresponding to the target field, to obtain a field value comparison result corresponding to the target field;
[0103] The second comparison submodule is used to compare the first field value and the second field value based on the field type corresponding to the target field in response to the target field being neither the ignored field nor the preset field, so as to obtain a field value comparison result corresponding to the target field.
[0104] Optionally, the second comparison submodule includes one of the following:
[0105] A date comparison unit, configured to determine that a comparison result of a field value corresponding to the target field is the same result in response to the preset comparison method corresponding to the target field including a date comparison method and the current date is less than an end date in the date comparison method;
[0106] a conversion comparison unit, configured to, in response to the preset comparison mode corresponding to the target field including a conversion comparison mode, perform character conversion on the first field value and the second field value according to the character conversion relationship in the conversion comparison mode, and compare the converted first field value and the second field value to obtain a field value comparison result corresponding to the target field;
[0107] a sorting and comparing unit, configured to, in response to the preset comparison method corresponding to the target field including a sorting and comparing method, sort the first field value and the second field value according to the list sorting field in the sorting and comparing method, and compare the sorted first field value and the second field value row by row to obtain a field value comparison result corresponding to the target field;
[0108] A script comparison unit is used to respond to the preset comparison method corresponding to the target field including a script comparison method, and to obtain a field value comparison result corresponding to the target field by running a logic script in the script comparison method to compare the first field value and the second field value.
[0109] Optionally, the sorting and comparison unit is specifically used to: sum the field values of the preset column fields in the sorted first field value and the field values of the preset column fields in the second field value by running the summation logic script in the script comparison method, and obtain the first summation result and the second summation result corresponding to the preset column fields; determine the field value comparison result corresponding to the preset column field based on the first summation result and the second summation result; compare the other column fields in the sorted first field value and the second field value except the preset column field, and obtain the field value comparison result corresponding to the other column fields in the target field.
[0110] Optionally, the script comparison unit includes one of the following:
[0111] a reference field comparison subunit, configured to detect whether the field values corresponding to the reference fields in the first message and the second message are the same by running the reference field logic script in the script comparison mode, and determine a field value comparison result corresponding to the target field based on the obtained detection result, wherein the first message and the second message each include at least two fields, and the reference field is different from the target field;
[0112] The numerical normalization comparison subunit is used to detect whether the first field value is a preset field value or the second field value by running the numerical normalization logic script in the script comparison method, and determine the field value comparison result corresponding to the target field based on the obtained detection result.
[0113] Optionally, the second comparison submodule is specifically used to:
[0114] In response to the field type corresponding to the target field being a string type, a check is performed on whether the first field value and the second field value are the same, and a field value comparison result corresponding to the target field is determined based on the obtained detection result; in response to the field type corresponding to the target field being an object type or a JSON type, a check is performed on whether each subfield in the target field is the ignored field or the preset field based on the comparison configuration information, and a first subfield value and a second subfield value corresponding to each subfield are compared based on the obtained detection result to obtain a subfield value comparison result corresponding to each subfield in the target field; in response to the field type corresponding to the target field being a list type, the first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field.
[0115] Optionally, the message information acquisition module 310 is specifically used to obtain the first message and the second message corresponding to the same business node in the first system and the second system through data embedding points pre-set in the business nodes in the first system and the business nodes in the second system, wherein the second system is the switching system of the first system.
[0116] Optionally, the device further comprises:
[0117] a target description information determination module, configured to determine the target description information corresponding to the target field based on the field description configuration information after obtaining the field value comparison result corresponding to the target field and in response to the field value comparison result corresponding to the target field being a difference result;
[0118] The difference display data determination module is used to determine the difference display data corresponding to the target field based on the field name of the target field, the target description information, the first field value and the second field value.
[0119] The message comparison device provided in the embodiment of the present invention can execute the message comparison method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the message comparison method.
[0120] It is worth noting that in the embodiment of the above-mentioned message comparison device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0121] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 4 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0122] like Figure 4 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0123] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0124] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0125] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0126] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0127] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0128] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a message comparison method provided by any embodiment of the present invention, the method comprising:
[0129] Acquire a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison mode corresponding to the preset field;
[0130] Based on the comparison configuration information, the target field is detected to determine whether it is an ignored field or the preset field, and based on the detection result, the first field value and the second field value are compared to obtain a field value comparison result of the target field.
[0131] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the message comparison method provided by any embodiment of the present invention.
[0132] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the message comparison method provided in any embodiment of the present invention are implemented.
[0133] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0134] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0135] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0136] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0137] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the message comparison method provided in any embodiment of the present invention.
[0138] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0139] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0140] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A message comparison method, characterized in that: include: Acquire a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison mode corresponding to the preset field; Based on the comparison configuration information, the target field is detected to determine whether it is an ignored field or the preset field, and based on the detection result, the first field value and the second field value are compared to obtain a field value comparison result of the target field.
2. The method according to claim 1, characterized in that The preset comparison method includes: at least one of a date comparison method, a conversion comparison method, a sorting comparison method and a script comparison method corresponding to the preset field; wherein, The date comparison method is to ignore the field value difference generated by the preset field before reaching the end date configured for the preset field; The conversion comparison method refers to performing character conversion on the field value of the preset field and then performing field value comparison based on the character conversion relationship configured for the preset field; The sorting and comparison method refers to sorting the field values of the preset fields based on the list sorting fields configured for the preset fields and then comparing the field values; The script comparison method refers to comparing the field values of the preset fields based on the logic script configured for the preset fields.
3. The method according to claim 1, characterized in that The comparing the first field value and the second field value based on the detection result to obtain a field value comparison result of the target field includes: In response to the target field being the ignored field, determining that a comparison result of field values corresponding to the target field is the same result; In response to the target field being the preset field, based on at least one preset comparison method corresponding to the target field, comparing the first field value and the second field value to obtain a field value comparison result corresponding to the target field; In response to the target field being neither the ignored field nor the preset field, based on the field type corresponding to the target field, the first field value and the second field value are compared to obtain a field value comparison result corresponding to the target field.
4. The method according to claim 3, characterized in that The comparing the first field value and the second field value based on at least one preset comparison method corresponding to the target field to obtain a field value comparison result corresponding to the target field includes the following: In response to the preset comparison method corresponding to the target field including a date comparison method, and the current date is less than the end date in the date comparison method, determining that the field value comparison result corresponding to the target field is the same result; In response to the preset comparison mode corresponding to the target field including a conversion comparison mode, performing character conversion on the first field value and the second field value according to the character conversion relationship in the conversion comparison mode, and comparing the converted first field value and the second field value to obtain a field value comparison result corresponding to the target field; In response to the preset comparison method corresponding to the target field including a sorting comparison method, the first field value and the second field value are sorted according to the list sorting field in the sorting comparison method, and the sorted first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field; In response to the preset comparison method corresponding to the target field including a script comparison method, the first field value and the second field value are compared by running a logic script in the script comparison method to obtain a field value comparison result corresponding to the target field.
5. The method according to claim 4, characterized in that The sorted first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field, including: By running the summing logic script in the script comparison method, the field values of the preset column fields in the sorted first field values and the field values of the preset column fields in the second field values are summed respectively to obtain the first summing result and the second summing result corresponding to the preset column fields; Determine a comparison result of a field value corresponding to the preset column field based on the first summation result and the second summation result; The sorted first field value and the second field value are compared with other column fields except the preset column field to obtain the field value comparison result corresponding to other column fields in the target field.
6. The method according to claim 4, characterized in that The step of comparing the first field value and the second field value by running the logic script in the script comparison mode to obtain a field value comparison result corresponding to the target field includes the following: By running the reference field logic script in the script comparison mode, detecting whether the field values corresponding to the reference fields in the first message and the second message are the same, and determining the field value comparison result corresponding to the target field based on the obtained detection result, wherein the first message and the second message each include at least two fields, and the reference field is different from the target field; By running the numerical normalization logic script in the script comparison method, the first field value is detected to see whether it is a preset field value or the second field value, and the field value comparison result corresponding to the target field is determined based on the obtained detection result.
7. The method according to claim 3, characterized in that The comparing the first field value and the second field value based on the field type corresponding to the target field to obtain a field value comparison result corresponding to the target field includes: In response to the field type corresponding to the target field being a string type, detecting whether the first field value and the second field value are the same, and determining a comparison result of the field value corresponding to the target field based on the obtained detection result; In response to the field type corresponding to the target field being an object type or a JSON type, detecting whether each subfield in the target field is the ignored field or the preset field based on the comparison configuration information, and comparing a first subfield value and a second subfield value corresponding to each subfield based on the obtained detection result to obtain a subfield value comparison result corresponding to each subfield in the target field; In response to the field type corresponding to the target field being a list type, the first field value and the second field value are compared row by row to obtain a field value comparison result corresponding to the target field.
8. The method according to claim 1, characterized in that The obtaining of the first message and the second message to be compared includes: By pre-setting data embedding points in the service nodes in the first system and the service nodes in the second system, the first message and the second message corresponding to the same service node in the first system and the second system are obtained, wherein the second system is the switching system of the first system.
9. The method according to any one of claims 1 to 8, characterized in that: After obtaining the field value comparison result corresponding to the target field, the method further includes: In response to a comparison result of the field value corresponding to the target field being a difference result, determining the target description information corresponding to the target field based on the field description configuration information; Based on the field name of the target field, the target description information, the first field value, and the second field value, the difference display data corresponding to the target field is determined.
10. A message comparison device, characterized in that: include: A message information acquisition module, used to acquire a first message and a second message to be compared and comparison configuration information, wherein the first message includes a first field value corresponding to a target field, the second message includes a second field value corresponding to the target field, and the comparison configuration information includes: at least one of ignored field configuration information and preset field configuration information, and the preset field configuration information includes at least one preset comparison mode corresponding to the preset field; A field value comparison module is used to detect whether the target field is an ignored field or the preset field based on the comparison configuration information, and compare the first field value and the second field value based on the detection result to obtain a field value comparison result of the target field.
11. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the message comparison method as described in any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the message comparison method as described in any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the message comparison method as described in any one of claims 1 to 9.
