Test data generation method and device

Through the test data generation method based on preset business models, combined with historical transaction information and current test data for inference and conversion, the problem that traditional test data cannot meet the multi-dimensional testing needs is solved, and a more comprehensive trading system testing is achieved.

CN114297052BActive Publication Date: 2025-03-21SHANGHAI FUDAN KINGSTAR COMPUTER CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111519955.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2025-03-21
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

Traditional distributed trading system test data cannot meet the system's multi-dimensional testing needs, especially in functional testing, automation testing, capacity testing and performance testing.

Method used

By obtaining the first test data and the initial test data file based on the preset business model, combining historical transaction information and current test data for calculation and conversion, generating historical test data and second test data, and storing these data into the target test data file.

Benefits of technology

It has achieved the acquisition of historical contract data, historical market data and data that are not related to market and contracts in historical time periods, meeting the multi-dimensional testing needs of the trading system, and improving the testing effect and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297052B_ABST
    Figure CN114297052B_ABST
Patent Text Reader

Abstract

The present application relates to a test data generation method, device, computer equipment and storage medium. The method includes: based on a preset business model, obtaining first test data and an initial test data file, performing inference conversion based on historical transaction information, current test data and first test data to obtain historical test data and second test data, storing the first test data, current test data, historical test data and second test data in a data file to be tested, and obtaining a target test data file. This method can be used to obtain historical contract data, historical market data and data unrelated to market conditions and contracts in a historical time period, and these data are combined as test data for a trading system, so that the trading system can obtain multi-dimensional current test data and historical test data to meet the all-round and blind spot testing requirements of the trading system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the financial field, and in particular to a test data generation method and device. Background Art

[0002] During the development process of a distributed trading system, a large amount of test data is required for functional testing, automation testing, capacity testing, performance testing, etc. of the distributed trading system.

[0003] In traditional technology, futures exchanges simulate market data and contract data in a simulation environment to implement distributed trading system testing. However, the test data obtained in traditional ways cannot meet the testing requirements of distributed trading systems. Summary of the invention

[0004] Based on this, it is necessary to provide a test data generation method and device to address the above technical issues.

[0005] A test data generating method, the method comprising:

[0006] Based on the preset business model, first test data and an initial test data file are obtained; the first test data includes data unrelated to market conditions and contracts;

[0007] The historical transaction information, the current test data and the first test data are extrapolated and converted to obtain the historical test data and the second test data; the current test data includes the current contract data, the current market data and the current dependent data, and the current dependent data includes the current data related to the market and the contract; the historical test data includes the historical contract data and the historical market data, and the second test data is the data unrelated to the market and the contract in the historical time period;

[0008] The first test data, the current test data, the historical test data and the second test data are stored in the initial test data file to obtain a target test data file.

[0009] In one embodiment, the obtaining of the first test data and the initial test data file based on the preset business model includes:

[0010] Parsing the preset business model to obtain a database import file, a database control file and a data file to be tested in the initial test data file; the database import file includes business field information, and the database control file includes field storage rules;

[0011] The first test data is obtained through preset rules, the database import file and the database control file.

[0012] In one embodiment, the method further comprises:

[0013] Expanding the business field information in the database import file and the field storage rules in the database control file to obtain an expanded database import file and an expanded database control file;

[0014] The obtaining of the first test data by using the preset rule, the database import file and the database control file includes:

[0015] The first test data is obtained through the preset rule, the expanded database import file and the expanded database control file.

[0016] In one embodiment, the obtaining of the first test data by using a preset rule, the database import file and the database control file includes:

[0017] Determine the preset rules according to the test requirements;

[0018] Based on the preset rule, the first test data is filtered from the database file.

[0019] In one embodiment, the method further comprises:

[0020] The initial contract data and the initial market data are preprocessed to obtain the current test data.

[0021] In one embodiment, the preprocessing of the initial contract data and the initial market data to obtain the current test data includes:

[0022] Performing denoising processing on the initial contract data and the initial market data to obtain target contract data and target market data, wherein the denoising processing includes removing at least one of invalid data and duplicate data;

[0023] The target contract data and the target market data are classified and processed to obtain the current contract data and the current market data.

[0024] In one embodiment, the classifying and processing the target contract data to obtain the current contract data includes:

[0025] Determining futures options contract data from the target contract data according to the type of the business field in the target contract data;

[0026] The futures options contract data are classified according to the type of the futures options contract data to obtain the current contract data.

[0027] In one embodiment, the classifying and processing the target market data to obtain the current market data includes:

[0028] According to the contract list, legal data within a preset time period is filtered out from the target market data to obtain the current market data.

[0029] In one embodiment, storing the first test data, the current test data, the historical test data, and the second test data in the initial test data file to obtain a target test data file includes:

[0030] The first test data, the current test data, the historical test data, and the second test data are stored in the to-be-tested data file according to the field storage rule to obtain the target test data file.

[0031] In one embodiment, the method further comprises:

[0032] The target test data file is imported into the trading system through the database import file and the database control file, so that the trading system performs development testing according to the target test data file.

[0033] A test data generating device, the device comprising:

