System performance testing method and system
By recording transaction packets in the financial business system, converting versions and desensitizing data, the problems of differences in test scenarios and production scenarios in the existing technology are solved, and the accuracy and stability of performance testing are improved, and the Test scenario fitting and load pressure control across environments.
Patent Information
- Application Number
- CN202110124837.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-29
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-01-29
AI Technical Summary
The existing performance testing methods have large differences between test scenarios and production scenarios and the version differences lead to inaccurate testing results. Testers need to maintain a large amount of scripts and data, which has a huge workload and is difficult to ensure the quality of the test.
By recording transaction messages from the financial business system, determining the version conversion strategy based on transaction type data, the message is converted and desensitized between production and testing environments, and the transaction recording and playback across versions and environments is realized to ensure testing Consistency between scenes and production scenarios.
It improves the accuracy and stability of system performance testing, reduces the learning cost of testers, realizes cross-environment test scenario fitting, flexibly controls load pressure, and ensures the reliability of the system under different loads.
Smart Images

Figure CN112799944B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing technology, and in particular to a system performance testing method and system. Background Art
[0002] Currently, a large number of financial institutions use mainframes as the core servers of financial business systems. With the continuous development of banking business, the amount of business connected to the mainframe system is increasing, the online business scenarios are becoming more and more complex, and the transaction volume is huge. The performance risks of any application may have a global impact and lead to a decline in system service quality. Therefore, performance testing of the overall performance of the system under the new application version is particularly important.
[0003] There are two main methods for implementing performance testing: 1. Testers list key transactions based on production operation statistics and transaction call volume in a certain proportion, and then develop performance test scripts for each transaction on the list. During performance testing, test scripts for all transactions are started at the same time. This method has two specific problems: (1) Testers need to maintain a large number of transaction scripts and test data, which is a huge workload and difficult to ensure test quality. (2) The diversity of data is difficult to reach production levels, and there is a large difference between the business scenario of the test and the production scenario, which reduces the test effect. 2. Using the transaction recording and playback method, record online transactions from the production environment and replay them in the test environment to implement performance testing. This method can better simulate production load scenarios, but there are two problems: (1) The application versions of production and test are different, and the message formats of transactions are different. When recording transactions from a low-version production environment and directly replaying them in a high-version test environment, incorrect transaction message formats will cause system abnormalities and a large number of transaction failures. (2) When the transactions recorded in production are directly replayed in the test environment, a large number of data inconsistency errors will occur. Summary of the invention
[0004] In response to the problems in the prior art, the present application proposes a system performance testing method and system, which can be applicable to application versions of application systems that are rapidly iteratively developed, and can improve the accuracy and stability of system performance testing.
[0005] In order to solve the above technical problems, this application provides the following technical solutions:
[0006] In a first aspect, the present application provides a system performance testing method, comprising:
[0007] Record transaction messages of the target financial business system;
[0008] Determine, according to the transaction type data in the transaction message, a version conversion strategy corresponding to the transaction message;
[0009] Applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment;
[0010] The converted transaction message is sent to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0011] Furthermore, before determining the version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message, the method further includes:
[0012] Obtaining a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same;
[0013] The first transaction message format definition file and the second transaction message format definition file are applied to generate the version conversion strategy.
[0014] Further, after applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment, the method further includes:
[0015] According to the preset field-transformation program comparison table, determine the sensitive fields in the converted transaction message and the transformation program corresponding to the sensitive fields;
[0016] Applying the transformation program to desensitize the sensitive fields;
[0017] The transaction messages after data desensitization are sent to the target test environment to play back the transaction messages after data desensitization to complete the performance test of the target financial business system.
[0018] Furthermore, the version conversion strategy includes at least one strategy element of adding a new field, deleting a field, and updating a field.
[0019] Further, the applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment includes:
[0020] If the version conversion strategy includes a newly added field strategy element, then updating the transaction message according to the newly added field strategy element;
[0021] If the version conversion strategy includes a deletion field strategy element, updating the transaction message according to the deletion field strategy element;
[0022] If the version conversion strategy includes an update field strategy element, then updating the transaction message according to the update field strategy element;
[0023] The updated transaction message version is used as the corresponding version of the transaction message in the target test environment.
[0024] Furthermore, the applying the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy includes:
[0025] Determine, according to the first transaction message format definition file and the second transaction message format definition file, newly added fields, deleted fields, and updated fields;
[0026] The field position, field name, field format, field description and field value of the newly added field are used as the newly added field policy elements, wherein the newly added field is a field that exists in the second transaction message format definition file and does not exist in the first transaction message format definition file;
[0027] Using the field position of the deleted field as a deleted field policy element, wherein the deleted field is a field that exists in the first transaction message format definition file and does not exist in the second transaction message format definition file;
[0028] The field position and field format of the update field are used as update field policy elements, wherein the update field is a field having the same field name and field description but different field formats in the first transaction message format definition file and the transaction message format definition file;
[0029] The deletion field policy element, the addition field policy element and the update field policy element are combined to form the version conversion strategy.
[0030] Furthermore, after sending the converted transaction message to the target test environment to play back the converted transaction message and completing the performance test of the target financial business system, the method further includes:
[0031] The ratio of the recording duration to the playback duration is adjusted, and the system performance testing method is executed again to complete the performance testing of the target financial business system under different load pressures.
[0032] In a second aspect, the present application provides a system performance testing system, comprising:
[0033] A transaction recording device, used to record transaction messages of a target financial business system;
[0034] A strategy determining device, used to determine a version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message;
[0035] A conversion device, used for applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment;
[0036] The first performance testing device is used to send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0037] Furthermore, the system performance test system further includes:
[0038] An acquisition device is used to acquire a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same;
[0039] The strategy generating device is used to apply the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy.
[0040] Furthermore, the system performance test system further includes:
[0041] A program determination device, used to determine the sensitive field in the converted transaction message and the transformation program corresponding to the sensitive field according to a preset field-transformation program comparison table;
[0042] A desensitizing device, used for applying the deformation program to perform data desensitization on the sensitive field;
[0043] The second performance testing device is used to send the transaction message after data desensitization to the target testing environment to play back the transaction message after data desensitization to complete the performance test of the target financial business system.
[0044] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the system performance testing method is implemented when the processor executes the program.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium having computer instructions stored thereon, which implement the system performance testing method when the instructions are executed.
[0046] It can be seen from the above technical solution that the present application provides a system performance testing method and system. Among them, the method includes: recording the transaction message of the target financial business system; determining the version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message; applying the version conversion strategy to convert the version of the transaction message into the corresponding version of the transaction message in the target test environment; sending the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system, which can be applied to the application version of the application system for rapid iterative development, and can improve the accuracy and stability of the system performance test; specifically, without the need for a large amount of manpower, the performance test can be implemented quickly, and it has the following advantages: 1. Through the method of production recording test playback 1. The test scenario is highly fitted with the production scenario, which can solve the problems of single test scenario and simple behavior, improve the test quality, and reduce the learning cost of business scenarios for testers; 2. Through the upgrade of transaction message format version and transaction data deformation, cross-version and cross-environment transaction recording and playback can be realized, which can solve the problems of version differences and data deformation in production and test environments, and can more flexibly adapt to the application versions of rapid iteration development and testing of current complex application systems; 3. By controlling the ratio of M and N (recording transactions of M milliseconds and playing them back within N milliseconds), flexible control of online load pressure can be achieved, so that the performance of the system under different load pressure conditions can be observed, and the reliability of system operation can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flowchart of a system performance testing method in an embodiment of the present application;
[0049] Figure 2 is a flow chart of a system performance testing method in another embodiment of the present application;
[0050] Figure 3 is a schematic diagram of the structure of the system performance test system in an embodiment of the present application;
[0051] Figure 4 It is a logical schematic diagram of the system performance test system in the application example of this application;
[0052] Figure 5It is a logical schematic diagram of a message format upgrade device in an application example of the present application;
[0053] Figure 6 It is a logical diagram of the message format upgrade strategy generated in the application example of this application;
[0054] Figure 7 It is a logical schematic diagram of a message data deformation device in an application example of the present application;
[0055] Figure 8 It is a flowchart of a system performance testing method in a specific application example of this application;
[0056] Fig. 9 A schematic block diagram of the system structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] In order to solve the problems in the above-mentioned prior art, the embodiment of the present application provides a system performance testing method and system, which records online transaction messages from a production environment, and then generates upgrade strategies (field addition, deletion and modification) for different transaction messages by comparing the transaction message format definition files of the recording and playback environments (i.e., the production and test environments). According to the strategy, the transaction message is upgraded to the target test environment version, and the data in the message is deformed and desensitized, so that the transaction message recorded in production is adapted to the test environment of different application versions. It is possible to flexibly implement system performance testing in the production environment recorded in the test environment of different application versions, and realize cross-environment transaction recording and playback performance testing, especially the overall performance of the new application version of the system performance can be tested, which can meet the following requirements: (1) the test scenario is as close to the production scenario as possible to ensure the diversity of transaction behavior and test data; (2) support modification and adjustment of the recorded transaction message (including message format version upgrade and data desensitization), and realize cross-application version performance testing of recording transactions in the production environment and replaying them in the test environment; (3) flexible control of test load pressure.
[0059] Based on this, in order to be suitable for the application version of the application system that is rapidly iteratively developed and to improve the accuracy and stability of the system performance test, the embodiment of the present application provides a system performance test system, which can be a server or a client device, and the client device can include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, and a smart wearable device, etc. Among them, the smart wearable device can include smart glasses, smart watches, and smart bracelets, etc.
[0060] In practical applications, the part of the system performance test can be performed on the server side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0061] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0062] The server and the client device may communicate using any suitable network protocol, including network protocols that have not yet been developed on the date of filing this application. The network protocol may include, for example, TCP / IP protocol, UDP / IP protocol, HTTP protocol, HTTPS protocol, etc. Of course, the network protocol may also include, for example, RPC protocol (Remote Procedure Call Protocol) and REST protocol (Representational State Transfer) used on top of the above protocols.
[0063] It should be noted that the system performance testing method and system disclosed in the present application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the system performance testing method and system disclosed in the present application is not limited.
[0064] The details are described through the following embodiments.
[0065] In order to adapt to the application version of the application system for rapid iteration development and improve the accuracy and stability of the system performance test, this embodiment provides a system performance test method in which the execution subject is a system performance test system, and the system performance test system includes but is not limited to a server, such as Figure 1 As shown, the method specifically includes the following contents:
[0066] Step 100: Record the transaction message of the target financial business system.
[0067] Specifically, you can select the peak period of production online transactions, turn on the bypass switch of the gateway, and record the online transaction messages of the production environment; the target financial business system can represent the production environment; the transaction message contains: transaction type and a series of transaction fields, each transaction field is composed of the following: field format definition (field name, field format, field description) and field value.
[0068] Step 200: Determine a version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message.
[0069] Specifically, the transaction types may include: transfer, online banking remittance, ATM inquiry and other transaction types.
[0070] Step 300: Apply the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment.
[0071] Specifically, the version conversion strategy may be applied to convert the version of the transaction message into a version applicable to the target test environment.
[0072] Step 400: Send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0073] As can be seen from the above description, the system performance testing method provided in this embodiment records the transaction message of the target financial business system; determines the version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message; applies the version conversion strategy to convert the version of the transaction message into the corresponding version of the transaction message in the target test environment; sends the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system, which can be applicable to the application version of the application system for rapid iterative development, and can improve the accuracy and stability of the system performance test; specifically, through the production recording test playback method, the test scenario is highly fitted to the production scenario, which can solve the problem of single test scenario and simple behavior, improve the test quality, and reduce the learning cost of the tester for the business scenario; it can avoid the problem that due to the different application versions of the production environment and the test environment, there are differences in the message format of the transaction, and the transaction is recorded from the low-version production environment and directly played back in the high-version test environment, and the wrong transaction message format causes a large number of abnormal failures of transactions and systems.
[0074] In order to further improve the reliability of the version conversion strategy, and then apply the reliable version conversion strategy to improve the accuracy of the subsequent system performance test, in one embodiment of the present application, before step 200, it also includes:
[0075] Step 020: Obtain a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same.
[0076] Specifically, the first transaction message format definition file may be a transaction message format definition file corresponding to an application version of a target financial business system, and the second transaction message format definition file may be a transaction message format definition file corresponding to an application version of a target test environment; the transaction message format definition file includes a series of transaction field format definitions, and each transaction field format definition consists of the following contents: field name, field format, and field description.
[0077] Step 021: Apply the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy.
[0078] Specifically, the above method can also generate version conversion strategies corresponding to multiple transaction types.
[0079] To ensure data security, avoid direct playback of recorded transaction messages in the test environment, which may cause a large number of data inconsistencies. Figure 2In one embodiment of the present application, after step 300, the following is further included:
[0080] Step 040: According to a preset field-transformation program comparison table, determine the sensitive field in the converted transaction message and the transformation program corresponding to the sensitive field.
[0081] Specifically, the transaction message can be parsed according to the second transaction message format definition file to obtain the "field name" and "field value" of the fields in the transaction message. If there is a field whose field name is in the preset field-transformation program comparison table, the field is determined to be a sensitive field, and the transformation program corresponding to the field is searched in the preset field-transformation program comparison table. The preset field-transformation program comparison table records the correspondence between field names and transformation programs. For example: field names such as "ID card", "ID number", and "customer ID number" correspond to the ID card transformation program; field names such as "name", "person's name", and "name" correspond to the name transformation program. The table is provided by the transformation program development department.
[0082] Step 041: Apply the transformation program to desensitize the sensitive fields.
[0083] Specifically, data desensitization refers to the deformation of certain sensitive information through desensitization rules to achieve reliable protection of sensitive privacy data.
[0084] Step 042: Send the data-massified transaction message to the target test environment to replay the data-massified transaction message to complete the performance test of the target financial business system.
[0085] The version conversion strategy includes at least one strategy element of adding a new field, deleting a field, and updating a field.
[0086] In order to avoid abnormal financial system performance test due to mismatch between transaction message format and environment, in one embodiment of the present application, step 300 includes:
[0087] Step 310: If the version conversion strategy includes a new field strategy element, the transaction message is updated according to the new field strategy element.
[0088] Specifically, the position where the new field is added to the transaction message can be determined according to the field position in the new field policy element, and the field name, field format, field description and field value in the new field policy element are added to the position.
[0089] Step 320: If the version conversion strategy includes a delete field strategy element, the transaction message is updated according to the delete field strategy element.
[0090] If the version conversion strategy includes a field deletion strategy element, the transaction message is updated according to the field position in the field deletion strategy element.
[0091] Specifically, the position of the deleted field in the transaction message may be determined according to the field position in the field deletion policy element, and the field at the position in the transaction message may be deleted.
[0092] Step 330: If the version conversion strategy includes an update field strategy element, the transaction message is updated according to the update field strategy element.
[0093] Specifically, the position of the update field in the transaction message may be determined according to the field position in the update field policy element, and the field format of the field at the position in the transaction message may be updated.
[0094] Step 340: Use the updated transaction message version as the corresponding version of the transaction message in the target test environment.
[0095] In order to further improve the reliability of the version conversion strategy, in one embodiment of the present application, step 021 includes:
[0096] Step 210: Determine the newly added fields, deleted fields, and updated fields according to the first transaction message format definition file and the second transaction message format definition file.
[0097] Step 211: The field position, field name, field format, field description and field value of the newly added field are used as the newly added field policy elements. The newly added field is a field that exists in the second transaction message format definition file and does not exist in the first transaction message format definition file.
[0098] Step 212: Using the field position of the deleted field as a deleted field policy element, wherein the deleted field is a field that exists in the first transaction message format definition file and does not exist in the second transaction message format definition file;
[0099] Step 213: The field position and field format of the update field are used as update field policy elements. The update field is a field with the same field name and field description in the first transaction message format definition file and the transaction message format definition file but different field formats.
[0100] Step 214: The delete field policy element, the add field policy element and the update field policy element are combined into the version conversion strategy.
[0101] In order to achieve flexible control of the online load pressure, so as to detect the performance of the system under different load pressure conditions, in one embodiment of the present application, after step 400, the following steps are further included:
[0102] Step 500: Adjust the ratio of the recording duration to the playback duration, and execute the system performance testing method again to complete the performance testing of the target financial business system under different load pressures.
[0103] In order to further improve the accuracy of the performance test and quantify the performance test results, after step 400, the following steps may also be included:
[0104] A transaction return message is received, and a throughput rate of the target financial business system is determined during a performance test according to the transaction return message.
[0105] Specifically, the timestamp of the transaction return message is used to obtain the number of transaction return messages received per unit time, and this number is used as the throughput of the target financial business system; the throughput rate in performance testing represents the volume of transactions processed by the system per unit time.
[0106] From the software level, in order to adapt to the application version of the application system for rapid iteration development and improve the accuracy and stability of the system performance test, the present application provides an embodiment of a system performance test system for implementing all or part of the content of the system performance test method, see Figure 3 , the system performance test system specifically includes the following contents:
[0107] The transaction recording device 10 is used to record transaction messages of a target financial service system.
[0108] The strategy determination device 20 is used to determine the version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message.
[0109] The conversion device 30 is used to apply the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment.
[0110] The first performance testing device 40 is used to send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0111] In one embodiment of the present application, the system performance testing system further includes:
[0112] The acquisition device is used to acquire a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same.
[0113] The strategy generating device is used to apply the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy.
[0114] In one embodiment of the present application, the system performance testing system further includes:
[0115] The program determination device is used to determine the sensitive field in the converted transaction message and the transformation program corresponding to the sensitive field according to a preset field-transformation program comparison table.
[0116] The desensitizing device is used to apply the deformation program to perform data desensitization on the sensitive field.
[0117] The second performance testing device is used to send the transaction message after data desensitization to the target testing environment to play back the transaction message after data desensitization to complete the performance test of the target financial business system.
[0118] The embodiment of the system performance testing system provided in this specification can be specifically used to execute the processing flow of the embodiment of the above-mentioned system performance testing method. Its functions are not repeated here, and reference can be made to the detailed description of the embodiment of the above-mentioned system performance testing method.
[0119] The embodiment of the present application adopts the form of transaction recording and playback, records online transaction messages from the production environment, and then generates upgrade strategies for different transaction messages by comparing the transaction message format definition files of the recording and playback environments (i.e., the production and test environments). According to the strategy, the transaction message is upgraded to the target test environment version, and the data in the message is deformed and desensitized, so that the transaction message recorded in production is adapted to the test environment of different application versions. Finally, the system performance test under different application versions is realized through playback. Based on this, the present application provides an application example of a system performance test system, which is specifically described as follows:
[0120] See also Figure 4In this application example, the system performance test system includes 5 devices, namely, a transaction recording device 101, a message format upgrade device 102, a message data deformation device 103, a transaction playback device 104 and a result analysis device 105; the function implemented by the message format upgrade device 102 can be equivalent to the function implemented by the above-mentioned conversion device, the function implemented by the message data deformation device 103 can be equivalent to the function implemented by the combination of the above-mentioned program determination device and the desensitization device, and the function implemented by the transaction playback device 104 can be equivalent to the function implemented by the above-mentioned second performance test device. The recording bypass of the production environment gateway is pointed to the transaction recording device 101, and the online transaction message sent to the host will be sent to the transaction recording device 101 at the same time. After receiving the message, the transaction recording device 101 writes it into the file system sequentially. When the recording is finished, the recorded transaction message file is passed to the message format upgrade device 102. The message format upgrade device 102 first generates a message format upgrade strategy, i.e., the above-mentioned version conversion strategy, by comparing the new and old versions of the transaction message format definition file (the transaction message format definition file defines the name, field position, field format, and field description of each field in the transaction message, and the transaction message can be parsed through this file). The message format upgrade strategy includes three types: adding new fields, deleting fields, and modifying field formats. Then, the transaction message format in the recorded transaction message file is upgraded. After the message format upgrade is completed, the transaction message file is handed over to the message data deformation device 103. The message data deformation device 103 parses the transaction message according to the format definition file, obtains the field name and field value, finds the corresponding deformation program through the "field-deformation program comparison table" and initiates a call, implements deformation on the field value, and finally writes the new field value back to the message file. At this point, the preparation stage of the transaction recording and playback performance test is completed. At the beginning of the performance test, the transaction replay device 104 is started, the transaction replay device 104 reads the transaction message data from the recording file, and the transaction replay device 104 simulates the gateway to send an online transaction message to the core business system of the test environment host, and starts the performance test. The transaction replay device 104 also sends the transaction return message to the result analysis device 105, and the result analysis device 105 analyzes the transaction return message and summarizes the results to generate a test result analysis report. The specific description of each device is as follows:
[0121] The transaction recording device 101 is used to complete writing the message data sent by the gateway into the file system. The recorded files are divided according to the source gateway of the message and the time period in which the message occurs. For example, the transaction message occurring in the first time period of the first gateway is recorded in the "Gateway 1-Time Period 1.DAT" file.
[0122] The message format upgrade device 102 is used to upgrade the old version of the transaction message to the new version of the transaction message. The message format upgrade device inputs the old (production) version message format definition file, the new (test) version transaction message format definition file, and the recorded old version transaction message file, and outputs the new version of the transaction message file. The transaction message contains the transaction type and a series of transaction fields, each transaction field consists of the following contents: field format definition (field name, field format, field description), field value; the transaction message format definition file contains a series of transaction field format definitions, each transaction field format definition consists of the following contents: field name, field format, field description.
[0123] like Figure 5 As shown, the message format upgrade device 102 is divided into two modules, a transaction message format upgrade strategy generation module 201 and a transaction message format upgrade module 202, which are specifically described as follows:
[0124] Transaction message format upgrade strategy generation module 201, this module inputs the new and old version message format definition files, and obtains the new and old version message field definitions by parsing the message format definition files. The field definition contains three attributes: "name", "format", and "description", which are represented by a vector f, f = [n, e, r], where n is the field name, e is the field format, and r is the field description.
[0125] like Figure 6 As shown, application N represents the set of fields f of the new (test) version transaction; application O represents the set of fields f of the old (production) version transaction; application C represents the set of fields common to the new and old versions; application D represents the set of fields unique to the new version; application E represents the set of fields unique to the old version, and the formula is expressed as:
[0126] N = {f|f∈new (test) version transaction field}
[0127] O = {f|f∈old (production) version transaction field}
[0128] C=N∩O
[0129] D=NO
[0130] E=ON
[0131] F is used to represent a set of fields with the same n (name) and r (description) but different e (format); G is used to represent a set of fields in the old version that are completely inconsistent with the new version; H is used to represent a set of fields in the new version that are completely inconsistent with the old version. The formula is:
[0132]
[0133] G=EF
[0134] H=DF
[0135] Set H is the fields added in the new version, and the corresponding new field strategy is generated;
[0136] Set G is the fields deleted in the new version, corresponding to the field deletion policy;
[0137] Set F is the fields whose formats have changed in the new version, corresponding to the field update strategy.
[0138] The three field upgrade strategy elements are as follows:
[0139] (1) New fields: field position, field name, field format (coding, length), field description, field value (customized);
[0140] (2) Delete field: field position;
[0141] (3) Update fields: field position, field format (coding, length).
[0142] A transaction of one type generates a transaction message upgrade strategy, which contains a set of field addition, deletion and modification strategies. Different types of transactions have different upgrade strategies, and the same type of transactions also have different upgrade strategies in different version test environments.
[0143] The following are two examples of transaction message upgrade strategies:
[0144] (1) Online banking remittance transactions
[0145] Add a new field; Position: after field 5; Name: Customer Number; Encoding: ASCII; Length: 17; Field value: default.
[0146] Delete field; position: field 10.
[0147] Delete field: Position: field11.
[0148] (2) ATM transaction inquiry
[0149] Update field; Position: field 6; Encoding: EBCDIC; Length: 10.
[0150] New field; Position: after field 7; Name: event number; Encoding: ASCII; Length: 27; Field value: event number.
[0151] The transaction message format upgrade module 202 inputs the transaction message file and the transaction message upgrade strategy. The module first parses the transaction message, finds the corresponding upgrade strategy according to the transaction type data in the message, and upgrades the transaction message according to the strategy. The process is as follows:
[0152] (1) Adding a new field: Find the location of the corresponding field in the transaction message, assemble a new field according to the field format and field value specified by the policy, and insert the field into the specified location of the message;
[0153] (2) Delete field: Find the corresponding field in the transaction message and delete it directly;
[0154] (3) Update field: Find the corresponding field in the transaction message, read the value of the field, re-encode and assemble the field value according to the format specified by the policy, and store it back to the original field location.
[0155] The message data deformation device 103 is used to input the transaction message file and the transaction message format definition file, and write the sensitive data into a new transaction message file after deformation, such as Figure 7 As shown, the message data deformation device 103 includes a deformation field identification module 301 and a data deformation module 302, which are specifically described as follows:
[0156] The deformation field identification module 301 is used to parse the message of each transaction according to the message format definition file, obtain the "field name" and "field value" of the field in the transaction message, and find the deformation program corresponding to the field in the "field-deformation program comparison table" through the field name (the table records the correspondence between the field name and the deformation program, for example: the field name "ID card", "ID number", "customer ID number" corresponds to the ID card deformation program; the field name "name", "person's name", "name" field corresponds to the name deformation program, and the table is provided by the deformation program development department), and then send the correspondence between the field and the deformation program to the data deformation module 302.
[0157] The data deformation module 302 is used to call the deformation program to perform data deformation on the field value according to the correspondence between the field and the deformation program, and write the new field value into the original transaction message after the deformation is completed.
[0158] The transaction playback device 104 is used to read the transaction message file and simulate the gateway to initiate an online transaction request to the host core business system. The specific implementation is as follows: (1) The number of gateways simulated by the transaction playback device 104 matches the recording file, and a virtual gateway is generated for each recorded transaction message file. The virtual gateway reads its own transaction message file and initiates a transaction request to the host core business system, so that the playback test reaches a concurrent scale equivalent to production. (2) All virtual gateways read the transactions in the recording file at the same rhythm for playback, so as to ensure the consistency of the multiple virtual gateways. Specifically, the virtual gateway completes the production of M milliseconds of transactions every N milliseconds, and all virtual gateways run at the same step size (N and M) to ensure that each virtual gateway is in step, so as to achieve the consistency of the transaction sequence with production. In addition, by adjusting the proportional relationship between the devices M and N, the playback speed can be controlled. (3) The transaction playback device 104 sends the return message of the transaction to the result analysis device 105 for subsequent processing.
[0159] The result analysis device 105 is used to input the transaction return message received during the playback performance test. Based on the data in the return message, the result analysis device 105 completes the following calculations: (1) using the transaction message format definition file, parses the transaction return message, determines the execution result of the transaction based on the field value in the message, and calculates the success rate and failure reason of the scenario; (2) uses the timestamp of the transaction return message to calculate the throughput rate of the system during the performance test.
[0160] For further explanation of this scheme, see Figure 8 In combination with the above system performance testing system, the present application provides an application example of a system performance testing method, which is specifically described as follows:
[0161] Step 001: Recording online transaction messages of the production environment; that is, selecting the peak period of online transaction of production, turning on the bypass switch of the gateway, and recording the online transaction messages of the production environment to the file system.
[0162] Step 002: Generate a transaction message format upgrade strategy; that is, obtain the new and old versions of the transaction message format definition files from the gateway systems of the test environment and the production environment respectively, expand and compare the new and old versions of the message format definition files, and generate a transaction message format upgrade strategy.
[0163] Step 003: Upgrading the transaction message format; that is, upgrading the recorded online transaction message according to the upgrade strategy to generate a new version of the transaction message file.
[0164] Step 004: Search for the message field transformation program; that is, apply the new version of the message format definition file to parse the message field, search the comparison table through the "field name", and obtain the transformation program corresponding to the field.
[0165] Step 005: Implement transaction message field deformation; that is, call the corresponding data deformation program, transform the field value, and then write it back to the transaction message file.
[0166] Step 006: replaying transactions in the test environment; that is, simulating the gateway system, replaying transaction messages in the test environment, and implementing performance testing.
[0167] Step 007: Playback result analysis; that is, parse the transaction return message, obtain the transaction execution result, and perform summary and induction calculations.
[0168] It can be seen from the above description that the system performance testing method and system provided by the present application can be applied to application versions of application systems that are rapidly iteratively developed, and can improve the accuracy and stability of system performance testing; specifically, without the need for a large amount of manpower, performance testing can be implemented quickly, and at the same time has the following advantages: 1. By producing recorded test playback, the test scenario is highly fitted with the production scenario, solving the problem of a single test scenario and simple behavior, improving the test quality, and reducing the learning cost of the tester for the business scenario; 2. By upgrading the transaction message format version and deforming transaction data, cross-version and cross-environment transaction recording and playback can be achieved, which can solve the problem of version differences and data deformation between the production and test environments, and can more flexibly adapt to the current application versions of complex application systems that are rapidly iteratively developed and tested; 3. By controlling the ratio of M and N (recording a transaction that takes M milliseconds and replays it within N milliseconds), flexible control of the online load pressure can be achieved, so that the performance of the system under different load pressure conditions can be observed.
[0169] From the hardware level, in order to be suitable for application versions of application systems that are rapidly iteratively developed and to improve the accuracy and stability of system performance testing, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the system performance testing method. The electronic device specifically includes the following contents:
[0170] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the system performance test system and related devices such as user terminals; the electronic device can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the electronic device can be implemented with reference to the embodiment for realizing the system performance test method and the embodiment for realizing the system performance test system, and the contents are incorporated herein, and the repeated parts are not repeated.
[0171] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0172] In one or more embodiments of the present application, the system performance test function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control:
[0173] Step 100: Record the transaction message of the target financial business system.
[0174] Step 200: Determine a version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message.
[0175] Step 300: Apply the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment.
[0176] Step 400: Send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0177] It can be seen from the above description that the electronic device provided by the embodiment of the present application can be suitable for application versions of application systems that are rapidly iterated and developed, thereby improving the accuracy and stability of system performance testing.
[0178] In another embodiment, the system performance test system may be configured separately from the central processing unit 9100. For example, the system performance test system may be configured as a chip connected to the central processing unit 9100, and the system performance test function may be implemented through the control of the central processing unit.
[0179] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0180] like Fig. 9As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0181] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0182] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0183] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0184] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0185] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0186] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0187] It can be seen from the above description that the electronic device provided by the embodiment of the present application can be applicable to application versions of application systems that are rapidly iterated and developed, thereby improving the accuracy and stability of system performance testing.
[0188] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the system performance testing method in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps in the system performance testing method in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0189] Step 100: Record the transaction message of the target financial business system.
[0190] Step 200: Determine a version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message.
[0191] Step 300: Apply the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment.
[0192] Step 400: Send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system.
[0193] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application can be applicable to application versions of application systems that are rapidly iterated and developed, thereby improving the accuracy and stability of system performance testing.
[0194] In this application, each embodiment of the above method is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For relevant parts, refer to the partial description of the method embodiment.
[0195] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0196] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0197] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0198] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0199] Specific embodiments are used in this application to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core idea of this application. At the same time, for those skilled in the art, according to the idea of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A system performance testing method, characterized in that: include: Recording transaction messages of the target financial business system, including: selecting the peak period of online transaction in production, turning on the bypass switch of the gateway, and recording online transaction messages in the production environment; Determine, according to the transaction type data in the transaction message, a version conversion strategy corresponding to the transaction message, wherein the version conversion strategy includes: at least one policy element of adding a field, deleting a field, and updating a field, and the transaction type data includes: transfer, online bank remittance, and ATM query transaction type data; Applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment; Sending the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system; After completing the performance test of the target financial business system, the method further includes: Receive transaction return messages, apply the timestamp of the transaction return messages, obtain the number of transaction return messages received per unit time, and use the number as the throughput rate of the target financial business system; After sending the converted transaction message to the target test environment to play back the converted transaction message and completing the performance test of the target financial business system, the method further includes: Adjust the ratio of recording time to playback time to complete the performance test of the target financial business system under different load pressures; Before determining the version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message, the method further includes: Obtaining a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same; Applying the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy; The first transaction message format definition file is a transaction message format definition file corresponding to the application version of the target financial business system, and the second transaction message format definition file is a transaction message format definition file corresponding to the application version of the target test environment; the first transaction message format definition file and the second transaction message format definition file both contain a plurality of transaction field format definitions, and each transaction field format definition consists of the following contents: field name, field format, and field description; After applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment, the method further includes: According to the preset field-transformation program comparison table, determine the sensitive fields in the converted transaction message and the transformation program corresponding to the sensitive fields; Applying the transformation program to desensitize the sensitive fields; The transaction messages after data desensitization are sent to the target test environment to play back the transaction messages after data desensitization to complete the performance test of the target financial business system.
2. The system performance testing method according to claim 1, characterized in that: The applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment includes: If the version conversion strategy includes a newly added field strategy element, then updating the transaction message according to the newly added field strategy element; If the version conversion strategy includes a deletion field strategy element, updating the transaction message according to the deletion field strategy element; If the version conversion strategy includes an update field strategy element, then updating the transaction message according to the update field strategy element; The updated transaction message version is used as the corresponding version of the transaction message in the target test environment.
3. The system performance testing method according to claim 1, characterized in that: The applying the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy includes: Determine, according to the first transaction message format definition file and the second transaction message format definition file, newly added fields, deleted fields, and updated fields; The field position, field name, field format, field description and field value of the newly added field are used as the newly added field policy elements, wherein the newly added field is a field that exists in the second transaction message format definition file and does not exist in the first transaction message format definition file; Using the field position of the deleted field as a deleted field policy element, wherein the deleted field is a field that exists in the first transaction message format definition file and does not exist in the second transaction message format definition file; The field position and field format of the update field are used as update field policy elements, wherein the update field is a field having the same field name and field description but different field formats in the first transaction message format definition file and the transaction message format definition file; The deletion field policy element, the addition field policy element and the update field policy element are combined to form the version conversion strategy.
4. A system performance testing system, characterized in that: include: The transaction recording device is used to record the transaction messages of the target financial business system, including: selecting the peak period of production online transactions, turning on the bypass switch of the gateway, and recording the online transaction messages of the production environment; A strategy determination device, for determining a version conversion strategy corresponding to the transaction message according to the transaction type data in the transaction message, wherein the version conversion strategy includes at least one strategy element of a newly added field, a deleted field, and an updated field, and the transaction type data includes transaction type data of transfer, online bank remittance, and ATM query; A conversion device, used for applying the version conversion strategy to convert the version of the transaction message into a corresponding version of the transaction message in the target test environment; A first performance testing device, used to send the converted transaction message to the target test environment to play back the converted transaction message to complete the performance test of the target financial business system; The system performance test system is also used to: receive transaction return messages, apply the timestamp of the transaction return messages, obtain the number of transaction return messages received per unit time, and use the number as the throughput rate of the target financial business system; The system performance testing system is also used to adjust the ratio of recording time and playback time to complete the performance test of the target financial business system under different load pressures; The system performance test system further includes: An acquisition device is used to acquire a first transaction message format definition file corresponding to the target financial business system and a second transaction message format definition file corresponding to the target test environment, wherein the transaction types corresponding to the first transaction message format definition file, the second transaction message format definition file and the transaction message are the same; A strategy generating device, used for applying the first transaction message format definition file and the second transaction message format definition file to generate the version conversion strategy; The first transaction message format definition file is a transaction message format definition file corresponding to the application version of the target financial business system, and the second transaction message format definition file is a transaction message format definition file corresponding to the application version of the target test environment; the first transaction message format definition file and the second transaction message format definition file both contain a plurality of transaction field format definitions, and each transaction field format definition consists of the following contents: field name, field format, and field description; The system performance test system further includes: A program determination device, used to determine the sensitive field in the converted transaction message and the transformation program corresponding to the sensitive field according to a preset field-transformation program comparison table; A desensitizing device, used for applying the deformation program to perform data desensitization on the sensitive field; The second performance testing device is used to send the transaction message after data desensitization to the target testing environment to play back the transaction message after data desensitization to complete the performance test of the target financial business system.
5. An electronic 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 program, the system performance testing method according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed, the system performance testing method described in any one of claims 1 to 3 is implemented.