Quantitative transaction strategy processing method and device and storage medium

By deploying quantitative trading strategies to cloud services and leveraging the computing power and resource elasticity of the cloud, the problems of low convenience and resource utilization efficiency in local device operation are solved, and efficient, stable and secure strategy operation is achieved.

CN120807141APending Publication Date: 2025-10-17FUTU NETWORK TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510723041.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

In the existing technology, quantitative trading strategies have low convenience and resource utilization efficiency when running on local devices, and are limited by computing resources and network environment.

Method used

Deploy quantitative trading strategies to cloud services, manage their operations through cloud services, and leverage the cloud's powerful computing power and resource elasticity to achieve efficient strategy operation and resource utilization.

Benefits of technology

It improves the operational convenience and resource utilization efficiency of quantitative trading strategies, reduces operating costs, ensures the continuous and stable operation of strategies and data security, simplifies management processes, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807141A_ABST
    Figure CN120807141A_ABST
Patent Text Reader

Abstract

The invention provides a quantitative transaction strategy processing method and device and a storage medium, and the method comprises the steps: responding to a cloud operation request of a target user for a target quantitative transaction strategy, and generating a container initialization instruction, the cloud operation request comprising a strategy starting parameter; based on the container initialization instruction, a strategy operation container is obtained from the cloud service, and a target quantification process is started in the strategy operation container; and through the target quantification process in the strategy operation container, obtaining and operating a target quantification transaction strategy according to the strategy starting parameter. The operation convenience and the resource utilization efficiency of the quantitative transaction strategy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of cloud computing, and particularly relate to a quantitative trading strategy processing method and device and storage medium. BACKGROUND

[0002] Quantitative trading strategy refers to a trading method that makes trading decisions by using historical market data and real-time market data, and predetermined rules and algorithms through mathematical models and statistical analysis.

[0003] At present, quantitative trading strategies are often run on local devices. However, due to the limited computing resources and network environment of local devices, and the need for underlying hardware and environment configuration, the running of quantitative trading strategies in this way has the problems of low convenience and resource utilization efficiency. SUMMARY

[0004] The present application provides a quantitative trading strategy processing method and device and storage medium, which can improve the running convenience and resource utilization efficiency of quantitative trading strategies.

[0005] In a first aspect, the present application provides a quantitative trading strategy processing method, which comprises: in response to a cloud running request of a target user for a target quantitative trading strategy, generating a container initialization instruction, the cloud running request comprising strategy start parameters; based on the container initialization instruction, obtaining a strategy running container in a cloud service, and starting a target quantitative process in the strategy running container; and through the target quantitative process in the strategy running container, obtaining and running the target quantitative trading strategy according to the strategy start parameters.

[0006] In a second aspect, the present application provides a quantitative trading strategy processing device, which comprises: an instruction generation module configured to generate a container initialization instruction in response to a cloud running request of a target user for a target quantitative trading strategy, the cloud running request comprising strategy start parameters; an obtaining and starting module configured to obtain a strategy running container in a cloud service based on the container initialization instruction, and start a target quantitative process in the strategy running container; and an obtaining and running module configured to obtain and run the target quantitative trading strategy according to the strategy start parameters through the target quantitative process in the strategy running container.

[0007] In a third aspect, the present application provides an electronic device, which comprises a processor and a memory, the memory being configured to store a computer program, and the processor being configured to invoke and run the computer program stored in the memory to execute the method in the first aspect or any of the implementation manners thereof.

[0008] In a fourth aspect, the present application provides a computer-readable storage medium configured to store a computer program, the computer program causing a computer to execute the method in the first aspect or any of the implementation manners thereof.

[0009] In a fifth aspect, the present application provides a computer program product comprising computer program instructions to cause a computer to perform the method according to the first aspect or any implementation thereof.

[0010] In a sixth aspect, the present application provides a computer program to cause a computer to perform the method according to the first aspect or any implementation thereof.

[0011] Other technical features and effects of the technical solutions of the present application will be described in subsequent embodiments. To avoid repetition, they will not be described here. BRIEF DESCRIPTION OF DRAWINGS

[0012] The drawings used in the description of the embodiments are introduced below.

[0013] Figure 1 An application scenario graph is provided for the embodiments of the present application.

[0014] Figure 2 A flowchart of a quantitative trading strategy processing method is provided for the embodiments of the present application.

[0015] Figure 3 A schematic diagram of a quantitative trading strategy processing method is provided for the embodiments of the present application.

[0016] Figure 4 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0017] Figure 5 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0018] Figure 6 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0019] Figure 7 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0020] Figure 8 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0021] Figure 9 A schematic diagram of another quantitative trading strategy processing method is provided for the embodiments of the present application.

[0022] Figure 10 A schematic diagram of a quantitative trading strategy processing device 1000 is provided for the embodiments of the present application.

[0023] Figure 11A schematic block diagram of an electronic device 1100 is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0025] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described accompanying drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or server including a series of steps or units does not necessarily have to include only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.

[0026] In one embodiment, the technical solutions of the present application can be used in the processing scenario of a quantitative trading strategy, and can be specifically applied to a scenario of running a quantitative trading strategy, for example, starting or stopping the running of a quantitative trading strategy, detecting the running state of a quantitative trading strategy, allocating and releasing related resources before and after running a quantitative trading strategy, and the like, but are not limited thereto.

[0027] The quantitative trading and quantitative trading strategy will be introduced as follows:

[0028] Quantitative trading refers to a process of completing transactions based on a pre-prepared quantitative trading strategy by using computer technology. Quantitative trading can reduce the influence of investor emotional fluctuations on transactions and avoid making irrational investment decisions in the case of market frenzy or pessimism.

[0029] The quantified trading strategy specifically includes a trading object, pre-established trading conditions, and triggered trading operations after the trading conditions are met. The trading conditions include, but are not limited to, specific conditions that need to be met by market data related to the trading object and / or related technical indicators. The trading operations include, but are not limited to, order placement operations and order cancellation operations. For example, taking the moving average golden cross opening strategy as an example, when the k-line data of the trading object specified in the quantified trading strategy crosses the moving average of the k-line data of the trading object in a certain short period (i.e., the pre-established trading conditions are met), the order placement operation of buying the trading object is executed (i.e., the trading operation triggered after the trading conditions are met).

[0030] For example, the strategy logic of the quantified trading strategy can be that when the technical indicators of the trading object specified in the quantified trading strategy meet the pre-established trading conditions, the order placement operation of the trading object is executed. Taking the moving average golden cross opening strategy as an example, when the moving average of the trading object specified in the quantified trading strategy meets the golden cross in a certain period, the buy order placement operation of the trading object is executed, thereby helping the investor to better seize the trading opportunity, achieving more accurate and efficient trading operations, improving the trading efficiency and speed.

[0031] Specifically, the quantified trading can be realized through the interaction between the client and the server corresponding to the client. The client includes a client front end and a client back end. The client front end can provide a visual interactive interface for the investor to build and / or select a quantified trading strategy and receive a trigger operation for triggering the execution of the quantified trading strategy. The client back end is used to send a cloud running request to the server to trigger the server to actually execute the quantified trading strategy through the cloud service.

[0032] The investor can define the strategy logic of the quantitative trading strategy based on the visual interactive interface provided by the client front end, that is, the investor can directly specify the preset trading condition (i.e., the pre-prepared trading condition described above) and the executed trading operation after the preset trading condition is met based on the visual interactive interface provided by the client front end. Specifically, the visual interactive interface provided by the client front end can include a quantitative trading strategy canvas, and the quantitative trading strategy canvas is provided with card controls, including a start card control, a condition card control, and an event card control. The user can edit the card controls provided by the quantitative trading strategy canvas based on the client front end to construct a quantitative trading strategy based on the quantitative trading strategy canvas. For example, the user can edit the condition card control to set the trading object to which the quantitative trading strategy is directed and the trading condition of the trading object, and edit the event card control to set the trading operation of the quantitative trading strategy. After the quantitative trading strategy is constructed, the client back end can convert the quantitative trading strategy constructed based on the start card control, the condition card control, and the event card control into corresponding execution strategy code and send it to the server.

