CN112035533A - System resource scheduling method and device based on multi-parameter quantization strategy feedback - Google Patents

System resource scheduling method and device based on multi-parameter quantization strategy feedback Download PDF

Info

Publication number
CN112035533A
CN112035533A CN202010913281.5A CN202010913281A CN112035533A CN 112035533 A CN112035533 A CN 112035533A CN 202010913281 A CN202010913281 A CN 202010913281A CN 112035533 A CN112035533 A CN 112035533A
Authority
CN
China
Prior art keywords
database
parameter quantization
backtesting
financial
quantization strategy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010913281.5A
Other languages
Chinese (zh)
Other versions
CN112035533B (en
Inventor
袁均良
骆伟祺
叶玮材
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National Sun Yat Sen University
Original Assignee
National Sun Yat Sen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National Sun Yat Sen University filed Critical National Sun Yat Sen University
Priority to CN202010913281.5A priority Critical patent/CN112035533B/en
Publication of CN112035533A publication Critical patent/CN112035533A/en
Application granted granted Critical
Publication of CN112035533B publication Critical patent/CN112035533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a system resource scheduling method and device based on multi-parameter quantization strategy retest, which comprises the steps of setting a plurality of database combinations according to the idle memory amount of a server, the memory occupied amount of a single-parameter quantization strategy and the memory occupied amount of a single financial database, and retesting multi-parameter quantization strategies according to the plurality of database combinations to obtain the retest running time corresponding to each database combination; the method comprises the steps of searching a plurality of optimal database combinations in a plurality of database combinations and the corresponding backtesting running time of each database combination according to the number of specified backtesting tasks input by a user, determining the number of financial databases to be opened and the number of backtesting tasks served by each financial database according to the optimal database combinations, and backtesting the multi-parameter quantization strategy according to the result, so that the backtesting time of the multi-parameter quantization strategy can be shortened, and the resource cost is reduced.

Description

System resource scheduling method and device based on multi-parameter quantization strategy feedback
Technical Field
The invention relates to the technical field of server resource scheduling, in particular to a system resource scheduling method and device based on multi-parameter quantization strategy backtesting.
Background
In recent years, more and more investors design corresponding quantitative strategies based on historical data of stocks to realize investment analysis of stocks. The existing quantization strategy is usually written by a financial engineer, and the quantization strategy can be tested back through historical data so as to evaluate the performance of the quantization strategy. Specifically, after a user sets some stock index combinations, based on real market data which have occurred in a certain period of time, the stock combinations obtained according to the quantitative strategy are subjected to simulated trading, and the quantitative strategy is comprehensively evaluated according to the data such as profit, withdrawal rate and the like in the period of time obtained in the process of simulated trading.
Generally, the quantization strategy involves a large number of parameters, such as average line length in single and double average line quantization strategies, and these parameters have a large influence on the performance of the quantization strategy. In order to obtain higher investment return, the quantization strategy needs to be tested back under different parameters and different scenes (such as different stock marks or different testing intervals). Because the related parameters are more, parallel calculation can be adopted during the return, so that the calculation speed is increased. However, in the prior art, parallel computation is mainly performed by a single-database multi-process method, which causes a large burden on system resources, resulting in low backtesting efficiency of a quantization strategy.
After retrieval, in the patent "a quantization strategy retest system based on cluster and retest method thereof" (published 2018.11.06, publication number CN108765149A) applied in china, it is disclosed that when the quantization strategy is retested, task allocation is performed according to the load condition of each computer node, so that each computer node is utilized with maximum efficiency, and the retest efficiency can be improved. However, it is obvious that the resource cost is too high to realize the parallel computing backtesting by calling a plurality of computers.
Disclosure of Invention
In order to overcome the defect of overhigh resource cost in the prior art, the invention provides a system resource scheduling method and device based on multi-parameter quantization strategy return measurement, which can shorten the return measurement time of the multi-parameter quantization strategy and reduce the resource cost.
In order to solve the technical problems, the technical scheme of the invention is as follows:
the invention discloses a system resource scheduling method based on multi-parameter quantization strategy feedback, which comprises the following steps:
s1: according to a preset time period of the return test and a preset standard stock mark, carrying out the return test on a specified single-parameter quantization strategy, and recording the memory occupied by the single-parameter quantization strategy in the return test process;
s2: setting a plurality of database combinations according to the idle memory amount of the server, the memory occupied amount of the single-parameter quantization strategy and the memory occupied amount of a single financial database; each database combination comprises a certain number of financial databases and the number of the return testing tasks served by each financial database, and the number of the financial databases in each database combination is different;
s3: carrying out retest on the multi-parameter quantization strategy according to the plurality of database combinations, the preset retest time period and the preset stock labels to obtain the retest time period corresponding to each database combination;
s4: searching the plurality of database combinations and the corresponding backtesting running time of each database combination according to the specified number of the backtesting tasks input by the user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations; the optimal database combinations comprise the optimal number of financial databases to be started when the multi-parameter quantization strategy is subjected to the recovery according to the specified recovery test task number and the optimal number of recovery test tasks served by each financial database;
s5: and according to the optimal database combinations, carrying out retesting on other stock labels or other retesting time periods of the multi-parameter quantization strategy, wherein the other stock labels are different from the preset standard stock labels, the other retesting time periods are different from the preset retesting time period, and the other retesting time periods are the same as the preset retesting time period in length.
Preferably, step S4 includes the steps of:
s4.1: compressing the plurality of database combinations and the corresponding backtesting running time of each database combination in an acceleration ratio grouping mode to obtain an acceleration ratio queue;
s4.2: and searching in the acceleration ratio queue according to the number of specified backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations.
Preferably, step S4.1 comprises:
s4.1.1: calculating the acceleration ratio corresponding to each database combination according to the retest running time corresponding to each database combination to obtain a plurality of acceleration ratios;
s4.1.2: and grouping the plurality of speed-up ratios to form a speed-up ratio queue.
Preferably, step S4.1.2 includes the steps of:
s4.1.2.1: according to the maximum acceleration ratio, the minimum acceleration ratio and the preset number of groups in the multiple acceleration ratios, calculating each group interval delta speed by the following formula:
Figure BDA0002664082680000031
wherein T represents a predetermined number of groups, speedupmaxIndicating the maximum acceleration ratio, speedupminRepresents an acceleration ratio minimum;
s4.1.2.2: grouping a plurality of acceleration ratios according to each group interval by the following formula to obtain a plurality of acceleration ratio groups Si
Si={s|[speedupmin+(i-1)*Δspeedup]≤s≤[speedupmin+i*Δspeedup],s∈speedup},1≤i≤T
Each acceleration ratio group comprises a plurality of acceleration ratios, a database combination corresponding to each acceleration ratio and a retest running time corresponding to the database combination;
s4.1.2.3: and determining the acceleration ratio with the maximum retest task number in each acceleration ratio group as a representative parameter of the acceleration ratio group to form a set speed:
Figure BDA0002664082680000032
wherein S represents an acceleration ratio, SiRepresenting the acceleration ratio set, nf representing the number of financial databases, ps representing the number of the backtesting tasks served by each financial database;
s4.1.2.4: and forming an acceleration ratio queue according to the acceleration ratio groups and the representative parameters of each acceleration ratio group.
Preferably, the multi-parameter quantization strategy is obtained by setting the average line length of the single-parameter quantization strategy as a variable parameter.
Preferably, the single parameter quantization strategy is specifically a single average line strategy.
Preferably, in step S2, according to the free memory amount of the server, the memory amount occupied by the single-parameter quantization policy, and the memory amount occupied by a single financial database, a plurality of database combinations are set to satisfy the following inequality:
Ms*ps*nf+Mf*nf<M
wherein, M represents the free memory amount of the server, Ms represents the memory amount occupied by the single parameter quantization strategy, and Mf represents the memory amount occupied by a single financial database.
Preferably, the plurality of database combinations is specifically an ordered even pair (nf, ps), and the number N of the plurality of database combinations is represented by the following formula:
N=nf*ps
where nf represents the number of financial databases and ps represents the number of return test tasks served by each financial database.
Preferably, said plurality of optimal database combinations are in particular one or more optimal ordered even pairs (nf)Superior food,psSuperior food) The number N of optimal database combinations included in each of the optimal ordered pairingsSuperior foodExpressed by the following formula:
Nsuperior food=nfSuperior food*psSuperior food
Wherein, nfSuperior foodRepresenting the optimal quantity, ps, of financial databasesSuperior foodRepresenting the optimal number of the return testing tasks served by each financial database; and N isSuperior food≤N。
The second aspect of the present invention discloses a system resource scheduling device based on multi-parameter quantization strategy feedback, which comprises:
the standard test unit is used for carrying out retest on the appointed single-parameter quantization strategy according to the preset retest time period and the preset standard stock mark and recording the memory occupied amount of the single-parameter quantization strategy in the retest process;
a setting unit, configured to set a plurality of database combinations according to the idle memory amount of the server, the memory occupied amount of the single-parameter quantization policy, and the memory occupied amount of a single financial database; each database combination comprises a certain number of financial databases and the number of the return testing tasks served by each financial database, and the number of the financial databases in each database combination is different;
the retest test unit is used for retesting the multi-parameter quantization strategy according to the multiple database combinations, the preset retest time period and the preset stock labels so as to obtain the retest running time corresponding to each database combination;
the optimizing unit is used for searching the plurality of database combinations and the corresponding backtesting running time of each database combination according to the specified number of backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations; the optimal database combinations comprise the optimal number of financial databases to be started when the multi-parameter quantization strategy is subjected to the recovery according to the specified recovery test task number and the optimal number of recovery test tasks served by each financial database;
and the backtesting execution unit is used for backtesting other stock marks or other backtesting time periods of the multi-parameter quantization strategy according to the optimal database combinations, wherein the other stock marks are different from the preset standard stock marks, the other backtesting time periods are different from the preset backtesting time period, and the other backtesting time periods are the same as the preset backtesting time period in length.
Compared with the prior art, the technical scheme of the invention has the beneficial effects that: the invention discloses a system resource scheduling method and device based on multi-parameter quantization strategy retest, which comprises the steps of setting a plurality of database combinations according to the idle memory amount of a server, the memory occupied amount of a single-parameter quantization strategy and the memory occupied amount of a single financial database, and retesting multi-parameter quantization strategies according to the plurality of database combinations to obtain retest running time corresponding to each database combination; based on the above, when the user inputs the specified number of the retest tasks and wants to retest other stock labels or other retest time periods of the multi-parameter quantization strategy, the user can search a plurality of optimal database combinations in the plurality of database combinations and the retest running time corresponding to each database combination according to the specified number of the retest tasks, determine the number of financial databases to be opened and the number of retest tasks served by each financial database according to the plurality of optimal database combinations, and retest the multi-parameter quantization strategy according to the result, so that the retest time of the multi-parameter quantization strategy can be shortened, the retest efficiency of the multi-parameter quantization strategy can be accelerated, and the resource cost can be reduced.
Drawings
Fig. 1 is a flowchart of a system resource scheduling method based on multi-parameter quantization policy backtesting in embodiment 1.
Fig. 2 is a schematic diagram of a system resource scheduling apparatus based on multi-parameter quantization policy feedback in embodiment 3.
Wherein: 201. a standard test unit; 202. a setting unit; 203. a back test unit; 204. an optimizing unit; 205. and a backtesting execution unit.
Detailed Description
The drawings are for illustrative purposes only and are not to be construed as limiting the patent;
the technical solution of the present invention is further described below with reference to the accompanying drawings and examples.
Example 1
As shown in fig. 1, the present embodiment provides a system resource scheduling method based on multi-parameter quantization policy backtesting, which includes the following steps:
s1: and carrying out retest on the appointed single-parameter quantization strategy according to the preset retest time period and the preset standard stock mark, and recording the memory occupied by the single-parameter quantization strategy in the retest process.
Alternatively, the preset standard stock mark is a stock mark serving as a reference standard, and can be preset by a developer.
The single-parameter quantization strategy refers to a quantization strategy with a fixed average line length, the number of parameters is one, and the single-parameter quantization strategy or the double-average line strategy can be specifically adopted.
Alternatively, the occupation information of the single parameter quantization strategy in the test process can be obtained, and the occupation information comprises the occupied memory amount Ms and the number of occupied CPU cores. For example, the memory amount Ms is 12KB, and the number of CPU cores is 1 physical core.
S2: setting a plurality of database combinations according to the idle memory amount of the server, the memory occupied amount of the single-parameter quantization strategy and the memory occupied amount of a single financial database; each database combination comprises a certain number of financial databases and the number of the retest tasks served by each financial database, and the number of the financial databases in each database combination is different.
Optionally, before step S2, hardware information of the server may be obtained using a tool or a command, where the hardware information includes CPU basic information and memory information; the CPU basic information can be CPU main frequency, CPU core number and the like; the memory information comprises the amount of idle memory, memory frequency and the like; the free memory amount may be specifically the number of bytes of the free memory, which is hereinafter referred to as M.
Before step S2, a financial database may be started in the server, and the memory amount Mf occupied by the financial database may be obtained. Alternatively, the financial database may be a redis database.
Optionally, the plurality of databases are combined into an ordered even pair (nf, ps), where nf represents the number of financial databases, and ps represents the number of return testing tasks served by each financial database. The selection range of nf and ps is limited by the free memory amount M of the server, the memory amount Ms occupied by the single parameter quantization strategy, and the memory amount Mf occupied by the single financial database, that is, the following inequality needs to be satisfied:
Ms*ps*nf+Mf*nf<M (1)
s3: the multi-parameter quantization strategy is retested according to the multiple database combinations, the preset retesting time period and the preset stock marks, so that the retesting running time corresponding to each database combination is obtained;
it should be noted that the single-parameter quantization strategy refers to a quantization strategy with a fixed average line length, and when a user intends to find out a single-parameter quantization strategy with an optimal benefit from a plurality of single-parameter quantization strategies with different average line lengths, the average line length of the single-parameter quantization strategy can be set as a variable parameter to form a multi-parameter quantization strategy, and the multi-parameter quantization strategy can include a plurality of single-parameter quantization strategies, and the average line lengths of the single-parameter quantization strategies are different. That is, the multi-parameter quantization strategy may be obtained by setting the average line length of the single-parameter quantization strategy in step S1 as a variable parameter.
The parameter number of the multi-parameter quantization strategy is more than one.
S4: searching in a plurality of database combinations and the corresponding backtesting running time of each database combination according to the number of specified backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations;
the optimal database combination comprises the optimal number of financial databases required to be started when the multi-parameter quantization strategy is subjected to recovery according to the specified recovery test task number and the optimal number of recovery test tasks served by each financial database.
Optionally, the multiple database combinations are specifically an ordered even pair (nf, ps), and the number N of the multiple database combinations is calculated by N ═ nf × ps.
Further, the plurality of optimal database combinations may specifically be one or more optimal ordered even pairs (nf)Superior food,psSuperior food) The number N of optimal database combinations included in each optimal ordered pairSuperior foodBy NSuperior food=nfSuperior food*psSuperior foodAnd (4) calculating. Wherein, nfSuperior foodRepresenting the optimal quantity, ps, of financial databasesSuperior foodRepresenting the optimal number of the return testing tasks served by each financial database; and N isSuperior foodN is less than or equal to N. That is, the sum of the number of the retest tasks served by the fusion database in each optimal database combination is less than or equal to the sum of the number of the retest tasks served by the fusion database in the plurality of database combinations.
Specifically, when the user inputs the designated number n of the backtesting tasks to perform the backtesting on the multi-parameter quantization strategy, the multiple database combinations and the backtesting running time corresponding to each database combination can be searched according to the designated number n of the backtesting tasks, so as to obtain multiple optimal database combinations.
However, the search space for searching in the multiple database combinations and the corresponding backtesting operation time of each database combination is large, so that the optimization process takes much time. In order to reduce the time taken by the optimization process, step S4 may optionally include the steps of:
s4.1: compressing a plurality of database combinations and the corresponding backtesting running time of each database combination in an acceleration ratio grouping mode to obtain an acceleration ratio queue;
s4.2: and searching in the acceleration ratio queue according to the number of specified backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations.
In particular, a search may be performed in the acceleration ratio queue to obtain a plurality of optimal database combinations.
Further optionally, step S4.1 may comprise the steps of:
s4.1.1: and calculating the acceleration ratio corresponding to each database combination according to the retest running time corresponding to each database combination to obtain a plurality of acceleration ratios.
It should be noted that the acceleration ratio is used to characterize the ratio of the running time of the same echo task in the single processor system and the parallel processor system, and is used to measure the performance and effect of parallelization of the parallel system or program. Where a single processor system refers to a situation where there is only one financial database and the financial database serves only one loop back test task, the database combination of the present invention is of a parallel processor system (i.e., one or more financial databases and each financial database serves one or more loop back test tasks).
Specifically, the acceleration ratio corresponding to each database combination (nf, ps) can be calculated by the following formula:
Figure BDA0002664082680000071
wherein, N represents the number of operation parameters, N is nf ps, nf represents the number of financial databases, and ps represents the number of return testing tasks served by each financial database; t (1,1) represents the runtime of the backtest in the single-processor system, and t (nf, ps) represents the runtime of the backtest corresponding to the database combination.
S4.1.2: and grouping the plurality of speed-up ratios to form a speed-up ratio queue.
Further optionally, step S4.1.2 may include the steps of:
s4.1.2.1: according to the maximum acceleration ratio, the minimum acceleration ratio and the preset number of groups in the acceleration ratios, calculating the interval delta speed of each group by the following formula (3):
Figure BDA0002664082680000081
wherein T represents a preset number of groups, speedupmaxIndicating the maximum acceleration ratio, speedupminIndicating an acceleration ratio minimum.
S4.1.2.2: grouping a plurality of acceleration ratios by the following formula (4) according to each group interval to obtain a plurality of acceleration ratio groups Si
Si={s|[speedupmin+(i-1)*Δspeedup]≤s≤[speedupmin+i*Δspeedup],s∈speedup},1≤i≤T(4)
Each acceleration ratio group comprises a plurality of acceleration ratios, a database combination corresponding to each acceleration ratio and a retest running time corresponding to the database combination.
It should be noted that, when grouping, it is necessary to record the database combination (nf, ps) corresponding to each acceleration ratio and the backtesting runtime t (nf, ps) corresponding to the database combination (nf, ps).
The preset group number T can be adjusted according to actual needs. The larger T is, the finer the granularity of the search space is, the closer the searched result is to the optimum, and the longer the search time is. The smaller T, the coarser the granularity of the search space, the less optimal the searched result is, and the shorter the search time is.
S4.1.2.3: and determining the acceleration ratio with the maximum retest task number in each acceleration ratio group as a representative parameter of the acceleration ratio group to form a set speed:
Figure BDA0002664082680000082
it should be noted that when each representative acceleration ratio is determined, the database combination (nf, ps) corresponding to each representative acceleration ratio and the backtesting running time t (nf, ps) corresponding to the database combination (nf, ps) need to be recorded.
S4.1.2.4: and forming an acceleration ratio queue according to the acceleration ratio groups and the representative parameters of each acceleration ratio group.
Accordingly, step S4.2 may comprise: and searching in the acceleration ratio queue according to the number of specified backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations.
Further optionally, the following dynamic programming algorithm may be used for searching when searching in the acceleration ratio queue:
Figure BDA0002664082680000091
after searching the speed-up ratio queue through a dynamic programming algorithm, a plurality of optimal database combinations can be output, and specifically, the optimal database combinations can be grouped into a group set:
group={(nfexcellent 1,psExcellent 1),(nfYou 2,psYou 2),L,(nfYouk (good k),psYouk (good k))} (6)
Where k is the number of batches divided. Grouping set group represents dividing the number of the specified return test tasks into k batches for return test, and the 1 st return test task uses nfExcellent 1Individual financial database, each financial database serving psExcellent 1One backtesting task, batch 2 backtesting task using nfYou 2Individual financial database, each financial database serving psYou 2The k batch of retest tasks use nfYouk (good k)Individual financial database, each financial database serving psYouk (good k)And (5) a backtesting task. And the total number of the retest tasks of each batch is less than or equal to N.
Therefore, the specified number of the retest tasks is divided into a plurality of batches for retest, and the results of how many financial databases need to be opened and how many retest tasks are served by each financial database are correspondingly output aiming at each batch of tasks, so that the retest time of the parallel multi-parameter quantization strategy can be further shortened, the retest efficiency of the multi-parameter quantization strategy is accelerated, and the resource cost is reduced.
S5: according to the combination of the optimal databases, carrying out retesting on other stock marks or other retesting time periods of the multi-parameter quantization strategy; the other stock marks are different from the preset standard stock marks, the other time measuring periods are different from the preset time measuring periods, and the lengths of the other time measuring periods are the same as the preset time measuring periods.
Alternatively, a batch of tasks may be set, the batch of tasks is the designated number n of the backtesting tasks input by the user, and then the existing backtesting methods, such as the serial backtesting method and the single-database multi-process backtesting method, are used respectively according to the optimal database combination in step S4 to perform the backtesting on the batch of tasksThe multiparameter quantization strategy is used for carrying out the retest, and the operation efficiency ratio improved by using the system resource scheduling method of the invention relative to the serial retest method is respectively calculated1Compared with the single-database multi-process back test method, the system resource scheduling method of the invention improves the running efficiency ratio2
Figure BDA0002664082680000101
Figure BDA0002664082680000102
Wherein, serial _ t is the total running time of the batch of tasks under the serial backtesting method, single _ t is the total running time of the batch of tasks under the single-database multi-process backtesting method, and optimized _ t is the total running time of the batch of tasks under the system resource scheduling method. ratio (R)1Represents the improved operating efficiency, ratio, of the system resource scheduling method relative to the serial test method2The method for scheduling the system resources improves the operation efficiency compared with a single-database multi-process backtesting method.
The embodiment provides a system resource scheduling method based on multi-parameter quantization strategy retest, which is characterized in that a plurality of database combinations are set according to the idle memory amount of a server, the memory occupied amount of a single-parameter quantization strategy and the memory occupied amount of a single financial database, and the multi-parameter quantization strategy is retested according to the plurality of database combinations to obtain the retest running time corresponding to each database combination; based on the above, when the user inputs the specified number of the retest tasks and wants to retest other stock labels or other retest time periods of the multi-parameter quantization strategy, the user can search a plurality of optimal database combinations in the plurality of database combinations and the retest running time corresponding to each database combination according to the specified number of the retest tasks, determine the number of financial databases to be opened and the number of retest tasks served by each financial database according to the plurality of optimal database combinations, and retest the multi-parameter quantization strategy according to the result, so that the retest time of the multi-parameter quantization strategy can be shortened, the retest efficiency of the multi-parameter quantization strategy can be accelerated, and the resource cost can be reduced.
In addition, the specified number of the retest tasks can be divided into a plurality of batches for retest, and the results of how many financial databases need to be opened and how many retest tasks are served by each financial database are correspondingly output aiming at each batch of tasks, so that the retest time of the multi-parameter quantization strategy is further shortened, the retest efficiency of the multi-parameter quantization strategy is accelerated, and the resource cost is reduced.
Example 2
The embodiment provides a system resource scheduling method based on multi-parameter quantization strategy feedback, which comprises the following steps:
step 1: a safe bank (000001.SZ) is selected as a preset standard stock mark, a single average line strategy is adopted as a specified single-parameter quantization strategy, the average line length of the single average line strategy is 5, the single average line strategy occupies 12KB of memory, and the number of CPU cores is 1.
Step 2: acquiring hardware information of the server by using a tool or a command; the hardware information includes CPU basic information and memory information.
Wherein, CPU basic information: the CPU main frequency is 2.10 GHz; the number of CPU cores: 2 physical CPUs, 1 CPU has 16 cores, and 64 logic CPUs are in total; memory information: the free memory amount M is 224GB, and the memory frequency is 2666 MHz.
And step 3: starting a redis database in a server as a financial database, and acquiring the memory occupation amount Mf of the financial database, wherein the memory occupation amount Mf of the financial database is 5.17GB, namely, one physical core is occupied.
And 4, step 4: according to the free memory amount M of the server, the memory occupied amount Ms occupied by the single-average line strategy and the memory occupied amount Mf of the financial database, a maximum of 12 different financial databases can be set through calculation of a formula (1), and each financial database can serve 32 backtesting tasks at most.
And 5: after the number nf of financial databases is set from 1 to 12 and the number ps of backtesting tasks of each financial database service is set from 1 to 32, the multi-parameter quantization strategy is backtested, and the backtesting running time corresponding to each database combination can be obtained, as shown in table 1 below:
TABLE 1 run time distribution Table
Figure BDA0002664082680000111
Figure BDA0002664082680000121
Figure BDA0002664082680000131
Step 6: calculating the acceleration ratio corresponding to each database combination according to the retest running time corresponding to each database combination for the running time distribution condition table obtained in the step 5, as shown in the following table 2:
TABLE 2 Accelerator List
Figure BDA0002664082680000132
Figure BDA0002664082680000141
And 7: taking T as 100, reducing the dimension of the acceleration ratio list, obtaining acceleration ratio groups, and determining a representative acceleration ratio of each acceleration ratio group to obtain an acceleration ratio queue as shown in the following table 3:
TABLE 3 acceleration ratio queue
Figure BDA0002664082680000142
Figure BDA0002664082680000151
Figure BDA0002664082680000161
And 8: aiming at different backtesting task quantities 24, 96, 200 and 320 specified by a user, respectively, a dynamic programming algorithm is adopted to search in the Speedup ratio queue Speedup, so that a group set of an optimal database combination corresponding to each specified backtesting task quantity can be obtained, as shown in the following table 4:
TABLE 4 grouped collection of optimal database combinations
Appointing the number n of backtesting tasks Grouping set group
24 {(4,6)}
96 {(8,12)}
200 {(8,12),(2,4),(8,12)}
320 {(13,12),(2,4),(13,12)}
And step 9: according to the number of each appointed backtesting task and the set of the optimal database combination corresponding to each appointed backtesting task, the pair of randomly selected stock labelsCarrying out back test on a multi-parameter quantization strategy; and respectively using the existing backtesting methods, such as a serial backtesting method and a single-database multi-process backtesting method, to backtest the multi-parameter quantization strategy, and calculating the operation efficiency ratio improved by using the system resource scheduling method of the invention compared with the serial backtesting method by using a formula (7)1And calculating the running efficiency ratio improved by using the system resource scheduling method of the invention relative to a single-database multi-process backtesting method through a formula (8)2. As shown in table 5 below, table 5 is a comparison table of the operation efficiency of the system resource scheduling method of the present invention with respect to the existing back test method.
TABLE 5 comparison of operating efficiency
Figure BDA0002664082680000162
As can be seen from table 5, when the number of designated backtesting tasks is large, the efficiency improved by using the system resource scheduling method of the present invention is more than 20 times compared with the serial backtesting method, and the efficiency improved by using the system resource scheduling method of the present invention is more than 4 times compared with the single-database multi-process backtesting method.
Therefore, the system resource scheduling method based on the multi-parameter quantization strategy retest can greatly improve the running efficiency of the multi-parameter quantization strategy retest and reduce the resource cost.
Example 3
As shown in fig. 2, the present embodiment provides a system resource scheduling apparatus based on multi-parameter quantization policy return test, which includes a standard test unit 201, a setting unit 202, a return test unit 203, an optimizing unit 204, and a return test execution unit 205, wherein:
the standard testing unit 201 is configured to perform a retest on the specified single-parameter quantization strategy according to the preset retest time period and the preset standard stock index, and record an amount of memory occupied by the single-parameter quantization strategy in the retest process;
a setting unit 202, configured to set a plurality of database combinations according to the idle memory amount of the server, the memory amount occupied by the single-parameter quantization policy, and the memory amount occupied by a single financial database; each database combination comprises a certain number of financial databases and the number of the retest tasks served by each financial database, and the number of the financial databases in each database combination is different;
the retest test unit 203 is configured to retest the multi-parameter quantization strategy according to the multiple database combinations, the preset retest time period, and the preset stock index, so as to obtain a retest time period corresponding to each database combination;
the optimizing unit 204 is configured to search a plurality of database combinations and a corresponding backtesting running time of each database combination according to the number of specified backtesting tasks input by the user for the multi-parameter quantization strategy, so as to obtain a plurality of optimal database combinations; the method comprises the following steps that a plurality of optimal database combinations comprise the optimal number of financial databases to be started when a multi-parameter quantization strategy is subjected to recovery according to the number of designated recovery testing tasks and the optimal number of recovery testing tasks served by each financial database;
the backtesting execution unit 205 is configured to perform backtesting on other stock labels or other backtesting time periods of the multi-parameter quantization strategy according to a combination of the plurality of optimal databases, where the other stock labels are different from the preset standard stock labels, the other backtesting time periods are different from the preset backtesting time period, and the other backtesting time periods are the same as the preset backtesting time period in length.
The embodiment discloses a system resource scheduling device based on multi-parameter quantization strategy retest, which is characterized in that a plurality of database combinations are set according to the idle memory amount of a server, the memory occupied amount of a single-parameter quantization strategy and the memory occupied amount of a single financial database, and the multi-parameter quantization strategy is retested according to the plurality of database combinations to obtain the retest running time corresponding to each database combination; based on the above, when the user inputs the specified number of the retest tasks and wants to retest other stock labels or other retest time periods of the multi-parameter quantization strategy, the user can search a plurality of optimal database combinations in the plurality of database combinations and the retest running time corresponding to each database combination according to the specified number of the retest tasks, determine the number of financial databases to be opened and the number of retest tasks served by each financial database according to the plurality of optimal database combinations, and retest the multi-parameter quantization strategy according to the result, so that the retest time of the multi-parameter quantization strategy can be shortened, the retest efficiency of the multi-parameter quantization strategy can be accelerated, and the resource cost can be reduced.
It should be understood that the above-described embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the claims of the present invention.

