Data testing method and device, equipment, storage medium and program product

By using visual tools to obtain policy data and generate test cases in quantitative transactions, and combining interactive strategy simulation and automation framework for testing, the problem of inefficient testing of complex strategy logic is solved, achieving full-process coverage and efficient verification.

CN119003352APending Publication Date: 2024-11-22CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411086232.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the case of complex logic of quantitative trading strategies, testers face problems such as large amount of data, frequent tool switching, and difficult to simulate order status, resulting in inefficient testing.

Method used

Obtain policy data through visualization tools, trigger ordering instructions and generate test cases, use interactive strategy simulation or pre-built automation framework for testing, generate test-complete transaction orders, and display and save data through visualization tools for subsequent regression verification.

Benefits of technology

It reduces the difficulty of writing automated scripts, improves testing efficiency, ensures the full process of testing coverage from order placing an order to order transactions, and improves the testing efficiency of quantitative trading strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003352A_ABST
    Figure CN119003352A_ABST
Patent Text Reader

Abstract

The invention discloses a data testing method and device, equipment, a storage medium and a program product, and relates to the technical field of data processing, and the method comprises the steps: obtaining strategy data through a visual tool; according to the strategy data, triggering an order placing instruction, and generating a test case based on the order placing instruction; and adopting an interactive strategy simulation mode and / or applying a pre-constructed automation framework to test the test case, and obtaining a transaction order after the test is completed. According to the scheme, different strategies can be manually or automatically covered and tested by configuring the strategy data and outputting, so that the automation script compiling difficulty is reduced, and the testing efficiency is improved; moreover, a whole-process test scheme from order placing triggering to final order transaction can be directly applied to an automatic framework after strategy data is stored, so that regression test and subsequent task coverage verification are facilitated, and improvement of quantitative transaction strategy test efficiency is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Currently, when testing business scenarios related to strategy logic, testers need to infer test data from the expected order results of the test case. As the strategy logic of quantitative trading becomes more complex, the requirements for testers' ability and familiarity with logic are getting higher and higher. For testers, there are several major difficulties in manually testing and verifying the correctness of strategy logic:

[0003] (1) The test data volume of a single scenario exceeds 100 fields, and testers cannot provide test data for all scenarios. In addition, inexperienced testers are not familiar with the new policy logic and cannot effectively execute test cases.

[0004] (2) Quantification is done by asynchronously triggering orders through monitoring events. Testers need to switch between multiple tools to send events to trigger orders. In addition, business data cannot be effectively stored during the test, resulting in repeated data generation for the same scenario, which is time-consuming.

[0005] (3) Some order states cannot be simulated using existing simulators or the exchange test environment.

[0006] In summary, as the logic of quantitative trading strategies becomes increasingly complex, improving the efficiency of their testing has become a key issue that the industry needs to tackle urgently. Summary of the invention

[0007] The main purpose of this application is to provide a data testing method, device, equipment, storage medium and program product, aiming to solve the technical problem of how to improve the efficiency of quantitative trading strategy testing.

[0008] To achieve the above purpose, the present application proposes a data testing method, which includes:

[0009] Obtain strategic data through visualization tools;

[0010] According to the strategy data, trigger an order instruction, and generate a test case based on the order instruction;

[0011] The test case is tested by interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order for which the test is completed.

[0012] In one embodiment, the step of triggering an order instruction according to the policy data and generating a test case based on the order instruction includes:

[0013] Based on the strategy data, an order instruction is triggered, and based on the order instruction, a current scene order is identified, and the current scene order is displayed in an order module, so that the user can confirm the current scene order in the order module and return the confirmed current scene order;

[0014] According to the confirmed current scene order returned by the user, the corresponding transaction status is obtained, and according to the corresponding transaction status, a transaction report message is generated;

[0015] According to the transaction report message, the latest profit and loss parameters are obtained;

[0016] The case name and case description input by the user are received, and a test case is generated in combination with the latest profit and loss parameters, and the test case is displayed to the user through a visualization tool.

[0017] In one embodiment, the step of testing the test case by interactive strategy simulation and / or using a pre-built automation framework to obtain a test-completed transaction order includes:

[0018] receiving user-selected test cases through a visualization tool;

[0019] In response to the strategy data and the preset event logic, the test case selected by the user is tested to obtain a transaction order for which the test is completed; and / or