[0033] During the execution of the quantitative trading strategy, the cloud service can obtain the market data of the trading object and the quantitative trading strategy from the server in real time, execute the execution strategy code corresponding to the quantitative trading strategy based on the market data, determine whether the specified preset trading condition is met based on the market data of the trading object, and trigger the execution of the trading operation when the preset trading condition is met to send a corresponding trading request to the corresponding trading request interface of the server to realize trading.

[0034] Specifically, Figure 1 An application scenario provided by an embodiment of the present application is shown in Figure 1 The application scenario can include a client and a server. The server includes a cloud service and a server service, and the server service includes a container management service and a strategy running management service. A plurality of containers, such as a strategy running container, can be run in the cloud service, and the strategy running container is used to run a quantitative trading strategy. The server service can be arranged in an intranet, and the server service and the client can communicate through an access layer, but are not limited thereto.

[0035] For example, the client can be a client for constructing or controlling the start / stop of the quantitative trading strategy, and specifically can be a client installed in a terminal device such as a mobile phone or a computer, and can be a client based on any operating system. For example, the client can be a personal computer (PC) client, an IOS client, or an Android client, but is not limited thereto.

[0036] The server service can be software or an application program running on a server. Figure 1 The server service in the server can refer to a server or a server cluster composed of multiple servers, and the present application does not limit this.

[0037] The cloud service can be a cloud platform control center, a cloud service cluster, or a cloud platform for arranging and managing containers. For example, a Kubernetes (K8S) cluster, a Docker Swarm, etc.

[0038] For example, the client can be used to start, stop, and query the running data of the quantitative trading strategy, such as the strategy running state. Specifically, the client can be implemented by accessing the access layer. The access layer can be an intermediate layer of the intranet service, which is used to isolate the intranet and the extranet. When a user logs in on the client, the identity can be first authenticated through the access layer, and a long connection can be established with the access layer after the login authentication is passed. Subsequently, the server service deployed in the intranet can be accessed through the long connection, so as to ensure the security of the communication between the client and the server service.

[0039] For the server service, the strategy running management service is used to directly connect to the client, can process user requests, such as cloud running requests for the quantitative trading strategy, and can manage the entire life cycle of the quantitative trading strategy running in the strategy running container, including the start, stop, and detection of the strategy running state. The container management service is used to connect to the cloud service, can be used as a proxy of the cloud service, and provides interfaces for creating, destroying, recycling, and querying containers. The container management service can be called by the strategy running management service to shield the operation details of the cloud service, so that the strategy running management service can focus on its own business process.

[0040] For the cloud service, n containers can be run therein, n is a positive integer, and a quantitative process and an agent service can be started in each container. The agent service is a service process running in the container, which can be a communication agent service used as a transfer station for communication between the strategy running management service and the quantitative process. Since the strategy running management service directly accesses the quantitative process to realize the process of direct communication between the server and the client, the agent service can be used as a transfer station to simplify the communication between the server service and the quantitative process. The quantitative process can be understood as a simple client obtained by separating the quantitative module in the terminal device, which can be used to run the quantitative trading strategy created by the user in the container, and is essentially not different from the client. Specifically, the quantitative trading strategy can be obtained and run by the strategy process in the quantitative process.

[0041] It can be understood that when the quantification component running the quantification trading strategy relies on a local device such as a local computer, there are many inconveniences and limitations, for example, the local device must be kept online at all times during the running of the quantification trading strategy, and it is limited by the stability of the local computing resources and network environment, in addition, the user has high technical requirements for managing and maintaining the quantification component running the quantification trading strategy in the local device, and the technical solution of the present application can deploy the component running the quantification trading strategy to the cloud service, and realize the running management of the quantification trading strategy through the cloud service. Since the cloud service has powerful computing power and resource elasticity, it can adjust resources according to the needs of the quantification trading strategy, so as to ensure the efficient running of the quantification strategy and the utilization rate of resources, and reduce the running cost. Moreover, the cloud service has high availability and disaster recovery capability, which can ensure the continuous and stable running of the quantification trading strategy and reduce the running interruption caused by the failure of the local device. In addition, the cloud service has more perfect security protection measures, which can better protect the security of user data and strategy running, and the user does not need to care about the underlying hardware and environment configuration, and can perform a series of operations through the cloud service through the client, including starting and stopping the quantification trading strategy, which can simplify the management process and improve the user experience.

[0042] The technical solution of the present application will be described in detail as follows:

[0043] It should be noted that the present application does not limit the specific form of the client and the server. In addition, all the technical solutions in the present application can adopt any combination to form optional embodiments of the present application. To avoid repetition, this will not be described.

[0044] It should be noted that in the specific embodiments of the present application, related data, information, requests or instructions such as quantification trading strategy, cloud running request, strategy start parameter, strategy running record table and user container information table are involved. When the embodiments of the present application are applied to specific products or technologies, the user's permission, consent or authorization is required, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0045] In the technical solution of the present application, a complete set of management methods for running the quantification trading strategy in the cloud container can be realized through the steps of starting, stopping, checking the running state of the quantification trading strategy and releasing the container resources. The following content will introduce the above steps.

[0046] For the starting step of the quantification trading strategy, it mainly involves the steps of allocating container resources, creating a strategy running container, performing user login operation in the strategy running container, pulling and running the quantification trading strategy through the strategy running container, and recording the strategy running state of the quantification trading strategy. The following embodiments will introduce this.

[0047] In one embodiment, Figure 2 A flowchart of a quantitative trading strategy processing method is provided for the embodiments of the present application, which can be executed by the server as Figure 1 shown, but is not limited thereto.

[0048] As Figure 2 shown, the method can include the following steps:

[0049] S210: In response to a cloud running request of a target user for a target quantitative trading strategy, a container initialization instruction is generated, and the cloud running request includes strategy start parameters;

[0050] S220: Based on the container initialization instruction, a strategy running container is obtained in the cloud service, and a target quantitative process is started in the strategy running container;

[0051] S230: Through the target quantitative process in the strategy running container, the target quantitative trading strategy is obtained and run according to the strategy start parameters.

[0052] Before introducing S210-S230, two data tables involved in the embodiments, namely, a user container information table and a strategy running record table, are introduced.

[0053] For the user container information table, data related to running a quantitative trading strategy of a user in a cloud device is recorded. Specifically, the user container information table can include at least one of the following fields: a user account of a specific user, a member expiration time, a number of quantitative trading strategies allowed to run, and a number of quantitative trading strategies currently actually running. The specific user can be a user who has opened a member for running a quantitative trading strategy in the cloud, or the specific user can also be any user, which is not limited by the present application; the member expiration time refers to the running period of the quantitative trading strategy started by the specific user in the cloud service, i.e., the strategy running period; the number of quantitative trading strategies allowed to run refers to the maximum number of quantitative trading strategies that can be started by the specific user in the cloud service, i.e., the maximum running strategy number, which can be the number of quantitative trading strategies that can be run simultaneously or the total number of quantitative trading strategies that can be run within the member expiration time; and the number of quantitative trading strategies currently actually running refers to the actual number of quantitative trading strategies currently started by the specific user in the cloud service, i.e., the actual running strategy number.

[0054] Specifically, the user container information table can include the account identification of the user account, the member expiration time, the maximum running strategy number, and the actual running strategy number; and the corresponding field names can be recorded as uid, expired_ts, total_num, and used_num, respectively.

[0055] For the strategy running record table, the running record of each running quantitative trading strategy can be recorded, which is used to track the running condition of the currently running quantitative trading strategy, involves the whole life cycle of the quantitative trading strategy from starting running to stopping running, and the strategy running record table can specifically include at least one of the following fields (wherein the quantitative trading strategy can be referred to as strategy in the embodiments of the present application):

[0056] The account identifier is used to uniquely identify the user, and can represent the corresponding user running the quantitative trading strategy. In the strategy running record table, the field corresponding to the account identifier can be: uid.

[0057] The running identifier is the primary key of the strategy running record table, and a unique running identifier is generated for each running quantitative trading strategy, which is used to uniquely identify this running. Specifically, the running identifier can be generated by a snowflake algorithm, so as to ensure that the running identifier is unique in the system, and all subsequent running processes can be tracked through the running identifier. In the strategy running record table, the field corresponding to the running identifier can be: running_id.