Claims (10)

1. A system resource scheduling method based on multi-parameter quantization strategy feedback is characterized by comprising the following steps:
s1: according to a preset time period of the return test and a preset standard stock mark, carrying out the return test on a specified single-parameter quantization strategy, and recording the memory occupied by the single-parameter quantization strategy in the return test process;
s2: setting a plurality of database combinations according to the idle memory amount of the server, the memory occupied amount of the single-parameter quantization strategy and the memory occupied amount of a single financial database; each database combination comprises a certain number of financial databases and the number of the return testing tasks served by each financial database, and the number of the financial databases in each database combination is different;
s3: carrying out retest on the multi-parameter quantization strategy according to the plurality of database combinations, the preset retest time period and the preset stock labels to obtain the retest time period corresponding to each database combination;
s4: searching the plurality of database combinations and the corresponding backtesting running time of each database combination according to the specified number of the backtesting tasks input by the user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations; the optimal database combinations comprise the optimal number of financial databases to be started when the multi-parameter quantization strategy is subjected to the recovery according to the specified recovery test task number and the optimal number of recovery test tasks served by each financial database;
s5: and according to the optimal database combinations, carrying out retesting on other stock labels or other retesting time periods of the multi-parameter quantization strategy, wherein the other stock labels are different from the preset standard stock labels, the other retesting time periods are different from the preset retesting time period, and the other retesting time periods are the same as the preset retesting time period in length.
2. The method for scheduling system resources based on multi-parameter quantization policy backtesting as claimed in claim 1, wherein step S4 comprises the following steps:
s4.1: compressing the plurality of database combinations and the corresponding backtesting running time of each database combination in an acceleration ratio grouping mode to obtain an acceleration ratio queue;
s4.2: and searching in the acceleration ratio queue according to the number of specified backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations.
3. The method for scheduling system resources based on multi-parameter quantization strategy feedback according to claim 2, wherein step S4.1 comprises:
s4.1.1: calculating the acceleration ratio corresponding to each database combination according to the retest running time corresponding to each database combination to obtain a plurality of acceleration ratios;
s4.1.2: and grouping the plurality of speed-up ratios to form a speed-up ratio queue.
4. The method of claim 3, wherein the step S4.1.2 comprises the following steps:
s4.1.2.1: according to the maximum acceleration ratio, the minimum acceleration ratio and the preset number of groups in the multiple acceleration ratios, calculating each group interval delta speed by the following formula:
Figure FDA0002664082670000021
wherein T represents a predetermined number of groups, speedupmaxIndicating the maximum acceleration ratio, speedupminRepresents an acceleration ratio minimum;
s4.1.2.2: grouping a plurality of acceleration ratios according to each group interval by the following formula to obtain a plurality of acceleration ratio groups Si
Si={s|[speedupmin+(i-1)*Δspeedup]≤s≤[speedupmin+i*Δspeedup],s∈speedup},1≤i≤T
Each acceleration ratio group comprises a plurality of acceleration ratios, a database combination corresponding to each acceleration ratio and a retest running time corresponding to the database combination;
s4.1.2.3: and determining the acceleration ratio with the maximum retest task number in each acceleration ratio group as a representative parameter of the acceleration ratio group to form a set speed:
Figure FDA0002664082670000022
wherein S represents an acceleration ratio, SiRepresenting the acceleration ratio set, nf representing the number of financial databases, ps representing the number of the backtesting tasks served by each financial database;
s4.1.2.4: and forming an acceleration ratio queue according to the acceleration ratio groups and the representative parameters of each acceleration ratio group.
5. The method as claimed in any one of claims 1 to 4, wherein the multi-parameter quantization strategy is obtained by setting the mean line length of the single-parameter quantization strategy as a variable parameter.
6. The method as claimed in claim 5, wherein the single-parameter quantization strategy is a single-average line strategy.
7. The method according to claim 1, wherein in step S2, the combination of databases is set to satisfy the following inequality according to the amount of idle memory of the server, the amount of memory occupied by the single-parameter quantization policy, and the amount of memory occupied by a single financial database:
Ms*ps*nf+Mf*nf<M
wherein, M represents the free memory amount of the server, Ms represents the memory amount occupied by the single parameter quantization strategy, and Mf represents the memory amount occupied by a single financial database.
8. The method as claimed in claim 7, wherein the database combinations are specifically an ordered even pair (nf, ps), and the number N of the database combinations is represented by the following formula:
N=nf*ps
where nf represents the number of financial databases and ps represents the number of return test tasks served by each financial database.
9. The method of claim 8, wherein the optimal database combinations are one or more optimal ordered even pairs (nf)Superior food,psSuperior food) The number N of optimal database combinations included in each of the optimal ordered pairingsSuperior foodExpressed by the following formula:
Nsuperior food=nfSuperior food*psSuperior food
Wherein, nfSuperior foodRepresenting the optimal quantity, ps, of financial databasesSuperior foodRepresenting the optimal number of the return testing tasks served by each financial database; and N isSuperior food≤N。
10. A system resource scheduling device based on multi-parameter quantization strategy feedback is characterized by comprising:
the standard test unit is used for carrying out retest on the appointed single-parameter quantization strategy according to the preset retest time period and the preset standard stock mark and recording the memory occupied amount of the single-parameter quantization strategy in the retest process;
a setting unit, configured to set a plurality of database combinations according to the idle memory amount of the server, the memory occupied amount of the single-parameter quantization policy, and the memory occupied amount of a single financial database; each database combination comprises a certain number of financial databases and the number of the return testing tasks served by each financial database, and the number of the financial databases in each database combination is different;
the retest test unit is used for retesting the multi-parameter quantization strategy according to the multiple database combinations, the preset retest time period and the preset stock labels so as to obtain the retest running time corresponding to each database combination;
the optimizing unit is used for searching the plurality of database combinations and the corresponding backtesting running time of each database combination according to the specified number of backtesting tasks input by a user aiming at the multi-parameter quantization strategy so as to obtain a plurality of optimal database combinations; the optimal database combinations comprise the optimal number of financial databases to be started when the multi-parameter quantization strategy is subjected to the recovery according to the specified recovery test task number and the optimal number of recovery test tasks served by each financial database;
and the backtesting execution unit is used for backtesting other stock marks or other backtesting time periods of the multi-parameter quantization strategy according to the optimal database combinations, wherein the other stock marks are different from the preset standard stock marks, the other backtesting time periods are different from the preset backtesting time period, and the other backtesting time periods are the same as the preset backtesting time period in length.
CN202010913281.5A 2020-09-03 2020-09-03 System resource scheduling method and device based on multi-parameter quantization strategy feedback Active CN112035533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010913281.5A CN112035533B (en) 2020-09-03 2020-09-03 System resource scheduling method and device based on multi-parameter quantization strategy feedback

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010913281.5A CN112035533B (en) 2020-09-03 2020-09-03 System resource scheduling method and device based on multi-parameter quantization strategy feedback

Publications (2)

Publication Number Publication Date
CN112035533A true CN112035533A (en) 2020-12-04
CN112035533B CN112035533B (en) 2022-07-12

Family

ID=73591683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010913281.5A Active CN112035533B (en) 2020-09-03 2020-09-03 System resource scheduling method and device based on multi-parameter quantization strategy feedback

Country Status (1)

Country Link
CN (1) CN112035533B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692206A (en) * 2009-08-28 2010-04-07 腾讯科技(深圳)有限公司 Method for adding dynamic parameters to static callback function and related realization
CN107833137A (en) * 2017-11-03 2018-03-23 上海宽全智能科技有限公司 Quantization trading strategies generation method and device, equipment and storage medium based on multiple-objection optimization
CN108765149A (en) * 2018-05-11 2018-11-06 南京工程学院 A kind of quantization strategy based on cluster returns examining system and its returns survey method
CN110533540A (en) * 2019-09-06 2019-12-03 北京神州同道智能科技有限公司 A kind of whole city multi items finance money guard system based on intelligence dimension Meta-Policy platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692206A (en) * 2009-08-28 2010-04-07 腾讯科技(深圳)有限公司 Method for adding dynamic parameters to static callback function and related realization
CN107833137A (en) * 2017-11-03 2018-03-23 上海宽全智能科技有限公司 Quantization trading strategies generation method and device, equipment and storage medium based on multiple-objection optimization
CN108765149A (en) * 2018-05-11 2018-11-06 南京工程学院 A kind of quantization strategy based on cluster returns examining system and its returns survey method
CN110533540A (en) * 2019-09-06 2019-12-03 北京神州同道智能科技有限公司 A kind of whole city multi items finance money guard system based on intelligence dimension Meta-Policy platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"《科学技术与工程》第十卷总目录", 《科学技术与工程》 *
骆伟祺: "鲁棒的区域复制图像篡改检测技术", 《计算机学报》 *

