Data processing method and device, storage medium and computer program product

By establishing an association between the request identifier and the test transaction identifier in the financial business system and obtaining data change information, the problem of data checking complexity caused by simultaneous operations by multiple testers is solved, and rapid matching and matching of business operations and data changes are achieved. Improvement of testing efficiency.

CN119357022AInactive Publication Date: 2025-01-24HUNDSUN TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411944874.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the test scenario of financial business systems, when multiple testers operate the same test environment at the same time, a large amount of data changes may be caused, resulting in a significant increase in the complexity and difficulty of data inspection.

Method used

Through receiving and executing test requests, obtaining the testing of the memory database generated, establishing a correlation relationship between the request logo and the test transaction logo, obtaining data change information, and determining the test results based on this information.

Benefits of technology

Realize the business operation of the testers with the data that changes in the memory database. It is clear that the data changes are caused by which business operations, which improves the test efficiency and reduces the difficulty of testing the design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357022A_ABST
    Figure CN119357022A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device, a storage medium and a computer program product, and the method comprises the steps: receiving and executing a test request to obtain a test transaction identifier generated by a memory database for the test request, and establishing an association relationship pair of a request identifier and the test transaction identifier, and acquiring data change information of the memory database, and determining a test result of the test request according to the request identifier of the test request, the association relationship pair and the data change information. By associating the request identifier in the test request with the transaction identifier in the memory database, the association between the test action of the tester and the memory data change is realized, so that the effect of distinguishing the memory data change caused by different operations of different testers can be achieved, and the problem that the test efficiency is high when a plurality of testers share a test environment is solved. The system data change is difficult to distinguish, so that the test case execution failure is caused.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, storage medium and computer program product. Background Art

[0002] In the testing scenario of the financial business system, testers need to test whether the data change values ​​in the memory database before and after the test operation are correct, and then determine whether there are problems in the business processing process related to the test operation based on the test results.

[0003] The commonly used testing method at present is to compare the data before and after the operation after the tester completes the operation to obtain the data change value of this operation, and compare the data change value with the expected change value to determine the result of this test.

[0004] However, when multiple testers operate the same test environment at the same time, a large number of data changes may occur, and multiple data changes may interfere with each other, which greatly increases the complexity and difficulty of test data checking. Summary of the invention

[0005] The purpose of the present application is to provide a data processing method, device, storage medium and computer program product to address the deficiencies in the above-mentioned prior art, so as to solve the problem in the prior art that a large number of data changes may occur when multiple testers operate the same test environment at the same time, and multiple data changes may interfere with each other, thereby greatly increasing the complexity and difficulty of test data checking.

[0006] To achieve the above objectives, the technical solutions adopted in this application are as follows: In a first aspect, the present application provides a data processing method, comprising: Receive and execute a test request to obtain a test transaction identifier generated by the memory database for the test request, wherein the test request includes: a request identifier; Establishing an association relationship pair between the request identifier and the test transaction identifier; Acquire data change information of the memory database, where the data change information is generated after the memory database performs a data operation, and the data change information includes: an operation transaction identifier and at least one post-operation data; A test result of the test request is determined according to the request identifier of the test request, the association relationship pair, and the data change information.

[0007] Optionally, the receiving and executing the test request to obtain a test transaction identifier generated by the in-memory database for the test request includes: Execute the test request, and submit a database transaction request to the in-memory database according to the test request, the in-memory database generates an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request, and uses the operation transaction identifier of the database transaction request as the test transaction identifier.

[0008] Optionally, the process of the in-memory database generating a transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request includes: If the operation type of the test operation is addition, deletion or modification, the in-memory database generates an operation transaction identifier of the test request; If the operation type of the test operation is query, the operation transaction identifier of the test request is not generated.

[0009] Optionally, the process of generating the data change information after the memory database performs data operation includes: The memory database is checked based on a preset time period. If the data in the memory database changes, the changed data is used as post-operation data, and the operation transaction identifier corresponding to the post-operation data is obtained, and the post-operation data and the operation transaction identifier are used as data change information.

[0010] Optionally, determining a test result of the test request according to the request identifier of the test request, the association relationship pair, and the data change information includes: Determine the data change information corresponding to the test request according to the request identifier of the test request, each of the association relationship pairs and the data change information; A test result of the test request is determined according to the request identifier of the test request and the data change information of the test request.

[0011] Optionally, determining the data change information corresponding to the test request according to the request identifier of the test request, each of the association relationship pairs and the data change information includes: Determine at least one first association relationship pair of the test request according to the request identifier of the test request and each of the association relationship pairs; The data change information of the test request is determined according to the test transaction identifier in each of the first association relationship pairs and the operation transaction identifier in the data change information.

