Platform testing method and device, computer readable storage medium and electronic device
By processing business requests within a target time frame and separating data synchronization and business processing on the simulation platform, the problem of data inconsistency in simulation platform testing was resolved, resulting in more accurate test results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2022-11-29
- Publication Date
- 2026-07-07
AI Technical Summary
During system reconstruction, there is a time lag in data synchronization between the simulation platform and the native system, which leads to data inconsistency and affects test results. Existing technologies have not been able to effectively solve this problem.
By processing business requests within the target time frame, the data synchronization and business processing processes of the simulation platform are executed separately. Business processing is paused to ensure the accuracy of data synchronization, and the test results are determined using the data and time points of the target platform.
This improved the accuracy of platform testing, avoided data loss or errors caused by business processing during data synchronization, and ensured the accuracy of business processing results.
Smart Images

Figure CN115658453B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the financial field or other fields, and more specifically, to a platform testing method, apparatus, computer-readable storage medium, and electronic device. Background Technology
[0002] Currently, relevant organizations typically use centralized systems for external services. To meet business needs or respond to relevant calls for action, it is necessary to refactor the mainframe and transition to a distributed open platform architecture. During the system refactoring process, ensuring that the refactored system maintains functional consistency with the original system can only be verified through testing. To reduce system risks and achieve a smooth transition, a simulation platform system solution is usually adopted. This involves building a distributed simulation platform system based on the functionality of the native mainframe system. When the native mainframe system initiates a transaction, it calls the services of the simulation platform system, enabling the parallel operation of the native and simulation systems. Even if the simulation platform system fails, it will not affect the native mainframe system.
[0003] During simulation, to ensure the accuracy of the simulation data, data from the production host (i.e., the native host) is periodically synchronized to the simulation environment. However, this periodic synchronization of production host data to overwrite simulation environment data presents challenges. Due to the large number of data tables, the large data volume, differences in production host and simulation times, production and simulation service response times, network latency, and the time lag between data updates in the simulation and native systems (the native host system supports 24 / 7 uninterrupted service with real-time dynamic changes on both sides), especially in high-concurrency scenarios, it is difficult to guarantee that the data synchronized to the simulation environment or the order of simulation service calls is completely consistent with the actual production environment. This can compromise the accuracy of various data synchronization methods, leading to deviations in simulation results and ultimately affecting test performance.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides a platform testing method, apparatus, computer-readable storage medium, and electronic device to at least solve the technical problem of low testing accuracy in related technologies when testing simulation platforms, as the simulation platform simultaneously performs data synchronization and business processing.
[0006] According to one aspect of the present invention, a platform testing method is provided, applied to a simulation platform, comprising: acquiring a plurality of first service requests sent by a target platform, and acquiring target data sent by the target platform during the Nth synchronization data, wherein the target platform is used to process the service requests to provide services externally, the target data is the data required by the target platform to process the service requests, and N is a positive integer; determining a target time range based on a first time and a second time, and processing at least one first service request within the target time range to obtain a processing result, wherein the first time is the time when the target platform completes the Nth synchronization data, the second time is the time when the target platform starts the N+1th synchronization data, and the function of the simulation platform is at least partially the same as the function of the target platform; and determining a test result for testing the simulation platform based on the processing result, wherein the test result is used to determine whether the simulation platform is used to provide services externally.
[0007] Furthermore, the platform testing method also includes: within a target time range, based on target data, determining at least one second business request from multiple first business requests, wherein the target data includes the data required to process the second business request; determining the request time of each second business request and the data synchronization time for processing the data required for each second business request; based on the request time and data synchronization time corresponding to each second business request, determining at least one third business request from at least one second business request; processing at least one third business request to obtain a processing result.
[0008] Furthermore, the platform testing method also includes: if the request time corresponding to the target business request is later than the data synchronization time, then the target business request is determined to be a third business request, wherein the target business request is any second business request.
[0009] Furthermore, the platform testing method also includes: obtaining call information for at least one service sent by the target platform; determining the target service corresponding to each third business request; calling the target service to process at least one third business request and obtaining the processing result.
[0010] Furthermore, the platform testing method also includes: determining the processing order of at least one third business request based on the request time of at least one third business request; processing at least one third business request according to the processing order to obtain the processing result.
[0011] Furthermore, the platform testing method also includes: obtaining the target processing result of the target platform processing at least one first business request; comparing the processing result with the target processing result to obtain a comparison result; if the comparison result indicates that the processing result is the same as the target processing result, then the test result is determined as the first test result, wherein the first test result indicates that the simulation platform is allowed to provide services externally; if the comparison result indicates that the processing result is different from the target processing result, then the test result is determined as the second test result, wherein the second test result indicates that the simulation platform is prohibited from providing services externally.
[0012] Furthermore, the platform testing method also includes: responding to a data synchronization command to obtain the target data sent by the target platform during the Nth data synchronization, and / or, when the current time is the same as the target time, obtaining the target data sent by the target platform during the Nth data synchronization.
[0013] According to another aspect of the present invention, a platform testing apparatus is also provided, comprising: an acquisition module, configured to acquire a plurality of first service requests sent by a target platform, and to acquire target data sent by the target platform during the Nth synchronization data, wherein the target platform is used to process the service requests to provide services externally, the target data is the data required by the target platform to process the service requests, and N is a positive integer; a first determination module, configured to determine a target time range based on a first time and a second time, and process at least one first service request within the target time range to obtain a processing result, wherein the first time is the time when the target platform completes the Nth synchronization data, the second time is the time when the target platform starts the N+1th synchronization data, and the function of the simulation platform is at least partially the same as the function of the target platform; and a second determination module, configured to determine a test result for testing the simulation platform based on the processing result, wherein the test result is used to determine whether to use the simulation platform to provide services externally.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described platform testing method at runtime.
[0015] According to another aspect of the present invention, an electronic device is also provided, the electronic device including one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to run the programs, wherein the programs are configured to execute the platform testing method described above during runtime.
[0016] In this embodiment of the invention, the data synchronization process and business processing process of the simulation platform are executed separately. Multiple first business requests sent by the target platform are acquired, as well as the target data sent by the target platform during the Nth data synchronization. Then, a target time range is determined based on a first time point and a second time point. At least one first business request is processed within the target time range to obtain a processing result. Based on the processing result, a test result for testing the simulation platform is determined. The target platform is used to process business requests to provide services externally. The target data is the data required by the target platform to process business requests. N is a positive integer. The first time point is the time when the target platform completes the Nth data synchronization, and the second time point is the time when the target platform begins the (N+1)th data synchronization. The simulation platform has at least partially the same functions as the target platform. The test result is used to determine whether to use the simulation platform to provide services externally.
[0017] In the above process, by processing at least one first business request within the target time frame, the business processing of the simulation platform is paused during data synchronization from the target platform to the simulation platform. This avoids data loss or errors caused by the simulation platform executing business requests during data synchronization, ensuring the accuracy of the business processing results. Furthermore, based on the aforementioned processing results, the test results for testing the simulation platform are determined, enabling effective testing of the simulation platform and thus improving the accuracy of platform testing.
[0018] Therefore, the solution provided in this application achieves the goal of separating the data synchronization process and the business processing process of the simulation platform, thereby improving the technical effect of platform testing accuracy and solving the technical problem of low testing accuracy when the simulation platform performs data synchronization and business processing simultaneously in related technologies. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0020] Figure 1 This is a schematic diagram of an optional platform testing method according to an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram of the operation of an optional target platform and simulation platform according to an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the operation of a simulation platform in the prior art;
[0023] Figure 4This is a schematic diagram of an optional simulation platform according to an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of the operation of an optional simulation platform according to an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram illustrating the relationship between an optional simulation replay pending task register, a simulation replay processed task register, and a simulation replay task supplement register according to an embodiment of the present invention.
[0026] Figure 7 This is a flowchart of an optional platform testing method according to an embodiment of the present invention;
[0027] Figure 8 This is a schematic diagram of an optional platform testing apparatus according to an embodiment of the present invention;
[0028] Figure 9 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should be noted that the platform testing methods, apparatus, computer-readable storage media and electronic devices provided in this disclosure can be used in the fintech field, or in any field other than fintech. The application fields of the platform testing methods, apparatus, computer-readable storage media and electronic devices provided in this disclosure are not limited.
[0032] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0033] Example 1
[0034] According to an embodiment of the present invention, an embodiment of a platform testing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] Figure 1 This is a schematic diagram of an optional platform testing method according to an embodiment of the present invention, such as... Figure 1 As shown, this method is applied to a simulation platform and includes the following steps:
[0036] Step S101: Obtain multiple first business requests sent by the target platform, and obtain the target data sent by the target platform during the Nth data synchronization. The target platform is used to process business requests to provide services to the outside world, and the target data is the data required by the target platform to process business requests. N is a positive integer.
[0037] Optionally, the target platform and simulation platform mentioned above should be described first. For example... Figure 2 As shown, the target platform is a production environment platform used to process business requests sent by the target organization and provide feedback on the processing results to the target organization, thereby providing services externally. The simulation platform is a platform built with reference to the functions of the target platform. When the target platform receives a business request, it can also send the business request to the simulation platform (e.g., ...). Figure 2 The simulation bypass shown allows the simulation platform to process the same business request. However, it should be noted that the processing result of the simulation platform does not feed back to the target structure, but is used as data to verify the functionality of the simulation platform. In an optional embodiment, the target platform is the platform currently used by the target institution, and the simulation platform is the platform to be used by the target institution. The target platform and the simulation platform can be used to process relevant business requests of financial institutions, such as transaction business.
[0038] Optionally, the data synchronization and business request processing process between the target platform and the simulation platform in the related technologies is described. In the related technologies, the target platform is used to continuously process business requests in real time, and each time a business request is received, it is also sent to the simulation platform. During the processing of business requests, both the target platform and the simulation platform need to acquire the corresponding data to achieve effective processing of the business requests. Furthermore, to improve the accuracy of the simulation data, data updates need to be systematically synchronized from the target platform to the simulation platform during the simulation phase (i.e., the testing phase). Therefore, as... Figure 3 As shown, in related technologies, the target platform periodically sends data to the simulation platform to update the data in the simulation platform. During each data transmission, the simulation platform simultaneously processes business requests. Since both the simulation platform and the target platform update relevant data during business request processing, if data synchronization and transaction processing operate on data simultaneously, it can lead to... Figure 3 The target time period shown in the figure has the problem of data overlapping. This may lead to the target platform and the simulation platform processing the same business request based on different data. The simulation platform may fail to process the corresponding business request (i.e., processing fails), or the data obtained after processing the business request may be inaccurate, resulting in deviations in the simulation results and affecting the test effect.
[0039] In this embodiment, optionally, the target platform has a centralized architecture, and the simulation platform has a distributed architecture. In step S101, as follows... Figure 4 As shown, the simulation platform includes a data access module. When the target platform receives the first business request, it can send the first business request to the simulation platform's Kafka cluster in real time as a distributed message. The simulation platform can obtain the aforementioned first business request through the data access module. Optionally, the target platform will also periodically synchronize data with the simulation platform. The simulation platform can obtain the target data sent by the target platform during the Nth data synchronization through the data access module.
[0040] Step S102: Determine the target time range based on the first time and the second time, and process at least one first service request within the target time range to obtain the processing result. The first time is the time when the target platform completes the Nth synchronization data, and the second time is the time when the target platform starts the N+1th synchronization data. The functions of the simulation platform are at least partially the same as those of the target platform.
[0041] Optional, such as Figure 4As shown, the simulation platform also includes a replay scheduling module. In step S102, the replay scheduling module can determine the time when the target platform completes the Nth data synchronization by obtaining the data synchronization completion instruction sent by the target platform. Optionally, the simulation platform can also determine the time when the target platform completes the Nth data synchronization by detecting that the time when the target platform stops sending data is greater than a preset time. It should be noted that the replay of the service request described in this application is used to indicate that the service request is processed through the simulation platform.
[0042] Furthermore, once the first moment is determined, it means that the data in the simulation platform will not be updated by the target platform at this time. Therefore, the first service request received by the simulation platform can be processed at the current time. Further, the simulation platform determines the time when the target platform starts the (N+1)th data synchronization. When the current time reaches the time when the target platform starts the (N+1)th data synchronization, the processing of the first service request is stopped, thus obtaining the processing result. It is important to emphasize that the time when the target platform starts the (N+1)th data synchronization can be determined by the simulation platform when the first moment is determined. For example, it can be determined from a preset timetable, which records at least the start time of each data transmission and may also record the end time of each data transmission. Optionally, the time when the target platform starts the (N+1)th data synchronization can also be determined in real-time by the simulation platform based on relevant instructions during the processing of the service request.
[0043] The aforementioned processing result can be a single result, for example, used to characterize whether any of the first business requests that have been processed have failed. The aforementioned processing result can also include multiple processing sub-results, for example, each processing sub-result corresponds to a first business request, and the processing sub-result is used to characterize the data result obtained by the simulation platform after processing a certain first business request. For example, if the original target data is "User A's deposit is 1000", and a certain first business request is "User A's deposit increases by 1000", then the processing sub-result corresponding to the first business request can be "User A's deposit is 2000".
[0044] Optionally, a relevant table structure can be constructed in the simulation platform to store relevant data. Specifically, a simulation replay pending task register (T_REPLAY_TASK_PND) can be constructed in the simulation platform. This table is used to record pending business requests and the list of services to be called when processing each business request. In this embodiment, an optional execution process of step S102 can be as follows: Figure 5As shown, before the simulation platform obtains target data from the target platform, it suspends processing business requests, and all the first business requests it obtains are stored in the aforementioned simulation replay pending task register. Afterwards, data transmission occurs between the simulation platform and the target platform to update the data within the simulation platform. Once the simulation platform's data update is complete, it can determine the first pending business request from the simulation replay pending task register and process it until the next data synchronization begins, at which point processing of the business request ceases.
[0045] It should be noted that by processing at least one first business request within the target time range, the business processing of the simulation platform is paused when the target platform synchronizes data with the simulation platform. This avoids data loss or data errors caused by executing business requests during data synchronization and ensures the accuracy of business processing results.
[0046] Step S103: Based on the processing results, determine the test results of the simulation platform, wherein the test results are used to determine whether to use the simulation platform to provide services to the outside world.
[0047] In step S103, when the processing result is used to characterize whether there are any failed requests in the first service request that has been processed, the simulation platform can determine that its function is working correctly if there are no failed requests in the first service request that has been processed, thus determining that the simulation platform's test result is acceptable for providing services externally. Conversely, if there are failed requests in the first service request that has been processed, the simulation platform's function is deemed to have a problem, thus determining that the simulation platform's test result is unacceptable for providing services externally. Optionally, when the processing result characterizes the data result obtained after processing each first service request, the simulation platform can compare its processing result for the first service request with the target platform's processing result for the same first service request, thereby determining the test result for testing the simulation platform based on the comparison result.
[0048] It should be noted that by determining the test results of the simulation platform based on the processing results obtained in step S102, the simulation platform can be effectively tested.
[0049] Based on the scheme defined in steps S101 to S103 above, it can be understood that in this embodiment of the invention, the data synchronization process and business processing process of the simulation platform are executed separately. This is achieved by acquiring multiple first business requests sent by the target platform and the target data sent by the target platform during the Nth data synchronization. Then, based on the first and second timestamps, a target time range is determined, and at least one first business request is processed within the target time range to obtain a processing result. Based on the processing result, a test result for testing the simulation platform is determined. The target platform is used to process business requests to provide services externally. The target data is the data required by the target platform when processing business requests. N is a positive integer. The first timetamp is the time when the target platform completes the Nth data synchronization, and the second timetamp is the time when the target platform begins the (N+1)th data synchronization. The functions of the simulation platform are at least partially the same as those of the target platform. The test result is used to determine whether to use the simulation platform to provide services externally.
[0050] It is noteworthy that, in the above process, by processing at least one first business request within the target time frame, the business processing of the simulation platform is paused during data synchronization from the target platform to the simulation platform. This avoids data loss or errors caused by the simulation platform executing business requests during data synchronization, ensuring the accuracy of the business processing results. Furthermore, based on the aforementioned processing results, the test results for testing the simulation platform are determined, enabling effective testing of the simulation platform and thus improving the accuracy of platform testing.
[0051] Therefore, the solution provided in this application achieves the goal of separating the data synchronization process and the business processing process of the simulation platform, thereby improving the technical effect of platform testing accuracy and solving the technical problem of low testing accuracy when the simulation platform performs data synchronization and business processing simultaneously in related technologies.
[0052] In one optional embodiment, during the process of processing at least one first service request within a target time range and obtaining a processing result, the simulation platform can, within the target time range and based on target data, determine at least one second service request from multiple first service requests. Then, it determines the request time of each second service request and the data synchronization time required to process each second service request. Based on the request time and data synchronization time corresponding to each second service request, it then determines at least one third service request from the at least one second service request, processes at least one third service request, and obtains a processing result. The target data includes the data required to process the second service requests.
[0053] Optionally, a simulation replay parameter table (T_REPLAY_PARAM) can be constructed in the simulation platform. This table stores the switching parameters and target data, including replay switch parameters. The replay switch parameters are used to determine whether service processing should be initiated. Specifically, the replay scheduling module can update the replay switch parameters when the current time is at the first moment, so that the replay switch parameters indicate that service processing can be initiated. Then, based on the target data, the replay scheduling module can determine from multiple first service requests the first service request (i.e., the aforementioned second service request) whose required data exists in the target data.
[0054] Furthermore, the replay scheduling module can query the simulation replay pending task register to determine the request time of each second service request, and obtain the target data and corresponding data synchronization time for each second service request by scanning the simulation replay parameter table. Then, based on the request time and data synchronization time of each second service request, the replay scheduling module can determine at least one third service request from at least one second service request, and process the third service request to obtain the processing result. Here, the aforementioned request time refers to the request time of the second service request to the target platform, and the aforementioned data synchronization time refers to the time it takes for the target platform to synchronize the data with the simulation platform.
[0055] Optionally, before data synchronization begins, the replay scheduling module can update the replay switch parameters again, so that the replay switch parameters indicate that business processing is prohibited, and all business requests received during data synchronization are in a pending replay state. By controlling the replay switch parameters, the simulation replay process can be flexibly controlled, avoiding data loss caused by replaying business requests during data synchronization and improving the accuracy of the simulation.
[0056] It should be noted that by filtering multiple first business requests based on target data, business request time, and data synchronization time, the problem of inaccurate processing results caused by processing each first business request when the data is inaccurate is avoided.
[0057] In an optional embodiment, during the process of determining at least one third service request from at least one second service request based on the request time and data synchronization time corresponding to each second service request, if the request time corresponding to the target service request is later than the data synchronization time, the target platform can determine the target service request as the third service request, wherein the target service request is any one of the second service requests.
[0058] Optionally, since the target platform updates the corresponding data after processing the business request, for example, if a first business request is "User A's deposit increases by 1000", then the data required to process this first business request is the same as the data updated after the business request is processed. Therefore, for example, if the original target data is "User A's deposit is 1000", then the data obtained by the target platform after processing the aforementioned first business request will be "User A's deposit is 2000". Furthermore, if the aforementioned first business request time is 3:00, then at the data synchronization time of 2:59, the target data obtained by the simulation platform is "User A's deposit is 1000", and at the data synchronization time of 3:01, the target data obtained by the simulation platform is "User A's deposit is 2000". This results in the simulation platform potentially having different processing results for the first business request.
[0059] Therefore, if the replay scheduling module determines that the request time corresponding to the target service request is later than the data synchronization time, it identifies the target service request as a third service request. Conversely, if the replay scheduling module determines that the request time corresponding to the target service request is earlier than or equal to the data synchronization time, it does not process the target service request. This effectively filters the second service requests and ensures the accuracy of the platform's test results.
[0060] In one optional embodiment, during the process of processing at least one third service request and obtaining the processing result, the simulation platform can obtain the call information of at least one service sent by the target platform, then determine the target service corresponding to each third service request, call the target service to process at least one third service request, and obtain the processing result.
[0061] Optionally, it should be noted that when processing business requests, the target platform often needs to rely on calling services in other systems. Therefore, when processing business requests, the target platform can also send the service call information it uses to process the business requests to the simulation platform. Specifically, the target platform can use aspect-oriented programming to intercept the call requests sent to the services, obtain the request data, and then send the request data (i.e., the aforementioned call information) to the simulation platform. The call information corresponding to the service may include the service name, method name, version number, relevant parameters of the request communication area, and channel event number. The data access module in the simulation platform can parse the call information to obtain the data contained within it. Afterwards, the simulation platform can register the parsed information in the simulation replay pending task register and the simulation replay task supplement register. The simulation replay task supplement register (T_REPLAY_TASK_ADD) is used to associate and register the request message large fields of each business request.
[0062] The simulation replay parameter table also stores access switch parameters, which determine whether parsing service call information is allowed. Before parsing the aforementioned service call information, the data access module can first query the simulation replay parameter table, and then parse the call information if the access switch parameters indicate that parsing the service call information is allowed.
[0063] Furthermore, the target platform also includes a service invocation module. This module can determine the target service corresponding to each third business request based on the mapping between business requests and services. When processing a specific third business request, it invokes the corresponding service for processing to obtain the processing result. Specifically, the service invocation module can use RPC to generically invoke the specified service (i.e., the target service) based on the obtained service name and method name, and send relevant target data to the service to receive the result record returned by the service invocation, which is then registered in the simulation replay log table. The result record includes the invocation result and the service processing result. The invocation result indicates whether the service was successfully invoked, and the service processing result is used to determine the simulation platform's processing result for the business request. The service processing result may not be the same as the simulation platform's processing result for the business request; for example, the target service may only be a part of the content used to process the business request. Optionally, the simulation replay log table (T_REPLAY_LOG) is used to register the service invocation result (such as successful or failed invocation) and the service processing result.
[0064] Optionally, the simulation platform also includes a simulation replay processed task register (T_REPLAY_TASK_FIN), which records completed business requests and their corresponding service lists. It should be noted that the simulation replay pending task register and the simulation replay processed task register are horizontally split by status, while the simulation replay task supplement register is vertically split. This splitting is to reduce the performance overhead of cyclic scanning. The relationships between the simulation replay pending task register, the simulation replay processed task register, and the simulation replay task supplement register are as follows: Figure 6 As shown, Figure 6 As shown, through table splitting, the pending registration book only stores business requests with a status of "pending processing." This is cyclically scanned by the simulation platform, and when a scanned business request enters the "processed" state, it is moved to the simulation replay processed task registration book. This keeps the scanned record set relatively small, and scanning efficiency is controllable. While the data volume in the simulation replay processed task registration book increases with transaction volume, it is only used for registration and updates via unique keys, and is not cyclically scanned. The supplementary registration book is only used for registering large fields of messages (i.e.,... Figure 6New records inserted in the database (queried via a unique key) will not be scanned repeatedly. By controlling reasonable retention and cleanup cycles, performance and capacity can be kept within a reasonable range.
[0065] It should be noted that by calling the same service to process the same business requests based on the service call information of the target platform, the processing process of the business requests of the target platform can be accurately reproduced, thereby improving the effect of simulation verification.
[0066] In an optional embodiment, during the process of processing at least one third service request and obtaining a processing result, the simulation platform can determine the processing order of at least one third service request based on the request time of at least one third service request, and then process at least one third service request in accordance with the processing order to obtain a processing result.
[0067] Optionally, the simulation platform can determine the corresponding processing order according to the chronological order, that is, to execute the third business request that is obtained first, and to execute the third business request that is obtained later. It should be noted that by processing the business requests in sequence, the transaction processing process of the target platform can be accurately reproduced, thereby improving the effectiveness of simulation verification.
[0068] In one optional embodiment, during the process of determining the test result for testing the simulation platform based on the processing result, the simulation platform can obtain the target processing result of the target platform processing at least one first business request, and then compare the processing result with the target processing result to obtain a comparison result. If the comparison result indicates that the processing result is the same as the target processing result, the test result is determined to be the first test result. If the comparison result indicates that the processing result is different from the target processing result, the test result is determined to be the second test result. The first test result indicates that the simulation platform is allowed to provide services externally, and the second test result indicates that the simulation platform is prohibited from providing services externally.
[0069] Optionally, when the processing result includes multiple processing sub-results, meaning the processing result represents the data result obtained after processing each first business request, the simulation platform can compare its processing result for the first business request with the target platform's processing result for the same first business request. If the comparison results for each processing sub-result are identical, i.e., the processing result matches the target processing result, the simulation platform's functionality is determined to be correct, and the test result is identified as the first test result. Conversely, if the comparison results for each processing sub-result are different, i.e., the processing result differs from the target processing result, the simulation platform's functionality is determined to be flawed, and the test result is identified as the second test result. In the aforementioned case, the target result also includes multiple target processing sub-results, which represent the data result obtained by the target platform after processing a specific first business request.
[0070] Specifically, when it is determined that the use of a simulation platform to provide services is permitted, it means that the target organization can use a simulation platform to replace the target platform; when it is determined that the use of a simulation platform to provide services is prohibited, it means that the target organization cannot use a simulation platform to replace the target platform.
[0071] It should be noted that by comparing the processing results of the business requests by the simulation platform with the processing results of the business requests by the target platform, the test results of the simulation platform can be determined more accurately.
[0072] In one optional embodiment, during the process of acquiring the target data sent by the target platform during the Nth synchronization data, the simulation platform may respond to the data synchronization command to acquire the target data sent by the target platform during the Nth synchronization data, and / or, when the current time is the same as the target time, acquire the target data sent by the target platform during the Nth synchronization data.
[0073] Optionally, the simulation platform can respond to the data synchronization command sent by the target platform and obtain the target data sent by the target platform during the Nth data synchronization. Alternatively, the simulation platform can obtain the target data sent by the target platform during the Nth data synchronization when the current time reaches the preset target time.
[0074] It should be noted that by enriching the criteria for determining the time when the simulation platform acquires target data, the flexibility of testing the simulation platform has been improved.
[0075] like Figure 7 As shown, an optional platform testing method provided in this application is illustrated. The method includes the following steps:
[0076] Step S1: When the target platform processes the business request, it simultaneously sends the business request to the simulation platform and sends the service call information corresponding to the business request to the simulation platform's Kafka cluster in the form of distributed messages.
[0077] Step S2: The simulation platform queries the simulation replay parameter table. If the access switch is on, it consumes the service call information sent by the target platform, parses the service call information, and registers the parsing results in the simulation replay pending task register and the simulation replay task supplement register.
[0078] Step S3: The simulation platform's background scheduling thread queries the simulation playback parameter table to obtain the playback switch parameters;
[0079] Step S4: If the replay switch is on, proceed to the next step; otherwise, the background scheduling thread will sleep for a period of time before rescanning and querying the simulation replay parameter table.
[0080] Step S5: The simulation platform reads the simulation playback parameter table and obtains the synchronization time T of the target data;
[0081] Step S6: Read the simulation replay pending task register, obtain the business requests with the status "pending replay" and the request time >= T, and associate them with the corresponding large field data of the simulation replay task supplement register;
[0082] Step S7: Update the status of the business requests being processed in the simulation replay pending task register to "Replaying";
[0083] Step S8: Based on the service name and method name in the service call information, make a generic RPC call to the specified service, send the request parameters, receive the service call return result record, and register the details in the simulation replay log table;
[0084] Step S9: Update the status of completed business requests in the simulation replay pending task register to "replayed", and move the relevant information of the business requests to the simulation replay processed task register, indicating that these business requests have been processed.
[0085] It should be noted that, in this application, since the task of the simulation phase is to verify the platform service functions and it is not required to run synchronously with production, the aforementioned switching parameters can also be manually adjusted by relevant personnel. This allows for flexible control of the transaction operation time. By starting, stopping, and replaying the switch, the simulation process can be made highly controllable, which helps to improve the simulation verification effect.
[0086] Therefore, the solution provided in this application achieves the goal of separating the data synchronization process and the business processing process of the simulation platform, thereby improving the technical effect of platform testing accuracy and solving the technical problem of low testing accuracy when the simulation platform performs data synchronization and business processing simultaneously in related technologies.
[0087] Example 2
[0088] According to an embodiment of the present invention, a platform testing apparatus is provided, wherein, Figure 8 This is a schematic diagram of an optional platform testing apparatus according to an embodiment of the present invention, such as... Figure 8 As shown, the device includes:
[0089] The acquisition module 801 is used to acquire multiple first business requests sent by the target platform, and to acquire the target data sent by the target platform during the Nth data synchronization. The target platform is used to process the business requests to provide services to the outside world, and the target data is the data required by the target platform to process the business requests. N is a positive integer.
[0090] The first determining module 802 is used to determine a target time range based on a first time and a second time, and to process at least one first business request within the target time range to obtain a processing result. The first time is the time when the target platform completes the Nth time of data synchronization, and the second time is the time when the target platform starts the N+1th time of data synchronization. The functions of the simulation platform are at least partially the same as those of the target platform.
[0091] The second determining module 803 is used to determine the test results of the simulation platform based on the processing results, wherein the test results are used to determine whether the simulation platform is used to provide services to the outside world.
[0092] It should be noted that the above-mentioned acquisition module 801, first determination module 802 and second determination module 803 correspond to steps S101 to S103 in the above embodiments. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment 1.
[0093] Optionally, the first determining module further includes: a first determining submodule, configured to determine at least one second business request from multiple first business requests within a target time range, based on target data, wherein the target data includes data required to process the second business request; a second determining submodule, configured to determine the request time of each second business request and the data synchronization time for processing the data required for each second business request; a third determining submodule, configured to determine at least one third business request from at least one second business request based on the request time and data synchronization time corresponding to each second business request; and a processing submodule, configured to process at least one third business request and obtain a processing result.
[0094] Optionally, the second determining submodule further includes: a first determining unit, used to determine the target business request as a third business request if the request time corresponding to the target business request is later than the data synchronization time, wherein the target business request is any second business request.
[0095] Optionally, the processing submodule further includes: an acquisition unit for acquiring call information of at least one service sent by the target platform; a second determination unit for determining the target service corresponding to each third business request; and a call unit for calling the target service to process at least one third business request and obtain the processing result.
[0096] Optionally, the processing submodule further includes: a third determining unit, used to determine the processing order of at least one third service request based on the request time of at least one third service request; and a processing unit, used to process at least one third service request according to the processing order to obtain a processing result.
[0097] Optionally, the second determining module further includes: a first obtaining submodule, used to obtain the target processing result of the target platform processing at least one first business request; a comparison submodule, used to compare the processing result with the target processing result to obtain a comparison result; a fourth determining submodule, used to determine the test result as the first test result if the comparison result indicates that the processing result is the same as the target processing result, wherein the first test result indicates that the simulation platform is allowed to provide services externally; and a fifth determining submodule, used to determine the test result as the second test result if the comparison result indicates that the processing result is different from the target processing result, wherein the second test result indicates that the simulation platform is prohibited from providing services externally.
[0098] Optionally, the acquisition module further includes: a second acquisition submodule, used to respond to a data synchronization command and acquire the target data sent by the target platform during the Nth data synchronization, and / or a third acquisition submodule, used to acquire the target data sent by the target platform during the Nth data synchronization when the current time is the same as the target time.
[0099] Example 3
[0100] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described platform testing method at runtime.
[0101] Example 4
[0102] According to another aspect of the present invention, an electronic device is also provided, wherein, Figure 9 This is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as... Figure 9 As shown, the electronic device includes one or more processors; and a memory for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to run the programs, wherein the programs are configured to execute the platform testing method described above during runtime.
[0103] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0104] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0105] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0106] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0107] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0108] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0109] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A platform testing method, characterized in that, Applications in simulation platforms include: The system acquires multiple first service requests sent by the target platform, and acquires the target data sent by the target platform during the Nth data synchronization, wherein the target platform is used to process the service requests to provide services to the outside world, and the target data is the data required by the target platform to process the service requests, and N is a positive integer; Based on the first moment and the second moment, a target time range is determined, and at least one first business request is processed within the target time range to obtain a processing result. The first moment is the time when the target platform completes the Nth data synchronization, and the second moment is the time when the target platform starts the N+1th data synchronization. The functions of the simulation platform are at least partially the same as those of the target platform. The process of processing at least one first service request within the target time range to obtain a processing result includes: within the target time range, determining at least one second service request from the plurality of first service requests based on the target data, wherein the target data includes data required to process the second service request; determining the request time of each second service request and the data synchronization time for processing the data required for each second service request; determining at least one third service request from the at least one second service request based on the request time and data synchronization time corresponding to each second service request; and processing the at least one third service request to obtain the processing result. Specifically, determining at least one third service request from the at least one second service request based on the request time and data synchronization time corresponding to each second service request includes: if the request time corresponding to the target service request is later than the data synchronization time, then the target service request is determined to be the third service request, wherein the target service request is any one of the second service requests; Based on the processing results, the test results of the simulation platform are determined, wherein the test results are used to determine whether the simulation platform is used to provide services to the outside world.
2. The method according to claim 1, characterized in that, Processing the at least one third service request to obtain the processing result includes: Obtain call information for at least one service sent by the target platform; Identify the target service corresponding to each third-party service request; The target service is invoked to process the at least one third business request, and the processing result is obtained.
3. The method according to claim 1, characterized in that, Processing the at least one third service request to obtain the processing result includes: Based on the request time of the at least one third service request, determine the processing order of the at least one third service request; The at least one third service request is processed according to the processing order to obtain the processing result.
4. The method according to claim 1, characterized in that, Based on the processing results, the test results for testing the simulation platform are determined, including: Obtain the target processing result of the target platform in processing the at least one first business request; The processing result is compared with the target processing result to obtain a comparison result; If the comparison result indicates that the processing result is the same as the target processing result, then the test result is determined to be the first test result, wherein the first test result indicates that the simulation platform is allowed to provide services externally; If the comparison result indicates that the processing result is different from the target processing result, then the test result is determined to be the second test result, wherein the second test result indicates that the simulation platform is prohibited from providing services to the outside world.
5. The method according to claim 1, characterized in that, Obtaining the target data sent by the target platform during the Nth synchronization includes: In response to a data synchronization command, obtain the target data sent by the target platform during the Nth data synchronization, and / or, When the current time is the same as the target time, obtain the target data sent by the target platform during the Nth synchronization.
6. A platform testing device, characterized in that, include: The acquisition module is used to acquire multiple first business requests sent by the target platform, and to acquire the target data sent by the target platform during the Nth data synchronization. The target platform is used to process the business requests to provide services to the outside world, and the target data is the data required by the target platform to process the business requests. N is a positive integer. The first determining module is used to determine a target time range based on a first time and a second time, and to process at least one first service request within the target time range to obtain a processing result. The first time is the time when the target platform completes the Nth data synchronization, and the second time is the time when the target platform starts the N+1th data synchronization. The functions of the simulation platform are at least partially the same as those of the target platform. The first determining module includes: a first determining submodule, configured to determine at least one second service request from the plurality of first service requests within the target time range, based on the target data, wherein the target data includes data required to process the second service request; a second determining submodule, configured to determine the request time of each second service request and the data synchronization time for processing the data required for each second service request; a third determining submodule, configured to determine at least one third service request from the at least one second service request based on the request time and data synchronization time corresponding to each second service request; and a processing submodule, configured to process the at least one third service request to obtain the processing result. The second determining submodule includes: a first determining unit, configured to determine the target business request as the third business request if the request time corresponding to the target business request is later than the data synchronization time, wherein the target business request is any second business request; The second determining module is used to determine the test results of the simulation platform based on the processing results, wherein the test results are used to determine whether the simulation platform is used to provide services to the outside world.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the platform testing method according to any one of claims 1 to 5 when it is run.
8. An electronic device, characterized in that, The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to be configured to run the programs, wherein the programs are configured to execute the platform testing method as described in any one of claims 1 to 5 at runtime.