[0020] Utilize the pre-built automated testing framework to parse and run the test cases selected by the user, complete the testing of the test cases, and obtain the transaction orders for which the testing has been completed.

[0021] In one embodiment, the step of testing the test case selected by the user in response to the strategy data and the preset event logic to obtain the transaction order after the test is completed includes:

[0022] Loading policy data based on user-selected test cases;

[0023] When receiving the operation instruction of the user's click, the preset event logic is triggered;

[0024] According to the strategy data and the preset event logic, the order placement and transaction are executed for the test case selected by the user, and a transaction order for the test completion is generated.

[0025] In one embodiment, the step of using a pre-built automated testing framework to parse and batch-run the test cases selected by the user, completing the test of the test cases, and obtaining the transaction orders after the test is completed includes:

[0026] In the pre-built automated testing framework, the test cases selected by the user are parsed to obtain key information and logic information in the test cases;

[0027] According to the key information and the logic information, the test cases selected by the user are batch-run, and a transaction order for completed testing is generated.

[0028] In one embodiment, after the step of testing the test case by interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed, the step further includes:

[0029] Intercept the transaction orders completed by the test, receive the transaction orders completed by the test through the transaction path, and display them through visualization tools for testers to query and return operation instructions;

[0030] After receiving the operation instruction returned by the user, the simulated exchange assembles the corresponding transaction message according to the operation instruction;

[0031] According to the transaction message, obtaining the transaction status of the transaction message;

[0032] When a message queue MQ message is received through the visualization tool, the transaction status of the transaction message is refreshed.

[0033] In addition, to achieve the above purpose, the present application also proposes a data testing device, the data testing device comprising:

[0034] The acquisition module is used to obtain policy data through visualization tools;

[0035] A generating module, used for triggering an order instruction according to the strategy data, and generating a test case module based on the order instruction;

[0036] The testing module is used to test the test case by means of interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed.

[0037] In addition, to achieve the above objectives, the present application also proposes a data testing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data testing method described above.

[0038] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data testing method described above are implemented.