[0012] Optionally, determining the data change information of the test request according to the test transaction identifier in each of the first association relationship pairs and the transaction identifier in the data change information includes: Each of the data change information is traversed, and if the operation transaction identifier of the current data change information is the same as the test transaction identifier in the first association relationship pair, the current data change information is used as the data change information of the test request.

[0013] Optionally, determining the test result of the test request according to the request identifier of the test request and the data change information of the test request includes: Determining an expected change value and pre-operation data of the test request according to a request identifier of the test request; Calculating the difference between the post-operation data and the pre-operation data, and using the difference as the actual change value of the test request; A test result of the test request is determined according to the expected change value of the test request and the actual change value.

[0014] In a second aspect, the present application provides a data processing device, the device comprising: A receiving module is used to receive and execute a test request to obtain a test transaction identifier generated by the memory database for the test request, wherein the test request includes: a request identifier; An establishing module, used for establishing an association relationship pair between the request identifier and the test transaction identifier; An acquisition module, configured to acquire data change information of the memory database, wherein the data change information is generated after the memory database performs a data operation, and the data change information includes: an operation transaction identifier and at least one post-operation data; A determination module is used to determine a test result of the test request according to a request identifier of the test request, the association relationship pair and the data change information.

[0015] Optionally, the receiving module is specifically used for: Execute the test request, and submit a database transaction request to the in-memory database according to the test request, the in-memory database generates an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request, and uses the operation transaction identifier of the database transaction request as the test transaction identifier.

[0016] Optionally, the device further includes a generating module, specifically configured to: If the operation type of the test operation is addition, deletion or modification, the in-memory database generates an operation transaction identifier of the test request; If the operation type of the test operation is query, the operation transaction identifier of the test request is not generated.

[0017] Optionally, the generating module is further used for: The memory database is checked based on a preset time period. If the data in the memory database changes, the changed data is used as post-operation data, and the operation transaction identifier corresponding to the post-operation data is obtained, and the post-operation data and the operation transaction identifier are used as data change information.

[0018] Optionally, the determining module is specifically used to: Determine the data change information corresponding to the test request according to the request identifier of the test request, each of the association relationship pairs and the data change information; A test result of the test request is determined according to the request identifier of the test request and the data change information of the test request.

[0019] Optionally, the determining module is specifically used to: Determine at least one first association relationship pair of the test request according to the request identifier of the test request and each of the association relationship pairs; The data change information of the test request is determined according to the test transaction identifier in each of the first association relationship pairs and the operation transaction identifier in the data change information.

[0020] Optionally, the determining module is specifically used to: Each of the data change information is traversed, and if the operation transaction identifier of the current data change information is the same as the test transaction identifier in the first association relationship pair, the current data change information is used as the data change information of the test request.

[0021] Optionally, the determining module is specifically used to: Determining an expected change value and pre-operation data of the test request according to a request identifier of the test request; Calculating the difference between the post-operation data and the pre-operation data, and using the difference as the actual change value of the test request; A test result of the test request is determined according to the expected change value of the test request and the actual change value.

[0022] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the data processing method as described in any one of the first aspects.

[0023] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method as described in any one of the first aspects are executed.

[0024] In a fifth aspect, an embodiment of the present application further provides a computer program product, wherein the computer program product comprises a computer program code. When the computer program code is executed by a computing device, the computing device executes the steps of the data processing method described in any one of the first aspects.

[0025] The beneficial effect of the present application is that by establishing an association relationship between a request identifier and a test transaction identifier, the business operations of the tester can be associated with the data that has changed in the memory database, thereby clarifying which business operations caused the data changes. Even if multiple people are testing at the same time, different business operations have different request identifiers. The present application can also quickly complete the rapid matching of business operations with corresponding changed data, thereby improving the test efficiency. In addition, compared with the prior art, the present application does not need to add specific feature values ​​for test cases, which reduces the difficulty of designing test cases and has better versatility.