[0034] A test information acquisition module, used to acquire first test data and an initial test data file based on a preset business model; the first test data includes data unrelated to market conditions and contracts;

[0035] A calculation conversion module, configured to perform calculation conversion based on historical transaction information, current test data and the first test data to obtain historical test data and second test data; the current test data includes current contract data, current market data and current dependent data, and the current dependent data includes current data related to the market and the contract; the historical test data includes historical contract data and historical market data, and the second test data is data unrelated to the market and the contract in the historical time period;

[0036] The test data storage module is used to store the first test data, the current test data, the historical test data, and the second test data into the initial test data file to obtain a target test data file.

[0037] The above-mentioned test data generation method and device, the method obtains the first test data and the initial test data file based on a preset business model, and performs inference and conversion according to historical transaction information, current test data and the first test data to obtain historical test data and second test data, and stores the first test data, current test data, historical test data and second test data in the initial test data file to obtain the target test data file; the method can obtain historical contract data, historical market data and data unrelated to market conditions and contracts in a historical time period, and combine these data as test data for the trading system, so that the trading system can obtain multi-dimensional current test data and historical test data to meet the all-round and no-dead-angle testing needs of the trading system. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is an internal structure diagram of a computer device in one embodiment;

[0039] Figure 2 A schematic diagram of a flow chart of a test data generating method in one embodiment;

[0040] Figure 3 A schematic diagram of a method flow for obtaining first test data and an initial test data file in one embodiment;

[0041] Figure 4 A schematic flow chart of a method for obtaining first test data in another embodiment;

[0042] Figure 5 A schematic flow chart of a method for obtaining current test data in another embodiment;

[0043] Figure 6 A flowchart of a method for obtaining current contract data in another embodiment;

[0044] Figure 7 FIG. 4 is a structural block diagram of a test data generating device in an embodiment. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] The test data generation method provided in this application can be applied to Figure 1 Computer equipment as shown. Figure 1As shown, the computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store preset business models and target test data files. The network interface of the computer device is used to communicate with an external endpoint through a network connection. When the computer program is executed by the processor, a test data generation method is implemented.

[0047] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0048] In one embodiment, Figure 2 As shown, a test data generation method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:

[0049] S100. Based on a preset business model, obtain first test data and an initial test data file; the first test data includes data unrelated to market conditions and contracts.

[0050] Specifically, the above-mentioned preset business model can be understood as a data model pre-built by the transaction system. An information table can be obtained through a preset business model, and the information table may include business field information, field storage rules, business field usage scenarios, business field sources, etc. The business field information may be database script information. In this embodiment, the computer device can obtain the first test data and the initial test data file based on multiple preset business models. The initial test data file may include multiple data files, including both real data files and empty data files.

[0051] The market data may be market data of stocks, futures, foreign exchange rates, indices, funds, bonds (including convertible bonds), warrants, and options, and the contract data corresponds to the market data. The first test data may be data in a customer table, a seat table, a transaction parameter table, and the like, and the customer-related table supports expansion of any customer order. In this embodiment, the preset business model is not fixed, and the trading system may update the preset business model in real time.

[0052] S200. Calculate and convert the historical transaction information, current test data and first test data to obtain historical test data and second test data; the current test data includes current contract data, current market data and current dependent data, and the current dependent data includes data currently related to the market and the contract; the historical test data includes historical contract data and historical market data, and the second test data is data unrelated to the market and the contract in the historical time period.

[0053] Specifically, the above historical transaction information can be information related to transactions in the historical time period, such as transaction time, transaction funds, transaction location, etc. The above current test data can be understood as test data of the current trading day, and the current test data can include contract data and market data of the current trading day obtained in real time from different financial institutions, as well as current dependent data obtained through the contract data and market data of the current trading day. In this embodiment, the computer device can export the six tables of transaction fund account table, customer position table, position detail table, combined position summary table, customer combined position detail table and unilateral discount table through the memory table viewing tool of the transaction core of the distributed trading system of the financial institution, and then calculate and convert according to the historical transaction information, the current test data and the first test data to obtain historical contract data, historical market data and data unrelated to market and contract in the historical time period, so as to provide the trading system with comprehensive test data.

[0054] It should be noted that the above-mentioned trading funds account table can store data such as the balance of the investor's fund account, margin fees, profits and losses; the above-mentioned customer position table can store the summary of the investor's trading positions of ordinary futures and options contracts, including the number of positions, position costs, margin, settlement price and other data; the above-mentioned position details table can store the details of each ordinary futures and options contract position of the investor, such as the insurance mark of each position, opening date, quantity, transaction number and other data; the above-mentioned combination position summary table can store the summary of the investor's combination contract trading positions, in which the data stored is similar to the data in the customer position table; the above-mentioned customer combination position details table can store the details of each combination contract position of the investor, in which the data stored is similar to the data in the position details table; the above-mentioned unilateral discount table can store the acceleration and record of the unilateral margin discount calculation process of the Shanghai Futures Exchange, the Energy Exchange and the China Financial Futures Exchange.

