CN116702741A - Information comparison method, device and related equipment - Google Patents

Information comparison method, device and related equipment Download PDF

Info

Publication number
CN116702741A
CN116702741A CN202310720921.4A CN202310720921A CN116702741A CN 116702741 A CN116702741 A CN 116702741A CN 202310720921 A CN202310720921 A CN 202310720921A CN 116702741 A CN116702741 A CN 116702741A
Authority
CN
China
Prior art keywords
request
processed
result
processing
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310720921.4A
Other languages
Chinese (zh)
Inventor
张明哲
许宪松
刘蓓
刘彦汝
胡庆华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Travelsky Technology Co Ltd
Original Assignee
China Travelsky Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Travelsky Technology Co Ltd filed Critical China Travelsky Technology Co Ltd
Priority to CN202310720921.4A priority Critical patent/CN116702741A/en
Publication of CN116702741A publication Critical patent/CN116702741A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an information comparison method, an information comparison device and related equipment, wherein the method comprises the following steps: acquiring a request to be processed; sending the request to be processed to a new service system for processing to obtain a first processing result; under the condition that the request to be processed is obtained from the log file, the request to be processed is sent to an old service system for processing so as to obtain a second processing result; comparing the first processing result with the second processing result to obtain a first comparison result; under the condition that the request to be processed is obtained from the request file, when the reference file which is related to the request file and the request type of the request to be processed exists, the first processing result is compared with the reference file, so that a second comparison result is obtained. The appointed information between the new service system and the old service system is not required to be compared manually, and the accuracy and the efficiency of information comparison are improved.

Description

Information comparison method, device and related equipment
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to an information comparison method, an information comparison device, and related devices.
Background
To provide passengers with better ticketing services (e.g., inquiring flights, booking tickets, etc.), airlines may utilize new technologies and new frameworks to develop new business systems (e.g., flight inquiry search systems, fare calculation systems, etc.). In order to ensure that the old service system and the new service system can be stably switched, the appointed information (the intermediate key result and the final result) between the new service system and the old service system needs to be compared so as to ensure that the intermediate key result and the final result of the new service system are consistent with the intermediate key result and the final result of the old service system.
At present, the appointed information between the new service system and the old service system is compared by adopting a manual comparison mode, but because the new service system and the old service system can generate a large amount of appointed information, the manual comparison mode is easy to cause careless mistakes and needs to consume higher manpower and material resources, the information comparison accuracy is lower and the information comparison efficiency is lower.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide an information comparison method, apparatus and related devices, so as to solve the problems of low accuracy of information comparison and low efficiency of information comparison in manual comparison.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
the first aspect of the embodiment of the invention discloses an information comparison method, which comprises the following steps:
acquiring a to-be-processed request, wherein the to-be-processed request is acquired from a log file or a pre-configured request file of an old service system;
the request to be processed is sent to a new service system to be processed so as to obtain a first processing result, wherein the first processing result comprises the following steps: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
And under the condition that the request to be processed is obtained from the log file, sending the request to be processed to the old service system for processing to obtain a second processing result, wherein the second processing result comprises: the old service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
comparing the first processing result with the second processing result to obtain a first comparison result;
and under the condition that the request to be processed is obtained from the request file, when a reference file related to the request file and related to the request type of the request to be processed exists, comparing the first processing result with the reference file to obtain a second comparison result.
Preferably, the method further comprises:
and when the reference file related to the request file and related to the request type of the request to be processed does not exist under the condition that the request to be processed is obtained from the request file, the step of sending the request to be processed to the old service system for processing to obtain a second processing result is executed.
Preferably, obtaining the pending request includes:
When a log file of an old service system is received, extracting requests in the log file according to a time sequence, and filtering the extracted requests by utilizing filtering conditions to obtain a request to be processed;
and when a request file obtained by pre-configuration is received, extracting a pending request from the request file.
Preferably, comparing the first processing result with the second processing result to obtain a first comparison result includes:
converting the first processing result and the second processing result into a preset structure type object;
comparing the first processing result and the second processing result converted into the preset structure type object to obtain a first comparison result;
correspondingly, comparing the first processing result with the reference file to obtain a second comparison result, including:
converting the first processing result and the reference file into a preset structure type object;
and comparing the first processing result converted into the preset structure type object with the reference file to obtain a second comparison result.
Preferably, the method further comprises:
under the condition that the first comparison result is obtained, if the first comparison result indicates that the comparison is failed, updating the request type of the request to be processed based on the direction of the new service system for processing the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result;
And under the condition that the second comparison result is obtained, if the second comparison result indicates that the comparison fails, updating the request type of the request to be processed based on the direction of the new service system for processing the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result.
Preferably, the method further comprises:
under the condition that the first comparison result is obtained, based on the direction of the new service system for processing the request to be processed, updating the request type of the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result;
and under the condition that the second comparison result is obtained, updating the request type of the to-be-processed request, and returning to the step of sending the to-be-processed request to a new service system for processing so as to obtain a first processing result.
Preferably, the method further comprises:
outputting and displaying the first comparison result in a display mode corresponding to the first comparison result under the condition that the first comparison result is obtained;
and under the condition that the second comparison result is obtained, outputting and displaying the second comparison result in a display mode corresponding to the second comparison result.
The second aspect of the embodiment of the invention discloses an information comparison device, which comprises:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a to-be-processed request, and the to-be-processed request is acquired from a log file or a pre-configured request file of an old service system;
the first processing unit is configured to send the request to be processed to a new service system for processing, so as to obtain a first processing result, where the first processing result includes: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
the second processing unit is configured to send the pending request to the old service system for processing to obtain a second processing result when the pending request is obtained from the log file, where the second processing result includes: the old service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
the comparison unit is used for comparing the first processing result with the second processing result to obtain a first comparison result;
and the third processing unit is used for comparing the first processing result with the reference file to obtain a second comparison result when the reference file related to the request file and the request type of the request to be processed exists under the condition that the request to be processed is obtained from the request file.
A third aspect of an embodiment of the present invention discloses an electronic device, including: the device comprises a processor and a memory, wherein the processor and the memory are connected through a communication bus; the processor is used for calling and executing the program stored in the memory; the memory is used for storing a program, and the program is used for realizing the information comparison method disclosed in the first aspect of the embodiment of the invention.
A fourth aspect of the embodiments of the present invention discloses a computer-readable storage medium having stored therein computer-executable instructions for performing the information comparison method disclosed in the first aspect of the embodiments of the present invention.
Based on the information comparison method, the information comparison device and the related equipment provided by the embodiment of the invention, the method comprises the following steps: acquiring a request to be processed; sending the request to be processed to a new service system for processing to obtain a first processing result; under the condition that the request to be processed is obtained from the log file, the request to be processed is sent to an old service system for processing so as to obtain a second processing result; comparing the first processing result with the second processing result to obtain a first comparison result; under the condition that the request to be processed is obtained from the request file, when the reference file which is related to the request file and the request type of the request to be processed exists, the first processing result is compared with the reference file, so that a second comparison result is obtained. In the scheme, a request to be processed is sent to a new service system for processing to obtain a first processing result. And acquiring a second processing result from the old service system according to the source of the request to be processed, or acquiring a reference file related to the request file and related to the request type of the request to be processed. And comparing the first processing result with the second processing result to obtain a first comparison result, or comparing the first processing result with the reference file to obtain a second comparison result. The appointed information between the new service system and the old service system is not required to be compared manually, and the accuracy and the efficiency of information comparison are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an information comparison method provided by an embodiment of the invention;
FIG. 2 is a schematic diagram of the PATA type object according to the embodiment of the present invention;
fig. 3 is a block diagram of an information comparing device according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the present disclosure, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As known from the background technology, the manual comparison mode is still adopted to compare the appointed information between the new service system and the old service system at present, but because the new service system and the old service system can generate a large amount of appointed information, the manual comparison mode is easy to cause careless mistakes and needs to consume higher manpower and material resources, the information comparison accuracy is lower and the information comparison efficiency is lower.
Therefore, the embodiment of the application provides an information comparison method, an information comparison device and related equipment, which are used for sending a request to be processed to a new service system for processing so as to obtain a first processing result. And acquiring a second processing result from the old service system according to the source of the request to be processed, or acquiring a reference file related to the request file and related to the request type of the request to be processed. And comparing the first processing result with the second processing result to obtain a first comparison result, or comparing the first processing result with the reference file to obtain a second comparison result. The appointed information between the new service system and the old service system is not needed to be compared manually, so that the accuracy of information comparison and the efficiency of information comparison are improved.
Referring to fig. 1, a flowchart of an information comparison method provided by an embodiment of the present invention is shown, where the information comparison method includes:
step S101: and obtaining a pending request.
It should be noted that, the to-be-processed request (corresponding to the comparison use case) mainly has two sources, namely, a log file of the old service system and a pre-configured request file, and the content in each request file is one to-be-processed request.
It should be further noted that, in the process of configuring the request file, at least one reference file (or may not be configured) related to the request file may be configured, where the reference file is also related to the request type of the request to be processed.
In the specific implementation process of step S101, a pending request is obtained from a log file or a request file of the old service system.
Specifically, when the log file of the old service system is received, the requests in the log file are extracted according to the time sequence, and the requests extracted from the log file are filtered by utilizing the filtering condition to obtain the to-be-processed request, wherein the to-be-processed request is the request meeting the filtering condition in the log file.
When a request file obtained by pre-configuration is received, a request to be processed is extracted from the request file.
It will be appreciated that in practical applications multiple pending requests may be required; when the source of the request to be processed is a log file, a plurality of requests to be processed can be extracted from the log file; when the source of the request to be processed is a request file, a plurality of request files are required to be configured in advance, and the request to be processed is extracted from each request file respectively.
The log file and the request file mentioned above are input by a user, and when the user inputs a plurality of request files, the user can input a plurality of request files respectively, and the user can input a plurality of request files in a folder manner.
When receiving the file folder, ordering the request files of the file folder according to file names, and extracting the requests to be processed from the ordered request files respectively.
It will be appreciated that when the new service system and the old service system process the pending request, corresponding information is output (or returned) according to the request type (also referred to as the request response type) of the pending request, and the output information is a final result or any intermediate key result. Specifically, the request type of the request to be processed includes a field for controlling the response return type (i.e. for controlling the output of the final result or which intermediate key result is output), where the field for controlling the response return type may be a FetchResultType type, an enumeration type, and an enumeration value of the FetchResultType type is shown in table 1.
Table 1:
FETCH_NOTHING=0, not to send requests
FETCH_FINAL_RESPONSE, The request response type is the final result
FETCH_ENGINE_REQUEST, The request response type is JSON request
FETCH_ENGINE_RESPONSE, The request response type is JSON response
In table 1 above, "JSON request" and "JSON response" are intermediate key results.
From the above, it can be seen that the user can input a pending request by the following three input methods.
The first input mode is as follows: the user may input a request file by entering a path of a single request file. If a user needs to input a plurality of request files in this way, the paths of the respective request files need to be separated by commas.
The second input mode is as follows: the user may input the request file by entering a folder containing at least the request file with the suffix "xml", "json", or "txt".
Third input mode: the user may enter a log file of the old business system to enter the pending request. The log files are ordered according to the file names of the logs, when a plurality of log files exist, the requests are extracted according to the time of the request records and the time sequence, and the extracted requests are filtered so as to obtain the requests to be processed.
It should be noted that if the reference file is also configured when the request file is configured, the reference file is related to the request file and also related to the request type of the request to be processed; specifically, the reference file is divided into a reference file of an intermediate key result and a reference file of a final result, the suffix of the reference file of the intermediate key result, which is "JSON request", is "jrexp", the suffix of the reference file of the intermediate key result, which is "JSON response", is "jsexp", and the suffix of the reference file of the final result is "exp"; the above-mentioned suffix about the reference file is merely for illustration, and in practical application, the reference file needs to be set according to practical situations.
The reference file and the request file may be specifically embodied in: the file names of the reference file and the request file are the same (but the suffixes are different).
For example: the reference file of the final result related to the request file of "1.Txt" is "1.Exp", and the reference file of the intermediate key result of "JSON request" related to the request file of "1.Txt" is "1.Jrexp".
In some embodiments, the request to be processed may be placed in a sending queue, and then the request to be processed is taken out from the sending queue and sent to the new service system, where the request to be processed is derived from the log file of the old service system, the request to be processed also needs to be sent to the old service system. In addition, when the pending request originates from the request file but there is no reference file related to the request type of the pending request, the pending request needs to be sent to the just-in-time service system.
Step S102: and sending the request to be processed to a new service system for processing to obtain a first processing result.
The first processing result includes: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed.
In the specific implementation process of step S102, the to-be-processed request is sent to a new service system for processing, and the new service system outputs a first processing result according to the request type of the to-be-processed request.
For example: if the request type of the request to be processed is the returned final result, the request to be processed is sent to a new service system for processing, and the new service system outputs the final result (the first processing result is the final result).
Also for example: if the request type of the request to be processed is an intermediate key result of returning a JSON response, the request to be processed is sent to a new service system for processing, and the new service system outputs the JSON response (at the moment, the first processing result is the JSON response).
From the above, it can be seen that the request to be processed is derived from a log file or a request file of the old service system; in the case that the request to be processed originates from the log file of the old service system, since the log file does not contain the reference file, the request to be processed needs to be sent to the old service system for processing, so as to obtain a second processing result for comparing the first processing result, that is, in the case that the request to be processed originates from the log file of the old service system, step S103 and step S104 are executed, where the second processing result corresponds to the comparison reference.
In the case where the request to be processed originates from the request file, the reference file may or may not be configured because the reference file may be configured; when there is a reference file related to the request file and related to the request type of the request to be processed, the first processing result may be compared directly by using the reference file (at this time, the request to be processed does not need to be sent to the old service system), and the reference file corresponds to the comparison reference. That is, in the case where the request to be processed originates from the request file, when there is a reference file related to the request file and to the request type of the request to be processed, step S105 is performed.
It can be appreciated that in the case where the request to be processed originates from the request file, if the reference file is not configured, the first processing result cannot be compared, and at this time, the request to be processed needs to be sent to the old service system to be processed, so as to obtain the second processing result for comparing the first processing result.
In some embodiments, in the case where the request to be processed is obtained from the request file, when there is no reference file related to the request file and to the request type of the request to be processed, step S103 and step S104 are performed.
That is, in the case where the request to be processed originates from the log file of the old service system, or when there is no reference file (the request to be processed is obtained from the request file), the request to be processed is sent to the new service system and the old service system for processing. In the case where the pending request originates from the request file, and when the reference file exists, only the pending request is sent to the new business system for processing.
Step S103: in the case that the request to be processed originates from the log file of the old service system, or when there is no reference file related to the request file and to the request type of the request to be processed, the request to be processed is sent to the old service system to be processed so as to obtain a second processing result.
The second processing result includes: the old business system outputs a final result or an intermediate key result according to the request type of the request to be processed.
In the process of the specific implementation step S103, in the case that the request to be processed is obtained from the log file, or when there is no reference file related to the request file and related to the request type of the request to be processed (when the request to be processed is obtained from the request file), the request to be processed is sent to the old service system for processing, and the old service system outputs a second processing result according to the request type of the request to be processed.
For example: and if the request type of the request to be processed is a returned final result, sending the request to be processed to the old service system for processing, and outputting the final result by the old service system (the second processing result is the final result).
Step S104: and comparing the first processing result with the second processing result to obtain a first comparison result.
In some embodiments, the corresponding first processing result and second processing result may be put into a comparison queue to wait for comparison; the corresponding first processing result and second processing result refer to: in the process of processing the request to be processed, the new service system and the old service system output results according to the request type of the same request to be processed.
In the specific implementation process of step S104, the corresponding first processing result and second processing result are converted into a preset structure type object, where the structure type object may be a JSON type object, an XML type object, or a PATA type object.
It should be noted that, the PATA type object is a string result of calculating the freight rate; a tree is formed by taking the brand name as a key and the brand detailed information as a value, so that the influence of the sequence of characters in the character string on the content to be compared can be avoided.
And comparing the first processing result and the second processing result converted into the preset structure type object to obtain a first comparison result. Specifically, determining a node to be ignored according to actual requirements, filtering the node to be ignored in the first processing result and the second processing result converted into the preset structure type object, and then comparing to obtain a first comparison result. The comparison may be performed to determine whether the first processing result and the second processing result have the same node, and whether the first processing result and the second processing result have the same node. After filtering out nodes which need to be ignored, when the first processing result and the second processing result converted into the preset structure type object are identical, the first comparison result indicates that the comparison is successful.
Step S105: under the condition that the request to be processed is obtained from the request file, when the reference file which is related to the request file and the request type of the request to be processed exists, the first processing result is compared with the reference file, so that a second comparison result is obtained.
In the process of implementing step S105, in the case where the request to be processed is obtained from the request file, when there is a reference file related to the request file and related to the request type of the request to be processed, it is not necessary to send the request to be processed to the old service system for processing, and the reference file related to the request file and related to the request type of the request to be processed is obtained.
And comparing the first processing result with the reference file to obtain a second comparison result. Specifically, converting the first processing result and the reference file into a preset structure type object; and comparing the first processing result converted into the preset structure type object with the reference file to obtain a second comparison result.
After the first comparison result or the second comparison result is obtained through the processing of the steps, the obtained first comparison result or second comparison result is put into an inspection queue for waiting inspection.
It should be noted that the first comparison result and the second comparison result both have two states of comparison failure and comparison success.
The new service system generates at least one intermediate key result (possibly multiple intermediate key results) and a final result in the process of processing the request to be processed, and outputs the intermediate key result or the final result according to the request type of the request to be processed; the direction in which the new business system processes the pending request represents: the new business system will sequentially generate intermediate key results and final results in the process of processing the pending request. The direction in which the old service system processes the pending request is the same and will not be described in detail here.
For example: the new service system sequentially generates an intermediate key result A, an intermediate key result B and a final result in the process of processing the request A to be processed; the intermediate key result A-intermediate key result B-final result is the direction of the new service system to process the pending request A.
Since the first processing result may be an intermediate key result or a final result, the first comparison result and the second comparison result are: and comparing the comparison result obtained by the final result or the comparison result obtained by the middle key result.
After the first comparison result and the second comparison result, whether to continue to compare other intermediate key results which are not compared can be determined according to actual setting; the method specifically comprises the following steps:
in some embodiments, under the condition that the first comparison result is obtained, if the first comparison result indicates that the comparison fails, based on the direction in which the new service system processes the pending request, the request type of the pending request is updated, and the next round of comparison is continued after the execution of step S102.
Similarly, if the second comparison result indicates that the comparison fails, the request type of the request to be processed is updated based on the direction in which the new service system processes the request to be processed, and the next round of comparison is continued after the execution of step S102 is returned.
The specific way of updating the request type of the pending request is: based on the direction of the new service system processing the request to be processed, the request type of the request to be processed is updated to the request type of the last intermediate key result of the current first processing result.
For example: setting the direction of the new service system for processing the to-be-processed request A as an intermediate key result A-intermediate key result B-final result, and comparing the final result (which is equivalent to the current first processing result at the moment) obtained by the new service system for processing the to-be-processed request A with the final result obtained by the old service system for processing the to-be-processed request A to obtain a first comparison result. If the first comparison result indicates that the comparison fails, updating the request type of the request A to be processed into the request type of the request middle key result B, and sending the updated request A to the new service system and the old service system again for processing and continuing the comparison until the obtained first comparison result indicates that the comparison is successful.
That is, when the comparison result (the first comparison result or the second comparison result) indicates that the comparison fails, the request type of the request to be processed is updated and the next round of comparison is continuously performed in step S102 until the comparison result indicates that the comparison is successful (the comparison is not performed after the comparison is successful).
In practical application, if the first processing result is a final result and the comparison of the final result (corresponding to the first processing result at this time) indicates that the comparison is successful, the subsequent comparison may not be performed.
Similarly, whether the comparison result indicates successful comparison or failed comparison, the subsequent comparison needs to be continued until all the intermediate key results and the final results are compared. The specific contents are as follows:
under the condition that the first comparison result is obtained, based on the direction of the new service system for processing the request to be processed, the request type of the request to be processed is updated, and the next round of comparison is continuously carried out until all the intermediate key results and the final results are compared by returning to the execution step S102.
Under the condition that the second comparison result is obtained, the request type of the request to be processed is updated, and the step S102 is executed in a return mode to continue the next round of comparison until all the intermediate key results and the final results are compared. The specific manner of updating the request type of the pending request is referred to above, and will not be described in detail herein.
It will be appreciated that the comparison can be used to locate the problem with the new business system.
For example: and setting the direction of the new service system for processing the pending request A as an intermediate key result A-intermediate key result B-final result. And comparing the final result obtained by the processing of the request A to be processed by the new service system and the old service system to obtain a corresponding first comparison result A. And continuously comparing the intermediate key result B obtained by the new service system and the old service system for processing the pending request A, and obtaining a first comparison result B. And continuously comparing the intermediate key result A obtained by the new service system and the old service system for processing the pending request A, and obtaining a first comparison result C.
If the first comparison result A indicates a comparison failure (corresponding to a final result comparison failure) and the first comparison result B indicates a comparison success (corresponding to an intermediate key result B comparison success), then a problem is indicated to occur in the process of the intermediate key result B-final result. If the first comparison result B indicates a comparison failure and the first comparison result C indicates a comparison success, then the problem is indicated to occur in the process of the intermediate key result A-intermediate key result B.
After the first comparison result and/or the second comparison result are obtained, the obtained first comparison result and/or the second comparison result need to be displayed for the user to check. Specifically, the obtained first comparison result and/or second comparison result are put into a rendering queue, and the first comparison result and the second comparison result in the rendering queue are output and displayed.
In some embodiments, when the first comparison result is obtained, the first comparison result is output and displayed in a display manner corresponding to the first comparison result.
And under the condition that the second comparison result is obtained, outputting and displaying the second comparison result in a display mode corresponding to the second comparison result.
For example: in the case of obtaining the first comparison result, if the first comparison result indicates that the comparison is successful, the first comparison result is displayed in green in the web page. If the first comparison result indicates that the comparison fails, the first comparison result is displayed in red in the webpage, and meanwhile, details of the comparison failure are displayed in a floating mode.
In some embodiments, in the process of outputting and displaying the first comparison result and/or the second comparison result, a corresponding comparison detail page is also generated for the user to check, and the user can quickly locate the problem by checking the comparison detail page.
The above is related description about the information comparison method; in practical application, a configuration file may be set based on the content of the information comparison method, where the configuration file at least includes: the method comprises the steps of requesting an input path of a file, filtering conditions, an address and a service name of a new service system, an address and a service name of an old service system, nodes needing to be ignored in comparison, and a storage path of a webpage displaying a comparison result. The nodes are designated in the configuration file in the manner of "[ node name ]", and the field values are defined in the manner of "field name=field value". The configuration file is analyzed into a configuration tree, and the information comparison method provided by the embodiment of the invention is realized by executing the configuration file.
In the embodiment of the invention, the request to be processed is sent to a new service system for processing so as to obtain a first processing result. And acquiring a second processing result from the old service system according to the source of the request to be processed, or acquiring a reference file related to the request file and related to the request type of the request to be processed. And comparing the first processing result with the second processing result to obtain a first comparison result, or comparing the first processing result with the reference file to obtain a second comparison result. The appointed information between the new service system and the old service system is not needed to be compared manually, so that the accuracy of information comparison and the efficiency of information comparison are improved.
In order to better explain the contents of the embodiments of the present invention described above, the following description is given by way of example.
When input data of a user is acquired, an input path is judged. If the file folder is input, traversing all files under the file folder to acquire the input file, and if the file path is input, acquiring the input file according to the file path.
If the input file is a log file, the log file is processed by using a predefined 'audioparamser class', and the specific processing mode is as follows: and generating an object of context class from the request in the log file, and placing the object into a sending queue according to the time stamp sequence of the request, wherein the request in the sending queue is the request to be processed.
If the input file is a request file, analyzing the request file in the thread by using a FileParser class, generating an object of a context class and placing the object in a sending queue, wherein the request in the sending queue is a to-be-processed request.
And processing the request to be processed in the sending queue to obtain a first processing result and obtain a second processing result or a reference file. And comparing the first processing result with the second processing result, or comparing the first processing result with the reference file. The comparison may be performed by a responsibility processing chain, specifically, defining a jsonCompare class, an xmlCompare class, and a cmdNATECTIVeCompare class to handle the comparison work of JSON type objects, XML type objects, and PATA type objects, respectively. For details of the PATA type object, reference may be made to the structured schema of the PATA type object shown in fig. 2.
In the comparison process, the abstract syntax structure tree is utilized to declare the filtering condition, wherein "|" represents the condition or "&" represents the condition and, and the filtering condition is as follows: "SSR" | "RMK". And taking out the context type object (the converted first processing result, the converted second processing result and the converted reference file) from the comparison queue, and transmitting the context type object into a responsibility processing chain, wherein the responsibility processing chain can complete comparison according to the specific structure type. And after the comparison result is put into the context type object, putting the context type object into a check queue.
It can be appreciated that the format content of the above mentioned configuration file is as follows:
[ Module name ]
Field name = field value.
The configuration is described as follows:
[parser]
request_root_paths=;
field interpretation: the "request_root_paths" may be a request file name, or a path name containing a request file, or may be a path name containing an audio log.
audit_log_request_oriSys=CRS_C,ICS_C,CRS_D,ICS_D,CRS_B,ICS_B,ICS_A,CRS_A;
Field interpretation: the conditions that the source system of the request in the audio log should meet are given.
audit_log_request_desSys=FARE_P_DPRICE;
Field interpretation: the conditions to which the requested destination system in the audio log should conform are given.
audit_log_request_filter=(">?PAT:()?[Aa].*"&!">?PAT:?[Aa].*#C@.*")|">?PAT:()?[^AaMm]*";
Field interpretation: the header of the black screen request is filtered.
audit_log_requestBody_filter="(\d{2}SC.*\r){1,}";
Field interpretation: the volume of the black screen request is filtered.
only_save_request=;
Field interpretation: only eligible requests are saved.
only_save_request_path:;
Field interpretation: the save path is requested, default req_save.
[sender]
cocount=30;
wsl_svcn_rsp=T_FARECOMM;
wsl_addr_rsp=10.221.170.209:43000;
Field interpretation: "wsl _svcn_rsp" is the tested service name, and "wsl _addr_rsp" is the tested service IP.
wsl_svcn_exp=T_FARECOMM;
wsl_addr_exp=10.221.165.33:43000;
Field interpretation: "wsl _svcn_exp" is a service name providing a desired result, and "wsl _addr_exp" is a service IP providing a desired result.
tpsControlTps=true;
Field interpretation: whether to control tps.
tps=100;
Field interpretation: tps value.
[differ]
only_compare_final_result=true;
Field interpretation: whether the final results are merely aligned.
jsonFilter=filterconfig.cfg;
Field interpretation: and json comparison results.
xmlFilter=xmlfilterconfig.cfg;
Field interpretation: filtering conditions of xml comparison results.
nativeFilter=;
patFilterCondition="^\d\*SSR.*"|"^\d\*RMK PAT//.*"|"^\d\*RMK FAREC ODE/.*"|"^\d\*RMK FARECODE/.*";
Field interpretation: when the pat results are aligned, overrate rows are required.
unknowTypeFilterCondition=".+/.+/PAGE\d+/\d+";
Field interpretation: the unknown type filters out rows.
[render]
save_all_case_including_successed=true;
Field interpretation: whether to store the product function.
final_save_path=report;
Field interpretation: "final_save_path" is the save path of the comparison result page.
The above is illustrative of the specific content of a configuration file.
Corresponding to the information comparison method provided by the embodiment of the present invention, referring to fig. 3, the embodiment of the present invention further provides a structural block diagram of an information comparison device, where the information comparison device includes: an acquisition unit 301, a first processing unit 302, a second processing unit 303, an alignment unit 304, and a third processing unit 305;
the obtaining unit 301 is configured to obtain a pending request, where the pending request is obtained from a log file of an old service system or a preconfigured request file.
In a specific implementation, the obtaining unit 301 is specifically configured to: when the log file of the old service system is received, extracting the request in the log file according to a time sequence, and filtering the extracted request by utilizing a filtering condition to obtain a request to be processed; when a request file obtained by pre-configuration is received, a request to be processed is extracted from the request file.
The first processing unit 302 is configured to send a request to be processed to a new service system for processing, so as to obtain a first processing result, where the first processing result includes: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed.
The second processing unit 303 is configured to send, when the request to be processed is obtained from the log file, the request to be processed to the old service system for processing, so as to obtain a second processing result, where the second processing result includes: the old business system outputs a final result or an intermediate key result according to the request type of the request to be processed.
And the comparing unit 304 is configured to compare the first processing result and the second processing result to obtain a first comparison result.
In a specific implementation, the alignment unit 304 is specifically configured to: converting the first processing result and the second processing result into a preset structure type object; comparing the first processing result converted into the preset structure type object with the second processing result to obtain a first comparison result;
the third processing unit 305 is configured to, in a case where the request to be processed is obtained from the request file, compare the first processing result with the reference file to obtain a second comparison result when there is the reference file related to the request file and related to the request type of the request to be processed.
In a specific implementation, the third processing unit 305 is specifically configured to: converting the first processing result and the reference file into a preset structure type object; and comparing the first processing result converted into the preset structure type object with the reference file to obtain a second comparison result.
Preferably, the third processing unit 305 is further configured to: in the case where the request to be processed is obtained from the request file, when there is no reference file related to the request file and to the request type of the request to be processed, the second processing unit 303 is executed to send the request to be processed to the old service system for processing to obtain a second processing result.
In the embodiment of the invention, the request to be processed is sent to a new service system for processing so as to obtain a first processing result. And acquiring a second processing result from the old service system according to the source of the request to be processed, or acquiring a reference file related to the request file and related to the request type of the request to be processed. And comparing the first processing result with the second processing result to obtain a first comparison result, or comparing the first processing result with the reference file to obtain a second comparison result. The appointed information between the new service system and the old service system is not required to be compared manually, and the accuracy and the efficiency of information comparison are improved.
Preferably, in combination with the content shown in fig. 3, the information comparing apparatus further includes:
and the first updating unit is configured to update the request type of the pending request based on the direction in which the new service system processes the pending request, and return to execute the first processing unit 302 if the first comparison result indicates that the comparison fails in the case that the first comparison result is obtained.
And the second updating unit is configured to update the request type of the pending request based on the direction in which the new service system processes the pending request, and return to execute the first processing unit 302 if the second comparison result indicates that the comparison fails in the case that the second comparison result is obtained.
Preferably, the first updating unit is further configured to: in case the first comparison result is obtained, the request type of the pending request is updated and the execution of the first processing unit 302 is returned based on the direction in which the pending request is processed by the new service system.
The second updating unit is further configured to: in case of obtaining the second comparison result, the request type of the pending request is updated and the execution of the first processing unit 302 is returned.
Preferably, in combination with the content shown in fig. 3, the information comparing apparatus further includes:
the display unit is used for outputting and displaying the first comparison result in a display mode corresponding to the first comparison result under the condition that the first comparison result is obtained; and under the condition that the second comparison result is obtained, outputting and displaying the second comparison result in a display mode corresponding to the second comparison result.
The embodiment of the invention also provides electronic equipment, which comprises: the processor and the memory are connected through a communication bus; the processor is used for calling and executing the program stored in the memory; and a memory for storing a program for implementing the information comparison method.
Referring now to fig. 4, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device may include a processing means (e.g., a central processor, a graphics processor, etc.) 401, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data required for the operation of the electronic device are also stored. The processing device 401, the ROM 402, and the RAM403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 408, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
Still further, an embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored, for performing the information comparison method.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: sending the request to be processed to a new service system for processing to obtain a first processing result; under the condition that the request to be processed is obtained from the log file, the request to be processed is sent to an old service system for processing so as to obtain a second processing result; comparing the first processing result with the second processing result to obtain a first comparison result; under the condition that the request to be processed is obtained from the request file, when the reference file which is related to the request file and the request type of the request to be processed exists, the first processing result is compared with the reference file, so that a second comparison result is obtained.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. An information comparison method, characterized in that the method comprises:
acquiring a to-be-processed request, wherein the to-be-processed request is acquired from a log file or a pre-configured request file of an old service system;
the request to be processed is sent to a new service system to be processed so as to obtain a first processing result, wherein the first processing result comprises the following steps: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
and under the condition that the request to be processed is obtained from the log file, sending the request to be processed to the old service system for processing to obtain a second processing result, wherein the second processing result comprises: the old service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
comparing the first processing result with the second processing result to obtain a first comparison result;
and under the condition that the request to be processed is obtained from the request file, when a reference file related to the request file and related to the request type of the request to be processed exists, comparing the first processing result with the reference file to obtain a second comparison result.
2. The method as recited in claim 1, further comprising:
and when the reference file related to the request file and related to the request type of the request to be processed does not exist under the condition that the request to be processed is obtained from the request file, the step of sending the request to be processed to the old service system for processing to obtain a second processing result is executed.
3. The method of claim 1, wherein obtaining the pending request comprises:
when a log file of an old service system is received, extracting requests in the log file according to a time sequence, and filtering the extracted requests by utilizing filtering conditions to obtain a request to be processed;
and when a request file obtained by pre-configuration is received, extracting a pending request from the request file.
4. The method of claim 1, wherein comparing the first processing result and the second processing result to obtain a first comparison result comprises:
converting the first processing result and the second processing result into a preset structure type object;
comparing the first processing result and the second processing result converted into the preset structure type object to obtain a first comparison result;
Correspondingly, comparing the first processing result with the reference file to obtain a second comparison result, including:
converting the first processing result and the reference file into a preset structure type object;
and comparing the first processing result converted into the preset structure type object with the reference file to obtain a second comparison result.
5. The method as recited in claim 1, further comprising:
under the condition that the first comparison result is obtained, if the first comparison result indicates that the comparison is failed, updating the request type of the request to be processed based on the direction of the new service system for processing the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result;
and under the condition that the second comparison result is obtained, if the second comparison result indicates that the comparison fails, updating the request type of the request to be processed based on the direction of the new service system for processing the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result.
6. The method as recited in claim 1, further comprising:
under the condition that the first comparison result is obtained, based on the direction of the new service system for processing the request to be processed, updating the request type of the request to be processed, and returning to the step of sending the request to be processed to the new service system for processing so as to obtain a first processing result;
and under the condition that the second comparison result is obtained, updating the request type of the to-be-processed request, and returning to the step of sending the to-be-processed request to a new service system for processing so as to obtain a first processing result.
7. The method according to any one of claims 1-6, further comprising:
outputting and displaying the first comparison result in a display mode corresponding to the first comparison result under the condition that the first comparison result is obtained;
and under the condition that the second comparison result is obtained, outputting and displaying the second comparison result in a display mode corresponding to the second comparison result.
8. An information comparison apparatus, the apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a to-be-processed request, and the to-be-processed request is acquired from a log file or a pre-configured request file of an old service system;
The first processing unit is configured to send the request to be processed to a new service system for processing, so as to obtain a first processing result, where the first processing result includes: the new service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
the second processing unit is configured to send the pending request to the old service system for processing to obtain a second processing result when the pending request is obtained from the log file, where the second processing result includes: the old service system outputs a final result or an intermediate key result according to the request type of the request to be processed;
the comparison unit is used for comparing the first processing result with the second processing result to obtain a first comparison result;
and the third processing unit is used for comparing the first processing result with the reference file to obtain a second comparison result when the reference file related to the request file and the request type of the request to be processed exists under the condition that the request to be processed is obtained from the request file.
9. An electronic device, comprising: the device comprises a processor and a memory, wherein the processor and the memory are connected through a communication bus; the processor is used for calling and executing the program stored in the memory; the memory is configured to store a program for implementing the information comparison method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored therein computer-executable instructions for performing the information alignment method of any of claims 1-7.
CN202310720921.4A 2023-06-16 2023-06-16 Information comparison method, device and related equipment Pending CN116702741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310720921.4A CN116702741A (en) 2023-06-16 2023-06-16 Information comparison method, device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310720921.4A CN116702741A (en) 2023-06-16 2023-06-16 Information comparison method, device and related equipment