[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the data testing method described above are implemented.

[0040] The present application provides a data testing method, device, equipment, storage medium and program product, which obtains strategy data through visualization tools; triggers order instructions according to the strategy data, and generates test cases based on the order instructions; tests the test cases using interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order that has been tested. This solution can configure strategy data and output, manually or automatically cover different strategies, reduce the difficulty of writing automated scripts, and improve testing efficiency; and the full-process testing solution from triggering an order to the final order transaction can save the strategy data and directly apply it to the automation framework, which is convenient for regression testing and subsequent task coverage verification, ensuring the improvement of the efficiency of quantitative trading strategy testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A flowchart of the first embodiment of the data testing method of this application is provided;

[0044] Figure 2 A schematic diagram of the strategy data preparation process provided in Example 1 of the present application;

[0045] Figure 3 A schematic diagram of the structure of a pre-built automated testing framework provided in Example 1 of the present application;

[0046] Figure 4 A brief flowchart of the data testing method provided in Example 2 of the present application;

[0047] Figure 5 A brief flowchart of the data testing method provided for this application;

[0048] Figure 6 A visualization tool page configuration strategy data display diagram provided for the data testing method of this application;

[0049] Figure 7 Prepare the first effect display diagram of the strategy data for the visualization tool page provided by the data testing method of this application;

[0050] Figure 8 Prepare a second effect display diagram of strategy data for the visualization tool page provided by the data testing method of this application;

[0051] Fig. 9 Prepare a third effect display diagram of strategy data for the visualization tool page provided by the data testing method of this application;

[0052] Fig.10 This is a schematic diagram of the module structure of the data testing device according to an embodiment of the present application;

[0053] Fig.11 This is a schematic diagram of the device structure of the hardware operating environment involved in the data testing method in the embodiment of the present application.

[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0057] The main solution of the embodiment of the present application is: obtaining strategy data through a visualization tool; triggering an order instruction according to the strategy data, and generating a test case based on the order instruction; testing the test case by interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order that has completed the test.

[0058] At present, for testers, there are several major difficulties in manually testing and verifying the correctness of strategy logic:

[0059] (1) The amount of test data for a single scenario exceeds 100 fields. Designers cannot provide test data for all scenarios. In addition, newcomers cannot effectively execute test cases when they are unfamiliar with the new policy logic.

[0060] (2) Quantification is done by asynchronously triggering orders through monitoring events. Testers need to switch between multiple tools to send events to trigger orders. In addition, business data cannot be effectively stored during the test, resulting in repeated data generation for the same scenario, which is time-consuming.

[0061] (3) Some order states cannot be simulated using existing simulators or the exchange test environment.

[0062] The present application provides a data testing method, device, equipment, storage medium and program product, which obtains strategy data through visualization tools; triggers order instructions according to the strategy data, and generates test cases based on the order instructions; uses interactive strategy simulation and / or uses a pre-built automation framework to test the test cases to obtain the transaction orders that have been tested. This solution configures strategy data and outputs, and manually or automatically covers different strategies, reduces the difficulty of writing automated scripts, and improves testing efficiency; and the full-process testing solution from triggering an order to the final order transaction can save the strategy data and directly apply it to the automation framework, which is convenient for regression testing and subsequent task coverage verification, ensuring the improvement of the efficiency of quantitative trading strategy testing; by simulating an exchange, intercepting quantitative orders, assembling status messages according to user instructions, simulating different trading states of the exchange, and realizing special case scenarios.

[0063] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes a personal computer as an example to illustrate this embodiment and the following embodiments.

[0064] Based on this, the present application embodiment provides a data testing method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the data testing method of the present application.

[0065] In this embodiment, the data testing method includes steps S10 to S20:

[0066] Step S10, obtaining strategy data through a visualization tool;

[0067] It should be noted that testers can also add and modify strategy data through visualization tools. Strategy data includes strategy data parameters, market data, and algorithm data.

[0068] In order to realize the function of multiple tools working together and triggering events to execute trading instructions, and to ensure that different trading strategies can load specific configuration files that match them, we need to prepare strategy-related data. Figure 2 As shown, Figure 2 Prepare a flow chart for policy data.

[0069] Optionally, the tester configures the strategy data parameters through a visualization tool, where the strategy parameters include but are not limited to strategy input parameter fields, algorithm input fields, market categories and fields, transaction return fields, strategy output parameter fields, etc. These strategy parameters are used in the front end. When the page is loaded, the strategy testing system will automatically parse all the above parameters and reset the page display according to the latest data or status to ensure that the user sees the latest information.

[0070] Optionally, the tester also configures the market format of different market categories through visualization tools, and the strategy testing system identifies and understands the various configured market formats, and converts them into data structures that can be processed within the strategy testing system. This parsing capability is a reflection of the flexibility and adaptability of the strategy testing system, enabling the strategy testing system to process market data from different sources. The parsed market data is presented on the user interface of the trading strategy testing system. Among them, market categories refer to different product types in the financial market, such as stocks, bonds, futures, options, foreign exchange, etc. Each product may have different trading rules and data formats; market formats refer to the specific representation of market data, including but not limited to opening price, highest price, lowest price, closing price, trading volume, timestamp and other information.

[0071] Optionally, the tester also configures the algorithm format of different strategies through a visual tool for use in the front end. When the page is loaded, the strategy testing system automatically parses the algorithm format and displays the result of the algorithm configuration on the page.

[0072] Optionally, the tester can also parse the market file through a visualization tool to load historical algorithm data and display it through the page. The market file contains historical market data, including price, volume and other information.

[0073] Optionally, the tester can also parse the algorithm file through a visualization tool to load historical algorithm data and display it on the page. The algorithm file stores the configuration and historical operation data of the algorithm, including the algorithm parameter settings and previous operation results.

[0074] Optionally, the tester also parses the test case selected by the user through a visual tool, reads the parameters and conditions defined in the test case selected by the user, and updates the user interface according to the content of the test case selected by the user.

[0075] In addition, it should be noted that testers also add and modify strategy data through visualization tools. Different strategy data are sent to the strategy testing system through visualization tools, and visualization tools save market data to market files and algorithm data to algorithm files.

[0076] Through the above steps, through the parameter configuration method and loading the visualization tool interface after parsing the configuration file, the strategy parameters, market categories, and algorithm formats of different strategies can be configured, providing important data support for subsequent case testing and simulated exchange operations; and by storing strategy data through personalized storage of different strategies, the required strategy data can be directly loaded when the tester conducts the test again to reproduce the scenario testing process, reducing the time for resetting the configuration and improving the efficiency of the test.

[0077] Step S20, triggering an order instruction according to the strategy data, and generating a test case based on the order instruction;

[0078] It should be noted that an order instruction refers to an instruction issued by a trader to the trading platform, requesting the purchase or sale of goods or specific orders for other trading assets.

[0079] In a feasible implementation, step S20 may include steps S21 to S24:

[0080] Step S21, based on the strategy data, triggering an order instruction, and based on the order instruction, identifying the current scene order, and displaying the current scene order in the order module, so that the user can confirm the current scene order in the order module and return the confirmed current scene order;

[0081] It should be noted that the current scenario order refers to the trading instructions or orders generated based on established strategy parameters, market conditions and algorithm logic.

[0082] Optionally, when the strategy testing system receives the strategy data sent by the visualization tool, it triggers the order instruction, and automatically identifies the current scenario order based on the order instruction, and displays the current scenario order in the order module. The tester can query and confirm in the order module through the visualization tool. If the current scenario order that does not meet the requirements is queried, the tester can delete the record by himself on the page of the visualization tool.

[0083] Step S22, obtaining a corresponding transaction status according to the confirmed current scene order returned by the user, and generating a transaction report message according to the corresponding transaction status;

[0084] It should be noted that the transaction status refers to the identification of the different stages and situations of the order during the transaction process. The transaction report message is used to confirm the execution status and details of the order.

[0085] Optionally, after receiving the confirmed current scenario order returned by the user, identify the transaction status corresponding to the confirmed current scenario order. The tester can click to query on the page of the visualization tool according to the confirmed current scenario order. The strategy testing system generates a transaction report message according to the query instruction and displays the transaction report message in the order module. The tester can query and confirm in the order module through the visualization tool. If the query finds a transaction report message that does not meet the requirements, the tester can delete the record on the page of the visualization tool.

[0086] Step S23, obtaining the latest profit and loss parameters according to the transaction report message;

[0087] It should be noted that profit and loss parameters usually refer to the numerical values ​​and indicators used to measure the degree of profit or loss of a specific transaction or investment portfolio in trading or investment activities.

[0088] Optionally, after the tester queries and confirms the transaction report message through the page of the visualization tool, the strategy testing system parses the transaction report message to obtain key transaction information, and then updates the transaction status according to the transaction information in the transaction report message, and uses the transaction price information in the transaction report message to calculate the position profit and loss (unrealized profit and loss) and realized profit and loss (realized profit and loss) to obtain the profit and loss parameters.

[0089] Step S24, receiving the case name and case description input by the user, and generating a test case in combination with the latest profit and loss parameters, and presenting the test case to the user through a visualization tool.

[0090] Optionally, after confirming the test points that meet the case scenario, the tester enters the case name and case description through the visualization tool and clicks Save. The strategy testing system obtains the case name, description, and profit and loss parameters from the user interface, and generates a test case based on the entered case name, case description, and profit and loss parameters and puts it into the case file. Finally, the generated test case is displayed to the user through the visualization tool page.

[0091] Through the above steps, the full-process test plan from triggering the order instruction to the final test case generation can ensure the standardization and repeatability of the test cases, allowing testers to perform tests efficiently.

[0092] Step S30, testing the test case by interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed.

[0093] It should be noted that interactive strategy simulation allows testers to perform various operations in a simulated environment and observe system behavior without having to perform them in a real environment.

[0094] In a feasible embodiment, step S30 may include steps S31 to S3:

[0095] Step S31, receiving a test case selected by a user through a visualization tool;

[0096] Optionally, the test case selected by the user on the visualization tool page is tested by interactive strategy simulation, that is, manually, or using a pre-built automation framework.

[0097] Step S32, in response to the strategy data and the preset event logic, testing the test case selected by the user to obtain a transaction order for which the test is completed;

[0098] It should be noted that the preset event logic refers to a set of pre-set rules that guide the automated trading system on how to respond to various events in the market. When the tester selects a specific test case, the system will simulate the trading process based on the event logic and strategy data in this case and finally generate a trading order.

[0099] In another feasible embodiment, step S32 may include steps A1 to A3:

[0100] Step A1, loading policy data based on the test case selected by the user;

[0101] Optionally, after the tester selects a test case on the page of the visualization tool, the strategy testing system loads the strategy data related to the test case, including but not limited to initial strategy data parameters, simulation parameters, market data, algorithm data, and displays these strategy data to the user through the visualization tool.

[0102] Step A2, when receiving the operation instruction returned by the user, triggering the preset event logic;

[0103] Optionally, the tester clicks the send button of each module through the page of the visualization tool to return an operation instruction to the strategy testing system, and triggers a preset event logic based on the operation instruction.

[0104] Step A3: According to the strategy data and the preset event logic, the order placement and transaction are executed for the test case selected by the user to generate a transaction order for the test completion.

[0105] Optionally, the strategy testing system processes the strategy data according to the preset event logic, including data analysis, risk assessment, etc. If the transaction conditions are met, a transaction order is generated and executed to obtain a transaction order for which the test is completed.

[0106] Step S33, using the pre-built automated testing framework, parse and run the test cases selected by the user, complete the testing of the test cases, and obtain the transaction orders after the testing is completed.

[0107] Since manual testing cannot ensure the efficiency and quality of work when testers are processing a large number of test cases, this embodiment also proposes a method that can process the test cases selected by the user by using a pre-built automated testing framework. Figure 3 As shown, Figure 3 A schematic diagram of the structure of the pre-built automated testing framework.

[0108] Among them, in the pre-built automated testing framework, modul represents the directory of special logic code files for different strategies; algorithm_column represents the directory of algorithm configuration files for different strategies (reusing tool configuration files); resources represents the configuration file directory; modul in the resources file represents different strategy configuration files, market configuration files and test case directories (reusing tool configuration files); quote_column represents the directory of historical market files for different varieties (market files of reusing tools); trading_colum represents order configuration files and transaction configuration files (configuration files of reusing tools) for different strategies; tools represents the test tool script directory; base.py represents public method code files such as scenario case loading, formula calculation, case analysis, file parsing code, etc.; base.py represents public method code files such as scenario case loading, formula calculation, case analysis, file parsing code, etc.; db.py represents database operation code files; runner.py represents a unified automated testing code entry.

[0109] In a feasible embodiment, step S32 may include steps B1 to B2:

[0110] Step B1, in a pre-built automated testing framework, parsing the test case selected by the user to obtain key information and logic information in the test case;

[0111] Optionally, in a pre-built automated testing framework, formula operations, case analysis, and file parsing codes are reused to parse test cases and extract key information and logical information therein. The key information includes but is not limited to relevant data extracted by formula operations, case analysis, and file parsing codes.

[0112] Step B2: According to the key information and logic information in the test case, the test case selected by the user is batch-run to generate a transaction order for completed testing.

[0113] Optionally, after obtaining the key information and logic information in the test case, the strategy to be used to process the test case is determined according to the logic information. Once the strategy to be used is determined, the system will "jump" to the module code corresponding to the strategy and execute the processing logic according to the key information. Among them, the key information guides the execution of the specific logic, and this embodiment uses the same automated test code entry to perform the "jump" operation.

[0114] In the corresponding module code, prepare the case according to the existing mode, copy the configuration file to the corresponding module directory, and directly run the batch test case in the corresponding module code to generate the transaction order for the test completion. The tester does not need to modify the automation code, which improves the test efficiency.

[0115] Through the above steps, different strategies can be tested manually or through an automated testing framework, which reduces the difficulty of writing automated scripts and improves testing efficiency. In addition, the automated testing framework is highly reusable and easy to configure, which prepares for adding strategies to subsequent projects.

[0116] Through the above-mentioned embodiment method, the strategy data is obtained through a visualization tool; according to the strategy data, the order instruction is triggered, and a test case is generated based on the order instruction; the test case is tested by an interactive strategy simulation method and / or a pre-built automation framework is used to test the test case to obtain a transaction order that has been completed. This solution provides important data support for subsequent case testing and simulated exchange operations by configuring the strategy parameters, market categories, and algorithm formats of different strategies; by manually or automatically covering and testing different strategies, the difficulty of writing automated scripts is reduced and the testing efficiency is improved; and the full-process testing solution from triggering an order to the final order transaction can be directly applied to the automation framework after saving the strategy data, which is convenient for regression testing and subsequent task coverage verification, ensuring the improvement of the efficiency of quantitative trading strategy testing.

[0117] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 After step S30, the data testing method further includes steps S301 to S304:

[0118] Step S301, intercepting the transaction order completed by the test, receiving the transaction order completed by the test through the transaction routing, and displaying it through a visualization tool for the tester to query and return the operation instruction;

[0119] Optionally, a baffle is built between the strategy testing system and the exchange testing environment to intercept the trading orders completed by the test. When the trading orders completed by the test are sent from the strategy testing system to the trading end backend, the trading orders forwarded by the trading route are connected to the backend service address.

[0120] After receiving the transaction order, the background service sends MQ (Message Queue) information to the visualization tool in real time. When the visualization tool receives the MQ message, it displays the relevant data of the transaction order to the tester.

[0121] The tester views the relevant data of the transaction order through the page of the visualization tool. Based on the relevant data of the transaction order, the tester sends different operation instructions to the strategy testing system through the page of the visualization tool to simulate trading activities, such as buying, selling, canceling orders, etc.

[0122] Step S302, after receiving the operation instruction returned by the user, assembling the corresponding message in a simulated exchange according to the operation instruction;

[0123] Optionally, after receiving the operation instructions returned by the tester through the background service, the operation instructions are parsed to understand the specific meaning and requirements of the operation instructions. Once the operation instructions are parsed, the background service will simulate the logic of the exchange to process these operation instructions, and assemble the corresponding transaction message according to the processing results of the simulated exchange, where the transaction message is a message formatted according to the exchange communication protocol, containing detailed information of the transaction instruction, such as instruction type, transaction code, price, quantity, timestamp, etc. Then, the assembled transaction message is sent to the transaction router in the test environment, or directly to the message queue (MQ) for further processing.

[0124] Step S303, obtaining the transaction status of the transaction message according to the transaction message;

[0125] Optionally, after receiving the transaction message, the transaction router sends it to the strategy testing system. When the strategy testing system receives the transaction message, it processes it according to the built-in strategy logic. After processing the transaction message, it generates a response, which reflects the transaction status of the current transaction message.

[0126] Step S304: when a message queue MQ message is received through the visualization tool, the transaction status of the transaction message is refreshed.

[0127] Optionally, when the latest MQ message is received through the visualization tool, including but not limited to the message that the transaction has been confirmed or rejected, the status of the transaction order is refreshed according to the latest MQ message, and the updated transaction order is updated to the corresponding transaction record on its interface through the visualization tool, reflecting the latest progress of the transaction in real time.

[0128] Through the above-mentioned embodiment method, that is, through a simulated exchange, quantitative system orders are intercepted in real time, status messages are assembled according to different user instructions, and different transaction states of the exchange are simulated, in-depth strategy testing can be carried out even in special case scenarios, ensuring that the expected performance can be achieved under various market conditions and special cases, and being able to quickly respond to market changes, thereby improving overall trading efficiency and profitability.

[0129] For example, to help understand the implementation process of the data testing method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 5 , Figure 5 A brief flow chart of a data testing method is provided, specifically:

[0130] The method of this embodiment mainly includes three parts: strategy data preparation, scenario case loading and order status simulation.

[0131] Among them, strategy data preparation includes five parts, which are implemented through visualization tools. Figure 6 As shown, Figure 6 Configure a policy data display graph for the visualization tool page.

[0132] Optionally, the tester can configure the strategy data through the visualization tool page. The strategy data includes but is not limited to strategy data parameters, market categories, and algorithm formats. The tester can save different strategy data to corresponding files through the visualization tool page for subsequent use when generating test cases. Figure 7 As shown, Figure 7 Prepare the first effect display chart of the strategy data for the visualization tool page.

[0133] When the strategy testing system receives the strategy data sent by the visualization tool, it triggers the order instruction, identifies the current scenario order, and displays it in the order module. If the tester finds an unrelated current scenario order in the order module of the visualization tool page, the tester can delete the record by himself. Figure 8 As shown, Figure 8 Prepare a second effect display chart of the strategy data for the visualization tool page.

[0134] The tester views the current scenario order through the visualization tool page, and after confirming that there is no problem, returns the confirmed order to the strategy testing system, and obtains the corresponding transaction status based on the confirmed order. According to the corresponding transaction status, a transaction report message and the latest profit and loss parameters are generated, where the transaction report message is displayed in the order module. If the tester finds that there is an unrelated transaction report message, the tester can delete the record by himself. Finally, based on the case name, case description, and the latest profit and loss parameters entered by the user, a test case is generated and saved in the case file. Fig. 9 As shown, Fig. 9 Prepare the third effect display chart of the strategy data for the visualization tool page.

[0135] Among them, scenario case loading includes two contents, manual testing and automated testing.

[0136] Optionally, the manual test step further includes: after the tester selects the test case on the visualization tool page, the strategy data is automatically loaded, including the initial strategy data parameters, simulation parameters, market data, and algorithm data. Then, the tester can click the send button of each module on the page to send an operation instruction to the strategy testing system. After receiving the operation instruction, the strategy testing system triggers the preset event logic, and executes orders and transactions for the test case according to the strategy data and the preset event logic, generating a transaction order for the test completion.

[0137] In addition, since manual testing cannot ensure the efficiency and quality of work when testers are dealing with a large number of test cases, this solution also proposes an automated testing method.

[0138] Among them, through the pre-built automated testing framework, the automatic parsing and batch running of test cases are completed, which effectively shortens the testing time and reduces the manpower investment in testing.

[0139] Specifically, in the automated testing framework, configuration processing is performed, including algorithm configuration, market configuration, and tool configuration. The test cases selected by the user are identified and parsed, and key information and logic information in the test cases are extracted.

[0140] According to the key information of the test case, the necessary formula operation, file parsing and case parsing codes are dynamically loaded. For the special logic of different strategies, the test case is jumped to the predefined module code for processing according to the logical information of the test case to ensure universality and flexibility. And all test cases are jumped through a unified code entry, which simplifies the test process and maintenance work.

[0141] The automated testing framework can automatically run the parsed test cases without manual intervention by the tester. The next time the tester performs a test, they can simply copy the existing cases and configuration files to quickly create a new test scenario. By placing the copied case configuration files in the corresponding module directory, batch testing can be started without modifying any automated testing code.

[0142] When the test is completed, a transaction order is generated. Then, the order status is simulated according to the transaction order.

[0143] Optionally, a baffle is built in the strategy testing system and the exchange testing environment to intercept the trading orders completed by the test, and the trading orders forwarded by the trading route are accessed by connecting the trading route to the background service address. When the background service receives the trading order, it sends MQ to the front end (including the visualization tool) in real time, and the front end receives the MQ message in real time and displays it on the front end interface.

[0144] When the tester sends different instructions to the strategy testing system through the front end, the back-end service receives the instructions through the interface, and the simulated exchange assembles the corresponding transaction message, forwards the route, and forwards the encapsulated transaction message to MQ. After receiving the transaction message through the transaction route, it is sent to the quantitative strategy backend to respond to the simulated exchange status. When the front end receives the MQ message, it refreshes the transaction order status.

[0145] Through the above-mentioned embodiment method, testers can manually or automatically cover test different strategies by configuring parameters and outputs, reduce the difficulty of writing automated scripts, and improve test efficiency; based on the full-process test plan of the quantitative system strategy from triggering an order to the final order transaction, and after saving the test data, it can be directly applied to the automation framework to facilitate regression testing and subsequent task coverage verification; by simulating an exchange, intercepting quantitative orders, assembling status messages according to user instructions, simulating different transaction states of the exchange, realizing special case scenarios, and improving test efficiency.

[0146] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the data testing method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0147] This application also provides a data testing device, please refer to Fig.10 , the data testing device comprises:

[0148] An acquisition module 10, used to acquire strategy data through a visualization tool;

[0149] A generating module 20, configured to trigger an order instruction according to the strategy data, and generate a test case module based on the order instruction;

[0150] The testing module 30 is used to test the test case by means of interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed.

[0151] The data testing device provided by the present application adopts the data testing method in the above embodiment, which can solve the technical problem of improving the efficiency of quantitative trading strategy testing. Compared with the prior art, the beneficial effects of the data testing device provided by the present application are the same as the beneficial effects of the data testing method provided by the above embodiment, and the other technical features in the data testing device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0152] The present application provides a data testing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data testing method in the above-mentioned embodiment one.

[0153] Reference below Fig.11 , which shows a schematic diagram of the structure of a data test device suitable for implementing the embodiment of the present application. The data test device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The data testing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0154] like Fig.11As shown, the data test equipment may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the data test equipment are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following strategy test systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the data test device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a data test device with various strategy test systems, it should be understood that it is not required to implement or have all the strategy test systems shown. More or fewer strategy test systems can be implemented or provided instead.

[0155] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0156] The data testing device provided by the present application adopts the data testing method in the above embodiment, which can solve the technical problem of improving the efficiency of quantitative trading strategy testing. Compared with the prior art, the beneficial effects of the data testing device provided by the present application are the same as the beneficial effects of the data testing method provided by the above embodiment, and the other technical features in the data testing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0157] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0158] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0159] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the data testing method in the above-mentioned embodiment.

[0160] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor strategy test system, strategy test system or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution strategy test system, a strategy test system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination thereof.

[0161] The computer-readable storage medium may be included in the data testing device; or may exist independently without being assembled into the data testing device.

[0162] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the data testing device, the data testing device: obtains strategy data through a visualization tool; triggers an order instruction according to the strategy data, and generates a test case based on the order instruction; tests the test case by an interactive strategy simulation method and / or using a pre-built automation framework to obtain a transaction order after the test is completed.

[0163] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the strategy test system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based strategy test system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0165] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0166] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned data testing method, and can solve the technical problems of data testing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the data testing method provided by the above-mentioned embodiment, and will not be repeated here.

[0167] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned data testing method when executed by a processor.

[0168] The computer program product provided by this application can solve the technical problem of how to improve the testing of quantitative trading strategies. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the data testing method provided by the above embodiment, which will not be repeated here.

[0169] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A data testing method, characterized in that: The method comprises: Obtain strategic data through visualization tools; According to the strategy data, trigger an order instruction, and generate a test case based on the order instruction; The test case is tested by interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order for which the test is completed.

2. The method according to claim 1, characterized in that The step of triggering an order instruction according to the policy data and generating a test case based on the order instruction includes: Based on the strategy data, an order instruction is triggered, and based on the order instruction, a current scene order is identified, and the current scene order is displayed in an order module, so that the user can confirm the current scene order in the order module and return the confirmed current scene order; According to the confirmed current scene order returned by the user, the corresponding transaction status is obtained, and according to the corresponding transaction status, a transaction report message is generated; According to the transaction report message, the latest profit and loss parameters are obtained; The case name and case description input by the user are received, and a test case is generated in combination with the latest profit and loss parameters, and the test case is displayed to the user through a visualization tool.

3. The method according to claim 1, characterized in that The step of testing the test case by means of interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed includes: receiving user-selected test cases through a visualization tool; In response to the strategy data and the preset event logic, the test case selected by the user is tested to obtain a transaction order for which the test is completed; and / or Utilize the pre-built automated testing framework to parse and run the test cases selected by the user, complete the testing of the test cases, and obtain the transaction orders for which the testing has been completed.

4. The method according to claim 3, characterized in that The step of testing the test case selected by the user in response to the strategy data and the preset event logic to obtain a transaction order after the test is completed includes: Loading policy data based on user-selected test cases; When receiving the operation instruction returned by the user, the preset event logic is triggered; According to the strategy data and the preset event logic, the order placement and transaction are executed for the test case selected by the user, and a transaction order for the test completion is generated.

5. The method according to claim 3, characterized in that The step of using a pre-built automated testing framework to parse and batch-run the test cases selected by the user, completing the test of the test cases, and obtaining the transaction orders after the test is completed includes: In the pre-built automated testing framework, the test cases selected by the user are parsed to obtain key information and logic information in the test cases; According to the key information and the logic information, the test cases selected by the user are batch-run, and a transaction order for completed testing is generated.

6. The method according to claim 1, characterized in that After the step of testing the test case by means of interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed, the following steps are further included: Intercept the transaction orders completed by the test, receive the transaction orders completed by the test through the transaction routing, and display them through the visualization tool for the tester to query and return the operation instructions; After receiving the operation instruction returned by the user, the simulated exchange assembles the corresponding transaction message according to the operation instruction; According to the transaction message, obtaining the transaction status of the transaction message; When a message queue MQ message is received through the visualization tool, the transaction status of the transaction message is refreshed.

7. A data testing device, characterized in that: The device comprises: The acquisition module is used to obtain policy data through visualization tools; A generating module, used for triggering an order instruction according to the strategy data, and generating a test case module based on the order instruction; The testing module is used to test the test case by means of interactive strategy simulation and / or using a pre-built automation framework to obtain a transaction order after the test is completed.

8. A data testing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the data testing method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the data testing method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the data testing method according to any one of claims 1 to the data testing method are implemented.