[0026] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 A schematic diagram of the architecture of a business system provided by an embodiment of the present application is shown; Figure 2 A flow chart of a data processing method provided by an embodiment of the present application is shown; Figure 3 A flowchart of generating an operation transaction identifier provided by an embodiment of the present application is shown; Figure 4 A flow chart for determining a test result provided by an embodiment of the present application is shown; Figure 5 A flow chart for determining data change information provided by an embodiment of the present application is shown; Figure 6 Another flow chart for determining test results provided by an embodiment of the present application is shown; Figure 7 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown; Figure 8 A schematic structural diagram of an electronic device 80 provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0030] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0031] In business system testing scenarios, it is usually necessary to test whether the database changes caused by business operations are the same as the expected values. Taking the financial business system testing scenario as an example, in most cases, it is necessary to check whether the data change value in the in-memory database is the same as the expected change value. The writing of the test case can be expressed as: Role A uses X yuan of funds to perform a certain operation, and the expected change value is generally written as: This operation causes the funds in account B to increase or decrease by Y yuan. The tester can obtain the actual change value by recording the data before and after the change, and compare the actual change value with the expected change value to determine the test result.

[0032] However, when multiple users operate the in-memory database at the same time, the existing testing methods have some problems. Specifically, multiple testers performing tests at the same time may cause a large number of data changes in the in-memory database, and these data changes may interfere with each other, thereby causing problems in the test results.

[0033] As an example, tester A performs the first query and save action on the in-memory database at time T0, then performs an operation at time T1, causing a change in a piece of data in a table in the in-memory database, and then performs the second query and save action at time T2. At the same time, tester B performs an operation at any time between T0 and T2, affecting the change of the same piece of data in the same table in the in-memory database. Then the changed data obtained by tester A through the two queries will be affected by the operation of tester B. In this way, it is impossible to distinguish whose operation caused the changed value, which will cause the expected change value of the test case executed by tester A to be different from the actual change value, causing the test to fail.

[0034] At present, although it is possible to distinguish multiple test actions in a test case through different business key fields or description identifiers, so as to achieve the purpose of distinguishing the data changes caused by each test action, this method requires special design for the test case, has high requirements for the case designer, and has the problem of poor versatility.

[0035] In summary, when conducting business system testing at present, a large number of data changes may occur when multiple testers operate the same test environment at the same time, and multiple data changes may interfere with each other, which greatly increases the complexity and difficulty of test data checking.

[0036] Based on this, the present application proposes a data processing method, which realizes the association between the tester's test action and the memory data change by associating the request identifier in the test request with the transaction identifier in the memory database, so as to achieve the effect of distinguishing the memory data changes caused by different operations of different testers, and solve the problem of test case execution failure caused by the difficulty in distinguishing system data changes when multiple testers share the test environment. In addition, the present application does not need to make targeted data feature values ​​for distinction in the test case design, which reduces the difficulty of test case design and has better versatility.

[0037] Figure 1 This is a schematic diagram of the architecture of a business system given in this application. Figure 1The business system includes a front-end program, a business service, a memory database, and an analysis program, wherein the number of business services can be multiple. The tester initiates a test request in the front-end program operation. After the business service receives the test request, it submits a transaction to the memory database based on the test request and obtains the transaction identifier of the test request. The business service stores the association relationship pair of the request identifier and the transaction identifier of the test request. The memory database records the data change information. The analysis program associates the tester's operation action with the changed data based on the association relationship pair stored in the business service and the data change information stored in the memory database, thereby obtaining the test result of the tester's test action.

[0038] Next, combine Figure 2 , the data processing method of the present application is described, and the method can be applied to Figure 1 In the business system shown in the figure, the execution subject can be an electronic device that deploys business services and analysis programs, referring to Figure 2 , the method comprising: S201. Receive and execute a test request to obtain a test transaction identifier generated by a memory database for the test request. The test request includes: a request identifier.

[0039] Reference Figure 1 , the tester initiates a test request for the business service through the front-end program, and sends the test request to the business service, so that the business service performs the test operation indicated by the test request. Among them, when there are multiple business services that need to be tested, the tester can execute the test case in the front-end program and generate test requests for multiple business services.

[0040] The request identifier may be the full-link request number of the test request, which is used to uniquely identify the business operation in the business system. Figure 1 The business system shown may include multiple business services. In some scenarios, a business operation may call multiple business services. In this case, a test request may flow through multiple business services. The request identifier of the test request may uniquely identify the test request during the request flow, that is, the same test request has the same request identifier in different business services.

[0041] The test request may indicate the role used for the test and the test operation. For example, the test request may indicate that role A used X yuan of funds to perform operation Y. After receiving the test request, the business service may log in to role A's account information and use X yuan of funds to perform operation Y to execute the test request.

[0042] In the process of executing the test request, changes to the in-memory database may be involved. The business service can submit a database transaction to the in-memory database according to the test request, so that the in-memory database can operate on the corresponding data in the in-memory database according to the database transaction, record the changed data and the test transaction identifier of the database transaction, and return the test transaction identifier to the business service.

