Version reconstruction test method, device and equipment for business system

Through the automated business system version reconstruction test method, log parsing and comparison rules are used to solve the problems of low efficiency and high risk of grayscale testing, and efficient and accurate version testing is achieved, especially in the reconstruction version of the payment system. In testing.

CN114371866BActive Publication Date: 2024-11-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011094892.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-14
Publication Date
2024-11-22
Estimated Expiration
2040-10-14

AI Technical Summary

Technical Problem

In business systems with fewer audiences or low frequency of function use, the grayscale test efficiency is low and error-prone, and it cannot effectively cover payment scenarios. Especially in the refactored version of the payment system, manual test efficiency is low and High risk.

Method used

By executing the target business in the original version and refactored version business system, obtaining the run log and performing log parsing, automatically comparing the difference results according to the set version reconstruction comparison rules, determining the test results of the refactored version, reducing the Manual participation improves testing efficiency and effectiveness.

Benefits of technology

Automatic version reconstruction testing is implemented, which improves testing efficiency and effectiveness, reduces manual errors, ensures complete coverage of payment scenarios, and reduces testing risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114371866B_ABST
    Figure CN114371866B_ABST
Patent Text Reader

Abstract

The present application discloses a version reconstruction test method, device and equipment for a business system, which relates to the field of computer technology, and in particular to the field of protocol testing technology, and is used to improve the test efficiency and effect after the application version is reconstructed. The method includes: initiating the target business in the original version and the reconstructed version of the business system respectively with the same input parameter value; obtaining the operation logs of the original version and the reconstructed version of the business system when executing the target business respectively; performing log parsing processing on the operation logs corresponding to the original version and the reconstructed version respectively, and obtaining a log parsing file including the information of each protocol interface called when the business system executes the target business; comparing the log parsing files corresponding to the original version and the reconstructed version respectively according to the set version reconstruction comparison rules, and obtaining the comparison difference results; determining the test results of the reconstructed version of the business system according to the comparison difference results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to the field of protocol testing technology, and provides a version reconstruction testing method, device and equipment for a business system. Background Art

[0002] In order to improve the user experience, backend technicians need to continuously reconstruct the business system version, and the reconstructed business system version needs to pass testing before it can be put into use.

[0003] At present, the reconstructed version is usually subjected to grayscale testing, that is, a designated group of people use the new version of the business system and gradually expand the grayscale of the test. However, this grayscale test can have a better testing effect on business systems with a wide audience and high frequency of function use. When the audience is small or the function is not used frequently, for example, the payment system used in a certain city, since the number of users in a city is limited and the payment system is generally only used when payment is needed, the frequency of use is obviously not high, and the grayscale test cannot have a good testing effect.

[0004] Therefore, for these business systems, the new and old versions are usually compared manually, but manual testing is extremely inefficient and prone to errors. For example, when manually testing the reconstructed version of the payment system, the entire testing process needs to be completed manually, which is extremely inefficient and prone to errors. In addition, since payment systems involve fund security, grayscale testing is risky and the grayscale method cannot guarantee that the reconstructed version of the payment scenario is fully covered. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus and device for version reconstruction testing of a business system, which are used to improve the testing efficiency and effect of the business system after version reconstruction.

[0006] On the one hand, a version reconstruction test method of a business system is provided, the method comprising:

[0007] Initiate the target business in the original version and the reconstructed version of the business system respectively with the same input parameter value;

[0008] Obtaining respectively the operation logs of the original version and the reconstructed version of the business system when executing the target business;

[0009] Performing log parsing processing on the operation logs corresponding to the original version and the reconstructed version respectively, to obtain a log parsing file including information of each protocol interface called when the business system executes the target business;

[0010] According to the set version reconstruction comparison rules, the log parsing files corresponding to the original version and the reconstructed version are compared to obtain the comparison difference results; wherein the comparison rules set the protocol interface and protocol interface parameters to be compared;

[0011] The test result of the reconstructed version of the business system is determined according to the comparison difference result.

[0012] On the one hand, a version reconstruction test device of a business system is provided, the device comprising:

[0013] A service initiation unit, used to initiate a target service in the original version and the reconstructed version of the service system respectively with the same input parameter value;

[0014] A log acquisition unit, used to respectively acquire the operation logs of the original version and the reconstructed version of the business system when executing the target business;

[0015] A log parsing unit, used to perform log parsing processing on the operation logs corresponding to the original version and the reconstructed version, respectively, to obtain a log parsing file including information of each protocol interface called when the business system executes the target business;

[0016] A comparison unit, used to compare the log parsing files corresponding to the original version and the reconstructed version according to the set version reconstruction comparison rules, to obtain a comparison difference result; wherein the comparison rules set the protocol interface and protocol interface parameters to be compared;

[0017] The determination unit is used to determine the test result of the reconstructed version of the business system according to the comparison difference result.

[0018] Optionally, the log acquisition unit is specifically used to:

[0019] According to the business unique identifier generated when the business system of the original version executes the target business, query and obtain the operation log corresponding to the original version from the operation log file; and

[0020] According to the business unique identifier generated when the business system of the reconstructed version executes the target business, the operation log corresponding to the reconstructed version is queried from the operation log file.

[0021] Optionally, the log parsing unit is specifically used to:

[0022] Performing log parsing processing on the log lines included in the operation log line by line;

[0023] According to the parsing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file.

[0024] Optionally, the log parsing unit is specifically used to:

[0025] Performing log line validity judgment on each log line;

[0026] If the validity judgment result indicates that each log line is a valid log line, then a log type judgment is performed on each log line; wherein the valid log line calls a protocol interface to execute a log line related to the target business;

[0027] According to the determined log type, a log parsing process is performed on each log line using a parsing method corresponding to the log type.

[0028] Optionally, the log parsing unit is specifically used to:

[0029] When each log line includes a last interface return mark, determining each log line as a last interface return line; or,

[0030] When each log line does not include a ciphertext request mark or a risk control request mark, determining that each log line is a plaintext data log line; or,

[0031] When each log line includes the risk control request mark, determining that each log line is a risk control interface log line; or,

[0032] When each log line includes the ciphertext request tag, each log line is determined to be a ciphertext data log line.

[0033] Optionally, the log parsing unit is specifically used to:

[0034] According to the parsing result of each line of log, the parsing result belonging to the same protocol interface call is obtained, wherein the parsing result of the same protocol interface call includes the protocol interface name, the request parameter information of the protocol interface, and the response parameter information for the request parameter information;

[0035] The parsing result of the same protocol interface call is processed by data format conversion to record the parsing result according to the set data format to obtain the log parsing file.

[0036] Optionally, the device further comprises a result display unit, which is used to:

[0037] According to the set comparison difference result category, each comparison difference result in the comparison difference result is classified and processed;

[0038] The comparison difference results will be displayed according to the divided categories.

[0039] On the one hand, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.

[0040] In one aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the steps of any of the above methods are implemented.

[0041] In one aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any of the above methods.

[0042] In an embodiment of the present application, the target business is executed through two versions of the business system, namely the original version and the reconstructed version of the business system, and the operation logs of different versions are parsed and processed to obtain log parsing files, which are then automatically compared according to the set version reconstruction comparison rules to obtain the difference between the two versions to determine whether there are errors in the reconstructed version and complete the testing requirements for the reconstructed version. There is no need for manual participation in protocol parsing and comparison, which reduces manual participation and improves testing efficiency and effectiveness. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0044] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0045] Figure 2 A schematic diagram of the test architecture of the test client provided in an embodiment of the present application;

[0046] Figure 3 A flowchart of a version reconstruction test method for a business system provided in an embodiment of the present application;

[0047] Figure 4 A comparative schematic diagram of initiating two payment services provided in an embodiment of the present application;

[0048] Figure 5 A schematic diagram of the parsing process for each log line provided in an embodiment of the present application;

[0049] Figure 6 A partial example diagram of a log parsing file provided in an embodiment of the present application;

[0050] Figure 7 Another example diagram of a log parsing file provided in an embodiment of the present application;

[0051] Figure 8 An example diagram of the comparison rules provided in the embodiments of the present application;

[0052] Fig. 9 A schematic diagram of a parameter or protocol selection interface provided in an embodiment of the present application;

[0053] Fig.10 A schematic diagram showing the comparison difference results provided in the embodiment of the present application;

[0054] Fig.11 A schematic diagram of a structure of a version reconstruction test device for a business system provided in an embodiment of the present application;

[0055] Fig.12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0057] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0058] Version reconstruction: also known as version update, the version reconstruction of the business system may include updates to the front-end and back-end of the business system, for example, it may include protocol reconstruction of the back-end of the business system, or version reconstruction in other aspects.

[0059] Protocol: The protocol interface call constraint rules involved in the business execution interface call. Different protocol interface calls are used to implement different functions. For example, for a payment system, the backend may involve plaintext protocols related to plaintext transmission, ciphertext protocols related to ciphertext transmission, risk control protocols related to risk control, and front-end protocols when processing payment services. Protocol interface information may include the name of the called protocol interface, one or more parameters involved in the protocol, and the names and values ​​of each parameter.

[0060] Comparison rules: In the embodiment of the present application, it refers to the comparison rules set for the version reconstruction comparison test. For the business system to be tested, the protocols to be compared and the parameters involved in each protocol are set according to the test requirements. For example, for a payment business system, it usually involves interfaces related to the payment protocol and interfaces related to the risk control protocol. The parameters that need to be compared in the payment interface may include, for example, the payment user name, payment amount, payee and payment amount, etc. The parameters that need to be compared in the risk control interface may include, for example, the system balance, payment limit and user identity information (ID card, address, etc.).

[0061] In the related technology, when the audience is small or the function is not used frequently, for example, for the payment system used in a certain city, since the number of users in a city is limited and the payment system is generally only used when payment is needed, the frequency of use is obviously not high. Grayscale testing of these business systems cannot have a good testing effect.

[0062] Taking the payment system as an example, when refactoring a version, it is generally required to ensure that the execution logic of the new version is consistent with the old version, and there is no problem of inconsistent funds. When manually testing the refactored version of the payment system in related technologies, the entire test process needs to be completed manually, that is, it is necessary to manually obtain two operation logs, manually filter and select legal protocol content for decryption, and then manually check the parameters. The efficiency of manual testing is extremely low and prone to errors. After the manual test is completed, grayscale testing is required. In addition, since the payment system involves fund security, grayscale testing has high risks. The grayscale method cannot guarantee that the payment scenarios of the refactored version are fully covered.

[0063] In view of this, an embodiment of the present application provides a version reconstruction testing method for a business system. In this method, the target business is executed through two versions of the business system, namely the original version and the reconstructed version of the business system, and the operation logs of the different versions are parsed and processed respectively to obtain log parsing files, and then automatically compared according to the set version reconstruction comparison rules to obtain the difference between the two versions to determine whether there are errors in the reconstructed version, complete the testing requirements for the reconstructed version, and do not require manual participation in protocol parsing and comparison, thereby reducing manual participation and improving testing efficiency and effectiveness.

[0064] In addition, in an embodiment of the present application, the protocols and parameters that need to be compared can be set, and then during the subsequent comparison, only the set protocols and adopted numbers will be compared, and then the tester can set them according to the test requirements to improve the flexibility of the comparative test.

[0065] After introducing the design ideas of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0066] The solution provided in the embodiment of the present application can be applied to most test scenarios after version reconstruction, such as Figure 1 As shown, it is a schematic diagram of an application scenario provided by an embodiment of the present application. In this scenario, a terminal device 101, a server 102, a test device 103 and a database 104 may be included.

[0067] The terminal device 101 and the test device 103 can be devices such as a tablet computer (PAD), a mobile phone, a laptop computer or a personal computer (PC). Of course, they can also be other possible devices, which are not limited by the embodiment of the present invention. The terminal device 101 is installed with a client of the business system under test, and the target business can be initiated from the client. Specifically, the original version of the business system and the reconstructed version of the business system can correspond to clients respectively, so the target business can be initiated from the clients corresponding to the two versions, and the business input parameters of the two versions are consistent.

[0068] A test client can be installed on the test device 103. In actual applications, in order to facilitate testing, the client on the terminal device 101 can control the automatic initiation of services through the test device 103, that is, after the test of the test device 103 starts, the client can be automatically controlled to initiate the target service. Of course, the terminal device 101 and the test device 103 can also be set as the same device, so the original version and the reconstructed version can be called through the test client to execute the same service respectively. For example, when the business system is a payment system, different versions of the payment application can be called to initiate the payment of the same amount for subsequent comparison.

[0069] The test device 103 may include one or more processors, memories, I / O interfaces interacting with the server 102 and the terminal device 101, a display panel, etc. The memory of the test device 103 may store program instructions of the comparison method provided in the embodiment of the present application, and when these program instructions are executed by the processor, they can be used to implement the steps of the version reconstruction test method of the business system provided in the embodiment of the present application, so as to perform a comparison test between the new and old versions of the business system.

[0070] Server 102 can be the background server of the business system. When a business is initiated, a business request will be initiated to server 102 accordingly. Server 102 can then implement the corresponding business and return a business response. At the same time, the business system will synchronously generate an operation log when executing the target business. For example, in order to implement the target business, server 102 needs to execute the business logic of the target business, that is, it needs to call the protocol interface involved in the business to implement the entire process. The log generated by it can be stored in database 104. Then, the test client on the subsequent test terminal 101 can obtain the corresponding operation log from database 104 according to the unique business identifier, such as the payment order number for the payment business, and then parse the operation log to obtain a log parsing file, so as to compare the two versions according to the log parsing file to determine whether the logic of the new version is consistent with the old version, and whether the execution results are consistent, etc., and finally determine whether there is an error (bug) in the new version.

[0071] In one possible implementation, the test client installed on the test device 103 can realize visual interaction of the tester, and the test logic can be deployed on the server, and the computing resources of the server can be used to implement the test logic, that is, the tester can remotely initiate the test through the test client, so that the test tool deployed on the server starts the test, that is, obtain the corresponding operation log from the database 104, and then parse the operation log to obtain a log parsing file, so as to compare the two versions according to the log parsing file to determine whether the logic of the new version is consistent with the old version, and whether the execution results are consistent, etc., and the test client can synchronously display the test process, such as the log parsing process and the final result display.

[0072] The above-mentioned devices can be directly or indirectly connected to each other through one or more networks. The network can be a wired network or a wireless network, for example, the wireless network can be a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, and of course other possible networks, which are not limited in the embodiments of the present application.

[0073] Of course, the method provided in the embodiment of the present application is not limited to Figure 1The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.

[0074] Before introducing the test method flow, the architecture of the test client provided by the embodiment of the present application is first introduced. Figure 2 The following is a schematic diagram of the test client test architecture. The architecture mainly includes the following modules:

[0075] (1) Log Analyzer

[0076] The log analyzer is the core of the test solution and the driving engine of the test tool. It is used to coordinate other modules to implement log capture, protocol parsing and comparison, such as calling the tools of the tool module to implement the corresponding functions of the tool.

[0077] (2) Tool Module

[0078] The tool module includes multiple tools involved in the test process, and each tool is called by the log analyzer to implement the corresponding function. For example, the tool module may include a remote control tool, an encryption / decryption tool, a format conversion tool, and a comparison tool. Of course, other possible tools may also be included, and the embodiments of the present application do not limit this.

[0079] The remote control tool can assist in realizing the remote control function, for example, it can be a Secure Shell Protocol (SSH Client) tool.

[0080] The encryption / decryption tool (Encrypt Manager) is used to encrypt and decrypt the content to be transmitted. In the embodiment of the present application, it is mainly used to decrypt the ciphertext log lines when performing log parsing.

[0081] The format conversion tool is used to store the parsed log data in a format set, for example, it can be stored in JSON (Java Script Object Notation) format. JSON is a lightweight data representation method that uses a key-value method to record data, which is more intuitive and concise.

[0082] The comparison tool (Compare Manager) is used to compare two versions of log parsing files according to the set comparison rules during the comparison stage of log parsing files.

[0083] (3) Comparison rules and result storage module

[0084] The comparison rule and result storage module is used to store the set comparison rules and the comparison result set obtained after the comparison is completed.

[0085] (4) Log parsing data module

[0086] The log parsing data module is used to store the log parsing files obtained by parsing. The log parsing files are stored according to the set log parsing structure (LogModule), and each log parsing file includes multiple log parsing entries (LogItem).

[0087] See also Figure 3 , which is a flow chart of a version reconstruction test method for a business system provided in an embodiment of the present application. The method can be performed by Figure 1 The method is performed by the test device 103 in the embodiment, and the process of the method is described as follows.

[0088] Step 301: Initiate a target business in the original version and the reconstructed version of the business system respectively with the same input parameter value.

[0089] In the embodiment of the present application, in order to facilitate the comparison between the new and old versions of the business system, the parameters input when the two services are initiated can be kept consistent. For example, for a payment system, the information such as the payee, payment amount, and payment method when the two services are initiated can be kept consistent. In this way, whether the new version has a fault can be determined directly based on whether the parameter data obtained by the analysis is consistent.

[0090] like Figure 4 As shown in the figure, a comparison diagram of two payment services initiated at the front desk is shown, taking the payment system as an example. The two payment initiation methods can be the same, such as code scanning payment or transfer payment, and the payment-related parameters entered on the payment page are also the same, such as Figure 4 The payee, payment amount, and payment method are the same in the original and refactored versions of the payment page.

[0091] Step 302: Obtain the operation logs of the original version and the reconstructed version of the business system when executing the target business respectively.

[0092] Generally speaking, each business execution will correspond to a business unique identifier, so the corresponding operation log can be queried from the operation log file according to the business unique identifier.

[0093] Specifically, based on the business unique identifier generated when the original version of the business system executes the target business, the operation log corresponding to the original version is queried from the operation log file of the business system; and based on the business unique identifier generated when the reconstructed version of the business system executes the target business, the operation log corresponding to the reconstructed version is queried from the operation log file of the business system.

[0094] For example, taking the payment system as an example, each payment can be considered as a payment order, which can correspond to a payment order number in the system. The payment order number is equivalent to the chromosome of each payment, which can distinguish different payment orders initiated. Then, all operation logs related to the payment order number can be queried from the operation log file according to the payment order number.

[0095] Or, generally speaking, each request initiated by a user corresponds to a unique request identifier (message_number, MSG_NO), so MSG_NO can also be used as the unique business identifier of the current business execution, and then all operation logs related to the MSG_NO can be queried from the operation log file according to MSG_NO.

[0096] Specifically, when performing a run log query, you can call a log query tool to perform the query, such as the grep (Globally search a Regular Expression and Print) tool. grep is a powerful text search tool that can use specific pattern matching to search text, such as regular expressions, and output matching lines by default. Of course, other search tools can also be used for querying, and the embodiments of the present application do not limit this.

[0097] Step 303: Perform log parsing processing on the operation logs corresponding to the original version and the reconstructed version, respectively, to obtain a log parsing file including information of each protocol interface called when the business system executes the target business.

[0098] In the embodiment of the present application, since the log parsing and processing processes of the operation logs corresponding to the original version and the reconstructed version are similar, the parsing and processing process of an operation log is introduced as an example below.

[0099] For a running log, log parsing is performed on the running log. When a log parsing file is obtained, the log lines included in the running log can be parsed line by line, and according to the parsing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file.

[0100] When parsing the log lines included in the operation log line by line, the validity of each log line can be judged for each log line to determine whether each log line is a valid log line. If it is a valid log line, the log line is parsed and processed. If it is not a valid log line, the log line is discarded. Among them, the valid log line is the log line related to the target business that calls the protocol interface. For example, for the payment system, the valid log line can be the log line that is strongly related to the payment business, such as the log line related to the payment-related protocol, while some debug log lines can be considered as log lines that are not related to the business and can be discarded without parsing.

[0101] Specifically, when determining the validity of a log line, the judgment can be made based on the keywords included in the log line. For example, for a payment system, valid log lines are usually log lines related to payment agreements, and these log lines usually include keywords such as "request" or "response", so log lines including these keywords can be determined as valid log lines.

[0102] For each valid log line, different log types usually involve different business protocols. Each business protocol needs to collect different data, and each business protocol has a different processing method. For example, the ciphertext protocol needs to be decrypted before it can be parsed. Therefore, you can first determine the log type of the log line, and then parse it according to the parsing method corresponding to the determined log type.

[0103] The log type can include one or more of the following log types:

[0104] (1) The last interface return line is the final return line of the target business call interface call, carrying the business execution result.

[0105] (2) Plaintext data log lines are log lines related to plaintext data protocol calls.

[0106] (3) Risk control interface log lines, which are log lines related to risk control protocol calls.

[0107] (4) Ciphertext data log lines are log lines related to ciphertext data protocol calls.

[0108] Of course, the log types and the parsing methods corresponding to each log type can be reasonably set according to actual needs.

[0109] Generally speaking, different log types usually include corresponding type tags in log lines. Therefore, for each valid log line, when determining the log type of the log line, the determination can be made based on the specific information included in the log line.

[0110] Specifically, when each log line includes the last interface return mark, each log behavior is determined to be the last interface return line; when each log line does not include a ciphertext request mark or a risk control request mark, each log behavior is determined to be a plaintext data log line; when each log line includes a risk control request mark, each log behavior is determined to be a risk control interface log line; when each log line includes a ciphertext request mark, each log behavior is determined to be a ciphertext data log line.

[0111] In an embodiment of the present application, when performing log parsing, the judgment of the log can also be executed in a certain order. For example, the parsing workload of the last interface return line and the plaintext data log line is smaller than the parsing workload of the ciphertext data log line. Therefore, the parsing process of the last interface return line and the plaintext data log line can be set earlier. In this way, for the tester, after the comparison test starts, the output of the result can be perceived very quickly.

[0112] like Figure 5 As shown in the figure, it is a schematic diagram of the parsing process of a log line. Figure 5 Taking a log behavior as an example, the parsing process is as follows.

[0113] S501: Check the validity of the log line.

[0114] That is, determine whether the currently processed log line is a valid log line. If the currently processed log line is a valid log line, continue the subsequent processing flow. If not, discard the current log line and jump to the next log line for processing.

[0115] S502: If the log line is a valid log line, a final interface return line determination is performed on the log line.

[0116] If the currently processed log line is a valid log line, determine whether the log line is the last interface return line. If the currently processed log line is the last interface return line, the log line can be parsed for the last interface return line, that is, the log line is parsed according to the parsing rules corresponding to the last interface return line.

[0117] The judgment of each log type has been introduced above, so it will not be repeated here.

[0118] S503: If the log line is a last interface return line, perform last interface return line parsing processing on the log line.

[0119] S504: If the log line is not the last interface return line, a plaintext data log line determination is performed on the log line.

[0120] If the currently processed log line is not the last interface return line, the subsequent processing flow continues, that is, determining whether the log line is a plaintext data log line.

[0121] S505: If the log line is a plaintext data log line, perform plaintext data log line parsing processing on the log line.

[0122] If the currently processed log line is a plaintext data log line, then the log line may be parsed for the plaintext data log line, that is, the log line may be parsed according to the parsing rule corresponding to the plaintext data log line.

[0123] S506: If the log line is not a plaintext data log line, a risk control interface log line judgment is performed on the log line.

[0124] If the currently processed log line is not a plaintext data log line, the subsequent processing flow continues, that is, determining whether the log line is a risk control interface log line.

[0125] S507: If the log line is a risk control interface log line, perform risk control interface log line parsing processing on the log line.

[0126] If the log line currently being processed is a risk control interface log line, the log line may be parsed for the risk control interface log line, that is, the log line may be parsed according to the parsing rules corresponding to the risk control interface log line.

[0127] S508: If the log line is not a risk control interface log line, a ciphertext data log line determination is performed on the log line.

[0128] If the log line currently being processed is not a risk control interface log line, the subsequent processing flow continues, that is, determining whether the log line is a ciphertext data log line.

[0129] S509: If the log line is a ciphertext data log line, perform ciphertext data log line parsing processing on the log line.

[0130] If the currently processed log line is a ciphertext data log line, the ciphertext data log line parsing process can be performed on the log line, that is, the log line is parsed according to the parsing rules corresponding to the ciphertext data log line. For example, when parsing a ciphertext data log line, it is necessary to first call the encryption / decryption tool to decrypt the log line, and then parse the data of the log line.

[0131] After parsing each valid log line through the above-mentioned parsing process, the parsing results of each log line can be obtained. In order to facilitate comparative analysis, the parsing results of the same protocol interface call can be associated and recorded in the same data block in the log parsing file, wherein the parsing results of the same protocol interface call include the protocol interface name, the request parameter information of the protocol interface and the response parameter information of the protocol interface. For the parsing results, the format conversion tool can be called to convert the data format of the parsing results to record the parsing results in the set data format to obtain a log parsing file.

[0132] like Figure 6 As shown in the figure, some examples of log parsing files are obtained. Figure 6 As shown in the figure, "5550886289685852931366578314668" is the unique identifier of the business when executing the target business, that is, MSG_NO, "ia_sitg_wx_deal_server" is the project name of the business system that executes the target business, which can correspond to the original version or the reconstructed version of the business system, and "ia_sitg_wx_efast_pay_c" indicates that the target business is a payment business. The "overview" part is an overview of the protocol interface calls, that is, the name and sequence of the protocol interfaces called when executing the target business.

[0133] like Figure 7 As shown, another example diagram of the obtained log parsing file is shown. Figure 7 Taking the storage of log parsing results in JSON format as an example, an example of a data block for a protocol interface call is shown. Among them, "ia_b2c_orderquery_service" is the name of the called protocol interface, and the contents in the two subsequent curly brackets correspond to the protocol request data and protocol return data when the protocol interface is called. These two parts of data are stored in JSON format. For example, "MSG_NO": "5550886289685852931366578314668M" in the protocol request data means that "MSG_NO" is "5550886289685852931366578314668M", which is more concise and clear, and is convenient for testers to check when there are problems later.

[0134] Step 304: According to the set version reconstruction comparison rule, the log parsing files corresponding to the original version and the reconstructed version are compared to obtain a comparison difference result.

[0135] In an embodiment of the present application, after the operation log parsing is completed, the two versions of the log parsing files can be compared according to the set comparison rules, in which the protocol interfaces and protocol interface parameters that need to be compared are set.

[0136] Specifically, before testing, the tester can set the comparison rules according to the test requirements, or select the default comparison rules, or set the comparison rule path, so that the test client can obtain the comparison rules. The comparison rules are a set of parameters configured according to the protocol involved in the target business to be tested. When testing, the comparison items in the comparison rules can be added or deleted.

[0137] like Figure 8 The figure shows an example of a comparison rule, wherein the comparison rule is a set of multiple comparison items, and for a comparison item "fill_anlyze_key("uin")\", it indicates to compare the parameter "uin". Of course, in addition to the parameters, the protocol to be compared can also be set.

[0138] In specific applications, in order to facilitate testers to set comparison rules, the protocols in the target business can also be identified, and then all the protocols and parameters involved can be displayed to the testers. Fig. 9 As shown, it is a schematic diagram of the parameter or protocol selection interface, and the tester can obtain all the protocols and parameters of each protocol involved in the target business through the interface, and can check the protocol or parameter for this requirement comparison before the test to obtain the comparison rules.

[0139] After comparing the log parsing file corresponding to the original version with the log parsing file corresponding to the reconstructed version, a comparison difference result between the two log parsing files can be obtained.

[0140] Step 305: Determine the test result of the reconstructed version of the business system according to the comparison difference result.

[0141] In the embodiment of the present application, a test report of the reconstructed version can be updated according to the obtained comparison difference results, and the test report can indicate the test results of the reconstructed version.

[0142] Specifically, when the comparison difference result indicates that there is no difference between the original version and the reconstructed version, the execution logic and execution result of the updated reconstructed version are completely consistent with those of the original version, and thus the test of the reconstructed version passes.

[0143] Specifically, in order to facilitate the result display so that the tester can intuitively know the test results, the comparison difference results in the comparison difference results can be divided into corresponding categories according to the set comparison difference result categories, and then the comparison difference results can be displayed according to the categories.

[0144] like Fig.10 , which is a schematic diagram showing the comparison difference results provided in the embodiment of the present application. Fig.10 The display interface shown includes the following categories: missing / extra protocol name, missing / extra protocol parameter, and comparison success / failure. Of course, in practical applications, the difference results can be classified according to actual needs, and the present application embodiment does not limit this. Each category is introduced below.

[0145] (1) Protocol name missing

[0146] The missing part of the protocol name indicates that the original version and the refactored version lack the call of a certain protocol interface when executing the target business. For example, the original version's protocol interface call sequence is protocol interface A, protocol interface B, and protocol interface C, while the refactored version's protocol interface call sequence is protocol interface A and protocol interface C, and the call of protocol interface B is missing.

[0147] like Fig.10 As shown in the example of missing protocol name “compare differe: service lack: ia_ui_verify_paypwd_service”, it indicates that when the target service is executed, the reconstructed version lacks the call of the “ia_ui_verify_paypwd_service” interface compared with the original version.

[0148] (2) Extra protocol names

[0149] The extra part of the protocol name indicates that the original version and the refactored version have an extra call to a certain protocol interface when executing the target business. For example, the original version's protocol interface call sequence is protocol interface A, protocol interface B, and protocol interface C, while the refactored version's protocol interface call sequence is protocol interface A, protocol interface B, protocol interface B, and protocol interface C, which means there is an extra call to protocol interface B.

[0150] like Fig.10As shown in , the example "compare differe: service more: ia_card_encrpt_service" with an additional protocol name indicates that when the target business is executed, the reconstructed version has an additional call to the "ia_card_encrpt_service" interface compared with the original version; the example "compare differe: service more: ia_card_encrpt_service" indicates that when the target business is executed, the reconstructed version has an additional call to the "ia_card_encrpt_service" interface compared with the original version; the example "compare differe: service more: ia_prom_qry_prizeinfo_v2_c" indicates that when the target business is executed, the reconstructed version has an additional call to the "ia_prom_qry_prizeinfo_v2_c" interface compared with the original version.

[0151] (3) Protocol parameters missing

[0152] The missing protocol parameter part indicates that when the original version and the reconstructed version execute the target business, the interface call of the reconstructed version is consistent with that of the original version, but the reconstructed version lacks a certain protocol parameter.

[0153] like Fig.10 As shown in the example "compare differe:9001lack:fun=0" with an extra protocol name, it indicates that when the target service is executed, the reconstructed version lacks the "fun" parameter when calling the protocol interface corresponding to 9001.

[0154] (4) Extra protocol parameters

[0155] The extra part of the protocol parameter indicates that when the original version and the reconstructed version execute the target business, the interface call of the reconstructed version is consistent with that of the original version, but the reconstructed version has an extra protocol parameter.

[0156] like Fig.10 As shown in , the example of an additional protocol name "compare differe:9001more:bank_total_fee=" indicates that when the target service is executed, the reconstructed version has an additional "bank_total_fee" parameter when calling the protocol interface corresponding to 9001.

[0157] (5) Comparison successful

[0158] The successful comparison part indicates that when the original version and the reconstructed version execute the target business, the reconstructed version and the original version call the same protocol interface, have the same protocol parameters, and have the same protocol parameter values, then the comparison of the protocol interface call is successful.

[0159] like Fig.10 As shown in the example of successful comparison "compare Success: ia_ui_query_bankacc_service", it indicates that the original version and the reconstructed version call the "ia_ui_query_bankacc_service" interface information are completely consistent.

[0160] (6) Comparison failed

[0161] The failed comparison part indicates that when the original version and the reconstructed version execute the target business, an error occurs in a certain protocol interface called by the reconstructed version and the original version after comparison according to the comparison rules, that is, a certain protocol interface is called and the protocol parameters are consistent, but the protocol parameter values ​​are inconsistent. The difference in parameter values ​​should be regarded as a more serious error, especially in the payment system, where parameter values ​​usually involve information such as the payee and the payment amount. Different parameter values ​​may lead to inconsistency in certain information, which will bring financial risks to users and the user experience will be very poor.

[0162] like Fig.10 As shown in the example of comparison failure "compare Failure: ia_ui_query_mer_service: left is cur_tape = 344, right is cur_tape = 840", it indicates that when the original version and the reconstructed version call the "ia_ui_query_mer_service" interface, the original version's "cur_tape = 344", while the reconstructed version's "cur_tape = 840", although both called the interface and the parameters existed, the parameter values ​​were inconsistent; and "compare Failure: ia_ui_query_mer_service: left is spid = 4220, spid is cur_tape = 3200", it indicates that when the original version and the reconstructed version call the "ia_ui_query_mer_service" interface, the original version's "spid = 4220", while the reconstructed version's "cur_tape = 3200", although both called the interface and the parameters existed, the parameter values ​​were inconsistent.

[0163] Furthermore, the test report can clearly analyze the protocol calls before and after the application reconstruction without manual intervention, ensuring the integrity and consistency of the protocol parameters, greatly improving the test efficiency.

[0164] To sum up, the test scheme of the embodiment of the present application does not require human intervention and can quickly and efficiently complete the reconstructed version test. The subsequent testing of the non-reconstructed version can also use this scheme to parse and generate the called protocol sequence table and all protocol input and output parameters in real time, quickly discover errors, improve test efficiency, and provide a complete parameter request example for writing automation.

[0165] See also Fig.11 Based on the same inventive concept, the embodiment of the present application further provides a version reconstruction test device 110 for a business system, the device comprising:

[0166] A service initiating unit 1101 is used to initiate a target service in the service system of the original version and the reconstructed version respectively with the same input parameter value;

[0167] The log acquisition unit 1102 is used to respectively acquire the operation logs of the original version and the reconstructed version of the business system when executing the target business;

[0168] The log parsing unit 1103 is used to perform log parsing processing on the operation logs corresponding to the original version and the reconstructed version, respectively, to obtain a log parsing file including information of each protocol interface called when the business system executes the target business;

[0169] The comparison unit 1104 is used to compare the log parsing files corresponding to the original version and the reconstructed version according to the set version reconstruction comparison rules to obtain the comparison difference results; wherein the comparison rules set the protocol interface and protocol interface parameters to be compared;

[0170] The determination unit 1105 is used to determine the test result of the reconstructed version of the business system according to the comparison difference result.

[0171] Optionally, the log acquisition unit 1102 is specifically configured to:

[0172] According to the business unique identifier generated when the original version of the business system executes the target business, query and obtain the operation log corresponding to the original version from the operation log file; and

[0173] According to the business unique identifier generated when the reconstructed version of the business system executes the target business, the operation log corresponding to the reconstructed version is queried from the operation log file.

[0174] Optionally, the log parsing unit 1103 is specifically used for:

[0175] Perform log parsing and processing on the log lines included in the operation log line by line;

[0176] According to the parsing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file.

[0177] Optionally, the log parsing unit 1103 is specifically used for:

[0178] Perform log line validity judgment on each log line;

[0179] If the validity judgment result indicates that each log line is a valid log line, then a log type judgment is performed on each log line; wherein the valid log line calls the protocol interface to execute the log line related to the target business;

[0180] According to the determined log type, a log parsing process is performed on each log line using a parsing method corresponding to the log type.

[0181] Optionally, the log parsing unit 1103 is specifically used for:

[0182] When each log line includes a last interface return marker, determining each log line as a last interface return line; or,

[0183] When each log line does not include a ciphertext request mark or a risk control request mark, determining each log line as a plaintext data log line; or,

[0184] When each log line includes a risk control request tag, determining each log line as a risk control interface log line; or,

[0185] When each log line includes a ciphertext request tag, each log line is determined to be a ciphertext data log line.

[0186] Optionally, the log parsing unit 1103 is specifically used for:

[0187] According to the parsing result of each line of log, the parsing result belonging to the same protocol interface call is obtained, wherein the parsing result of the same protocol interface call includes the protocol interface name, request parameter information of the protocol interface, and response parameter information for the request parameter information;

[0188] The parsing result of the same protocol interface call is converted into a data format to record the parsing result in a set data format to obtain a log parsing file.

[0189] Optionally, the device further includes a result display unit 1106, which is used to:

[0190] According to the set comparison difference result category, each comparison difference result in the comparison difference result is classified and processed;

[0191] The comparison difference results will be displayed according to the divided categories.

[0192] The device can be used to perform Figures 3 to 10 Therefore, for the functions that can be realized by each functional module of the device, please refer to Figures 3 to 10 The description of the illustrated embodiment is not repeated in detail.

[0193] See also Fig.12 Based on the same technical concept, an embodiment of the present application also provides a computer device 120, which may include a memory 1201 and a processor 1202.

[0194] The memory 1201 is used to store computer programs executed by the processor 1202. The memory 1201 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the computer device, etc. The processor 1202 may be a central processing unit (CPU), or a digital processing unit, etc. The specific connection medium between the above-mentioned memory 1201 and the processor 1202 is not limited in the embodiments of the present application. The embodiments of the present application are Fig.12 In the embodiment, the memory 1201 and the processor 1202 are connected via a bus 1203. The bus 1203 is connected to the processor 1202 via a bus 1203. Fig.12 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 1203 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0195] The memory 1201 may be a volatile memory, such as a random-access memory (RAM); the memory 1201 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 1201 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1201 may be a combination of the above memories.

[0196] The processor 1202 is used to execute the following when calling the computer program stored in the memory 1201: Figures 3 to 10 The method executed by the device in the illustrated embodiment.

[0197] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the following steps: Figures 3 to 10 The method executed by the device in the illustrated embodiment.

[0198] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may 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 of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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.

[0199] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0200] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A version reconstruction test method for a business system, characterized in that: The method comprises: Identify the protocols in the target service to display the protocols and parameters of each protocol involved in the target service in the selection interface; Generate corresponding version reconstruction comparison rules according to the selection operation performed in the selection interface, wherein the selection operation is used to select the protocol or parameter to be compared in this test in the selection interface; Initiate the target business in the original version and the reconstructed version of the business system respectively with the same input parameter value; According to the unique business identifier generated when the original version of the business system executes the target business, obtaining the operation log of the original version executing the target business from the operation log file of the original version of the business system; According to the business unique identifier generated when the business system of the reconstructed version executes the target business, obtaining the operation log of the reconstructed version executing the target business from the operation log file of the business system of the reconstructed version; Performing log parsing processing on the log lines in the operation logs corresponding to the original version and the reconstructed version respectively; wherein, when performing log parsing processing on each log line, performing log type judgment on each log line, and according to the determined log type, performing log parsing processing on each log line using a parsing method corresponding to the log type, wherein the log types include a final return line carrying a business execution result, a log line related to a plaintext data protocol call, a log line related to a risk control protocol call, and a log line related to a ciphertext data protocol call; According to the parsing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file to obtain the corresponding log parsing file, each log parsing file including the information of each protocol interface called when the business system executes the target business; According to the version reconstruction comparison rule, the log parsing files corresponding to the original version and the reconstructed version are compared to obtain a comparison difference result; wherein the protocol interface and protocol interface parameters to be compared are set in the version reconstruction comparison rule; The test results of the reconstructed version of the business system are determined based on the comparison difference results; wherein the test results include the results of categorizing the comparison difference results according to the set comparison difference result categories, and the comparison difference result categories include missing protocol name, extra protocol name, missing protocol parameter and extra protocol parameter.

2. The method according to claim 1, characterized in that When performing log parsing processing on each log line, determining the log type of each log line includes: Performing log line validity judgment on each log line; If the validity judgment result indicates that each log line is a valid log line, a log type judgment is performed on each log line; wherein the valid log line calls a protocol interface to execute the log line related to the target business.

3. The method according to claim 2, characterized in that The log type is determined for each log line, specifically including: When each log line includes a last interface return mark, determining each log line as a last interface return line; or, When each log line does not include a ciphertext request mark or a risk control request mark, determining that each log line is a plaintext data log line; or, When each log line includes the risk control request mark, determining that each log line is a risk control interface log line; or, When each log line includes the ciphertext request tag, each log line is determined to be a ciphertext data log line.

4. The method according to claim 1, characterized in that According to the parsing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file, including: According to the parsing result of each line of log, the parsing result belonging to the same protocol interface call is obtained, wherein the parsing result of the same protocol interface call includes the protocol interface name, the request parameter information of the protocol interface and the response parameter information for the request parameter information; The parsing result of the same protocol interface call is processed by data format conversion to record the parsing result according to the set data format to obtain the log parsing file.

5. A version reconstruction test device for a business system, characterized in that: The device comprises: A service initiation unit is used to identify the protocols in the target service, so as to display the protocols and parameters of each protocol involved in the target service in the selection interface; generate corresponding version reconstruction comparison rules according to the selection operation performed in the selection interface, wherein the selection operation is used to select the protocol or parameter to be compared in this test in the selection interface; and initiate the target service in the original version and the reconstructed version of the service system respectively with the same input parameter value; A log acquisition unit is used to acquire, from the operation log file of the original version of the business system, an operation log of the original version executing the target business, according to the business unique identifier generated when the original version of the business system executes the target business; and, from the operation log file of the reconstructed version of the business system, an operation log of the reconstructed version executing the target business, according to the business unique identifier generated when the reconstructed version of the business system executes the target business; A log parsing unit, used to perform log parsing processing on the log lines in the operation logs corresponding to the original version and the reconstructed version respectively; wherein, when performing log parsing processing on each log line, a log type judgment is performed on each log line, and according to the determined log type, a parsing method corresponding to the log type is adopted to perform log parsing processing on each log line, wherein the log types include a final return line carrying a business execution result, a log line related to a plaintext data protocol call, a log line related to a risk control protocol call, and a log line related to a ciphertext data protocol call; and, according to the parsing processing result of each line of log, the parsing result of the same protocol interface call is associated and recorded in the same data block in the log parsing file to obtain a corresponding log parsing file, wherein each log parsing file includes information on each protocol interface called when the business system executes the target business; A comparison unit, used to compare the log parsing files corresponding to the original version and the reconstructed version respectively according to the version reconstruction comparison rule to obtain a comparison difference result; wherein the protocol interface and protocol interface parameters to be compared are set in the version reconstruction comparison rule; A determination unit is used to determine the test results of the reconstructed version of the business system based on the comparison difference results; wherein the test results include the results of categorizing each comparison difference result according to the set comparison difference result category, and the comparison difference result category includes missing protocol name, extra protocol name, missing protocol parameter and extra protocol parameter.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.