Publications (1)

Publication Number Publication Date
CN116702741A true CN116702741A (en) 2023-09-05

Family

ID=87835484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310720921.4A Pending CN116702741A (en) 2023-06-16 2023-06-16 Information comparison method, device and related equipment

Country Status (1)

Country Link
CN (1) CN116702741A (en)

Similar Documents

Publication Publication Date Title
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111581291A (en) Data processing method and device, electronic equipment and readable medium
CN111291103B (en) Interface data analysis method and device, electronic equipment and storage medium
CN112965761B (en) Data processing method, system, electronic equipment and storage medium
CN111338944B (en) Remote Procedure Call (RPC) interface testing method, device, medium and equipment
CN113760722A (en) Test system and test method
CN113761588A (en) Data verification method and device, terminal equipment and storage medium
CN111628938A (en) Branch merging method and device, electronic equipment and computer storage medium
CN116049142A (en) Data processing method, device, electronic equipment and storage medium
CN116302271A (en) Page display method and device and electronic equipment
CN116702741A (en) Information comparison method, device and related equipment
CN115964302A (en) Data testing method and device
CN112181675A (en) Satellite real-time data processing method and device, computer equipment and storage medium
CN111240657A (en) Method and device for generating SDK and electronic equipment
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
CN111314457B (en) Method and device for setting virtual private cloud
CN116257501A (en) Data processing method, device, electronic equipment and storage medium
CN114968621B (en) Data communication method, device, equipment, storage medium and system
CN114253520B (en) Interface code generation method and device
CN115062022B (en) Aircraft manual splitting method, device, electronic equipment and computer readable medium
CN118132870A (en) Verification method, verification device, verification equipment, verification medium and verification product
CN117453230A (en) Software package release method, device and equipment
CN118012886A (en) Inspection system, method and device
CN116880898A (en) Document processing method and device, readable medium and electronic equipment
CN114201949A (en) Contract document automatic generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination