CN117891714A - Flow playback testing method, device, equipment and storage medium - Google Patents

Flow playback testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN117891714A
CN117891714A CN202311630854.3A CN202311630854A CN117891714A CN 117891714 A CN117891714 A CN 117891714A CN 202311630854 A CN202311630854 A CN 202311630854A CN 117891714 A CN117891714 A CN 117891714A
Authority
CN
China
Prior art keywords
database data
data
database
test
flow playback
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
CN202311630854.3A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311630854.3A priority Critical patent/CN117891714A/en
Publication of CN117891714A publication Critical patent/CN117891714A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a flow playback testing method, a device, equipment and a storage medium. The method comprises the following steps: before a target business transaction set starts, backing up or snapshot a database of a production system to obtain first database data; in the transaction processing, recording a business transaction identifier, an external calling parameter and calling return information which are externally called by a production system; after transaction processing, backing up or snapshot the database of the production system to obtain business transaction flow records and second database data; performing flow playback test according to the first database data, the service transaction identifier, the external calling parameters, the calling return information and the service transaction running water to obtain third database data; and comparing the third database data with the second database data, and carrying out flow playback test alarm according to the comparison result, so that the business transaction is not required to be judged step by step, and only the comparison result is required, thereby supporting the comparison under the optimization of the system and improving the comparison accuracy.

Description

Flow playback testing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for testing flow playback.
Background
The flow playback is a testing technology for recording online service flow and playing back the recorded service flow in a testing environment. Because the online (production) flow is large, the scene is comprehensive, the limitation of manual testing can be effectively made up, and the risk brought by rapid iteration of the service is further reduced.
Currently, the industry generally adopts a method of comparing an external call interface and a database write instruction generated by playback with recorded online corresponding data to perform a flow playback test. However, this method needs to compare the process values, and in the case of system upgrade optimization or data structure change, erroneous judgment is caused, so that the correctness of the related transaction cannot be effectively verified.
Disclosure of Invention
The invention provides a flow playback test method, a device, equipment and a storage medium, which are used for supporting comparison under system optimization and improving the accuracy of the comparison.
According to an aspect of the present invention, there is provided a flow playback testing method, the method comprising:
before processing a target business transaction set, backing up or snapshot a database of a production system to obtain first database data at a starting moment;
In the transaction processing of a target service transaction set, recording a service transaction identifier, an external calling parameter and calling return information which are called by a production system;
after the target business transaction set is processed, backing up or snapshot is carried out on a database of the production system, so that business transaction flow records and second database data at the end time are obtained;
performing flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the time of completing the test;
and carrying out data comparison according to the third database data and the second database data to obtain a comparison result, and carrying out flow playback test alarm according to the comparison result.
Optionally, performing a flow playback test according to the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction running water to obtain third database data at a time of completing the test, where the third database data includes:
performing flow playback simulation according to the first database data, the service transaction identifier, the external call parameter and the call return information to generate simulated external call return information;
And carrying out flow playback test according to the simulated external call return information, the first database data, the business transaction identifier and the business transaction running water to obtain third database data at the moment of completing the test.
Optionally, performing a flow playback test according to the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction running water to obtain third database data at a time of completing the test, where the third database data includes:
respectively performing desensitization processing on the first database data, the external calling parameters, the calling return information, the business transaction flow and the second database data to obtain respectively corresponding desensitization results;
and performing flow playback test according to each desensitization result and the service transaction identifier to obtain the desensitization result of the third database data at the moment of completion of the test.
Optionally, performing data comparison according to the third database data and the second database data to obtain a comparison result, including:
extracting a first desensitization result corresponding to the business transaction identifier from the desensitization result of the third database data;
Extracting a second desensitization result corresponding to the business transaction identifier from the desensitization result of the second database data;
and carrying out data comparison under the key field according to the first desensitization result and the second desensitization result to obtain a comparison result.
Optionally, the method further comprises:
when the data structure reconstruction of the flow playback system is detected, carrying out data upgrading on the first database data and the second database data;
performing a flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the time of completing the test, wherein the third database data comprises:
performing flow playback test according to the data upgrading result of the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the moment of completing the test;
performing data comparison according to the third database data and the second database data to obtain a comparison result, including:
and carrying out data comparison according to the data upgrading result of the third database data and the second database data to obtain a comparison result.
Optionally, after performing the flow playback test alarm according to the comparison result, the method further includes:
if the flow playback test alarm is abnormal, carrying out time-division processing on the target business transaction set to obtain a plurality of target business transaction subsets;
and performing a flow playback test according to each target business transaction subset to obtain a flow playback test alarm corresponding to each target business transaction subset.
Optionally, the target business transaction set includes: online transactions, timed transactions, or batch processing transactions.
According to another aspect of the present invention, there is provided a flow playback testing apparatus, comprising:
the first database data determining module is used for carrying out backup or snapshot on a database of the production system before processing the target business transaction set to obtain first database data at the starting moment;
the external call information recording module is used for recording the service transaction identifier, the external call parameter and the call return information of the external call of the production system in the transaction processing of the target service transaction set;
the second database data determining module is used for carrying out backup or snapshot on the database of the production system after the target business transaction set is processed to obtain a business transaction flow record and second database data at the end time;
The third database data determining module is used for carrying out flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the moment of completing the test;
and the flow playback test alarm module is used for carrying out data comparison according to the third database data and the second database data to obtain a comparison result, and carrying out flow playback test alarm according to the comparison result.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of flow playback testing of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a method for flow playback testing according to any one of the embodiments of the present invention.
According to the technical scheme, the database of the production system is backed up or snapshot before the target business transaction set is processed, so that first database data at the starting moment is obtained; in the transaction processing of a target service transaction set, recording a service transaction identifier, an external calling parameter and calling return information which are called by a production system; after the target business transaction set is processed, backing up or snapshot is carried out on a database of the production system, so that business transaction flow records and second database data at the end time are obtained; performing flow playback test according to the first database data, the service transaction identifier, the external calling parameters, the calling return information and the service transaction running water to obtain third database data at the time of completing the test; and carrying out data comparison according to the third database data and the second database data to obtain comparison results, carrying out flow playback test alarm according to the comparison results, solving the flow playback test problem after system upgrading optimization, and only needing to compare results without gradually judging business transactions, thereby supporting comparison under system optimization and improving comparison accuracy.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for testing playback of traffic according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a flow playback testing apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device implementing a flow playback test method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a flow playback testing method according to a first embodiment of the present invention, where the method is applicable to a case of performing a flow playback test through a flow playback, and is particularly applicable to a case of performing a flow playback test after system upgrade optimization, and the method may be performed by a flow playback testing device, which may be implemented in the form of hardware and/or software, and the flow playback testing device may be configured in an electronic device, such as a computer. As shown in fig. 1, the method includes:
Step 110, backing up or snapshot the database of the production system before processing the target business transaction set, so as to obtain the first database data at the starting moment.
The range of the target business transaction set can be set according to the actual processing capacity. For example, the target set of business transactions may be all transactions, or may be narrowed down, such as a city, a branch, a website, or a transaction corresponding to a segment of customers, etc. The types of business transactions involved in the target set of business transactions may also be varied. Optionally, the target business transaction set includes: online transactions, timed transactions, or batch processing transactions. The online transaction may be a normal process of daily transactions. The timed transaction may be a transaction process when a specified time is reached. The batch processing may be to batch process the traffic when the traffic reaches a certain value.
In this embodiment, the data of the production system may be maintained in a database, and the data generated by the generation system may be stored in the database. And backing up or snapshot is carried out on the database before the business transaction is processed, so that the first database data can be obtained, the system to be tested can be tested according to the same initial database content of the production system during the flow playback test, and the test result of the system to be tested is ensured to have comparability.
And, using the real database during playback test, database reading and writing can be verified, and errors (such as data structures, indexes, read-write plans and the like) related to the database can be found.
Step 120, in the transaction processing of the target service transaction set, recording the service transaction identifier, the external calling parameter and the calling return information of the external calling of the production system.
Wherein the recording mode may be turned on when the transaction begins to be processed. The recording mode may be a pre-and post-return add process of a service number generation function call at the time of an out call by the production system. In particular, the recording mode may be realized by a programming manner, and may be set in a component form. The recording mode is realized, for example, by a face-oriented programming (AOP) technique. Recording the business transaction identification, the external call parameters and the call return information of the external call by the production system can be realized by recording the transaction traceID, the external call parameters and the return message and the return information of the transaction call business number/account number generation function.
And 130, after the target business transaction set is processed, backing up or snapshot is carried out on the database of the production system, so as to obtain a business transaction flow record and second database data at the end time.
And carrying out database backup or snapshot after the transaction to obtain second database data, and facilitating the result comparison of the flow playback test.
After the transaction is completed, the recording mode of the production system may be turned off with less overhead. Since the recording mode can be realized in the form of a component, the flexibility of switching on or off the recording mode can be realized.
And 140, performing flow playback test according to the first database data, the service transaction identifier, the external calling parameters, the calling return information and the service transaction running water to obtain third database data at the time of completing the test.
The recording mode may also be set at the time of the flow playback test. In a recording mode of the flow playback test, the flow playback can be performed on the business transaction running water based on the first database data according to the business transaction identification, the external calling parameter and the calling return information recorded by the production system, so that a transaction result under the same transaction identification is generated, and the transaction result can be recorded in a third database to obtain third database data.
When the flow is tested and played back, the system to be tested can call the outside as the production system, and in order to not really influence the system called outside, the system to be tested can simulate the service transaction identification of the production system, call the external call parameters, return call return information recorded by the production system, and not really call the external system, so that the data acquired when the flow is played back and tested and the data acquired when the production system performs service processing are the same, the comparability is higher, and the interference to the external system is avoided.
In an optional implementation manner of the embodiment of the present invention, performing a flow playback test according to the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction running water, to obtain third database data at a time of completing the test, where the third database data includes: performing flow playback simulation according to the first database data, the service transaction identification, the external calling parameters and the calling return information to generate simulated external calling return information; and carrying out flow playback test according to the simulated external call return information, the first database data, the service transaction identifier and the service transaction running water to obtain third database data at the moment of completing the test.
The simulated callout return information may be call return information obtained from information recorded by the production system.
And 150, comparing the data according to the third database data with the second database data to obtain a comparison result, and playing back the test alarm according to the flow rate of the comparison result.
In this embodiment, the second database data is a result obtained by the production system performing the business transaction processing. The third database data is the result of the business transaction of the system to be tested for the flow playback test of the production system. In the flow playback test data comparison of the embodiment of the invention, only the transaction service processing results need to be compared, and an intermediate process does not need to be compared.
When specifically aligned, the key fields may be checked to determine if the values of the key fields are identical. The non-critical fields may not be aligned or may be aligned only if they satisfy a certain similarity. The non-critical fields may be server IP, transaction time, random number, etc. Key fields may include, but are not limited to, report subject, product balance, etc., totals.
The flow playback test method can be applied to the situation after the system service is upgraded and optimized. For example, after the system service is upgraded and optimized, the data result is changed, and the read-write instruction of the system to be tested is inconsistent with the original production system. Therefore, the transaction implementation changes, but the original business processing logic is not changed, and the read-write times and the read-write contents of the database can also change. For example, the production original system reads A1, A2 and A3, and three fields are written as the system to be tested reads A1 and A3, and two fields; however, the data structure change increases the A4 field, and when the flow is played back, the data structure change becomes four fields of A1, A2, A3 and A4, and the writing becomes three fields of A1, A3 and A4. In the case that A4 is a non-business critical field, only one more action may be taken, without affecting normal business processes. Just like the original market buying, the market buying is still going now, the dishes are just the same but buying more salt, and the business processing is not affected. For example, the original production system reads the database four times, and the system to be tested is read three times; the original production system writes the database for three times, and the system to be tested is changed into writing for two times after optimization, just like buying dishes, and the buying for four times is not substantially different from buying for three times as long as the dishes are bought. In practice, external call parameters generated by playback test transaction and a scene that a database read-write instruction is inconsistent with an online system often occur due to data structure change and system upgrading optimization, and when the transaction is played back, close to 10% of transaction playback fails or errors are reported, so that a great deal of time and effort are required to find out invalid abnormal errors.
The technical scheme of the embodiment of the invention can avoid the problems by simulating the external call and comparing only the transaction results. After the technical scheme of the embodiment of the invention is adopted, when ensuring that the service processing logic of the system to be tested is identical with that of the production system, the comparison result is consistent, the playback passing rate reaches 100%, and false alarm does not occur. And when the comparison result is inconsistent, the comparison result is also necessarily inconsistent of certain playback transaction service processing logic or the defect of upgrading the production script, so that the flow playback test alarm can be carried out according to the comparison result to find out the code or script problem and avoid production error.
According to the technical scheme, the database of the production system is backed up or snapshot before the target business transaction set is processed, so that first database data at the starting moment is obtained; in the transaction processing of a target service transaction set, recording a service transaction identifier, an external calling parameter and calling return information which are called by a production system; after the target business transaction set is processed, backing up or snapshot is carried out on a database of the production system, so that business transaction flow records and second database data at the end time are obtained; performing flow playback test according to the first database data, the service transaction identifier, the external calling parameters, the calling return information and the service transaction running water to obtain third database data at the time of completing the test; and carrying out data comparison according to the third database data and the second database data to obtain comparison results, carrying out flow playback test alarm according to the comparison results, solving the flow playback test problem after system upgrading optimization, and only needing to compare results without gradually judging business transactions, thereby supporting comparison under system optimization and improving comparison accuracy.
Furthermore, in order to keep the data of the stream measurement playback secret, the technical scheme of the embodiment of the invention also supports desensitization processing. Specifically, in an optional implementation manner of the embodiment of the present invention, performing a flow playback test according to the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction running water, to obtain third database data at the time of completing the test, where the third database data includes: respectively performing desensitization processing on the first database data, the external calling parameters, the calling return information, the business transaction running water and the second database data to obtain respectively corresponding desensitization results; and performing flow playback test according to each desensitization result and the service transaction identifier to obtain the desensitization result of the third database data at the moment of completion of the test.
The first database data and the second database data can be directly desensitized by adopting a desensitization mode of the production system. The desensitization of external call parameters, call returns, and traffic transaction streamlines may be desensitization of sensitive fields from transaction to transaction. The specific desensitization mode can be various, for example, the desensitization can be performed by text substitution of all data or partial original data mask processing. The third database data obtained by the flow playback test of the system to be tested according to the desensitization result is a desensitization result, so that the third database data does not need to be desensitized again.
In an optional implementation manner of the embodiment of the present invention, performing data comparison according to the third database data and the second database data to obtain a comparison result, including: extracting a first desensitization result corresponding to the business transaction identifier from the desensitization result of the third database data; extracting a second desensitization result corresponding to the business transaction identifier from the desensitization result of the second database data; and carrying out data comparison under the key field according to the first desensitization result and the second desensitization result to obtain a comparison result.
After the data is subjected to desensitization treatment, when the data is compared, the data is compared based on the desensitization result. Wherein, when data are compared, a desensitization field in the desensitization result can be used as a non-key field. The technical scheme of the embodiment of the invention supports data desensitization, the test environment and data do not need to take supervision and safety measures like a production system and production data, the program update and the data modification are convenient, and the error checking and positioning are convenient. Under the condition of data desensitization, the flow playback test environment does not contain user sensitive information, and the same management means as the production environment is not needed to be adopted to prevent information leakage, so that the management cost is reduced, and meanwhile, the workload and difficulty of updating and debugging the test error routine are also reduced.
After the system is upgraded and optimized, when the data structure is changed, the data can be synchronously upgraded in order to further improve the reliability of comparison. Specifically, on the basis of the foregoing embodiment, optionally, the method further includes: when the data structure reconstruction of the flow playback system is detected, carrying out data upgrading on the first database data and the second database data; performing a flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the time of completing the test, including: performing flow playback test according to the data upgrading result, the service transaction identifier, the external calling parameters, the calling return information and the service transaction running water of the first database data to obtain third database data at the moment of completing the test; data comparison is carried out according to the third database data and the second database data to obtain a comparison result, and the method comprises the following steps: and carrying out data comparison according to the data upgrading result of the third database data and the second database data to obtain a comparison result.
The data structure of the system to be tested is updated, so that only the first database data and the second database data are required to be subjected to data updating, and the flow playback test is performed according to the result after the data updating, and the obtained third database data are also the result after the updating. In alternative embodiments, external call parameters, call return information, and business transaction pipelining may also be used for data upgrades.
On the basis of the above embodiment, optionally, after performing the flow playback test alarm according to the comparison result, the method further includes: if the flow playback test alarm is abnormal, carrying out time-interval processing on the target business transaction set to obtain a plurality of target business transaction subsets; and performing flow playback test according to each target business transaction subset to obtain flow playback test alarms corresponding to each target business transaction subset.
When the flow playback test alarm is that the comparison is not passed and the transaction fails, the error of the program to be put into production or the put into production script is indicated, the error can be checked, the put into production script is modified or the error program is updated, and then the flow playback test is carried out.
According to the technical scheme, the service number or account number generated by the transaction is consistent with the production environment when the flow is replayed by performing AOP post-processing on the service number or account number generating function through the component to obtain the number same as the production, and finally the service number or account number is consistent with the production environment, so that if the difference occurs, the discrepancy can be positioned to the discrepancy of a certain service number service record or a certain account number account, then the operations of the service record or the account number, which operations are executed, are analyzed, wherein the operations possibly generate abnormality, and the whole searching flow is similar to the fault positioning of the production discovery problem. Normally, the business number or the transaction related to the account is limited, even only one or two, and the problem can be quickly located without special treatment. Even if the difference records are more, the same type can be solved, and the same type can be basically solved. If the transaction related to the difference business records or the difference account numbers is more, for quick positioning and reducing the range, taking into account time-division time intervals of the production environment records to make data snapshot, namely carrying out time-division processing on the target business transaction set, obtaining record information of different time intervals in batches, comparing the record information with corresponding batch business records during playback, looking at which batch of transaction can be compared and passed, comparing which batch of transaction corresponds to when the difference exists, carrying out fault analysis on the batch of transaction, and continuing to carry out transaction playback test of the later batch after the problem is solved. The business processing range can be reduced through time-division and batch processing, and fault location is convenient.
In the embodiment of the invention, the calling parameters and the return are recorded and simulated in a component mode, the JVM (virtual machine) is not involved, and the intrusion and the potential safety hazard to the JVM are not existed. The final result is used for checking without requiring that each data operation must be consistent with the production system, and various changes including data structure modification and code upgrade optimization are flexibly supported. The Sandbox-Repeater technology uses a reading database generated by production transaction as a reading database data result during playback, uses a production writing database instruction as a standard for verifying transaction correctness during playback, and can cause reading and writing messages to be different during code optimization, upgrading and transformation or data structure change. For example, the production reads three fields A1, A2 and A3, and rewrites two fields A1 and A3; but after the code is updated, four fields A1, A2, A3 and A4 are read, three fields A1, A3 and A4 are rewritten, and the flow test playback comparison result is reported to be wrong. The technical scheme of the embodiment of the invention can avoid the problems.
In addition, the number of times of reading and writing and the content of each reading and writing of the database may be changed due to the change of transaction implementation, for example, the original implementation is to read 8 fields in three times, namely, A1, A2, A3 for the first time, A4, A5, A6 for the second time and A7, A8 for the third time, and now optimize to read two times, namely, A1, A2, A3, A4, A5, A6 for the second time and A7, A8 for the second time, which can lead to traffic playback test transaction errors in Sandbox-Repeater technology, so that a great amount of time and effort are required to check invalid errors. The technical scheme of the embodiment of the invention can avoid the problems.
The technical scheme of the embodiment of the invention can avoid false alarm, can ensure that the found problem is certain when the result comparison is inconsistent, and can be used for carefully troubleshooting and finding out the problem of the upgrade script or the code error. And a playback test tool which is verified by database processing, such as Sandbox-Pepeater, has the advantages that the playback error rate of the upgrade test can reach 10%, thousands of anomalies can be generated in ten-thousand financial transactions, and the mistakes are too much to pay attention to the elimination of the unnecessary anomalies. The technical scheme of the embodiment of the invention adopts a checking mode that the final results are consistent, the final results are inconsistent, the playback process is proved to have errors, and a specific product number or account with differences can be found out according to the reduced range of subjects, product types, product numbers and accounts and then specific transactions are located.
In addition, the test environment is completely isolated from the production environment, so that unpredictable results are avoided when test messages or test transactions enter the production system. In the playback test, part of business transaction data can be selected for playback without configuring the same database and server as the production system, thereby saving resources.
Example two
Fig. 2 is a schematic structural diagram of a flow playback testing apparatus according to a second embodiment of the present invention. As shown in fig. 2, the apparatus includes: a first database data determination module 210, a callout information recording module 220, a second database data determination module 230, a third database data determination module 240, and a flow playback test alert module 250. Wherein:
The first database data determining module 210 is configured to backup or snapshot a database of the production system before processing the target business transaction set, to obtain first database data at a starting time;
the external call information recording module 220 is configured to record, in a transaction process of the target service transaction set, a service transaction identifier, an external call parameter and call return information of the external call by the production system;
the second database data determining module 230 is configured to backup or snapshot the database of the production system after the target service transaction set is processed, so as to obtain a service transaction flow record and second database data at the end time;
the third database data determining module 240 is configured to perform a flow playback test according to the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction running water, to obtain third database data at a time when the test is completed;
the flow playback test alarm module 250 is configured to perform data comparison according to the third database data and the second database data, obtain a comparison result, and perform flow playback test alarm according to the comparison result.
Optionally, the third database data determining module 240 includes:
The simulated external call return information generation unit is used for performing flow playback simulation according to the first database data, the service transaction identifier, the external call parameters and the call return information to generate simulated external call return information;
and the third database data determining unit is used for carrying out flow playback test according to the simulated external call return information, the first database data, the business transaction identifier and the business transaction running water to obtain third database data at the moment of completing the test.
Optionally, the third database data determining module 240 includes:
the desensitization processing unit is used for respectively carrying out desensitization processing on the first database data, the external calling parameters, the calling return information, the business transaction running water and the second database data to obtain respectively corresponding desensitization results;
and the flow playback test unit is used for carrying out flow playback test according to the desensitization results and the service transaction identification to obtain the desensitization result of the third database data at the moment of completion of the test.
Optionally, the flow playback test alert module 250 includes:
a first desensitization result extraction unit, configured to extract a first desensitization result corresponding to the service transaction identifier from the desensitization results of the third database data;
A second desensitization result extraction unit, configured to extract a second desensitization result corresponding to the service transaction identifier from the desensitization results of the second database data;
and the comparison result determining unit is used for comparing the data under the key field according to the first desensitization result and the second desensitization result to obtain a comparison result.
Optionally, the device further includes:
the data upgrading module is used for carrying out data upgrading on the first database data and the second database data when detecting the data structure reconstruction of the flow playback system;
the third database data determination module 240 includes:
the third database data unit is used for carrying out flow playback test according to the data upgrading result of the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the moment of completing the test;
the flow playback test alert module 250 includes:
and the comparison result determining unit is used for comparing the data according to the data upgrading result of the third database data and the second database data to obtain a comparison result.
Optionally, the device further includes:
the target business transaction subset determining module is used for carrying out time-division processing on the target business transaction set to obtain a plurality of target business transaction subsets if the flow playback test alarm is abnormal after the flow playback test alarm is carried out according to the comparison result;
And the flow playback test alarm module is used for carrying out flow playback test according to each target business transaction subset to obtain flow playback test alarms corresponding to each target business transaction subset.
Optionally, the target business transaction set includes: online transactions, timed transactions, or batch processing transactions.
The flow playback testing device provided by the embodiment of the invention can execute the flow playback testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example III
Fig. 3 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the flow playback test method.
In some embodiments, the flow playback testing method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the flow playback test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the flow playback test method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for testing playback of traffic, comprising:
before processing a target business transaction set, backing up or snapshot a database of a production system to obtain first database data at a starting moment;
in the transaction processing of a target service transaction set, recording a service transaction identifier, an external calling parameter and calling return information which are called by a production system;
after the target business transaction set is processed, backing up or snapshot is carried out on a database of the production system, so that business transaction flow records and second database data at the end time are obtained;
Performing flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the time of completing the test;
and carrying out data comparison according to the third database data and the second database data to obtain a comparison result, and carrying out flow playback test alarm according to the comparison result.
2. The method of claim 1, wherein performing a flow playback test based on the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction flow to obtain third database data at a time of completion of the test, comprising:
performing flow playback simulation according to the first database data, the service transaction identifier, the external call parameter and the call return information to generate simulated external call return information;
and carrying out flow playback test according to the simulated external call return information, the first database data, the business transaction identifier and the business transaction running water to obtain third database data at the moment of completing the test.
3. The method of claim 1, wherein performing a flow playback test based on the first database data, the service transaction identifier, the external call parameter, the call return information, and the service transaction flow to obtain third database data at a time of completion of the test, comprising:
respectively performing desensitization processing on the first database data, the external calling parameters, the calling return information, the business transaction flow and the second database data to obtain respectively corresponding desensitization results;
and performing flow playback test according to each desensitization result and the service transaction identifier to obtain the desensitization result of the third database data at the moment of completion of the test.
4. A method according to claim 3, wherein the comparing the data according to the third database data and the second database data to obtain a comparison result comprises:
extracting a first desensitization result corresponding to the business transaction identifier from the desensitization result of the third database data;
extracting a second desensitization result corresponding to the business transaction identifier from the desensitization result of the second database data;
And carrying out data comparison under the key field according to the first desensitization result and the second desensitization result to obtain a comparison result.
5. The method as recited in claim 1, further comprising:
when the data structure reconstruction of the flow playback system is detected, carrying out data upgrading on the first database data and the second database data;
performing a flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the time of completing the test, wherein the third database data comprises:
performing flow playback test according to the data upgrading result of the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the moment of completing the test;
performing data comparison according to the third database data and the second database data to obtain a comparison result, including:
and carrying out data comparison according to the data upgrading result of the third database data and the second database data to obtain a comparison result.
6. The method of claim 1, further comprising, after performing a flow playback test alert based on the comparison result:
if the flow playback test alarm is abnormal, carrying out time-division processing on the target business transaction set to obtain a plurality of target business transaction subsets;
and carrying out flow playback test according to each target business transaction subset to obtain flow playback test alarms corresponding to each target business transaction subset.
7. The method of claim 1, wherein the set of target business transactions comprises: online transactions, timed transactions, or batch processing transactions.
8. A flow playback testing apparatus, comprising:
the first database data determining module is used for carrying out backup or snapshot on a database of the production system before processing the target business transaction set to obtain first database data at the starting moment;
the external call information recording module is used for recording the service transaction identifier, the external call parameter and the call return information of the external call of the production system in the transaction processing of the target service transaction set;
the second database data determining module is used for carrying out backup or snapshot on the database of the production system after the target business transaction set is processed to obtain a business transaction flow record and second database data at the end time;
The third database data determining module is used for carrying out flow playback test according to the first database data, the service transaction identifier, the external calling parameter, the calling return information and the service transaction running water to obtain third database data at the moment of completing the test;
and the flow playback test alarm module is used for carrying out data comparison according to the third database data and the second database data to obtain a comparison result, and carrying out flow playback test alarm according to the comparison result.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the method of flow playback testing of any one of claims 1-7 when executed.
CN202311630854.3A 2023-11-30 2023-11-30 Flow playback testing method, device, equipment and storage medium Pending CN117891714A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311630854.3A CN117891714A (en) 2023-11-30 2023-11-30 Flow playback testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311630854.3A CN117891714A (en) 2023-11-30 2023-11-30 Flow playback testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117891714A true CN117891714A (en) 2024-04-16

Family

ID=90649765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311630854.3A Pending CN117891714A (en) 2023-11-30 2023-11-30 Flow playback testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117891714A (en)

Similar Documents

Publication Publication Date Title
US11288168B2 (en) Predictive software failure discovery tools
CN107111595B (en) Method, device and system for detecting early boot errors
CN111309343A (en) Development deployment method and device
CN109067605B (en) Storage subsystem fault diagnosis method and device, terminal and storage medium
CN110471696B (en) Clearing data playback comparison method, device, computer equipment and storage medium
CN115437961A (en) Data processing method and device, electronic equipment and storage medium
CN117891714A (en) Flow playback testing method, device, equipment and storage medium
CN110609786A (en) Software testing method and device, computer equipment and storage medium
CN113468058B (en) Regression testing method and device for software as service platform and electronic equipment
CN109902001A (en) To the detection method and terminal device of uninitialized variable
CN115757099A (en) Automatic test method and device for platform firmware protection recovery function
CN115373929A (en) Test method, device, equipment, readable storage medium and program product
CN114693116A (en) Method and device for detecting code review validity and electronic equipment
CN115048311A (en) Test environment monitoring method and device, electronic equipment and readable storage medium
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN117709255B (en) Test method, device, equipment and medium for indirect access register
CN110765006A (en) Flow testing method and device, computer readable storage medium and electronic device
CN109920466B (en) Hard disk test data analysis method, device, terminal and storage medium
CN115599689A (en) Test logic display method, device, equipment and storage medium
CN116383058A (en) Conversion method and device of software system model, electronic equipment and medium
CN116302086A (en) Application processing method and device, electronic equipment and readable storage medium
CN117827661A (en) Code grammar checking method, system, computer device and storage medium
CN117724980A (en) Method and device for testing software framework performance, electronic equipment and storage medium
CN116955201A (en) Data development test method, device, equipment and medium
CN114416535A (en) Unstable test case processing method, device, 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