[0043] The test transaction identifier can be the transaction number of the database transaction generated by the in-memory database according to the test request, which is used to uniquely identify the database transaction corresponding to the test request initiated by the business service this time. After different test requests are initiated, the corresponding test transaction identifiers in the in-memory database are different. When the same test request is initiated by different business services, the test transaction identifiers are also different.

[0044] S202: Establish an association relationship pair between the request identifier and the test transaction identifier.

[0045] As a possible implementation method, after the in-memory database completes the database transaction corresponding to the test request, it can return a transaction completion message to the business service. After the business service receives the transaction completion message and determines that the database transaction has been completed, it can establish and record the association between the request identifier of the test request and the test transaction identifier corresponding to the database transaction.

[0046] In another implementation, the memory database has returned the test transaction identifier in the above step S201. After the business service processes the test request, the association relationship between the request identifier of the test request and the test transaction identifier may also be established and recorded.

[0047] Among them, the business service can add the request identifier and the test transaction identifier as an item to the record file, and the content format is request identifier-test transaction identifier. For example, assuming that the test identifier of the test request received by the business service is TcID1, after submitting the database transaction corresponding to the test request to the memory database, the test transaction identifier returned by the memory database is TS1, and the business service can add TcID1-TS1 as an item to the record file.

[0048] S203: Acquire data change information of the memory database. The data change information is generated after the memory database performs a data operation. The data change information includes: an operation transaction identifier and at least one post-operation data.

[0049] As a possible implementation method, the in-memory database can record data change information in log files and regularly push the log files to Figure 1 The parser shown. Alternatively, the parser can periodically read the log files from an in-memory database.

[0050] A database transaction may cause data in the memory database to change. The pre-operation data may be the data before the change, and the post-operation data may be the data after the change. A database transaction may cause changes to multiple data, that is, an operation transaction identifier may be associated with one or more changed data. The changed pre-operation data, post-operation data, and the operation transaction identifier corresponding to the database transaction may be recorded as data change information.

[0051] As another possible implementation method, the analysis program may also obtain data from the in-memory database after startup, and use the obtained data as the initial state. After the data changes, the in-memory database records the changed data caused by the database transaction and the operation transaction identifier corresponding to the database transaction as data change information, and sends the data change information to the analysis program. The analysis program can determine the data change value based on the initial state data and the changed data stored in itself.

[0052] It should be understood that after receiving the database transaction request, the in-memory database can generate a database transaction and an operation transaction identifier of the database transaction based on the database transaction request, and perform data operations. If the database transaction request is initiated by a business service according to a test request, the in-memory database can use the operation transaction identifier as a test transaction identifier and return the test transaction identifier to the business service.

[0053] A database transaction can include at least one test operation. The test operation can be triggered by the SDK or API. The test operation can also be an SQL (Structured Query Language) statement that the in-memory database needs to execute. The in-memory database performs data operations by calling the SDK or API to perform data operations such as adding, deleting, modifying, and querying the database, or operating the corresponding data in the in-memory database according to the instructions of the SQL statement.

[0054] It should be noted that there is no sequential relationship between the above steps S202 and S203. After receiving the test transaction identifier, the business service can establish an association relationship pair between the request identifier and the test transaction identifier. After receiving the database transaction request corresponding to the test request, the memory database can record the data change information after the database transaction request is executed. The analysis program can periodically obtain the data change information, and obtain the test result of the test request based on the association relationship pair and the data change information analysis.

[0055] S204: Determine a test result of the test request according to the request identifier, the association relationship pair, and the data change information of the test request.

[0056] The association pair records the association between the request identifier and the test transaction identifier. The data change information includes the operation transaction identifier. Based on the test transaction identifier and the operation transaction identifier, the analysis program can associate the test request with the changed data in the memory database, thereby analyzing the data changes caused by the test request and obtaining the test results of the test request.

[0057] The analysis program can obtain the expected value of the test request based on the request identifier of the test request, and obtain the test result of the test request based on the expected value and the data change analysis caused by the test request. The test result is used to indicate whether the expected value of the test request is the same as the actual data change value.

[0058] For example, the test request may be that role A uses funds of X yuan to perform operation Y, and the expected value of the test request may be: this operation causes role A's account funds to increase by Z yuan. If the change value of role A's account funds between the data before and after the operation in the data change information is +Z yuan, then the test result of the test request is: the expected value is consistent with the actual change value, and the test passes.

[0059] It should be noted that the test request may also include IP information for uniquely identifying the tester. The IP information may be the IP address of the device used by the tester or the unique identifier of the tester. After determining the test result of the test request based on the request identifier, association relationship pair, and data change information of the test request, the tester who initiated the test request can be determined based on the IP information in the test request, and the test result is returned to the tester indicated by the IP information. When multiple testers perform test operations in parallel, the tester who initiated the test request can be determined based on the IP information, and the business operation corresponding to the test request can be determined based on the request identifier, thereby realizing the association between the tester, the test operation, and the test change data.

[0060] In an embodiment of the present application, a test request is received and executed to obtain a test transaction identifier generated by a memory database for the test request, the test request includes: a request identifier, an association relationship pair between the request identifier and the test transaction identifier is established, data change information of the memory database is obtained, the data change information is generated after the memory database performs a data operation, the data change information includes: an operation transaction identifier, at least one post-operation data, and a test result of the test request is determined based on the request identifier, the association relationship pair and the data change information of the test request.

[0061] By establishing an association between the request identifier and the test transaction identifier, the business operations of the tester can be associated with the data that has changed in the memory database, so as to clarify which business operations caused the data changes. Even if multiple people are testing at the same time and different business operations have different request identifiers, this application can quickly complete the matching of business operations with corresponding changed data, thereby improving the test efficiency. In addition, compared with the prior art, this application does not need to add specific feature values ​​for test cases, which reduces the difficulty of designing test cases and has better versatility.

[0062] The following is a further description of the above-mentioned receiving and executing the test request to obtain the test transaction identifier generated by the in-memory database for the test request. The above-mentioned step S201 includes: Execute the test request and submit a database transaction request to the in-memory database according to the test request. The in-memory database generates an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request, and uses the operation transaction identifier of the database transaction request as the test transaction identifier.

[0063] The test request may include at least one test operation for the database. The business service may generate a database transaction request based on the test operation and send the database transaction request to the in-memory database.

[0064] The database transaction request includes at least one test operation on at least one data in the memory database, including adding, deleting, modifying, querying, etc. of the data.

[0065] As an example, if the test request is "Role A transfers X yuan of funds from account A to account B", the test operations of the database transaction request generated by the business service may include "reduce the funds of account A by X yuan" and "increase the funds of account B by X yuan". In this case, one database transaction request includes two test operations for changing two pieces of data.

[0066] After receiving the database transaction request, the in-memory database can determine the operation type of the test operation contained in the database transaction request. If the test operation will cause the data in the in-memory database to change, a transaction identifier of the database transaction request is generated and the test transaction identifier is returned to the business service. If the test operation does not cause the data in the in-memory database to change, no test transaction identifier is generated.

[0067] It should be noted that the transaction identifier generated by the in-memory database is an operation transaction identifier. After the in-memory database returns the operation transaction identifier to the business service, the business service can use the operation transaction identifier as the test transaction identifier of the test request and establish an association relationship pair between the test transaction identifier and the request identifier.

[0068] Further, such as Figure 3 As shown, the process of the above-mentioned in-memory database generating an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request includes: S301: If the operation type of the test operation is addition, deletion or modification, the in-memory database generates an operation transaction identifier for the test request.

[0069] Among them, when the operation type of the test operation is to add data, delete data or modify data, it will cause changes to the data in the memory database. At this time, the memory database can generate an operation transaction identifier for the database transaction request containing the test operation, and return the operation transaction identifier to the business service. The business service uses the operation transaction identifier as the test transaction identifier of the test request corresponding to the database transaction request.

[0070] S302: If the operation type of the test operation is query, then no operation transaction identifier of the test request is generated.

[0071] If the operation type of the test operation is to query data, it will not cause the data in the memory database to change. In this case, the memory database may not generate a transaction identifier for the test request.

[0072] It should be noted that a database transaction request may include multiple consecutive test operations. If all the multiple test operations are query operations, no operation error identifier is generated for the test request. If at least one of the multiple test operations is an add, delete, or modify operation, the in-memory database can generate an operation transaction identifier for the database transaction request and return the operation transaction identifier to the business service.

[0073] The operation type of the test operation can be determined based on the SQL statement of the test operation, and the operation type of the test operation can be determined by character matching of the SQL statement. When the test operation is triggered by the user through the SDK or API, the operation type of the test operation can be determined according to the functional attributes of the SDK or API. For example, assuming that the tester calls the API to query the data in the memory database, and the functional attribute of the called API is query, the operation type of the test operation is a query operation.

[0074] After the in-memory database generates an operation transaction identifier and returns the operation transaction identifier to the business service, the in-memory database can execute the database transaction in the database transaction request and generate data change information after the transaction execution is completed. The specific process includes: The memory database is checked. If the data in the memory database changes, the changed data is used as the post-operation data, and the operation transaction identifier corresponding to the post-operation data is obtained, and the post-operation data and the operation transaction identifier are used as a data change information.

[0075] As a possible implementation, the in-memory database can also record the operation transaction identifier of the current database transaction and the changed post-operation data after executing each database transaction, and use the operation transaction identifier and the post-operation data as data change information. The analysis program can determine the pre-operation data based on the identifier of the test request, and determine the data change value based on the pre-operation data and the post-operation data.

[0076] As another possible implementation method, after executing each database transaction, the in-memory database can record the operation transaction identifier of the current database transaction and the data of the database transaction operation, including the pre-operation data before the database transaction is executed and the post-operation data after the database transaction is executed, and use the operation transaction identifier, the pre-operation data and the post-operation data as a data change information.

[0077] After executing multiple database transactions, the in-memory database can write data change information to a log file and check the log file based on a preset time period. If there is an updated increment in the data in the log file, the in-memory database can push the incremental data in the log file as data change information to the analysis program.

[0078] The following is a further explanation of determining the test result of the test request based on the request identifier, the association relationship pair and the data change information of the test request. Figure 4 As shown, the above step S204 includes: S401: Determine data change information corresponding to the test request according to a request identifier of the test request, each association relationship pair and data change information.

[0079] It should be understood that a test request can flow through multiple business services, and each business service can generate a database transaction request based on the test request, and obtain the test transaction identifier of the test request in each business service, that is, a test request can correspond to multiple association pairs. The analysis program can determine the association pair related to the test request according to the request identifier, and match the data change information corresponding to the test request according to the operation transaction identifier in the data change information and the test transaction identifier in the association pair.

[0080] The data change information corresponding to the test request may be data change information generated by calling a memory database when the test request is executed in at least one business service.

[0081] S402: Determine a test result of the test request according to the request identifier of the test request and the data change information of the test request.

[0082] The analysis program can obtain the expected change value of the test request according to the identifier of the test request, and the actual change value of the test request according to the data change information. By comparing the expected change value of the test request with the actual change value of the test request, the test result of the test request can be obtained.

[0083] Specifically, if the actual change value of the test request is the same as the expected change value, the test result is that the test passes. If the actual change value of the test request is different from the expected change value, the test result is that the test fails.

[0084] Further, the process of determining the data change information corresponding to the test request according to the request identifier of the test request, each association relationship pair and the data change information is as follows: Figure 5 As shown, including: S501: Determine at least one first association relationship pair of the test request according to a request identifier of the test request and each association relationship pair.

[0085] The test request may be sent to multiple business services. When each business service processes the test request, it may execute the above steps S201-S202 to obtain the association relationship pairs of the test request in each business service.

[0086] The analysis program can obtain the association relationship pairs of all business services, and match each association relationship pair based on the request identifier of the test request to be analyzed, and use the association relationship pair with the same request identifier as the request identifier of the test request to be analyzed as the first association relationship pair of the test request.

[0087] S502: Determine data change information of the test request according to the test transaction identifier in each first association relationship pair and the operation transaction identifier in the data change information.

[0088] If the test transaction identifier in the first association relationship pair is the same as the operation transaction identifier in the data change information, the data change information may be used as the data change information of the test request corresponding to the first association relationship pair.

[0089] As an example, assume that the test request TcID1 calls business service A and business service B in sequence. When executed in business service A, the memory database is called to generate data change information 1. The content of data change information 1 includes "operation transaction identifier TS1, pre-operation data of data 1, and post-operation data of data 1". When executed in business service B, the memory database is called to generate data change information 2. The content of data change information 2 includes "operation transaction identifier TS2, pre-operation data of data 2, and post-operation data of data 2". The association pair recorded by business service A is "TcID1-TS1", and the association pair recorded by business service B is "TcID1-TS2". Based on the request identifier TcID1 of the test request, the association pair "TcID1-TS1" and "TcID1-TS2" can be obtained. Based on the test transaction identifier included in the association pair, data change information 1 and data change information 2 can be obtained. Then the data change information of the test request TcID1 is data change information 1 and data change information 2.

[0090] The following is a further explanation of determining the data change information of the test request according to the transaction identifiers in each first association relationship pair and the transaction identifiers in the test data, including: Each data change information is traversed, and if the operation transaction identifier of the current data change information is the same as the test transaction identifier in the first association relationship pair, the current data change information is used as the data change information of the test request.

[0091] For the current data change information traversed, the operation transaction identifier in the current data change information is compared with the test transaction identifier in the first association pair. If the operation transaction identifier in the current data change information is the same as the test transaction identifier in the first association pair, the current data change information can be used as the data change information of the test request.

[0092] The first association relationship may include more than one test transaction identifier, and the above steps can be performed for each test transaction identifier to obtain the data change information corresponding to each test transaction identifier. The embodiment of the present application can associate the test actions for each business service with the change data, thereby enabling the test differentiation of different testers and different business services.

[0093] The process of determining the test result of the test request according to the request identifier of the test request and the data change information of the test request is as follows: Figure 6 As shown, including: S601: Determine an expected change value of the test request and pre-operation data according to a request identifier of the test request.

[0094] The analysis program can obtain the expected change value of the test request and the pre-operation data according to the request identifier of the test request. The expected change value can indicate the data operated by the test request and the expected change value of the data. Exemplarily, the expected change value of the test request can be "the funds of account A increase by X yuan".

[0095] Among them, the analysis program can obtain data in the memory database after startup, use the obtained data as initial data, determine the data operated by the test request according to the request identifier of the test request, and obtain the pre-operation data corresponding to the test request from the initial data.

[0096] S602: Calculate the difference between the data after the operation and the data before the operation, and use the difference as the actual change value of the test request.

[0097] S603: Determine a test result of the test request according to the expected change value and the actual change value of the test request.

[0098] The analysis program can calculate the difference between the data after the operation and the data before the operation, take the difference as the actual change value, and compare each actual change value with the corresponding expected change value. If all the actual change values ​​are the same as the expected change values, the test result of the test request is a test pass. If the actual change value is different from the expected change value, the test result is a test fail.

[0099] In another implementation, if the difference between the expected change value and the actual change value is less than or equal to a preset threshold, the test result of the test request can be considered as a test pass. If the difference between the expected change value and the actual change value is greater than the preset threshold, the test result of the test request can be considered as a test fail.

[0100] Based on the same inventive concept, a data processing device corresponding to the data processing method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned data processing method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0101] Figure 7 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application is shown. Figure 7 The device includes a receiving module 701, a establishing module 702, an acquiring module 703 and a determining module 704.

[0102] The receiving module 701 is used to receive and execute a test request to obtain a test transaction identifier generated by the memory database for the test request, wherein the test request includes: a request identifier; Establishing module 702, used to establish an association relationship pair between a request identifier and a test transaction identifier; The acquisition module 703 is used to acquire data change information of the memory database. The data change information is generated after the memory database performs a data operation. The data change information includes: an operation transaction identifier and at least one post-operation data; The determination module 704 is used to determine the test result of the test request according to the request identifier, the association relationship pair and the data change information of the test request.

[0103] Optionally, the receiving module 701 is specifically configured to: Execute the test request and submit a database transaction request to the in-memory database according to the test request. The in-memory database generates an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request, and uses the operation transaction identifier of the database transaction request as the test transaction identifier.

[0104] Optionally, the device further includes a generating module, specifically configured to: If the operation type of the test operation is add, delete or modify, the in-memory database generates an operation transaction identifier for the test request; If the operation type of the test operation is query, the operation transaction identifier of the test request is not generated.

[0105] Optionally, the generation module is also used to: The memory database is checked based on a preset time period. If the data in the memory database changes, the changed data is used as the post-operation data, and the operation transaction identifier corresponding to the post-operation data is obtained, and the post-operation data and the operation transaction identifier are used as a data change information.

[0106] Optionally, the determination module 704 is specifically configured to: Determine the data change information corresponding to the test request according to the request identifier of the test request, each association relationship pair and the data change information; A test result of the test request is determined according to the request identifier of the test request and the data change information of the test request.

[0107] Optionally, the determination module 704 is specifically configured to: Determine at least one first association relationship pair of the test request according to the request identifier of the test request and each association relationship pair; The data change information of the test request is determined according to the test transaction identifier in each first association relationship pair and the operation transaction identifier in the data change information.

[0108] Optionally, the determination module 704 is specifically configured to: Each data change information is traversed, and if the operation transaction identifier of the current data change information is the same as the test transaction identifier in the first association relationship pair, the current data change information is used as the data change information of the test request.

[0109] Optionally, the determination module 704 is specifically configured to: Determine an expected change value of the test request and pre-operation data according to a request identifier of the test request; Calculate the difference between the data after the operation and the data before the operation, and use the difference as the actual change value of the test request; A test result of the test request is determined according to the expected change value and the actual change value of the test request.

[0110] By establishing an association relationship between a request identifier and a test transaction identifier, the embodiment of the present application can associate the business operations of the tester with the data that has changed in the memory database, thereby clarifying which business operations caused the data changes. Even if multiple people are testing at the same time and different business operations have different request identifiers, the present application can quickly complete the rapid matching of business operations with corresponding changed data, thereby improving the test efficiency. In addition, compared with the prior art, the present application does not need to add specific feature values ​​for test cases, which reduces the difficulty of designing test cases and has better versatility.

[0111] Figure 8 A schematic diagram of the structure of an electronic device 80 provided in an embodiment of the present application is shown, comprising: a processor 801, a storage medium 802 and a bus 803, wherein the storage medium 802 stores machine-readable instructions executable by the processor 801, and when the electronic device runs a data processing method such as in the embodiment, the processor 801 communicates with the storage medium 802 via the bus 803, and the processor 801 executes the machine-readable instructions, and the processor 801 executes the preamble of the method item to execute the steps in the above-mentioned data processing method.

[0112] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program is executed when a processor is running, and the processor executes the steps in the above-mentioned data processing method.

[0113] In the embodiment of the present application, the computer program can also execute other machine-readable instructions when run by the processor to execute other methods described in the embodiment. For the specific execution method steps and principles, please refer to the description of the embodiment, which will not be repeated here.

[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0117] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, ROM (Read-Only Memory), RAM (Random Access Memory), disk or optical disk, and other media that can store program codes.

[0118] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0119] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A data processing method, characterized in that: include: Receive and execute a test request to obtain a test transaction identifier generated by the in-memory database for the test request, wherein the test request includes: a request identifier; Establishing an association relationship pair between the request identifier and the test transaction identifier; Acquire data change information of the memory database, where the data change information is generated after the memory database performs a data operation, and the data change information includes: an operation transaction identifier and at least one post-operation data; A test result of the test request is determined according to the request identifier of the test request, the association relationship pair, and the data change information.

2. The method according to claim 1, characterized in that The receiving and executing the test request to obtain a test transaction identifier generated by the in-memory database for the test request includes: Execute the test request, and submit a database transaction request to the in-memory database according to the test request, the in-memory database generates an operation transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request, and uses the operation transaction identifier of the database transaction request as the test transaction identifier.

3. The method according to claim 2, characterized in that The process of generating, by the memory database, a transaction identifier corresponding to the database transaction request according to the operation type of the test operation in the database transaction request includes: If the operation type of the test operation is addition, deletion or modification, the in-memory database generates an operation transaction identifier of the test request; If the operation type of the test operation is query, the operation transaction identifier of the test request is not generated.

4. The method according to claim 1, characterized in that: The process of generating the data change information after the memory database performs data operation includes: The memory database is checked. If the data in the memory database is changed, the changed data is used as post-operation data, and an operation transaction identifier corresponding to the post-operation data is obtained, and the post-operation data and the operation transaction identifier are used as data change information.

5. The method according to claim 1, characterized in that The determining, according to the request identifier of the test request, the association relationship pair, and the data change information, a test result of the test request includes: Determine the data change information corresponding to the test request according to the request identifier of the test request, each of the association relationship pairs and the data change information; A test result of the test request is determined according to the request identifier of the test request and the data change information of the test request.

6. The method according to claim 5, characterized in that The determining the data change information corresponding to the test request according to the request identifier of the test request, each of the association relationship pairs and the data change information includes: Determine at least one first association relationship pair of the test request according to the request identifier of the test request and each of the association relationship pairs; The data change information of the test request is determined according to the test transaction identifier in each of the first association relationship pairs and the operation transaction identifier in the data change information.

7. The method according to claim 6, characterized in that The determining the data change information of the test request according to the test transaction identifier in each of the first association relationship pairs and the operation transaction identifier in the data change information includes: Each of the data change information is traversed, and if the operation transaction identifier of the current data change information is the same as the test transaction identifier in the first association relationship pair, the current data change information is used as the data change information of the test request.

8. The method according to claim 5, characterized in that The determining, according to the request identifier of the test request and the data change information of the test request, a test result of the test request includes: Determining an expected change value and pre-operation data of the test request according to a request identifier of the test request; Calculating the difference between the post-operation data and the pre-operation data, and using the difference as the actual change value of the test request; A test result of the test request is determined according to the expected change value of the test request and the actual change value.

9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the data processing method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 8 are executed.

11. A computer program product, characterized in that The computer program product comprises computer program codes. When the computer program codes are executed by a computing device, the computing device executes the steps of the data processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data processing method, apparatus and server

    CN109241014A

  • Data processing method and device, equipment and storage medium

    CN115934737A

  • Information generation method and device, electronic equipment and storage medium

    CN117951000A

  • Software system validity testing

    US20150212920A1