[0055] For example, during the conversion process, (1) for the trading fund account table, "Last settlement reserve" is set to "Futures settlement reserve", "Last occupied margin" is set to "Current total margin", "Frozen margin", "Frozen funds", "Frozen handling fees", "Fund difference", "Closing profit and loss", and "Opening profit and loss" are all set to 0; (2) for the position summary table and the combined position summary table, the "Position date" of a futures exchange contract is set to "Last day's position", and the "Position date" of other exchanges is set to "Today's position", "Long freeze", "Short freeze", "Opening position frozen amount", "Closing volume", "Closing amount" and so on are all set to 0, "Position cost" = "Last settlement price × contract multiplier × number of positions", "Last Occupied Margin" is set to "Occupied Margin"; (3) For the position details table, set "Trading Day" to the current trading day, "Opening Date" to the previous trading day, "Daily Mark-to-Market Closing Profit and Loss", "Transaction-by-Transaction Hedge Closing Profit and Loss", "Daily Mark-to-Market Position Profit and Loss", "Transaction-by-Transaction Hedge Position Profit and Loss", "Closing Volume", and "Closing Amount" are all set to 0. If it is a contract of other commodity exchanges, it is necessary to set "First Open, First Close Remaining Quantity" to "Quantity"; (4) For the combined position details table, set "Last Day's Position" to "Today's Position", and the other items are set the same as the position details table; (5) For the unilateral discount table, set "Buy Frozen Margin" and "Sell Frozen Margin" to 0, and set "Frozen Margin Collection Direction" to "Margin Collection Direction".

[0056] S300, storing first test data, current test data, historical test data and second test data into an initial test data file to obtain a target test data file.

[0057] Specifically, the computer device may store the first test data, the current test data, the historical test data, and the second test data synchronously or sequentially into the initial test data file according to the field storage rule to obtain the target test data file.

[0058] In the above test data generation method, the computer device can obtain the first test data and the initial test data file based on the preset business model, and perform inference and conversion according to the historical transaction information, the current test data and the first test data to obtain the historical test data and the second test data, and store the first test data, the current test data, the historical test data and the second test data in the data file to be tested to obtain the target test data file; the method can obtain historical contract data, historical market data and data unrelated to the market and the contract in the historical time period, and combine these data as the test data of the trading system, so that the trading system can obtain multi-dimensional current test data and historical test data to meet the all-round and no-dead-angle testing requirements of the trading system, and further improve the testing effect of the trading system; at the same time, the method can also continuously obtain the corresponding updated test data according to the updated preset business model, so as to facilitate the later maintenance of the test function of the trading system, and the test stability is relatively strong; the method can be implemented by a set of computer programs, so as to improve the speed of obtaining test data.

[0059] As one of the embodiments, Figure 3 As shown, the step of obtaining the first test data and the initial test data file based on the preset business model in the above S100 can be implemented by the following steps:

[0060] S110, parsing the preset business model, obtaining a database import file, a database control file and a data file to be tested in the initial test data file; the database import file includes business field information, and the database control file includes field storage rules.

[0061] In the present embodiment, the computer device can parse each preset business model through a parsing tool, obtain the business field information and field storage rules contained in the information table in each preset business model, and then construct a database import file, a database control file and a data file to be tested through the business field information and the field storage rules. The above-mentioned parsing tool can be implemented by python language, and the parsing tool can be the xml.dom.minidom tool in the dependency library. The above-mentioned database import file and the database control file can be real data files, that is, specific data is stored in the file. Among them, the business field information can be stored in the database import file, the field storage rules can be stored in the database control file, and the data file to be tested can be a kind of empty data file with only field titles, and the empty data file can store values ​​separated by symbols such as commas, semicolons, and colons, but in the present embodiment, the data file to be tested can store values ​​separated by comma symbols, that is, the data file to be tested can be an empty csv data file. The above-mentioned database import file and the database control file can respectively include files supporting the operation of the windows operating system and files supporting the operation of the linux operating system, and of course, files running by other operating systems can also be included.

[0062] It is understandable that the above information table can be an investor information table, a trading fund account table, a combined position summary table, a unilateral discount table, etc. For example, the trading fund account table may include a brokerage company code, an investor account number, available funds, available funds, a trading day, a settlement number, a credit limit, a pledge amount, and a customer number, etc. Taking the information table as an investor information table as an example, the computer device can obtain the corresponding database import file, database control file, and data file to be tested, that is, a database import file supporting a windows operating system (file name import.bat), a database import file supporting a linux operating system (file name import.sh), a database control file supporting a windows operating system (file name INVESTOR.ctl), a database control file supporting a linux operating system (file name INVESTOR_linux.ctl) and an empty csv data file (file name INVESTOR.csv). The above database import file may include a database import script program.

[0063] Among them, an instance information table that can be stored in a database import file supporting a Windows operating system and a database import file supporting a Linux operating system is shown in Table 1.

[0064] Table 1

[0065]

[0066] In Table 1, sqlldr is the name of the database import tool. In the business field information, the first duser indicates the user name, the second duser indicates the password, 127.0.0.1:1521 / dtpf indicates the IP address: port number / database instance name, INVESTOR.ctl indicates the database control file name, and INVESTOR.log indicates the log file name.

[0067] At the same time, an instance information table that can be stored in a database control file supporting a Windows operating system and a database control file supporting a Linux operating system is shown in Table 2.

[0068] Table 2

[0069]

[0070] It should be noted that, through the field storage rules in the database control file, it can be determined that the test data in the test data file needs to be separated by commas. The field storage rules can be the field information included in TRAILING NULLCOLS in the database control file in Table 2.

[0071] S120 , obtaining first test data through preset rules and database import files.

[0072] Specifically, the above-mentioned preset rules can be rules for filtering data that are not related to market conditions and contracts in real time. The computer device can filter the business field information in the database import file according to the preset rules, and then sort the filtered business field information according to the field storage rules in the database control file to obtain the first test data, or the computer device can filter the business field information in the database import file according to the preset rules, and use the filtered business field information as the first test data. In this embodiment, the first test data can be simulated data that is not related to market conditions and contracts on the current trading day.

[0073] The above-mentioned test data generation method can parse the preset business model, obtain the database import file, database control file and data file to be tested in the initial test data file, and obtain the first test data through preset rules and database import files. This method can obtain simulation data that is unrelated to the market and contract on the current trading day, so that the trading system can obtain test data that is unrelated to the market and contract, and implement testing in combination with market data and contract data, thereby further improving the testing effect of the trading system.

[0074] As one of the embodiments, before executing the above step S120, the above test data generation method may further include the following steps: expanding the business field information in the database import file and the field storage rules in the database control file to obtain an expanded database import file and an expanded database control file.

[0075] Specifically, the computer device can expand the relevant business field information according to the business field information in the database import file based on the number of users to obtain the expanded database import file. At the same time, the field storage rules in the database control document can be expanded according to the expanded relevant business field information and the field storage rules in the database control document to obtain the expanded database control file. The number of expanded field storage rules can be equal to the number of expanded relevant business field information. In this embodiment, the amount of expanded data can be of any scale, which is not limited.

[0076] Furthermore, the step of acquiring the first test data by importing the file through the preset rules and the database in the above S120 may include: acquiring the first test data by importing the file through the preset rules and the expanded database.

[0077] It should be noted that the computer device can filter the field information in the expanded database import file according to preset rules, and then sort the filtered field information according to the field storage rules in the expanded database control file to obtain the first test data, or the computer device can filter the business field information in the expanded database import file according to preset rules, and use the filtered business field information as the first test data.

[0078] This embodiment can obtain the full amount of first test data through preset rules and the expanded database import file, so that the test data finally obtained meets the test requirements of the trading system to a greater extent.

[0079] The above-mentioned test data generation method can expand the business field information in the database import file and the field storage rules in the database control document to obtain the expanded database import file and the expanded database control file, and further process them through preset rules, the expanded database import file and the expanded database control file to obtain a relatively complete amount of test data, so that the final test data can meet the all-round and no-dead-angle testing requirements of the trading system to a greater extent, thereby improving the testing effect of the trading system; at the same time, the method can also expand the business field information in the database import file and the field storage rules in the database control document based on the number of users, so as to obtain large-scale test data, so that the final test data can meet the manual business testing requirements of testers, and can meet the large-scale automated testing, capacity testing and performance testing requirements; in addition, the trading system realizes development testing through large-scale test data, and can clearly understand the defects and bottlenecks in the development process of the trading system, which is of great significance for the subsequent development and maintenance of the trading system.

[0080] As one of the embodiments, Figure 4 As shown, the step of obtaining the first test data by importing the file through the preset rules and the database in the above S120 can be implemented by the following steps:

[0081] S121. Determine preset rules according to test requirements.

[0082] Specifically, the first test data stored in the target test data file determined in this embodiment can be understood as a test data table, and the first test data stored in the table is data screened according to certain rules. According to the actual test requirements of the trading system, the computer device can first obtain the corresponding data dictionary, trading parameters, entry and exit rules and other related rule tables, and then parse these related rule tables to obtain preset rules. However, in this embodiment, the user can manually write a custom preset rule code according to the actual test requirements so that the computer device can obtain the preset rules. The number of preset rules can be greater than or equal to 1.

[0083] It should be noted that different test data tables and different business field information in each test data table have different rules. Exemplarily, taking the information table in the preset business model as the investor information table, the investor information table may include an investor ID, and the investor ID may represent a customer number, through which the customer number can be fully expanded to obtain the advantages of large-scale test data. The customer number can be incremented or decremented from a certain data to distinguish the IDs of different investors. If the scalability of the test data is taken into account, the customer number in the rules defined by the trading system can be gradually traversed and increased starting from 10,000, and further obtain the target customer data volume of 2,000,000 simulated by the trading system. The customer number can also be generated in the form of a string, and the customer number can also be set to other forms, which are not limited to this. The rate template code (TemplateCode) in the investor information table can be important field information related to the rate, and it is also the field information that the trading system needs to test the trading function. Since the customer number is generated by traversal, the customer number can be ranged according to the template number when generating the data in the investor information table. For example, customers 10000 to 10999 belong to template 1, customers 11000 to 11999 belong to template 2, and so on. At the same time, the trading system can also fully design test cases based on these rules.

[0084] S122: Filter first test data from a database file based on a preset rule.

[0085] It is understandable that the computer device can filter the business field information that meets the preset rules from the database file according to the preset rules and use it as the first test data that is unrelated to the market and the contract.

[0086] The above-mentioned test data generation method can determine the preset rules according to the test requirements, and filter the first test data from the database file based on the preset rules. This method can obtain simulation data that is unrelated to the market conditions and contracts on the current trading day, so that the trading system can obtain test data that is unrelated to the market conditions and contracts, and implement testing in combination with the market data and contract data, thereby further improving the testing effect of the trading system.

[0087] As one of the embodiments, before the step in S200 is executed, the test data generating method may further include: preprocessing the initial contract data and the initial market data to obtain the current test data.

[0088] Specifically, the computer device can obtain the initial contract data and initial market data from the MongoDB database stored in the local or cloud storage location of different financial institutions, and further pre-process the initial contract data and initial market data to obtain the current test data. The above pre-processing can be denoising processing, analysis processing, comparison processing, data calculation processing, etc.

[0089] The above-mentioned test data generation method can pre-process the initial contract data and initial market data obtained in real time to obtain current test data, and then combine the current test data, the first test data, the historical test data and the second test data as the final test data, so that the trading system can obtain multi-dimensional test data that meets the requirements of all-round and no-dead-angle testing, thereby further improving the testing effect of the trading system.

[0090] As one of the embodiments, Figure 5 As shown, the above step of preprocessing the initial contract data and the initial market data to obtain the current test data can be achieved by the following steps:

[0091] S400, performing denoising processing on the initial contract data and the initial market data to obtain target contract data and target market data, wherein the denoising processing includes removing at least one of invalid data and duplicate data.

[0092] Specifically, in some scenarios, if there are invalid data and / or duplicate data in the initial contract data and the initial market data, the computer device can use the data analysis library to perform denoising on the acquired initial contract data and initial market data to remove the invalid data and / or duplicate data in the initial contract data and the initial market data, respectively, to obtain the target contract data and the target market data. The above-mentioned data analysis library can be python pandas.

[0093] It should be noted that if there is invalid data in the initial contract data and the initial market data, the computer device can perform denoising on the initial contract data and the initial market data, remove the invalid data in the initial contract data and the initial market data, and use the initial contract data after the invalid data is removed as the target contract data, and use the initial market data after the invalid data is removed as the target market data. If there is duplicate data in the initial contract data and the initial market data, the computer device can perform denoising on the initial contract data and the initial market data, remove the duplicate data in the initial contract data and the initial market data, and use the initial contract data after the duplicate data is removed as the target contract data, and use the initial market data after the duplicate data is removed as the target market data. If there is invalid data and duplicate data in the initial contract data and the initial market data, the computer device can perform denoising on the initial contract data and the initial market data, remove the invalid data and duplicate data in the initial contract data and the initial market data, and use the initial contract data after the invalid data and duplicate data are removed as the target contract data, and use the initial market data after the invalid data and duplicate data are removed as the target market data.

[0094] In addition, if there is no invalid data and / or duplicate data in the initial contract data and the initial market data, the initial contract data can be directly used as the target contract data, and the initial market data can be used as the target market data.

[0095] S500: Classify and process the target contract data and the target market data to obtain the current contract data and the current market data.

[0096] Specifically, the computer device can first perform arithmetic operations on the target contract data and the target market data, and then classify the arithmetic operation results to obtain the current contract data and the current market data, or screen the target contract data and the target market data, and then classify the screening results to obtain the current contract data and the current market data. Of course, the target contract data and the target market data can also be directly classified to obtain the current contract data and the current market data.

[0097] The above-mentioned test data generation method can obtain the current contract data and the current market data, and then combine the current contract data, the current market data, the first test data, the historical test data and the second test data as the final test data, so that the trading system can obtain multi-dimensional test data that meets the requirements of all-round and no-dead-angle testing, and further improve the testing effect of the trading system.

[0098] As one of the embodiments, Figure 6 As shown, the step of classifying the target contract data in the above S500 to obtain the current contract data may specifically include:

[0099] S510. Determine the futures options contract data from the target contract data according to the type of the business field in the target contract data.

[0100] Exemplarily, the computer device performs denoising on some initial contract data, removes invalid data and duplicate data in the initial contract data to obtain 99,888 target contract data, and then divides the target contract data into 9,823 futures options contract data and 90,065 combined contract data according to the business field type in the target contract data.

[0101] S520. Classify the futures options contract data according to the type of the futures options contract data to obtain current contract data.

[0102] Continuing with the previous example, the computer device can classify and process 9823 futures options contract data according to the types of exchange information, varieties, some price information, etc. in the futures options contract data to obtain data such as exchange information, varieties, some price information, etc. At the same time, the computer device can generate basic data such as contract tables, variety tables, price tables, etc. from these data, and these basic data are called current contract data.

[0103] Meanwhile, the step of classifying the target market data to obtain the current market data in the above S500 may include: filtering out legal data within a preset time period from the target market data according to the contract list to obtain the current market data.

[0104] It is understandable that the computer device can filter out legal data within a preset time period from the target market data according to the contract table in the current contract data to obtain the current market data. The above preset time period can be any time period within a day, or any time period within multiple days, without limitation.

[0105] Continuing with the previous example, the computer device can obtain the most recently marked legal data of each current contract data before the closing at 3 pm based on the contract table in the current contract data, and filter out a corresponding static market data from the target market data according to the most recently marked legal data of each current contract data, and then parse each static market data to obtain a series of exchange information, varieties, price information, etc., and use it as the current market data. The dependent data in the present invention mainly refers to data related to contracts and market conditions, which are mainly concentrated in DTP-F as contract tables, variety tables, rate tables, market tables, etc. The specific data tables are as follows:

[0106] It should be noted that the computer device can also obtain data strongly related to the contract and the market through the obtained current contract data and current market data, that is, the current dependent data. The current dependent data may include a contract table, a product table, a rate table, a market table, etc. The information names corresponding to the data included in the current dependent data may be as shown in Table 3. Of course, the current dependent data is not limited to the data corresponding to these information names.

[0107] Table 3

[0108] Contract Information Table Combined Contract Information Table (Dalian) Combined Contract Priority In-depth market Product (i.e. variety) Customer Fee Rate Customer Option Fee Rate Template Fee Rate Template Option Fee Rate Company Fee Rate Company Option Fee Rate Customer Margin Rate (Options) Customer Margin Rate Template margin rate (Option) Template Margin Rate Company Margin Rate (Options) Company Margin Rate Exchange Margin Rate (Options) Exchange Margin Rate Investor Margin Following Table Customer Position Limit Table Frequent ordering rules list Frequent order cancellation rules list Option Transaction Costs

[0109] The above-mentioned test data generation method can obtain the current contract data, and then combine the current contract data, current market data, the first test data, the historical test data and the second test data as the final test data, so that the trading system can obtain multi-dimensional test data that meets the requirements of all-round and no-dead-angle testing, and further improve the testing effect of the trading system.

[0110] As one of the embodiments, the step of storing the first test data, current test data, historical test data, and second test data in the initial test data file to obtain the target test data file in the above S300 may include: storing the first test data, current test data, historical test data, and second test data in the data file to be tested according to the field storage rule to obtain the target test data file.

[0111] Specifically, the field storage rules may be field information type, field storage time, and field storage order. However, in this embodiment, the field storage rules may be the order of field titles.

[0112] It is understandable that the computer device can traverse the test data in the first test data, current test data, historical test data, and second test data according to the field storage rules in the database control file, and sequentially store these test data in the data file to be tested to obtain a large-scale, multi-dimensional target test data file. In the entire test data generation process, each time a type of test data is obtained, the test data of this type can be preferentially stored in the data file to be tested until all types of test data (i.e., the first test data, the current test data, the historical test data, and the second test data) are obtained.

[0113] Furthermore, after executing all the above steps, the above test data generation method may also include: importing the target test data file into the trading system through the database import file and the database control file, so that the trading system performs development testing according to the target test data file.

[0114] The computer device can use the data import tool in the database import file and the database control file to import the target test data file into the database of the trading system to be developed, so that the trading system can perform various development tests according to the large-scale and multi-dimensional test data in the target test data file. In this embodiment, the data import tool can be sqlldr, and the database control file can be an oracle control file.

[0115] It should be noted that the above-mentioned development test can be capacity testing, performance testing, functional testing, automated testing, etc.

[0116] At the same time, the trading system stipulates that the format of the loaded and imported test data is a txt file with semicolon separators to distinguish different field information. In order to simulate the process of data entry and exit, the cx_Oracle tool is usually used to export the test data in the target test data file previously imported into the database according to the test data export requirements.

[0117] This embodiment can improve the testing effect of the trading system by performing various development tests based on large-scale, multi-dimensional test data in the target test data file.

[0118] The above-mentioned test data generation method can obtain large-scale, multi-dimensional test data, and store these test data in the data file to be tested according to the field storage rules in the database control file, so as to ensure that the test data obtained by the trading system is the same as the data in the information table in the preset business model, avoiding data deviation. At the same time, it can enable the trading system to obtain the target test data file containing large-scale, multi-dimensional test data that meets the test requirements, and further realize development testing through the target test data file, which can greatly improve the accuracy of the test results. In addition, the trading system realizes development testing through large-scale test data, which can clearly understand the defects and bottlenecks in the development process of the trading system, which is of great significance for the subsequent development and maintenance of the trading system.

[0119] To facilitate the understanding of those skilled in the art, the test data generation method provided by the present application is introduced by taking a computer device as an example. Specifically, the method includes:

[0120] (1) Parse the preset business model to obtain the database import file, database control file and test data file in the initial test data file; the database import file includes business field information, and the database control file includes field storage rules.

[0121] (2) Expand the business field information in the database import file and the field storage rules in the database control file to obtain an expanded database import file and an expanded database control file.

[0122] (3) Determine preset rules based on test requirements, the expanded database import file, and the expanded database control file.

[0123] (4) Based on preset rules, first test data is screened from the expanded database file, where the first test data includes data that is unrelated to market conditions and contracts.

[0124] (5) Preprocess the initial contract data and initial market data to obtain current test data.

[0125] (6) Performing denoising processing on the initial contract data and the initial market data to obtain target contract data and target market data, wherein the denoising processing includes removing at least one of invalid data and duplicate data.

[0126] (7) Determine the futures options contract data from the target contract data based on the type of the business field in the target contract data.

[0127] (8) According to the contract list, legal data within a preset time period is filtered out from the target market data to obtain the current market data.

[0128] (9) Calculate and convert the historical transaction information, current test data and first test data to obtain historical test data and second test data; the current test data includes current contract data, current market data and current dependent data, and the current dependent data includes data related to the market and contract; the historical test data includes historical contract data and historical market data, and the second test data is data unrelated to the market and contract in the historical time period.

[0129] (10) According to the field storage rule, the first test data, the current test data, the historical test data, and the second test data are stored in the to-be-tested data file to obtain the target test data file.

[0130] (11) Import the target test data file into the trading system through the database import file and the database control file, so that the trading system can perform development testing based on the target test data file.

[0131] The execution process of the above (1) to (11) can be specifically referred to the description of the above embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0132] It should be understood that although Figure 2-6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0133] In one embodiment, Figure 7 As shown, a test data generating device is provided, comprising: a test information acquisition module 11, a calculation conversion module 12 and a test data storage module 13, wherein:

[0134] The test information acquisition module 11 is used to acquire first test data and an initial test data file based on a preset business model; the first test data includes data unrelated to market conditions and contracts;

[0135] The inference conversion module 12 is used to perform inference conversion based on historical transaction information, current test data and first test data to obtain historical test data and second test data; the current test data includes current contract data, current market data and current dependent data, and the current dependent data includes current data related to the market and contract; the historical test data includes historical contract data and historical market data, and the second test data is data unrelated to the market and contract in the historical time period;

[0136] The test data storage module 13 is used to store the first test data, the current test data, the historical test data and the second test data into the initial test data file to obtain a target test data file.

[0137] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0138] In one embodiment, the test information acquisition module 11 includes: a parsing unit and a first test data acquisition unit, wherein:

[0139] A parsing unit, used to parse the preset business model, and obtain a database import file, a database control file, and a data file to be tested in the initial test data file; the database import file includes business field information, and the database control file includes field storage rules;

[0140] The first test data acquisition unit is used to acquire first test data through preset rules and database import files.

[0141] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0142] In one embodiment, the test information acquisition module 11 further includes: an expansion unit, wherein:

[0143] An extension unit is used to extend the business field information in the database import file and the field storage rules in the database control file to obtain an extended database import file and an extended database control file;

[0144] The first test data acquisition unit is specifically used to acquire the first test data through preset rules and the expanded database import file.

[0145] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0146] In one embodiment, the first test data acquisition unit includes: a rule determination subunit and a screening subunit, wherein:

[0147] A rule determination subunit, used to determine preset rules according to test requirements;

[0148] The screening subunit is used to screen the first test data from the database file according to a preset rule.

[0149] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0150] In one embodiment, the test data generating device further comprises: a preprocessing module, wherein:

[0151] The preprocessing module is used to preprocess the initial contract data and initial market data to obtain the current test data.

[0152] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0153] In one embodiment, the preprocessing module includes: a denoising processing unit and a classification processing unit, wherein:

[0154] A denoising processing unit, used to perform denoising processing on the initial contract data and the initial market data to obtain target contract data and target market data, wherein the denoising processing includes removing at least one of invalid data and duplicate data;

[0155] The classification processing unit is used to classify the target contract data and the target market data to obtain the current contract data and the current market data.

[0156] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0157] In one embodiment, the classification processing unit includes: a first classification processing subunit and a second classification processing subunit, wherein:

[0158] A first classification processing subunit is used to determine the futures option contract data from the target contract data according to the type of the business field in the target contract data;

[0159] The second classification processing subunit is used to classify the futures options contract data according to the type of the futures options contract data to obtain the current contract data.

[0160] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0161] In one embodiment, the classification processing unit further includes: a third classification processing subunit, wherein:

[0162] The third classification processing subunit is used to filter out legal data within a preset time period from the target market data according to the contract list to obtain current market data.

[0163] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0164] In one embodiment, the test data storage module 13 is specifically used to store the first test data, the current test data, the historical test data, and the second test data into the to-be-tested data file according to the field storage rule to obtain the target test data file.

[0165] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0166] In one embodiment, the test data generating device further includes: a file importing module, wherein:

[0167] The file import module is used to import the target test data file into the trading system through the database import file and the database control file, so that the trading system can perform development testing according to the target test data file.

[0168] The test data generating device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0169] For the specific definition of the test data generating device, please refer to the definition of the test data generating method above, which will not be repeated here. Each module in the above-mentioned test data generating device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0170] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0171] Based on the preset business model, first test data and an initial test data file are obtained; the first test data includes data unrelated to market conditions and contracts;

[0172] The historical test data and the second test data are calculated and converted according to the historical transaction information, the current test data and the first test data; the current test data includes the current contract data, the current market data and the current dependent data, and the current dependent data includes the current data related to the market and the contract; the historical test data includes the historical contract data and the historical market data, and the second test data is the data unrelated to the market and the contract in the historical time period;

[0173] The first test data, the current test data, the historical test data and the second test data are stored in the to-be-tested data file to obtain a target test data file.

[0174] In one embodiment, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0175] Based on the preset business model, first test data and an initial test data file are obtained; the first test data includes data unrelated to market conditions and contracts;

[0176] The historical test data and the second test data are calculated and converted according to the historical transaction information, the current test data and the first test data; the current test data includes the current contract data, the current market data and the current dependent data, and the current dependent data includes the current data related to the market and the contract; the historical test data includes the historical contract data and the historical market data, and the second test data is the data unrelated to the market and the contract in the historical time period;

[0177] The first test data, the current test data, the historical test data and the second test data are stored in the to-be-tested data file to obtain a target test data file.

[0178] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0179] Based on the preset business model, first test data and an initial test data file are obtained; the first test data includes data unrelated to market conditions and contracts;

[0180] The historical test data and the second test data are calculated and converted according to the historical transaction information, the current test data and the first test data; the current test data includes the current contract data, the current market data and the current dependent data, and the current dependent data includes the current data related to the market and the contract; the historical test data includes the historical contract data and the historical market data, and the second test data is the data unrelated to the market and the contract in the historical time period;

[0181] The first test data, the current test data, the historical test data and the second test data are stored in the to-be-tested data file to obtain a target test data file.

[0182] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0183] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0184] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A test data generation method, characterized in that: The method comprises: Parse the preset business model to obtain a database import file, a database control file and a data file to be tested in the initial test data file; the database import file includes business field information, and the database control file includes field storage rules; Obtaining first test data by using preset rules and the database import file; the first test data includes data unrelated to market conditions and contracts; The historical transaction information, the current test data and the first test data are extrapolated and converted to obtain the historical test data and the second test data; the current test data includes the current contract data, the current market data and the current dependent data, and the current dependent data includes the current data related to the market and the contract; the historical test data includes the historical contract data and the historical market data, and the second test data is the data unrelated to the market and the contract in the historical time period; The first test data, the current test data, the historical test data and the second test data are stored in the initial test data file to obtain a target test data file.

2. The method according to claim 1, characterized in that The method further comprises: Expanding the business field information in the database import file and the field storage rules in the database control file to obtain an expanded database import file and an expanded database control file; The obtaining of the first test data by using the preset rule, the database import file and the database control file includes: The first test data is obtained by using the preset rule and the expanded database import file.

3. The method according to claim 1 or 2, characterized in that: The step of obtaining the first test data by using a preset rule and the database import file includes: Determine the preset rules according to the test requirements; Based on the preset rule, the first test data is filtered from the database import file.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: The initial contract data and the initial market data are preprocessed to obtain the current test data.

5. The method according to claim 4, characterized in that The preprocessing of the initial contract data and the initial market data to obtain the current test data includes: Performing denoising processing on the initial contract data and the initial market data to obtain target contract data and target market data, wherein the denoising processing includes removing at least one of invalid data and duplicate data; The target contract data and the target market data are classified and processed to obtain the current contract data and the current market data.

6. The method according to claim 5, characterized in that The classifying and processing the target contract data to obtain the current contract data includes: Determining futures options contract data from the target contract data according to the type of the business field in the target contract data; The futures options contract data are classified according to the type of the futures options contract data to obtain the current contract data.

7. The method according to claim 5, characterized in that The classifying and processing the target market data to obtain the current market data includes: According to the contract list, legal data within a preset time period is filtered out from the target market data to obtain the current market data.

8. The method according to claim 1 or 2, characterized in that: The storing the first test data, the current test data, the historical test data, and the second test data into the initial test data file to obtain a target test data file includes: The first test data, the current test data, the historical test data, and the second test data are stored in the to-be-tested data file according to the field storage rule to obtain the target test data file.

9. The method according to claim 8, characterized in that The method further comprises: The target test data file is imported into the trading system through the database import file and the database control file, so that the trading system performs development testing according to the target test data file.

10. A test data generating device, characterized in that: The device comprises: A test information acquisition module is used to parse the preset business model, obtain the database import file, the database control file and the data file to be tested in the initial test data file, and obtain the first test data through the preset rules and the database import file; the database import file includes business field information, the database control file includes field storage rules, and the first test data includes data unrelated to the market and the contract; A calculation conversion module, configured to perform calculation conversion based on historical transaction information, current test data and the first test data to obtain historical test data and second test data; the current test data includes current contract data, current market data and current dependent data, and the current dependent data includes current data related to the market and the contract; the historical test data includes historical contract data and historical market data, and the second test data is data unrelated to the market and the contract in the historical time period; The test data storage module is used to store the first test data, the current test data, the historical test data, and the second test data into the initial test data file to obtain a target test data file.

Citation Information

Patent Citations

  • Test data generation method and device, electronic equipment and storage medium

    CN110908891A

  • Semiconductor test data analysis system

    US20040002829A1