[0058] The strategy identifier is the unique identifier of the quantitative trading strategy, and the quantitative trading strategy constructed by the user on the client can be saved to the cloud service. When the quantitative trading strategy is run in the container of the cloud service, the quantitative trading strategy can be pulled down from the cloud service through the strategy identifier. In the strategy running record table, the field corresponding to the strategy identifier can be: strategy_id.

[0059] The container name is the unique identifier of the container (i.e. the strategy running container), which records which container is used for this running. By storing the container name, the corresponding container can be released after the quantitative trading strategy is run. In the strategy running record table, the field corresponding to the container name can be: pod_name.

[0060] The network address of the container can be the Internet Protocol Address (IP address) of the container, which is used to call the specified container through the network address when calling the proxy service (specifically, the communication proxy service) in the container. In the strategy running record table, the field corresponding to the network address of the container can be: pod_ip.

[0061] The strategy running state is a running state of the quantitative trading strategy, and includes the following three states: a running state, which indicates that the user has received an instruction to start the strategy, but the preparation of the container takes a period of time, and the strategy is in the running state during the waiting period; a running state, which indicates that the container is prepared and the strategy is successfully started in the container; and a stopped state, which indicates the strategy state when the user stops the strategy, and indicates the end of this run. In the strategy running record table, the field corresponding to the strategy running state can be running_status, which can identify different strategy running states by different enumeration values.

[0062] The container state is used to mark whether the container has been recycled, and can be specifically: an unrecycled state, which indicates the state from the allocation of the container to the end of the strategy running; and a recycled state, which indicates the state after the recycling of the container resources after the end of the strategy running. In the strategy running record table, the field corresponding to the container state can be pod_status, which can identify different container states by different enumeration values.

[0063] The reason for stopping the strategy running includes: user manual stop, which indicates that the user manually stops the running of the quantitative trading strategy through the button on the client; strategy automatic stop, which indicates that the user constructs a quantitative trading strategy with a stop condition, and the strategy is automatically stopped when the stop condition is met; and abnormal reason stop, which indicates that the stop is caused by various unexpected abnormal reasons, for example, when the memory used by the quantitative process exceeds the memory limit allocated by the container or the system, i.e., OOM (Out Of Memory), the corresponding quantitative trading strategy stops running. In the strategy running record table, the field corresponding to the reason for stopping the strategy running can be stop_reason.

[0064] The timestamp of stopping the strategy running is the time when the quantitative trading strategy stops, which can be a second-level timestamp. In the strategy running record table, the field corresponding to the timestamp of stopping the strategy running can be stop_ts.

[0065] In an embodiment, the user container information table and the strategy running record table can be determined in advance and stored, so as to facilitate the subsequent embodiments.

[0066] In an embodiment, before S210 is performed, the target user can first construct and / or start the target quantitative trading strategy based on the visual interactive interface provided by the client front end. For example, the client front end can display a visual interface as shown in FIG. 6, and the target user can construct and / or start the target quantitative trading strategy based on the visual interface. Figure 3The quantitative trading strategy canvas is shown, and a user triggers an operation on a cloud running button in a live button in the quantitative trading strategy canvas. In response to the triggering operation, a cloud running request can be generated and sent to a server to trigger the server to run a target quantitative trading strategy through a cloud service. Specifically, the cloud running request can be sent to a strategy running management service in the server. Based on the cloud running request, the strategy running management service generates a container initialization instruction to create a container in the cloud service through the container initialization instruction to run the target quantitative process.

[0067] The cloud running request includes strategy startup parameters, which can include a target account identifier of a target user, an account key corresponding to the target account identifier, and a strategy identifier of the target quantitative trading strategy. Specifically, the strategy startup parameters can be carried in the request body of the cloud running request.

[0068] Next, in response to the cloud running request, the container initialization instruction can be generated, which can include: creating and starting a first database transaction (DB transaction); obtaining target container information corresponding to the target account identifier through the first database transaction; in response to the target container information meeting a preset container condition, adding a target strategy running record corresponding to the target account identifier and the strategy identifier in a preset strategy running record table through the first database transaction; and creating a container initialization instruction based on the target strategy running record.

[0069] The container initialization instruction can be generated by the strategy running management service in the server.

[0070] Specifically, the target container information can be container information corresponding to the target account identifier in a user container information table, which can specifically include a strategy running deadline corresponding to the target account identifier, a maximum number of running strategies, and an actual number of running strategies. Correspondingly, the target container information meeting the preset container condition includes that the current time is within the strategy running deadline and the actual number of running strategies is less than the maximum number of running strategies.

[0071] In addition, the target container information corresponding to the target account identifier can be obtained by querying the target account identifier in the user container information table. In response to the target account identifier being found in the user container information table, the target container information corresponding to the target account identifier is obtained from the user container information table.

[0072] In addition, the server can also update the user container information table correspondingly. For example, the actual number of running strategies in the user container information table can be increased by 1 to avoid the actual number of running strategies being greater than the maximum number of running strategies when the user continues to start.

[0073] Specifically, the content corresponding to the target strategy running record corresponds to each field of the strategy running record table, for example, the target strategy running record can include: the running identifier of the running target quantitative trading strategy, the strategy identifier of the target quantitative trading strategy, the strategy running state of the target quantitative trading strategy, the container name and network address of the strategy running container running the target quantitative trading strategy.

[0074] Specifically, the container initialization instruction can be created based on the target strategy running record, which can include: creating a container initialization instruction according to the container name and network address in the target strategy running record. The container name and network address can be used to obtain the strategy running container running the target quantitative trading strategy in the cloud service in S220.

[0075] In addition, the strategy startup parameters can be written into the container initialization instruction. Correspondingly, the container initialization instruction can be created based on the target strategy running record and the strategy startup parameters. The target account identifier and the strategy identifier in the strategy startup parameters can be used to obtain and run the target quantitative trading strategy in S230 (mainly according to the account identifier and the account key in the strategy startup parameters to log in the account). By writing the strategy startup parameters into the container initialization instruction, the strategy startup parameters can be transmitted to the command starting the target quantitative process through the container initialization instruction, so that the target quantitative process obtains the strategy startup parameters, and then performs the step of obtaining and running the target quantitative trading strategy in S230 according to the quantitative startup parameters. The subsequent embodiments will introduce this. Of course, the strategy startup parameters can also be directly sent to the target quantitative process, which is not limited in the present application.

[0076] In addition, it can be understood that the control of the whole life cycle of the target quantitative process running in the strategy running container is realized by twisting the strategy running state field of the target quantitative trading strategy in the target strategy running record, such as starting the target quantitative trading strategy or stopping the target quantitative trading strategy; for example, in response to the target container information meeting the preset container condition, a target strategy running record corresponding to the target account identifier and the strategy identifier is added in the preset strategy running record table through the first database transaction, and the strategy running state in the target strategy running record can be set to a to-be-run state first; if the above container creation initialization instruction succeeds, the strategy running state in the target strategy running record can be kept as the to-be-run state; if the above container creation initialization instruction fails, the strategy running state can be modified to a stopped state, at the same time, the reason for stopping the strategy in the target strategy running record is recorded as an abnormal stop, so as to display the failure of starting the container in time on the client side; a timing task is triggered to reduce the actual running strategy quantity in the target container information by 1, and the strategy running container is released to prevent continuous occupation of the available container quantity. The adjustment of the strategy running state and the release of the container will be described in detail in subsequent embodiments. In addition, if the container is successfully created and the target quantitative trading strategy has been running in the container, the strategy running state in the target strategy running record is adjusted to a running state.

[0077] The above process will be introduced through a schematic diagram as follows:

[0078] In one embodiment, in combination with the above content, such as Figure 4As shown, in response to the user triggering the starting of the target quantitative trading strategy based on the client, the server can query the container information held by the user, i.e., the target container information, in the user container information table in the database, and if no container information held by the user is queried, return a failure of starting the strategy; if the container information held by the user is queried, determine whether the number of container usage reaches an upper limit, i.e., determine whether the actual running strategy number is less than the maximum running strategy number, and if the usage upper limit is reached, set the return packet to the client as that the container usage reaches the upper limit, and if the upper limit is not reached, add 1 to the actual running strategy number in the container information held by the user (i.e., the target container information) and generate a target strategy running record in the strategy running record table. Then, it can be determined whether the actual running strategy number plus 1 is successful, and if not, return a failure of starting the strategy; if so, continue to determine whether the generation of the target strategy running record is successful. If the generation of the target strategy running record fails, the container usage reaches the upper limit is set to the client as the return packet; if the generation of the target strategy running record is successful, a container initialization instruction is generated and the container management service interface is called according to the container initialization instruction to request the acquisition of the strategy running container. Then, it is determined whether the calling of the container management service interface is successful, and if so, return a success of starting the strategy, otherwise, the strategy running state in the target strategy running record is updated to an abnormal stop and the return packet is set to the client as a failure of starting the strategy.

[0079] It can be understood that by performing the update to the user container information table and the strategy running record table and the creation of the container initialization instruction in the same database transaction, it can be ensured that the update to the user container information table, the update to the strategy running record table and the creation of the container initialization instruction are either all successful or all failed, thereby ensuring data consistency and accuracy.

[0080] In one embodiment, for S220, acquiring the strategy running container according to the container initialization instruction can include: creating a new container as the strategy running container according to the container initialization instruction in the cloud service; or selecting a corresponding container as the strategy running container from the containers already created in the cloud service according to the container initialization instruction. Wherein, the container name and network address of the acquired strategy running container are consistent with the container name and network address in the container initialization instruction.

[0081] Wherein, the container initialization instruction can be sent to the container management service by the strategy running management service in the server; and then the container management service acquires the strategy running container according to the container initialization instruction.

[0082] Further, the container initialization instruction can carry a policy startup parameter, when a new container is created in the cloud service, a target quantitative trading policy (or referred to as a target quantitative strategy, a target strategy) code can be acquired according to a policy identifier in the policy startup parameter, and a unit demand resource amount of the target quantitative trading policy can be determined based on the target quantitative trading policy code, and then, the to-be-allocated resource amount of each task processing node in the cloud service is acquired, and then, at least one target node is determined from the task processing nodes based on the unit demand resource amount of the target quantitative trading policy and the to-be-allocated resource amount of each task processing node, so as to create and run a new container in the target node as a policy running container.

[0083] The unit demand resource amount of the target quantitative trading policy refers to the resource amount required to run the target quantitative trading policy once, including but not limited to processor usage and / or memory usage; after the policy code of the target quantitative trading policy is acquired, the unit demand resource amount of the target quantitative trading policy can be determined based on the code amount of the policy code, the input data amount in the policy code, and the data output amount of the policy code; the code amount of the policy code refers to the code quantity of the policy code, such as the number of code lines, and the input data amount in the policy code refers to the quantity to be input into the policy code; it can be understood that the more the code quantity of the policy code is, the longer the running time is, and more resources can be allocated to ensure the execution efficiency of the policy code; similarly, the input data of the target quantitative trading policy is usually the market data of a transaction object and / or a reference object, when the object quantity of the transaction object and the reference object is large and / or the time range of the input market data is large, the processing time of the policy code for the input data is longer, and more resources can be allocated to ensure the execution efficiency of the policy code. Specifically, a plurality of different demand resource levels can be set in advance, different demand resource levels correspond to different unit demand resource amounts, and then the demand resource level corresponding to the target quantitative trading policy is determined based on the code amount of the policy code, the input data amount in the policy code, and the data output amount of the policy code by the following formula:

[0084]

[0085] code act represents the code amount of the policy code, code val represents the code amount that can be processed by a unit resource (such as a unit processor), input act represents the input data amount in the policy code, input valrepresents the data amount of input data that a unit resource (such as a unit processor) can process; round(·) represents rounding to an integer to ensure that the value is an integer. After determining the demand resource level corresponding to the target quantitative trading strategy, the unit demand resource amount corresponding to the target quantitative trading strategy can be determined based on the demand resource level corresponding to the target quantitative trading strategy, and β represents a weight parameter.

[0086] Further, the unit demand resource amount of the target quantitative trading strategy can also be measured during the historical running of the target quantitative trading strategy and saved in association with the target quantitative trading strategy. After obtaining the strategy identifier in the strategy start parameter, the unit demand resource amount of the corresponding target quantitative trading strategy can be directly queried according to the strategy identifier.

[0087] The task processing node in the cloud service refers to a single machine (or virtual machine) for deploying a container (as a workload); the to-be-allocated resource amount of the task processing node refers to the remaining resource amount of the task node that can be allocated, including but not limited to the remaining processor amount and / or memory amount of the task processing node. After obtaining the demand resource amount of the target quantitative trading strategy in a unit time and the to-be-allocated resource amount of each task processing node, at least one task processing node whose to-be-allocated resource amount matches the demand resource amount of the target quantitative trading strategy in a unit time can be determined from each task processing node as a target node for constructing a strategy running container, thereby improving resource utilization.

[0088] Further, the corresponding container can be selected as the strategy running container according to the container initialization instruction in the container created in the cloud service, which can specifically include: obtaining the strategy code of the target quantitative trading strategy according to the strategy identifier in the strategy start parameter, and determining the unit demand resource amount of the target quantitative trading strategy based on the strategy code of the target quantitative trading strategy, and then obtaining the resource allocation amount of each idle container in the cloud service, and then determining a target container from the idle containers as the strategy running container based on the unit demand resource amount of the target quantitative trading strategy and the resource allocation amount of each idle container.

[0089] The idle container refers to a container that is not running any process, and the resource allocation amount of the idle container refers to the resource amount used to deploy the container, including but not limited to the processor amount and / or memory amount. After determining the resource allocation amount of each idle container in the cloud service and the demand resource amount of the target quantitative trading strategy in a unit time, one idle container whose resource allocation amount matches the demand resource amount of the target quantitative trading strategy in a unit time can be determined from each idle container as the strategy running container, thereby improving resource utilization.

[0090] Further, one of the idle containers whose resource allocation amount matches the demand resource amount of the target quantification trading strategy in unit time can be searched from the idle containers first, and if there is no idle container matching the demand resource amount, at least one task processing node whose resource allocation amount matches the demand resource amount of the target quantification trading strategy in unit time can be determined from the task processing nodes as the target node for constructing the strategy running container.

[0091] In one embodiment, the starting the target quantification process in the strategy running container in S220 can include: splicing the strategy starting parameter in a process starting command for starting the target quantification process; and starting the target quantification process in the strategy running container according to the process starting command. In this way, the strategy starting parameter can be obtained after the cloud service starts the target quantification process, so that the target quantification process can be initialized according to the strategy starting parameter, for example, account login according to the account identifier and account key in the strategy starting parameter, and pulling the strategy code of the target quantification trading strategy according to the strategy identifier in the strategy starting parameter and running it in the target quantification process. Of course, the strategy starting parameter can also not be spliced in the process starting command, but the strategy starting parameter can be directly obtained from the cloud running request in S230, and the present application does not limit this.

[0092] In one embodiment, the starting the target quantification process in the strategy running container in S220 can include: splicing the strategy starting parameter in a process starting command for starting the target quantification process; and starting the target quantification process in the strategy running container according to the process starting command. In this way, the strategy starting parameter can be obtained after the cloud service starts the target quantification process, so that the target quantification process can be initialized according to the strategy starting parameter, for example, account login according to the account identifier and account key in the strategy starting parameter, and pulling the strategy code of the target quantification trading strategy according to the strategy identifier in the strategy starting parameter and running it in the target quantification process. Of course, the strategy starting parameter can also not be spliced in the process starting command, but the strategy starting parameter can be directly obtained from the cloud running request in S230, and the present application does not limit this.

[0093] In one embodiment, for S230, the above-mentioned obtaining and running the target quantification trading strategy by the target quantification process in the strategy running container according to the strategy starting parameter includes: performing account login by the target quantification process in the strategy running container according to the target account identifier and the corresponding account key; and in response to successful account login, obtaining and running the target quantification trading strategy by the target quantification process according to the strategy identifier indicated by the strategy starting parameter.

[0094] The above embodiments are introduced as a whole below:

[0095] In one embodiment, in combination with Figure 1In addition to the above, first, the target user can trigger the target quantitative trading strategy to start in the cloud based on the client, so that the client can send a cloud running request including the strategy start parameters to the strategy running management service in the server; then, the strategy running management service can update the user container information table and the strategy running record table under the same database transaction in response to the cloud running request, and generate a container initialization instruction, wherein the container initialization instruction has the strategy start parameters; then, the strategy running management service can send the strategy start parameters to the container management service; after that, the container management service obtains the strategy running container according to the container initialization instruction, specifically, the container management service can create a container in the cloud service, that is, the strategy running container, and splice the strategy start parameters in the process start command for starting the target quantitative process; then, the cloud service can start the target quantitative process in the strategy running container according to the process start command, and obtain the strategy start parameters; then, the target quantitative process can perform an account login operation through the account identifier and the account key in the strategy start parameters; after the account login is successful, the target quantitative process can obtain the target quantitative trading strategy according to the strategy identifier in the strategy start parameters, specifically, the target user can store the created target quantitative trading strategy to the cloud service, and the target quantitative process pulls the target quantitative trading strategy from the cloud service according to the strategy identifier; finally, the target quantitative trading strategy is run in the strategy running container, realizing the cloud running of the target quantitative trading.

[0096] For the stopping running and running state detection steps of the quantitative trading strategy, the communication agent service can be used to realize the steps, which will be introduced in the following embodiments.

[0097] It can be known in combination with the foregoing that in the running process of the quantitative trading strategy, communication between different modules is involved, for example, when the strategy running management service needs to manage the quantitative trading strategy running in the strategy running container (for example, starting the target quantitative trading strategy introduced in the foregoing, stopping the running target quantitative trading strategy to be introduced later, and checking the running state), the strategy running management service in the server service needs to send data or instructions to the target quantitative process. In the technical solution of the present application, a proxy service for data transfer, that is, a communication proxy service, is deployed in each strategy running container, and the communication proxy service is used to realize communication between the strategy running management service and the target quantitative process, without establishing a long connection, so that the communication between the strategy running management service and the quantitative process is realized at low cost. It can be understood that if the strategy running management service directly sends instructions or data to the target quantitative process, it is similar to the server directly accessing the client. In the prior art, a long connection is often established between the strategy running management service and the target quantitative process, and then data or instructions are sent through the long connection, but the implementation and operation and maintenance of the long connection are relatively high in cost. The communication between the strategy running management service and the target quantitative process is realized through the communication proxy service, without establishing a long connection, so that a low-cost communication mode is realized.

[0098] Specifically, the server can start the communication proxy service in the strategy running container, and the communication proxy service communicates with the target quantitative process through the first named pipe and the second named pipe; then, the communication proxy service can send a control instruction to the target quantitative process through the first named pipe, and the control instruction is used to process the target quantitative trading strategy running in the strategy running container; finally, the communication proxy service can receive control reply information returned by the target quantitative process through the second named pipe. Since the communication proxy service and the quantitative process are in the same strategy running container, data can be transmitted through inter-process communication, for example, the named pipe.

[0099] In addition, the communication proxy service can provide a remote procedure call (RPC) interface to realize communication between the communication proxy service and the strategy running management service. For example, an external service, such as the strategy running management service, can send data or instructions to the communication proxy service by calling the interface, and similarly, the communication proxy service can also send data to the strategy running management service through the interface.

[0100] The control instruction can include a running state detection instruction or a strategy stop running instruction.

[0101] The communication process between the strategy running management service and the target quantitative process based on the communication proxy service is introduced as a whole below.

[0102] In Example 1, the client can send a control instruction to the strategy operation management service in response to the user's trigger operation; then, the strategy operation management service can send the control instruction to the communication agent service by calling the RPC interface; thereafter, the communication agent service sends the control instruction to the target quantitative process through the first named pipe; then, the target quantitative process processes the target quantitative trading strategy running in the strategy operation container according to the control instruction to obtain and return control reply information. For example, when the control instruction is an operation status detection instruction, the target quantitative process can detect the operation status of the target quantitative trading strategy and return the detection result as control reply information to the communication agent service through the second named pipe. For another example, when the control instruction is a strategy stop operation instruction, the target quantitative process can stop the operation status of the target quantitative trading strategy and return the responded message as control reply information to the communication agent service through the second named pipe; then, the communication agent service can receive the control reply information returned by the target quantitative process through the second named pipe.

[0103] Specifically, such as Figure 5 As shown, the policy operation management service can obtain the network address of the policy operation container, for example, it can be obtained by completing the initialization of the policy operation container by the container management service, or it can be obtained from the target policy operation record in the policy operation record table; then, the communication agent service in the policy operation container corresponding to the network address is called to send the data or instructions to be transmitted to the policy operation container, specifically to the communication agent service; then, the communication agent service can pass the data or instructions to be transmitted by the policy operation management service to the target quantization process through a named pipe (i.e., named pipe 2, specifically the first named pipe in the subsequent embodiments) by an inter-process communication method; then, the target quantization process can read the named pipe, obtain the data or instructions forwarded by the communication agent service, and perform corresponding processing to obtain response data; then, the target quantization process can write the response data into another named pipe (i.e., named pipe 1, specifically the second named pipe in the subsequent embodiments), and pass the reply data to the communication agent service by an inter-process communication method; then, the communication agent service can obtain the reply of the target quantization process from the pipe, and write the data into the return packet of the RPC request, and return it to the policy operation management service through the RPC interface.

[0104] Example 2 is similar to Example 1, but the control instructions are generated by the server. For example, they can be generated by a communication agent service or a strategy operation management service to automatically / regularly manage the target quantitative trading strategy.

[0105] Embodiment 3 is similar to Embodiment 1, but the control instruction can include, but is not limited to, a request for detecting the running state of the target quantitative trading strategy or a request for stopping the running of the strategy, which is sent by the server according to the control request sent by the client. For example, the control request can be generated by the communication agent service or the strategy running management service so as to make the control request comply with the communication rules or protocols thereof.

[0106] The following will introduce the steps of stopping the running of the quantitative trading strategy and detecting the running state in combination with the above description.

[0107] In an embodiment, the strategy running management service can traverse the strategy running records in the preset strategy running record table; then, in response to the strategy running state recorded in the target strategy running record corresponding to the target quantitative trading strategy being the to-be-run state or the running state, the strategy running management service can obtain the container state and the container network address of the corresponding strategy running container from the target strategy running record; then, in response to the container state being the created state, the strategy running management service can generate a strategy running state detection instruction; then, according to the container network address, the strategy running management service can send the strategy running state detection instruction to the target quantitative process so as to obtain the target strategy running state of the target quantitative trading strategy based on the target quantitative process; and according to the target strategy running state, update the strategy running state in the target strategy running record.

[0108] Alternatively, the server can set a timing task to send the above-mentioned strategy running state detection instruction to the target quantitative process through the strategy running management service. The time interval corresponding to the timing task can be 3 seconds, but is not limited thereto.

[0109] The generation or obtaining process of the strategy running state detection instruction can refer to Embodiments 1-3 described above, and will not be described herein.

[0110] Specifically, the sending of the strategy running state detection instruction to the target quantitative process according to the container network address so as to obtain the target strategy running state of the target quantitative trading strategy based on the target quantitative process includes: determining the strategy running container corresponding to the target quantitative trading strategy according to the container network address; determining the communication agent service started in the strategy running container, and the communication agent service communicates with the target quantitative process through the first named pipe and the second named pipe; sending the strategy running state detection instruction to the target quantitative process through the first named pipe based on the communication agent service; and receiving the target strategy running state of the target quantitative trading strategy returned by the target quantitative process through the second named pipe based on the communication agent service.

[0111] Specifically, the strategy running management service can obtain the container state of the strategy running container by calling the container management service.

[0112] Specifically, in combination with the description of the strategy running record table above, when updating the strategy running state in the target strategy running record, if the strategy running state is the stopped state, the reason for stopping the strategy running and the timestamp, etc. can be returned through the communication agent service at the same time, and the target strategy running record is updated synchronously.

[0113] Specifically, if the target strategy running state of the target quantitative trading strategy is successfully acquired, the corresponding success identifier can be returned through the communication agent service, otherwise the corresponding failure identifier is returned.

[0114] In addition, if the corresponding failure identifier is returned, that is, the strategy running state detection instruction request fails, it can be retried for several times, that is, the strategy running state detection instruction is sent to the target quantitative process according to the container network address repeatedly for a maximum of a preset number of times, until the target strategy running state of the target quantitative trading strategy is acquired. If it still fails after retrying, the strategy running state can be marked as the stopped state, and then the container can be recycled through the timing task to forcibly stop the target quantitative trading strategy.

[0115] It can be understood that if the strategy running state detection instruction request fails only due to timeout caused by general network jitter, retry can solve it. If it still fails after retrying for several times, it is probably that the container or the process in the container has an exception, and it is risky to continue running in this unknown error situation, so the target quantitative trading strategy can be stopped by modifying the strategy running state.

[0116] The running state detection process of the quantitative trading strategy will be introduced in the form of a schematic diagram as follows:

[0117] In one embodiment, as Figure 6As shown, the policy operation management service can trigger a scheduled task and filter the policy operation records in the policy operation record table whose policy operation status is the waiting state or the running state; if there is no policy operation record with the policy operation status of the waiting state or the running state, the execution is terminated directly, otherwise, each policy operation record with the policy operation status of the waiting state or the running state is traversed, and the following steps are performed respectively: obtain the container name of the corresponding policy operation container from the policy operation record, and call the container management service to obtain the container status corresponding to the container name; if the container status is not the created state (for example, it is in the creating state), the execution is terminated; otherwise, obtain the container network address of the corresponding policy operation container from the policy operation record, and call the communication corresponding to the container according to the network address. Proxy service, to send a check request, i.e., a policy operation status detection instruction, to the corresponding quantization process; if the communication proxy service does not return the policy operation status normally, repeat the sending of the check request three times; otherwise, determine whether the returned policy operation status is in a stopped state; if the returned policy operation status is in a stopped state, update the policy operation status and the stop reason in the corresponding policy operation record to the stopped state, and the stop time to the current time, otherwise, update the policy operation status in the corresponding policy operation record to the return value; if the above-mentioned sending of the check request is repeated three times and is successful, execute the above-mentioned determination to determine whether the returned policy operation status is in a stopped state, otherwise, update the policy operation status in the corresponding policy operation record to the stopped state, the stop reason to the abnormal stop, and the stop time to the current time.

[0118] It is understandable that by querying the strategy running status, not only can timely feedback on the operation status of the quantitative trading strategy be provided and the entire life cycle of the quantitative trading strategy be managed during operation, but it can also be timely determined that the quantitative trading strategy has been completed or the strategy running container has failed, thereby promptly notifying the user and releasing container resources.

[0119] In one embodiment, the method of stopping the target quantitative trading strategy includes the following two methods:

[0120] Method 1: The server can directly recycle the strategy running container. After the strategy running container is destroyed, the target quantitative process and target quantitative trading strategy inside the strategy running container will naturally stop.

[0121] Method 2 is achieved by the user triggering the stop button for the target quantitative trading strategy based on the client. If this method is unsuccessful, it can be achieved through method 1 to ensure that the strategy can be stopped as expected by the user.

[0122] For example, Figure 7As shown, the client can display a stop running button, and if a user triggers the button, the client can send a policy stop running instruction to the policy running management service to stop running the target quantitative trading strategy through the policy running management service.

[0123] Specifically, the policy running management service can obtain a policy stop running instruction, which includes a running identifier of the running target quantitative trading strategy. Then, according to the running identifier, the target quantitative trading strategy corresponding target policy running record is obtained from the preset policy running record table, and the policy running state of the target quantitative trading strategy in the target policy running record is updated to a stop running state. Then, the container network address of the corresponding policy running container is obtained from the target policy running record. Finally, according to the container network address, the policy stop running instruction is sent to the target quantitative process to stop running the target quantitative trading strategy based on the target quantitative process.

[0124] According to the container network address, the policy stop running instruction is sent to the target quantitative process to stop running the target quantitative trading strategy based on the target quantitative process, including: determining the target quantitative trading strategy corresponding policy running container according to the container network address; determining the communication agent service started in the policy running container, and the communication agent service communicates with the target quantitative process through the first named pipe and the second named pipe; based on the communication agent service, the policy stop running instruction is sent to the target quantitative process through the first named pipe; the target quantitative trading strategy is stopped running through the target quantitative process, and the stop running strategy message returned by the target quantitative process is received through the second named pipe based on the communication agent service.

[0125] In addition, before sending the policy stop running instruction to the target quantitative process, it can be checked whether the policy running state is in the stopped state, and if it is already in the stopped state, it does not need to be processed again, which can prevent multiple requests from being received repeatedly in a short time.

[0126] In addition, if the failure identifier corresponding to the policy stop running instruction is returned, that is, the policy stop running instruction request fails, the policy stop running instruction is sent to the target quantitative process according to the container network address for a maximum of a preset number of times. Here, the processing process is similar to the above-mentioned processing process for the policy running state detection instruction, which will not be described here.

[0127] The stop running process of the quantitative trading strategy will be introduced in the form of a schematic diagram as follows:

[0128] In one embodiment, as Figure 8As shown, the user can send a strategy stop running instruction including a running identifier of a running target quantitative trading strategy to the strategy running management service based on the client; then, the strategy running management service can acquire a target strategy running record corresponding to the target quantitative trading strategy from the preset strategy running record table according to the running identifier, and determine whether the target strategy running record is in a stopped state; if yes, return stop success, otherwise update the strategy running state in the target strategy running record to the stopped state, the stop reason to manual stop, and the stop time to the current time; then, the container network address of the corresponding strategy running container can be acquired from the target strategy running record, and the strategy stop running instruction is sent to the target quantitative process according to the container network address; if a correct reply is received, for example, stop success, return stop success, otherwise retry at most three times to send the strategy stop running instruction to the target quantitative process according to the container network address until stop success is returned.

[0129] It can be understood that the above process is to first mark the strategy running state as "stopped state", and then send the strategy stop running instruction to the target quantitative process, to ensure that the running state of the strategy running record is changed to "stopped state" before the container is recycled, to avoid the misstop of the quantitative trading strategy in the normal running state caused by the container recycling, to reduce the possibility of abnormality, and at the same time, even if the strategy stop running instruction request fails, the corresponding container can also be recycled through the subsequent timing task, which also ensures that the strategy can eventually stop, and reduces the possibility of stopping strategy failure.

[0130] The following embodiments introduce the release step of the container resource.

[0131] In one embodiment, the server (specifically, the strategy running management service or the container management service) can screen a specific strategy running record in the preset strategy running record table that meets any of the following conditions: the container state of the corresponding strategy running container is in an unreclaimed state, the strategy running state of the corresponding quantitative trading strategy is in a stopped running state, and the corresponding strategy running stop time is greater than a preset time length from the current time; then, the specific container identifier corresponding to the specific strategy running record in the strategy running record table is acquired, the specific strategy running container corresponding to the specific container identifier is determined, and the container resource of the specific strategy running container is released (specifically, the container management service can be called to release the container resource); thereafter, in response to the release success, a second database transaction is created and started; the container state corresponding to the specific strategy running record in the strategy running record table is modified to a released state through the second database transaction, and the strategy running quantity corresponding to the specific quantitative trading strategy in the preset user container information table is updated. For example, the actual strategy running quantity corresponding to the specific quantitative trading strategy is reduced by a value of 1 to release the container usage data, to facilitate the smooth running of the new quantitative trading strategy.

[0132] Specifically, the server can set a timing task, trigger the timing task to filter the specific strategy running record, and realize the timing and automatic container resource recycling. The time interval corresponding to the timing task is 2 seconds, that is, the container recycling task can be executed once every 2 seconds.

[0133] In addition, if the current release strategy running container fails, for example, the container management service fails, the container is not successfully recycled, or the container is successfully recycled but the container state update fails, the recycling process can be executed again through the timing task, similar to retrying the recycling process, and therefore, the strategy running container can still be successfully released at the end.

[0134] The stopping process of the quantitative trading strategy will be introduced below by means of a schematic diagram:

[0135] In one embodiment, in combination with the above, as shown in Figure 9 The server can register a timing task to perform recycling check of the container at regular intervals. Specifically, the server can filter the specific strategy running record in the preset strategy running record table; if no specific strategy running record is filtered, the timing task is directly ended, otherwise, the specific container identifier corresponding to the specific strategy running record in the strategy running record table is obtained, the specific strategy running container corresponding to the specific container identifier is determined, and the container management service is called to release the container resource of the specific strategy running container; if the release is not successful, the timing task is ended, otherwise, a second database transaction is created and started, the container state corresponding to the specific strategy running record in the strategy running record table is modified to the released state or the value corresponding to the released state, for example, 1, and the actual strategy running quantity corresponding to the specific quantitative trading strategy in the user container information table is reduced by 1.

[0136] It can be understood that even if the strategy running record records the strategy running state as "stopped state", the corresponding quantitative trading strategy has not been truly stopped, and if the container is directly forced to be recycled, the strategy running may be abnormal, therefore, a preset time length, for example, 5 seconds, can be set, and the container is recycled after waiting for the preset time length to try to ensure that the strategy is normally stopped. If the strategy is still not stopped after the preset time length (that is, the time corresponding to the strategy running stop time is greater than the preset time length from the current time), it is highly probable that an abnormality has occurred, and waiting in this case has little meaning, so the container can be forced to be recycled to stop the strategy, thereby ensuring that the strategy can be finally stopped and avoiding the possibility of stopping the strategy.

[0137] Figure 10 A schematic diagram of a quantitative trading strategy processing device 1000 provided in an embodiment of the present application.

[0138] As shown in Figure 10As shown, the quantitative transaction strategy processing apparatus 1000 comprises: an instruction generation module 1001, an acquisition starting module 1002, an acquisition running module 1003, a first starting module 1004, a first sending module 1005, a first receiving module 1006, a first traversal module 1007, a first acquisition module 1008, a first generation module 1009, a second sending module 1010, a first update module 1011, a second acquisition module 1012, a third acquisition module 1013, a second update module 1014, a third sending module 1015, a first screening module 1016, a fourth acquisition module 1017, a resource release module 1018, a creation starting module 1019, a modification update module 1020, and the like, wherein:

[0139] In one embodiment, the instruction generation module 1001 is configured to generate a container initialization instruction in response to a cloud running request of a target user for a target quantitative transaction strategy, the cloud running request comprising a strategy starting parameter; the acquisition starting module 1002 is configured to acquire a strategy running container based on the container initialization instruction in a cloud service, and start a target quantitative process in the strategy running container; and the acquisition running module 1003 is configured to acquire and run the target quantitative transaction strategy according to the strategy starting parameter through the target quantitative process in the strategy running container.

[0140] Specifically, the cloud running request comprises a target account identifier of the target user and a strategy identifier of the target quantitative transaction strategy; the instruction generation module 1001 is specifically configured to: create and start a first database transaction; acquire target container information corresponding to the target account identifier through the first database transaction; in response to the target container information meeting a preset container condition, add a target strategy running record corresponding to the target account identifier and the strategy identifier in a preset strategy running record table through the first database transaction; and create the container initialization instruction based on the target strategy running record.

[0141] Specifically, the strategy starting parameter comprises: the target account identifier of the target user, an account key corresponding to the target account identifier, and the strategy identifier; the acquisition running module 1003 is specifically configured to: execute account login according to the target account identifier and the corresponding account key through the target quantitative process in the strategy running container; and in response to successful account login, acquire and run the target quantitative transaction strategy according to the strategy identifier indicated by the strategy starting parameter through the target quantitative process.

[0142] Specifically, the first startup module 1004 is used to start the communication agent service in the strategy execution container, and the communication agent service communicates with the target quantitative process through the first named pipe and the second named pipe; the first sending module 1005 is used to send control instructions to the target quantitative process through the first named pipe based on the communication agent service, and the control instructions are used to process the target quantitative trading strategy running in the strategy execution container; the first receiving module 1006 is used to receive control reply information returned by the target quantitative process through the second named pipe based on the communication agent service.

[0143] Specifically, the first traversal module 1007 is used to traverse the strategy operation records in the preset strategy operation record table; the first acquisition module 1008 is used to obtain the container status and container network address of the corresponding strategy operation container from the target strategy operation record in response to the strategy operation status recorded in the target strategy operation record corresponding to the target quantitative trading strategy being in the waiting state or the running state; the first generation module 1009 is used to generate a strategy operation status detection instruction in response to the container status being the created state; the second sending module 1010 is used to send the strategy operation status detection instruction to the target quantitative process according to the container network address, so as to obtain the target strategy operation status of the target quantitative trading strategy based on the target quantitative process; the first update module 1011 is used to update the strategy operation status in the target strategy operation record according to the target strategy operation status.

[0144] Specifically, the second sending module 1010 is specifically used to: determine the strategy running container corresponding to the target quantitative trading strategy based on the container network address; determine the communication agent service started in the strategy running container, and the communication agent service communicates with the target quantitative process through the first named pipe and the second named pipe; based on the communication agent service, send the strategy running status detection instruction to the target quantitative process through the first named pipe; based on the communication agent service, receive the target strategy running status of the target quantitative trading strategy returned by the target quantitative process through the second named pipe.

[0145] Specifically, the second acquisition module 1012 is used to obtain a strategy stop operation instruction, which includes an operation identifier for running the target quantitative trading strategy; the third acquisition module 1013 is used to obtain a target strategy operation record corresponding to the target quantitative trading strategy from a preset strategy operation record table according to the operation identifier; the second update module 1014 is used to update the strategy operation status of the target quantitative trading strategy in the target strategy operation record to a stopped operation status, and obtain the container network address of the corresponding strategy operation container from the target strategy operation record; the third sending module 1015 is used to send the strategy stop operation instruction to the target quantitative process according to the container network address, so as to stop running the target quantitative trading strategy based on the target quantitative process.

[0146] Specifically, the third sending module 1015 is configured to: determine a strategy running container corresponding to the target quantitative trading strategy according to the container network address; determine a communication agent service started in the strategy running container, the communication agent service being configured to communicate with the target quantitative process via the first named pipe and the second named pipe; send, based on the communication agent service, a strategy stop running instruction to the target quantitative process via the first named pipe; stop running the target quantitative trading strategy via the target quantitative process, and receive a stop running strategy message returned by the target quantitative process based on the communication agent service via the second named pipe.

[0147] Specifically, the first screening module 1016 is configured to screen a specific strategy running record in the preset strategy running record table, the specific strategy running record meeting any of the following conditions: a container state of a corresponding strategy running container is an unreclaimed state, a strategy running state of a corresponding quantitative trading strategy is a stopped running state, and a strategy running stop time corresponding to the specific strategy running record is greater than a preset time length from a current time. The fourth obtaining module 1017 is configured to obtain a specific container identifier corresponding to the specific strategy running record in the strategy running record table, and determine a specific strategy running container corresponding to the specific container identifier. The resource releasing module 1018 is configured to release container resources of the specific strategy running container. The creating and starting module 1019 is configured to, in response to successful release, create and start a second database transaction. The modifying and updating module 1020 is configured to modify, via the second database transaction, a container state corresponding to the specific strategy running record in the strategy running record table to a released state, and update a strategy running quantity corresponding to the specific quantitative trading strategy in the preset user container information table.

[0148] It should be understood that the apparatus embodiments and the method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, no longer be described here. Specifically, Figure 10 The apparatus 1000 shown can perform the method embodiments described above, and the foregoing and other operations and / or functions of each module in the apparatus 1000 are respectively for realizing the corresponding processes in each of the methods described above. To be brief, no longer be described here.

[0149] The apparatus 1000 of the embodiments of the present application is described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in the form of hardware, or in the form of instructions of software, or in the form of a combination of hardware and software modules. Specifically, each step of the method embodiments in the embodiments of the present application can be completed by integrated logic circuits of hardware in a processor and / or instructions of software. The steps of the method disclosed in the embodiments of the present application can be directly embodied as hardware code processing performed by a processor, or can be executed by a combination of hardware and software modules in the processor. Alternatively, the software module can be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, and the like. The storage medium is located in a memory, and a processor reads information in the memory and combines hardware to complete the steps in the above method embodiments.

[0150] Figure 11 A schematic block diagram of an electronic device 1100 is provided in the embodiments of the present application.

[0151] As shown in Figure 11 , the electronic device 1100 can include:

[0152] The memory 1110 is configured to store a computer program and transmit the program code to the processor 1120. In other words, the processor 1120 can call and run the computer program from the memory 1110 to implement the method in the embodiments of the present application.

[0153] For example, the processor 1120 can be configured to execute the above method embodiments according to the instructions in the computer program.

[0154] In some embodiments of the present application, the processor 1120 can include but is not limited to:

[0155] A general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like.

[0156] In some embodiments of the present application, the memory 1110 includes but is not limited to:

[0157] The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), which is used as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synch Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0158] In some embodiments of the present application, the computer program can be divided into one or more modules, which are stored in the memory 1110 and executed by the processor 1120 to complete the method provided by the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device.

[0159] As shown in Figure 11 The electronic device can further include:

[0160] The transceiver 1130 can be connected to the processor 1120 or the memory 1110.

[0161] The processor 1120 can control the transceiver 1130 to communicate with other devices, specifically, can send information or data to other devices, or receive information or data sent by other devices. The transceiver 1130 can include a transmitter and a receiver. The transceiver 1130 can further include an antenna, and the number of antennas can be one or more.

[0162] It should be understood that the various components within the electronic device are connected via a bus system, which includes, in addition to a data bus, a power supply bus, a control bus, and a state signal bus.

[0163] The application also provides a computer storage medium, which stores a computer program, and the computer program enables a computer to execute the method of the method embodiment when executed by the computer. Alternatively, the application embodiment also provides a computer program product containing instructions, and the instructions enable the computer to execute the method of the method embodiment when executed by the computer.

[0164] When implemented by using software, the software can be implemented in the form of a computer program product entirely or partially. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer program instructions can enable the computer to execute the corresponding flow in each method in the application embodiment entirely or partially, and generate the function that can be implemented by each method in the application embodiment. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, digital video disc (DVD)), or a semiconductor medium (for example, solid state disk (SSD)), etc.

[0165] Those skilled in the art can realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the application.

[0166] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiments is only a logical function division, and there can be another division manner for the actual implementation, for example, multiple devices or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different parts can be indirect couplings or communication connections through some interfaces, devices or modules, and can be electrical, mechanical or in other forms.

[0167] The modules explained as separated components can or can not be physically separated, and the components shown as modules can or can not be physical modules, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. For example, the functional modules in the embodiments of the present application can be integrated into a processing module, or each module can be physically present separately, or two or more modules can be integrated into one module.

[0168] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A quantitative trading strategy processing method, characterized in that: include: generating a container initialization instruction in response to a target user's cloud-based execution request for a target quantitative trading strategy, wherein the cloud-based execution request includes strategy startup parameters; Obtaining a policy execution container from a cloud service based on the container initialization instruction, and starting a target quantization process in the policy execution container; The target quantitative trading strategy is obtained and run according to the strategy startup parameters by running the target quantitative process in the container.

2. The method according to claim 1, characterized in that The cloud operation request includes the target account identifier of the target user and the strategy identifier of the target quantitative trading strategy; the generating container initialization instruction includes: Create and start the first database transaction; Obtaining target container information corresponding to the target account identifier through the first database transaction; In response to the target container information meeting the preset container condition, adding the target account identifier and the target policy operation record corresponding to the policy identifier to the preset policy operation record table through the first database transaction; The container initialization instruction is created based on the target policy operation record.

3. The method according to claim 1, characterized in that The policy startup parameters include: the target account identifier of the target user, the account key corresponding to the target account identifier, and the policy identifier; The target quantitative trading strategy is acquired and executed according to the strategy startup parameters by running the target quantitative process in the container, including: Run the target quantization process in the container using the policy, and perform account login based on the target account identifier and the corresponding account key; In response to a successful account login, the target quantitative trading strategy is acquired and run according to the strategy identifier indicated by the strategy startup parameter through the target quantitative process.

4. The method according to any one of claims 1 to 3, characterized in that Also includes: Starting a communication proxy service in the policy execution container, wherein the communication proxy service communicates with the target quantization process through a first named pipe and a second named pipe; Sending a control instruction to the target quantitative process through the first named pipe based on the communication agent service, wherein the control instruction is used to process the target quantitative trading strategy running in the strategy running container; The control reply information returned by the target quantization process is received through the second named pipe based on the communication agent service.

5. The method according to any one of claims 1 to 3, characterized in that Also includes: Traverse the strategy operation records in the preset strategy operation record table; In response to a target strategy operation record corresponding to the target quantitative trading strategy having a strategy operation status of being in a waiting-to-run state or a running state, obtaining a container status and a container network address of a corresponding strategy operation container from the target strategy operation record; In response to the container being in a created state, generating a policy running state detection instruction; According to the container network address, the strategy operation status detection instruction is sent to the target quantitative process, so as to obtain the target strategy operation status of the target quantitative trading strategy based on the target quantitative process; According to the target policy running status, the policy running status in the target policy running record is updated.

6. The method according to claim 5, characterized in that The step of sending the strategy operation status detection instruction to the target quantitative trading process according to the container network address, so as to obtain the target strategy operation status of the target quantitative trading strategy based on the target quantitative trading process, includes: Determine the strategy running container corresponding to the target quantitative trading strategy according to the container network address; Determine a communication proxy service started in the policy execution container, wherein the communication proxy service communicates with the target quantization process through a first named pipe and a second named pipe; Sending the policy running status detection instruction to the target quantization process through the first named pipe based on the communication agent service; The target strategy running status of the target quantitative trading strategy returned by the target quantitative process is received based on the communication agent service through the second named pipe.

7. The method according to any one of claims 1 to 3, characterized in that After the target quantitative trading strategy is acquired and executed according to the strategy startup parameters through the target quantitative process in the container, the method further includes: Obtaining a strategy stop operation instruction, wherein the strategy stop operation instruction includes an operation identifier for running the target quantitative trading strategy; According to the operation identifier, obtaining the target strategy operation record corresponding to the target quantitative trading strategy from a preset strategy operation record table; Update the strategy running state of the target quantitative trading strategy in the target strategy running record to a stopped running state, and obtain the container network address of the corresponding strategy running container from the target strategy running record; According to the container network address, the strategy stop running instruction is sent to the target quantitative process, so as to stop running the target quantitative trading strategy based on the target quantitative process.

8. The method according to claim 7, characterized in that The step of sending the strategy stop execution instruction to the target quantitative process according to the container network address, so as to stop the target quantitative trading strategy based on the target quantitative process, includes: Determine the strategy running container corresponding to the target quantitative trading strategy according to the container network address; Determine a communication proxy service started in the policy execution container, wherein the communication proxy service communicates with the target quantization process through a first named pipe and a second named pipe; Sending the strategy stop running instruction to the target quantization process through the first named pipe based on the communication agent service; The target quantitative trading strategy is stopped by the target quantitative process, and a strategy stop message returned by the target quantitative process is received through the second named pipe based on the communication agent service.

9. The method according to any one of claims 1 to 3, characterized in that Also includes: Filter the preset strategy operation record table for specific strategy operation records that meet any of the following conditions: the container status of the corresponding strategy operation container is unrecovered, the strategy operation status of the corresponding quantitative trading strategy is stopped, and the stop time of the corresponding strategy operation is greater than the preset time. Obtain a specific container identifier corresponding to the specific policy operation record in the policy operation record table, and determine a specific policy operation container corresponding to the specific container identifier; Release the container resources of the container running the specific policy; In response to the release being successful, creating and starting a second database transaction; The container state corresponding to the specific strategy operation record in the strategy operation record table is modified to a released state through the second database transaction, and the strategy operation quantity corresponding to the specific quantitative trading strategy in the preset user container information table is updated.

10. A quantitative trading strategy processing device, characterized in that: include: An instruction generation module, configured to generate a container initialization instruction in response to a target user's cloud-based operation request for a target quantitative trading strategy, wherein the cloud-based operation request includes strategy startup parameters; An acquisition startup module is used to acquire a policy operation container from a cloud service based on the container initialization instruction, and to start a target quantization process in the policy operation container; The acquisition and operation module is used to run the target quantitative process in the container through the strategy, and obtain and run the target quantitative trading strategy according to the strategy startup parameters.

11. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 9 by executing the executable instructions.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.