Business system testing method and device, equipment, storage medium and program product
By obtaining the actual dependency data and results from the original business system and comparing the processing results of the system under test using a message queue, the accuracy problem existing in manual testing was solved, and more accurate test results were achieved.
Patent Information
- Application Number
- CN202511662005.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-24
AI Technical Summary
In existing technologies, manual testing methods for updated software systems suffer from inaccurate test results, especially due to human error, flawed test case design, or discrepancies between test data and the actual business environment.
By obtaining the actual dependency data and results of the original business system in processing business requests, and using a message queue to send the requests and data to the system under test, the processing results of the original system and the system under test are compared to determine the test results, thus avoiding the impact of manual simulation and test case design defects.
This improves the accuracy of test results, ensuring that test results are compared with real data and verified processing results, and reduces the impact of test errors and human error.
Smart Images

Figure CN121560741A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a business system testing method, apparatus, equipment, storage medium, and program product. Background Technology
[0002] With the comprehensive promotion of the information technology application innovation (ITAI) industry, various industries have begun to fully upgrade their existing IT infrastructure, application systems, hardware equipment, and software systems to meet the standards and requirements of ITAI, in order to achieve independent control and ensure information security. After the software system is updated, it needs to be tested. Only after the usability tests of each function in the software system pass can the updated software system be allowed to go online and be used.
[0003] In existing technologies, testing relies on manual operation to simulate test data, and test cases are executed using simulated test data to obtain test results, which results in inaccurate test results. Summary of the Invention
[0004] Therefore, it is necessary to provide a business system testing method, apparatus, equipment, storage medium, and program product that can improve the accuracy of test results during the testing process, addressing the aforementioned technical problems.
[0005] Firstly, this application provides a business system testing method, including:
[0006] Upon receiving a business request from the terminal, and when processing the business request requires dependent data, the system obtains the dependent data required by the original business system to process the business request and the first processing result obtained from processing the business request; the dependent data is the real user data associated with the business request stored in the external system and the data provided to the original business system.
[0007] The business request and dependency data are sent to the business system under test using a message queue; the business system under test is the system obtained by updating the original business system.
[0008] Receive the second processing result sent by the business system under test; the second processing result is obtained by the business system under test based on the dependency data processing business request.
[0009] The test results of the business system to be tested are determined based on the first and second processing results.
[0010] In one embodiment, the number of business requests is multiple, and the test result of the business system is determined based on the first processing result and the second processing result, including:
[0011] For each business request, determine the comparison result between the first processing result and the second processing result corresponding to the business request;
[0012] Generate test result reports based on the comparison results corresponding to each business request;
[0013] Determine the test results of the business system to be tested based on the test result report.
[0014] In one embodiment, determining the test results of the business system under test based on the test result report includes:
[0015] If the consistency rate of the comparison results within the preset time period in the test results report is greater than or equal to the preset threshold, then the test result of the business system under test is determined to be a successful test.
[0016] In one embodiment, the business system testing method further includes:
[0017] Obtain the business type of the business request;
[0018] If the business type is consistent with the preset business type, it is determined that the business request requires dependent data.
[0019] In one embodiment, the business system testing method further includes:
[0020] When processing business requests does not require data, the business requests are sent to the original business system and the business system to be tested respectively to obtain the first processing result and the second processing result.
[0021] The test results of the business system to be tested are determined based on the first and second processing results.
[0022] In one embodiment, the business system testing method further includes:
[0023] When the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request.
[0024] Input the business request, the first processing result, the second processing result, the first log information, and the second log information into the anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
[0025] Secondly, this application also provides a business system testing apparatus, comprising:
[0026] The acquisition module is used to acquire the dependent data required by the original business system to process the business request and the first processing result obtained from processing the business request when a business request is received from the terminal and the processing of the business request requires dependent data. The dependent data is the real user data associated with the business request stored in the external system and provided to the original business system.
[0027] The sending module is used to send business requests and dependency data to the business system under test based on a message queue; the business system under test is the system obtained by updating the original business system.
[0028] The receiving module is used to receive the second processing result sent by the business system under test; the second processing result is obtained by the business system under test based on the dependency data processing business request.
[0029] The determination module is used to determine the test results of the business system to be tested based on the first processing result and the second processing result.
[0030] In one embodiment, the determining module is specifically used to determine, for each business request, a comparison result between the first processing result and the second processing result corresponding to the business request; generate a test result report based on the comparison result corresponding to each business request; and determine the test result of the business system to be tested based on the test result report.
[0031] In one embodiment, the determining module is specifically used to determine that the test result of the business system under test is passed if the consistency rate of the comparison results within a preset time period in the test result report is greater than or equal to a preset threshold.
[0032] In one embodiment, the acquisition module is further configured to acquire the business type of the business request; if the business type is consistent with the preset business type, it determines that the processing of the business request requires dependent data.
[0033] In one embodiment, the determining module is further configured to send the business request to the original business system and the business system to be tested respectively when processing the business request does not require data, so as to obtain a first processing result and a second processing result; and determine the test result of the business system to be tested based on the first processing result and the second processing result.
[0034] In one embodiment, the determining module is further configured to, when the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request; input the business request, the first processing result, the second processing result, the first log information and the second log information into the anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
[0035] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in any of the first aspects above.
[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the methods described in the first aspect. Fifthly, this application also provides a computer program product comprising a computer program that, when executed by a processor, implements any of the methods described in the first aspect.
[0037] The aforementioned business system testing methods, apparatus, equipment, storage media, and program products, upon receiving a business request from a terminal and finding that processing the request requires dependent data, acquire the dependent data required by the original business system to process the request and the first processing result obtained from processing the request. The dependent data consists of real user data associated with the business request stored in an external system and provided to the original business system. The business request and dependent data are sent to the business system under test via a message queue. The business system under test is a system obtained by updating the original business system. A second processing result is received from the business system under test, obtained by processing the business request based on the dependent data. The test result of the business system under test is determined based on the first and second processing results. However, in existing technologies, manual testing is prone to operational errors. For example, the designed test cases may have defects, or the manually simulated test data may contain errors, or the amount of test data may differ significantly from the amount of data in the actual business environment. These factors can lead to inaccurate test results. Compared to existing technologies, the aforementioned business system testing method offers several advantages. First, since the first processing result is obtained from the original business system's handling of the business request, its correctness has been verified multiple times. By comparing the second processing result with the first, rather than comparing it with the expected result designed in the test case, the impact of test case design flaws on the test results is avoided. The test result of the business system under test can be accurately determined based on the comparison between the second and first processing results. Second, when processing business requests requires dependent data, the original business system can first process the business request to obtain the actual dependent data required during processing. Then, the business system obtained after the IT innovation transformation is tested based on the actual dependent data and the business request. The second processing result corresponding to the system under test is determined based on the actual business request and actual dependent data received from the terminal, which avoids the impact of test case design flaws and incorrect test data on the test results, thus improving the accuracy of the test results. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is an application environment diagram of a business system testing method in one embodiment;
[0040] Figure 2 This is a flowchart illustrating a business system testing method in one embodiment;
[0041] Figure 3 This is a flowchart illustrating the steps for determining the test results of a business system in one embodiment.
[0042] Figure 4 This is a flowchart illustrating a business system testing method in another embodiment;
[0043] Figure 5 This is a flowchart illustrating a business system testing method in another embodiment;
[0044] Figure 6 This is a flowchart illustrating a business system testing method in another embodiment;
[0045] Figure 7 This is a flowchart illustrating a business system testing method in another embodiment;
[0046] Figure 8 This is a schematic diagram of the system architecture of a business system testing method in one embodiment;
[0047] Figure 9 This is a structural block diagram of a business system testing device in one embodiment;
[0048] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. It should be noted that existing industry solutions such as software, components, and models may be mentioned in the embodiments of this application. These should be considered exemplary and are intended only to illustrate the feasibility of implementing the technical solutions of this application, but do not imply that the applicant has already used or necessarily used such solutions.
[0050] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations. The acquisition, storage, use and processing of data in the technical solution of this application all comply with the relevant provisions of national laws and regulations.
[0051] The terms "first," "second," etc., used in this application may be used to describe various elements, but these elements are not limited by these terms. These terms are used only to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0052] The business system testing method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. When server 104 receives a business request from terminal 102, and processing the business request requires dependent data, it obtains the dependent data required by the original business system to process the business request and the first processing result obtained from processing the business request. The dependent data is real user data associated with the business request stored in an external system and provided to the original business system. The server 104 sends the business request and dependent data to the business system under test based on a message queue. The business system under test is a system obtained by updating the original business system. The server 104 receives the second processing result sent by the business system under test. The second processing result is obtained by the business system under test processing the business request based on the dependent data. The server 104 determines the test result of the business system under test based on the first and second processing results. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0053] In one exemplary embodiment, such as Figure 2 As shown, a business system testing method is provided, which is applied to... Figure 1 Taking the server in the example, the explanation includes the following steps 202 to 206. Wherein:
[0054] Step 201: Upon receiving a business request from the terminal, and when processing the business request requires dependent data, obtain the dependent data required by the original business system to process the business request and the first processing result obtained from processing the business request; the dependent data is the real user data associated with the business request stored in the external system and the data provided to the original business system.
[0055] Among them, the original business system is the system that has been launched and put into use. The real user data can include the user's real identity information, resource value, credit score and risk level, etc. For example, identity information can include personal attribute information (such as account ID, gender, age, etc.) and identity verification information (such as facial information, fingerprints and other biometric features), and resource value can include resource borrowing value, resource transfer value, resource gain data, etc.
[0056] After receiving a service request from a terminal, the server can determine whether processing the service request requires data based on the service type of the request, or it can obtain the request parameters carried in the service request, combine the request parameters and match them with preset rules to determine whether processing the service request requires data.
[0057] It is understandable that both the business type that requires data and the corresponding preset rules can be determined in advance by staff based on the business logic corresponding to the business request and set according to the actual situation.
[0058] Optionally, when processing business requests, the original business system may need to call external interfaces to receive dependent data from downstream systems (external systems). Taking the business request as a resource borrowing business as an example, when processing the resource borrowing business, the original business system may need to query dependent data such as the user's real resource value or the user's credit score from the external system, and then process the resource borrowing business based on the dependent data. The real resource value may include the real resource borrowing value, the real resource transfer value, etc.
[0059] The original business system can store the received dependency data in a database or cache. The server can query the database or cache according to the business request to obtain the dependency data. Alternatively, the server can monitor the original business system and record the dependency data provided by the external system when the original business system processes the business request in real time, thereby obtaining the dependency data.
[0060] The first processing result may include the final output result, or it may include both the final output result and the intermediate process results.
[0061] For example, taking the case where the original business system requires multiple processing steps to process a business request, the original business system can record each step and the intermediate process result corresponding to that step according to the order of the processing steps, and record the final output result after all processing steps are executed.
[0062] Step 202: Send the business request and dependency data to the business system to be tested based on the message queue; the business system to be tested is the system obtained by updating the original business system.
[0063] Optionally, after the original business system has processed the business request, the server can send the business request and the corresponding dependency data to the business system under test, so that the business system under test can process the business request based on the dependency data.
[0064] On the one hand, when the business system under test processes business requests based on dependency data, the impact of test data on the test results can be avoided during the processing. On the other hand, the original business system and the business system under test can be isolated, so that the business system under test does not affect the original business system.
[0065] The server sends business requests and dependency data based on a message queue. In high-concurrency scenarios, it can efficiently and accurately send multiple business requests and their corresponding dependency data to the business system under test. Alternatively, when the amount of dependency data corresponding to a business request is large, it can also effectively send the dependency data to the business system under test.
[0066] For example, message queues may include RabbitMQ, Kafka, RocketMQ, etc.
[0067] Step 203: Receive the second processing result sent by the business system under test; the second processing result is obtained by the business system under test based on the dependency data processing business request.
[0068] When a business system under test receives dependency data and a business request, it stores the dependency data in the database or cache of the server where it is deployed (e.g., the test environment), and then processes the business request based on the dependency data.
[0069] Taking the business request as an example, when the business system under test processes the resource borrowing business, it can conduct business testing based on the dependency data already obtained by the original business system in the process of processing the business request. There is no need to query the user's real resource value or user credit score from external systems, nor is there a need to rely on the testers to simulate the corresponding user's real resource value or credit score.
[0070] Optionally, the server obtains the second processing result of the business request based on dependency data processing of the business system under test. Similarly, the processing result may include the final output result, or it may include the final output result and the intermediate process results.
[0071] Step 204: Determine the test results of the business system to be tested based on the first processing result and the second processing result.
[0072] Optionally, the first processing result can be compared with the second processing result, and the test result of the business system to be tested can be determined based on the comparison result.
[0073] Specifically, if the comparison results are consistent, the test result of the business logic corresponding to the business request in the business system under test can be determined. If the comparison results are inconsistent, the test result of the business logic corresponding to the business request in the business system under test can be determined as failing.
[0074] Understandably, based on the first and second processing results of a business request, the functional test result for that business request can be obtained. However, the test result of the business system under test needs to be determined based on the first and second processing results corresponding to various different business requests.
[0075] The aforementioned business system testing methods, apparatus, equipment, storage media, and program products, upon receiving a business request from a terminal and finding that processing the request requires dependent data, acquire the dependent data required by the original business system to process the request and the first processing result obtained from processing the request. The dependent data consists of real user data associated with the business request stored in an external system and provided to the original business system. The business request and dependent data are sent to the business system under test via a message queue. The business system under test is a system obtained by updating the original business system. A second processing result is received from the business system under test, obtained by processing the business request based on the dependent data. The test result of the business system under test is determined based on the first and second processing results. However, in existing technologies, manual testing is prone to operational errors. For example, the designed test cases may have defects, or the manually simulated test data may contain errors, or the amount of test data may differ significantly from the amount of data in the actual business environment. These factors can lead to inaccurate test results. Compared to existing technologies, the aforementioned business system testing method offers several advantages. First, since the first processing result is obtained from the original business system's handling of the business request, its correctness has been verified multiple times. By comparing the second processing result with the first, rather than comparing it with the expected result designed in the test case, the impact of test case design flaws on the test results is avoided. The test result of the business system under test can be accurately determined based on the comparison between the second and first processing results. Second, when processing business requests requires dependent data, the original business system can first process the business request to obtain the actual dependent data required during processing. Then, the business system obtained after the IT innovation transformation is tested based on the actual dependent data and the business request. The second processing result corresponding to the system under test is determined based on the actual business request and actual dependent data received from the terminal, which avoids the impact of test case design flaws and incorrect test data on the test results, thus improving the accuracy of the test results.
[0076] The following explains how to determine whether data dependency is needed when processing business requests. In an exemplary embodiment, such as... Figure 3 As shown, optionally, the business system testing method further includes steps 301 to 302. Wherein:
[0077] Step 301: Obtain the business type of the business request.
[0078] In one possible implementation, the service type can be determined based on the service identifier carried in the service request. After receiving the service request, the server can read the service identifier field in the service request and determine the service type based on the value corresponding to the service identifier field.
[0079] In another possible implementation, the server assigns different interface paths to different business types. The business type of the business request can be determined by parsing the Uniform Resource Locator Path (URL) path of the business request and the URL path and a preset mapping table. The mapping table includes multiple sets of correspondences between different business types and URL paths.
[0080] Step 302: If the business type is consistent with the preset business type, determine the data that needs to be used to process the business request.
[0081] The preset business type can be the business type corresponding to the target business request that requires the data. There can be multiple preset business types, while the target business request can be determined by the staff according to the corresponding business processing logic.
[0082] For example, the preset business types may include resource transfer business types, resource borrowing business types, registration business types, etc. Taking the resource borrowing business type as an example, when processing this type of business request, it may be necessary to query the user's real resource value or the user's credit score and other dependent data from the external system, and then process the resource borrowing business based on the dependent data.
[0083] Optionally, preset business types can be pre-stored in a database or other types of storage media. Taking the example of storing preset business types in a database, the business type can be used as a query condition to determine the corresponding Structured Query Language (SQL). The database is queried according to the SQL and the query results are obtained. When the query results are not empty, it can be determined that the business type is consistent with the preset business type, and the processing of business requests requires data; when the query results are empty, it indicates that the business type is not in the preset business type, and the processing of business requests does not require data.
[0084] The above method obtains the business type of the business request. If the business type matches the preset business type, it determines the data required to process the business request. Based on the business type, it can quickly determine whether the dependent data needs to be sent to the business system under test for testing, thus improving testing efficiency and accuracy.
[0085] In one exemplary embodiment, such as Figure 4 As shown, optionally, the number of business requests is multiple. The test result of the business system is determined based on the first processing result and the second processing result, including the following steps 401 to 403. Wherein:
[0086] Step 401: For each business request, determine the comparison result between the first processing result and the second processing result corresponding to the business request.
[0087] For a business request, the server can obtain a second processing result after the business system under test processes the business request, and compare the second processing result with the first processing result corresponding to the original business system's processing of the business request to determine the comparison result.
[0088] Optionally, for each service request, the server can periodically compare the first processing result and the second processing result corresponding to each service request in batches to determine multiple comparison results, or it can compare the first processing result and the second processing result corresponding to each service request in real time. This application embodiment does not limit this.
[0089] For example, the server can periodically determine the comparison result corresponding to each business request received within a preset time interval.
[0090] Step 402: Generate a test result report based on the comparison results corresponding to each business request.
[0091] Among them, the test result report can be a document or visual report generated by integrating scattered test information (such as business requests, comparison results, test time, etc.) in a standardized format after the comparison results are determined.
[0092] In one possible implementation, after determining the comparison results corresponding to one or a batch of business requests, the server can generate a test result report based on a preset report template and each comparison result.
[0093] In another possible implementation, after determining the comparison result corresponding to each business request, the server can send each comparison result to the data warehouse or data lake, and the data warehouse can generate test result reports based on each comparison result.
[0094] Step 403: Determine the test results of the business system to be tested based on the test result report.
[0095] In one possible implementation, if the consistency rate of the comparison results within a preset time period in the test results report is greater than or equal to a preset threshold, then the test result of the business system under test is determined to be a successful test.
[0096] The preset time period can be the most recent period. For example, the preset threshold can be 100% or 99.999%. If the consistency rate of the comparison results of each business request in the recent period in the test result report is greater than or equal to the preset threshold, it indicates that for any business request, the second processing result corresponding to the business system under test is the same as the first processing result corresponding to the original business system. The business logic of the business system under test is correct. Therefore, the test result can be determined as a successful test.
[0097] In another possible implementation, if the consistency rate of the comparison results for different business types in the test results report is greater than or equal to a preset threshold, then the test result of the business system under test is determined to be a successful test.
[0098] For each business request, the comparison result between the first processing result and the second processing result is determined. A test result report is generated based on the comparison result of each business request. The test result report is used to determine the test result of the business system under test. By testing multiple business requests and generating a test result report, the test result can be determined intuitively based on the test result report. This also avoids the occurrence of test randomness and improves the accuracy of the test result.
[0099] In one exemplary embodiment, such as Figure 5 As shown, optionally, the business system testing method further includes steps 501 to 502. Wherein:
[0100] Step 501: When the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request.
[0101] When the first and second processing results differ, it indicates that the updated test system has an anomaly in its business logic when processing business requests, and the corresponding function fails the test. It is necessary to locate the cause of the anomaly and determine why the first and second processing results differ.
[0102] Log information can refer to text or structured data that is automatically recorded by the original business system or the business system under test during operation according to preset rules, including key events, operations, status changes, and error details. Therefore, by obtaining log information, the cause of the anomaly can be located based on the log information.
[0103] The first and second log information are stored on the server's local disk. The first and second log information corresponding to a business request can be obtained based on a preset target log. Alternatively, the first and second log information can be stored in a centralized log system. The server can send query requests to the centralized log system and receive the first and second log information sent by the centralized log system.
[0104] Step 502: Input the business request, the first processing result, the second processing result, the first log information, and the second log information into the anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
[0105] Anomaly analysis models can be trained using any neural network model framework and a training dataset. This training dataset includes multiple training input data and anomaly cause labels corresponding to each training input data. Each training input data includes a sample business request, the first processing result of the sample business request, the second processing result of the sample, the first log information of the sample, and the second log information of the sample. In this way, during the training of the anomaly analysis model based on the training dataset, the anomaly analysis model can fully learn the mapping relationship between the training input data and the corresponding anomaly cause labels.
[0106] Once the anomaly analysis model is trained, the business request, the first processing result, the second processing result, the first log information, and the second log information are input into the anomaly analysis model. The anomaly analysis model can then output the corresponding anomaly cause based on the learned mapping relationship.
[0107] When the first processing result and the second processing result are different, the first log information of the original business system when processing the business request and the second log information of the business system under test when processing the business request are obtained. The business request, the first processing result, the second processing result, the first log information and the second log information are input into the anomaly analysis model. The cause of the anomaly is determined based on the output of the anomaly analysis model. When the test result indicates that there is an anomaly in the business system under test, the cause of the anomaly can be quickly and accurately located based on the processing result, log information and anomaly analysis model, so that the developers can update the business system under test according to the cause of the anomaly.
[0108] The above embodiments describe a testing method for a business system when processing business requests requires data. However, when the business type differs from the preset business type, i.e., when it is determined that processing business requests does not require data, such as... Figure 6 As shown, optionally, the business system testing method also includes:
[0109] Step 601: If processing a business request does not require data, send the business request to the original business system and the business system to be tested respectively to obtain the first processing result and the second processing result.
[0110] Optionally, when the business type of the business request is inconsistent with the preset business type, the business system may not need to obtain relevant data from the external system when processing the business request. It can process the request parameters carried in the business request based on the business logic in the business system to obtain the processing result. The business system includes the original business system and the business system to be tested. The processing result may also include a first processing result and a second processing result.
[0111] The server can send the received business requests to the original business system and the business system under test respectively, and then receive the first processing result obtained by the original business system from processing the business requests, and the second processing result obtained by the business system under test from processing the business requests respectively.
[0112] Step 602: Determine the test results of the business system to be tested based on the first processing result and the second processing result.
[0113] The specific implementation method of step 602 can be referred to the above embodiments, and will not be repeated here.
[0114] In the scenario described above, where processing business requests does not rely on data, the business requests are sent to both the original business system and the business system under test to obtain a first processing result and a second processing result. The test result of the business system under test is then determined based on the first and second processing results. In this way, the test result of the business system under test can be accurately determined by comparing whether the second processing result is the same as the first processing result.
[0115] As an optional implementation method, such as Figure 7 As shown, the business system testing method provided in this application embodiment may include the following specific steps:
[0116] Step 701: Receive the service requests sent by the terminal and obtain the service type of each service request.
[0117] Step 702: If the business type is inconsistent with the preset business type, send the business request to the original business system and the business system to be tested respectively to obtain the first processing result and the second processing result.
[0118] Step 703: If the business type is consistent with the preset business type, determine the data that needs to be used to process the business request.
[0119] Step 704: Obtain the dependency data required by the original business system to process the business request and the first processing result obtained from processing the business request; the dependency data is the real user data associated with the business request stored in the external system and the data provided to the original business system.
[0120] Step 705: Send the business request and dependency data to the business system to be tested based on the message queue; the business system to be tested is the system obtained by updating the original business system.
[0121] Step 706: Receive the second processing result sent by the business system under test; the second processing result is obtained by the business system under test based on the dependency data processing business request.
[0122] Step 707: For each business request, determine the comparison result between the first processing result and the second processing result corresponding to the business request.
[0123] Step 708: When the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request.
[0124] Step 709: Input the business request, the first processing result, the second processing result, the first log information, and the second log information into the anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
[0125] Step 710: Generate a test result report based on the comparison results corresponding to each business request.
[0126] Step 711: If the consistency rate of the comparison results within the preset time period in the test result report is greater than or equal to the preset threshold, then the test result of the business system under test is determined to be a successful test.
[0127] For example, such as Figure 8 The diagram illustrates the system architecture of the aforementioned business system testing method. After receiving a business request, the server sends it to the original business system. The original business system, in processing the request, calls an external system (downstream system) to obtain the necessary dependency data. It can then retrieve the dependency data and the corresponding first processing result from the original business system. Finally, it sends the business request and the obtained dependency data to the business system under test via a message queue, and retrieves the second processing result obtained by the business system under test based on the dependency data. Periodically, the first and second processing results corresponding to each business request are pushed in batches to the data warehouse. The comparison between the first and second processing results for each business request is determined, and a test result report is generated. Based on the test result report, the test result of the business system under test is determined, thus achieving the testing of the business system under test.
[0128] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0129] Based on the same inventive concept, this application also provides a business system testing apparatus for implementing the business system testing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more business system testing apparatus embodiments provided below can be found in the limitations of the business system testing method described above, and will not be repeated here.
[0130] In one exemplary embodiment, such as Figure 9 As shown, a business system testing apparatus is provided, comprising: an acquisition module 901, a sending module 902, a receiving module 903, and a determining module 904, wherein:
[0131] The acquisition module 901 is used to acquire the dependent data required by the original business system to process the business request and the first processing result obtained by processing the business request when it receives a business request sent by the terminal and the processing of the business request requires dependent data; the dependent data is the real user data associated with the business request stored in the external system and the data provided to the original business system.
[0132] The sending module 902 is used to send business requests and dependency data to the business system under test based on a message queue; the business system under test is a system obtained by updating the original business system;
[0133] The receiving module 903 is used to receive the second processing result sent by the business system under test; the second processing result is obtained by the business system under test based on the dependent data processing business request.
[0134] The determination module 904 is used to determine the test results of the business system to be tested based on the first processing result and the second processing result.
[0135] In one embodiment, the determining module 904 is specifically used to determine, for each business request, the comparison result between the first processing result and the second processing result corresponding to the business request; generate a test result report based on the comparison result corresponding to each business request; and determine the test result of the business system to be tested based on the test result report.
[0136] In one embodiment, the determining module 904 is specifically used to determine that the test result of the business system under test is passed if the consistency rate of the comparison results within a preset time period in the test result report is greater than or equal to a preset threshold.
[0137] In one embodiment, the acquisition module 901 is further configured to acquire the business type of the business request; if the business type is consistent with the preset business type, it is determined that the processing of the business request requires dependent data.
[0138] In one embodiment, the determining module 904 is further configured to send the business request to the original business system and the business system to be tested respectively when processing the business request does not require data, so as to obtain a first processing result and a second processing result; and determine the test result of the business system to be tested based on the first processing result and the second processing result.
[0139] In one embodiment, the determining module 904 is further configured to, when the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request; input the business request, the first processing result, the second processing result, the first log information and the second log information into the anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
[0140] Each module in the aforementioned business system testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the operations corresponding to each module.
[0141] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to business system testing. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a business system testing method.
[0142] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0143] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described in any of the above method embodiments.
[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps described in any of the above method embodiments.
[0145] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps described in any of the above method embodiments.
[0146] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0147] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A business system testing method, characterized in that, The method includes: Upon receiving a service request from a terminal, and when processing the service request requires dependent data, the system obtains the dependent data required by the original business system to process the service request and the first processing result obtained from processing the service request; the dependent data is real user data associated with the service request stored in an external system and provided to the original business system. The business request and the dependency data are sent to the business system under test using a message queue; the business system under test is a system obtained by updating the original business system. Receive a second processing result sent by the business system under test; the second processing result is obtained by the business system under test processing the business request based on the dependency data. The test results of the business system to be tested are determined based on the first processing result and the second processing result.
2. The method according to claim 1, characterized in that, The number of business requests is multiple, and determining the test result of the business system based on the first processing result and the second processing result includes: For each of the aforementioned service requests, a comparison result is determined between the first processing result and the second processing result corresponding to the service request; Generate a test result report based on the comparison results corresponding to each of the aforementioned business requests; The test results of the business system to be tested are determined based on the test result report.
3. The method according to claim 2, characterized in that, Determining the test result of the business system under test based on the test result report includes: If the consistency rate of the comparison results within the preset time period in the test result report is greater than or equal to the preset threshold, then the test result of the business system under test is determined to be a successful test.
4. The method according to claim 1, characterized in that, The method further includes: Obtain the business type of the business request; If the business type is consistent with the preset business type, it is determined that the dependent data is required to process the business request.
5. The method according to claim 4, characterized in that, The method further includes: If the dependent data is not required to process the business request, the business request is sent to the original business system and the business system to be tested respectively to obtain the first processing result and the second processing result; The test results of the business system to be tested are determined based on the first processing result and the second processing result.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: When the first processing result and the second processing result are different, obtain the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request. The business request, the first processing result, the second processing result, the first log information, and the second log information are input into the anomaly analysis model, and the cause of the anomaly is determined based on the output of the anomaly analysis model.
7. A business system testing device, characterized in that, The device includes: The acquisition module is used to acquire, upon receiving a service request sent by a terminal and when processing the service request requires dependent data, the dependent data required by the original business system to process the service request and the first processing result obtained from processing the service request; the dependent data is real user data associated with the service request stored in an external system and provided to the original business system. The sending module is used to send the business request and the dependency data to the business system to be tested based on a message queue; the business system to be tested is a system obtained by updating the original business system; A receiving module is configured to receive a second processing result sent by the business system under test; the second processing result is obtained by the business system under test processing the business request based on the dependency data. The determination module is used to determine the test result of the business system to be tested based on the first processing result and the second processing result.
8. The apparatus according to claim 7, characterized in that, The determining module is specifically used to determine, for each of the business requests, the comparison result between the first processing result and the second processing result corresponding to the business request; and to generate a test result report based on the comparison result corresponding to each of the business requests. The test results of the business system to be tested are determined based on the test result report.
9. The apparatus according to claim 8, characterized in that, The determining module is specifically used to determine that the test result of the business system under test is passed if the consistency rate of the comparison results within a preset time period in the test result report is greater than or equal to a preset threshold.
10. The apparatus according to claim 7, characterized in that, The acquisition module is further configured to acquire the business type of the business request; and if the business type is consistent with the preset business type, determine that the dependent data is required to process the business request.
11. The apparatus according to claim 10, characterized in that, The determining module is further configured to send the business request to the original business system and the business system to be tested respectively when the dependent data is not required to process the business request, so as to obtain the first processing result and the second processing result; The test results of the business system to be tested are determined based on the first processing result and the second processing result.
12. The apparatus according to any one of claims 7 to 11, wherein the determining module is further configured to, when the first processing result and the second processing result are different, acquire the first log information of the original business system when processing the business request and the second log information of the business system to be tested when processing the business request; input the business request, the first processing result, the second processing result, the first log information and the second log information into an anomaly analysis model, and determine the cause of the anomaly based on the output of the anomaly analysis model.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.