Also Published As

Publication number Publication date
CN112035533B (en) 2022-07-12

Similar Documents

Publication Publication Date Title
WO2021012930A1 (en) Voting node configuration method and system
WO2019153487A1 (en) System performance measurement method and device, storage medium and server
CN107908536B (en) Performance evaluation method and system for GPU application in CPU-GPU heterogeneous environment
CN106790529B (en) Dispatching method, control centre and the scheduling system of computing resource
US11709834B2 (en) Method and database system for sequentially executing a query and methods for use therein
CN110717687A (en) Evaluation index acquisition method and system
CN110377519B (en) Performance capacity test method, device and equipment of big data system and storage medium
CN115562978A (en) Performance test system and method based on service scene
CN113807046A (en) Test excitation optimization regression verification method, system and medium
CN110825526B (en) Distributed scheduling method and device based on ER relationship, equipment and storage medium
US20070219646A1 (en) Device performance approximation
CN112035533B (en) System resource scheduling method and device based on multi-parameter quantization strategy feedback
WO2023224742A1 (en) Predicting runtime variation in big data analytics
CN112784435B (en) GPU real-time power modeling method based on performance event counting and temperature
CN113157814B (en) Query-driven intelligent workload analysis method under relational database
CN115168509A (en) Processing method and device of wind control data, storage medium and computer equipment
CN108629441A (en) Prediction technique and device based on clustering and the improved fan noise of small echo
CN115794570A (en) Pressure testing method, device, equipment and computer readable storage medium
CN101201751B (en) Method for planning capacity of multiple machines aiming at OLTP application
CN113791904B (en) Method, apparatus, device and readable storage medium for processing query input
CN117009303B (en) Method for storing chip vision test data
CN117336296B (en) Intelligent selection method for cluster consensus
CN113742216B (en) Method, device and storage medium for detecting efficiency of machine learning engine
CN117707742A (en) Load prediction-based energy consumption balance job scheduling method and system
JP2004258705A (en) Program processing time estimation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant