Quantitative transaction strategy operation method and device, equipment and storage medium

By directly running quantitative trading strategies using pre-created candidate containers within the quantitative cloud cluster, the problem of long container creation time is solved, improving user experience and the timeliness of trading strategies.

CN121879902APending Publication Date: 2026-04-17SHENZHEN FUTU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FUTU NETWORK TECH CO LTD
Filing Date
2025-12-02
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Quantitative trading strategies are slow to start when deployed in containers in cloud clusters, which affects user experience and may cause missed trading opportunities.

Method used

By running quantitative trading strategies using pre-created candidate containers in the quantitative cloud cluster, the target container can be directly obtained and the run command can be sent, avoiding the waiting time for container creation.

Benefits of technology

It greatly reduces users' online waiting time, improves user experience, meets the needs of trading strategy implementation in a timely manner, and avoids missing trading opportunities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879902A_ABST
    Figure CN121879902A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a quantitative transaction strategy operation method and device, equipment and a storage medium, and the method comprises the steps: obtaining at least one candidate container in response to an obtaining request for obtaining a target container; the candidate container is a container created according to a container mirror image in the quantized cloud cluster; based on the acquisition request, determining the target container from the candidate containers; and sending an operation instruction of the quantitative transaction strategy to the target container to enable the target container to execute the quantitative transaction strategy, thereby realizing operation of the quantitative transaction strategy by using the created container, reducing the starting time of the quantitative transaction strategy, timely meeting the implementation demand of a user for the quantitative transaction strategy, improving the use experience of the user, and improving the user experience. And the transaction opportunity is prevented from being missed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of computer technology, and specifically to a method, apparatus, device, and storage medium for operating a quantitative trading strategy. Background Technology

[0002] Quantitative trading platforms typically support users in creating quantitative trading strategies for various trading instruments, enabling them to execute these strategies and complete the actual trading process. In network and cloud computing environments, containers, as the smallest scheduling and management unit within a cloud cluster, can represent an instance running within that cluster.

[0003] In related technologies, quantitative trading platforms, in order to address the issue that quantitative trading strategies must run online and are limited by local resources and network environment, have proposed deploying quantitative cloud clusters. This involves deploying corresponding containers within the quantitative cloud cluster to enable offline execution of quantitative trading strategies. However, creating the corresponding containers within the quantitative cloud cluster takes a considerable amount of time, resulting in slow startup of quantitative trading strategies and severely impacting the user experience. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, apparatus, device and storage medium for running a quantitative trading strategy, which reduces the startup time of the quantitative trading strategy by utilizing a pre-created container to run the quantitative trading strategy, timely meets the user's needs for implementing the quantitative trading strategy, improves the user experience, and avoids missing trading opportunities.

[0005] In a first aspect, embodiments of this application provide a method for operating a quantitative trading strategy, including: In response to a request to obtain a target container, at least one candidate container is obtained; the candidate container is a container that has been created in the quantitative cloud cluster based on a container image. Based on the acquisition request, the target container is determined from the candidate containers; Send a command to the target container to execute the quantitative trading strategy.

[0006] Secondly, embodiments of this application provide an apparatus for operating a quantitative trading strategy, comprising: The acquisition module is used to acquire at least one candidate container in response to an acquisition request for the target container; the candidate container is a container that has been created in the quantitative cloud cluster based on a container image; A determining module is configured to determine the target container from the candidate containers based on the acquisition request; The instruction module is used to send execution instructions of the quantitative trading strategy to the target container, so that the target container executes the quantitative trading strategy.

[0007] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in embodiments of this application.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in embodiments of this application.

[0009] The operation method, device, equipment, and storage medium of the quantitative trading strategy obtain the target container by determining the target container from the candidate containers already created in the quantitative cloud cluster after receiving the request to obtain the target container. This not only ensures the purpose of providing the target container for the quantitative trading strategy and meets the user's needs for publishing the quantitative trading strategy, but also eliminates the need to wait for the container to be created, greatly saving the user's online waiting time and improving the user experience.

[0010] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0011] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 The implementation environment architecture diagram of the quantitative trading strategy operation method provided in the embodiments of this application is shown; Figure 2 A flowchart illustrating the operation method of a quantitative trading strategy provided in an embodiment of this application is shown. Figure 3 A flowchart illustrating the operation method of a quantitative trading strategy provided in another embodiment of this application is shown; Figure 4 A flowchart illustrating the operation method of a quantitative trading strategy provided in another embodiment of this application is shown; Figure 5 A flowchart illustrating the operation method of a quantitative trading strategy provided in another embodiment of this application is shown; Figure 6 A schematic diagram of the structure of an operating device for a quantitative trading strategy provided in an embodiment of this application is shown; Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device or server according to embodiments of this application is shown. Detailed Implementation

[0012] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0013] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0014] It should be noted that all information (including but not limited to user device information, user login information, user transaction information, and other related personal information), data (including but not limited to data used for analysis, stored data, and displayed data), and signals involved in this application are authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0015] Quantitative trading refers to the process of using mathematical and statistical methods and computer technology to complete trades based on pre-defined quantitative trading strategies. Quantitative trading greatly reduces the impact of user emotional fluctuations, preventing users from making irrational investment decisions when the market is extremely bullish or bearish.

[0016] Quantitative trading strategies specifically include trading targets, pre-defined trading conditions, and trading operations triggered when these conditions are met. Trading conditions include, but are not limited to, specific conditions that the market data and / or related technical indicators of the trading target must meet. Trading operations include, but are not limited to, order placement and order cancellation. For example, taking a moving average golden cross entry strategy as an example, when the candlestick data of the trading target specified in the quantitative trading strategy crosses above its moving average over a certain long-term period (i.e., meeting the quantitative condition), a buy order is placed for the trading target. Another example is that the strategy logic of a quantitative trading strategy can be: when the technical indicators of the trading target specified in the quantitative trading strategy meet the preset conditions, an order is placed for the trading target. For instance, with a moving average golden cross entry strategy as an example, when the moving averages of the trading target specified in the quantitative trading strategy form a golden cross over a certain period, a buy order is placed for the trading target. This helps users better seize trading opportunities, achieve more precise and efficient trading operations, and improve trading efficiency and speed.

[0017] Users can define the strategy logic of preset quantitative trading strategies based on the visual interactive interface provided by the client front-end. Specifically, users can directly specify preset trading conditions and the trading operations to be executed after these conditions are met through this interface. The visual interactive interface provided by the client front-end may include a quantitative trading strategy canvas, which provides card controls, including start card controls, condition card controls, and event card controls. Users can edit these card controls to construct the quantitative trading strategy canvas. For example, users can edit the condition card controls to set the trading conditions of the quantitative trading strategy, and edit the event card controls to set the trading operations of the quantitative trading strategy.

[0018] During the execution of a quantitative trading strategy, real-time market data of the trading object is acquired, and the trading operation is automatically executed when the market data of the trading object determines whether the specified preset trading conditions are met. This involves sending the corresponding trading request to the corresponding trading request interface on the server to realize the transaction.

[0019] Considering that quantitative trading strategies deployed locally on the client side typically require the client device to remain online at all times, this presents many inconveniences and limitations, and is also constrained by local computing resources and network conditions. Therefore, to ensure the efficient operation of quantitative trading strategies, the strategies originally running locally on the client side can be decoupled and deployed to cloud containers for efficient execution.

[0020] A quantitative cloud cluster is a cloud computing cluster that deploys and runs quantitative trading strategies through its containers. Within a quantitative cloud cluster, containers are the basic unit of application execution, and the cluster supports monitoring the specific operational status of each container within it for the corresponding quantitative trading strategy.

[0021] For example, the quantitative cloud cluster in this application can be a Kubernetes cluster (denoted as a K8s cluster), which is an open-source container orchestration platform capable of automating the deployment, scaling, and management of containerized applications. In a K8s cluster, a Pod is the smallest unit of deployment and management, as well as the basic unit of scheduling. It serves as a container for deploying quantitative trading strategies in this application, executing the actual operation of the corresponding quantitative trading strategies.

[0022] In related technologies, the process execution files required to run a quantitative trading strategy are packaged into a container image. When a user needs to start a quantitative trading strategy, a sandbox environment needs to be created in the K8s cluster. A sandbox environment is a virtual machine. Within the K8s cluster, each Pod runs independently on a virtual machine. Then, a quantitative container image is pulled from the image repository, and a Pod that meets the running environment of the quantitative trading strategy is created on the sandbox using the quantitative container image.

[0023] However, in the aforementioned process, creating the sandbox takes approximately 60 seconds, and pulling the quantitative container image takes about 30 seconds. If these steps are implemented after receiving the user's command to execute the quantitative trading strategy from the client-side, the actual execution of the quantitative trading strategy will take 1-2 minutes. This results in users having to wait a considerable amount of time after configuring the quantitative trading strategy before receiving operational feedback, impacting the user experience. Moreover, in applications involving the trading of financial products, this can easily lead to missed trading opportunities, further affecting the user's trading experience.

[0024] Based on this, this application proposes a method, apparatus, device, and storage medium for running a quantitative trading strategy, which reduces the startup time of the quantitative trading strategy by utilizing a pre-created container to run the quantitative trading strategy, promptly meets the user's needs for implementing the quantitative trading strategy, improves the user experience, and avoids missing trading opportunities.

[0025] For the specific implementation environment of the quantitative trading strategy proposed in this application, please refer to [link / reference needed]. Figure 1 . Figure 1 The implementation environment architecture diagram of the quantitative trading strategy operation method provided in the embodiments of this application is shown.

[0026] like Figure 1 As shown, the implementation environment architecture includes: a quantitative client, a quantitative server, and a quantitative cloud cluster.

[0027] A quantitative trading client can refer to a front-end application that supports users in designing various quantitative trading strategies to achieve quantitative functions. It provides users with various strategy management controls on the front-end page to support their control over quantitative trading strategies. For example, a quantitative trading client can support users in designing, initiating, stopping, querying the running status, and managing related containers for any quantitative trading strategy, thus completing a comprehensive interactive operation for any quantitative trading strategy. This quantitative trading client can be, but is not limited to, tablets, mobile phones (such as foldable phones, large-screen phones, etc.), wearable devices, in-vehicle devices, laptops, and ultra-mobile personal computers (Ultra). This application does not impose any restrictions on the specific types of electronic devices, including mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart TVs, smart screens, high-definition TVs, 4K TVs, smart projectors, and other computing devices.

[0028] The quantitative server deploys multiple business services to directly respond to any business operations initiated by the quantitative client, accurately implementing the various business operations of the quantitative client. The quantitative server communicates with both the quantitative client and the quantitative cloud cluster to deploy the quantitative trading strategies configured by the user in the quantitative client to the target container in the quantitative cloud cluster, enabling offline execution of the quantitative trading strategies through the target container.

[0029] A quantitative cloud cluster consists of multiple cluster nodes, each of which can deploy multiple virtual machines, and each virtual machine can deploy one container. This quantitative cloud cluster can also be a supernode cluster, such as Tencent Cloud's supernode cluster.

[0030] The quantitative trading strategy proposed in this application can be implemented by a device for running the quantitative trading strategy. This device can be used in a quantitative server or a quantitative cloud cluster. The quantitative server and quantitative cloud cluster can be independent physical servers, server clusters composed of multiple physical servers, or distributed systems. They can also be cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. This application does not impose any restrictions on the specific types of quantitative servers and quantitative cloud clusters. This application uses the application of the quantitative trading strategy's running device in a quantitative server as an example for illustration.

[0031] To further illustrate the technical solutions provided in the embodiments of this application, a detailed description is provided below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of this application provide method operation instruction steps as shown in the following embodiments or drawings, the method may include more or fewer operation instruction steps based on conventional or non-creative effort. In steps where there is no logically necessary causal relationship, the execution order of these steps is not limited to the execution order provided in the embodiments of this application. In actual processing or when the device executes the method, it may be executed sequentially or in parallel according to the method shown in the embodiments or drawings.

[0032] Please refer to Figure 2 , Figure 2 A flowchart illustrating the operation method of a quantitative trading strategy provided in an embodiment of this application is shown. Figure 2As shown, the method includes: Step 201: In response to the request to obtain the target container, obtain at least one candidate container, which is a container that has been created in the quantitative cloud cluster based on a container image.

[0033] It should be noted that users can obtain a request for the target container by inputting information on the front-end page of the quantitative trading client. For example, users can send a request to the quantitative server to obtain the target container used to run the quantitative trading strategy by triggering the control control for launching or executing the quantitative trading strategy.

[0034] It should be understood that, for any quantitative trading strategy, the front-end page of the quantitative trading client can provide users with various related strategy control controls to support users' various management and control over the quantitative trading strategy. Specifically, after detecting a user's login operation, the quantitative client can present the corresponding front-end page to the user. This front-end page can include various graphical controls for designing any quantitative trading strategy and various control controls for any pre-designed quantitative trading strategy, including but not limited to control controls for publishing or executing the quantitative trading strategy.

[0035] After receiving a request, the quantification server responds to the request by retrieving at least one already created container from the quantification cloud cluster through the container retrieval interface. It should be understood that, in this embodiment, the quantification cloud cluster can create containers independently before receiving the request, forming at least one candidate container. Since container creation requires a certain amount of time, candidate containers can include both already created containers and containers in the creation process; this application does not impose specific limitations on this.

[0036] It should also be understood that in related technologies, after receiving a request to obtain a target container, a container is created by calling the container acquisition interface to use that container as the target container. However, in this embodiment of the application, after receiving a request to obtain a target container, at least one candidate container that has already been created is obtained by calling the container acquisition interface.

[0037] In one feasible embodiment, creating a container based on a container image in a quantitative cloud cluster specifically includes: creating a sandbox environment in the quantitative cloud cluster, pulling a quantitative container image provided by the quantitative cloud server from the image repository, and creating a Pod container in the sandbox environment using the quantitative container image.

[0038] Step 202: Based on the acquisition request, determine the target container from the candidate containers.

[0039] It should be noted that quantitative cloud servers provide different versions of quantitative container images or update quantitative container images based on the operational requirements of quantitative trading strategies, such as providing corresponding runtime components for newly added business services. Therefore, to meet the operational requirements of the quantitative trading strategy to be run, it is necessary to select the target container from the candidate containers based on the request to obtain the target container.

[0040] In one feasible embodiment, determining the target container from the candidate containers based on the retrieval request includes: obtaining target query conditions based on the retrieval request, and determining the target container from the candidate containers based on the target query conditions.

[0041] The target query conditions include the attribute information of the target container, preferably including the version information of the target container.

[0042] In other words, in order to ensure the effective operation of the quantitative trading strategy to be run, the request carries the container version number required to run the quantitative trading strategy. By parsing the request, the version information (version number) of the target container can be obtained, and it can be used as the target query condition for filtering candidate containers, so as to select the container that can be used for the quantitative trading strategy to be run from at least one candidate container.

[0043] In one feasible embodiment, this application allows multiple users to select target containers from a quantitative cloud cluster. Specifically, the information of candidate containers is stored on a middleware, such as MySQL, so that retrieval requests submitted by different users can be filtered for target containers through MySQL. In other words, this application utilizes MySQL to build a storage pool for candidate containers, storing the created containers in the storage pool to filter the required target containers from the storage pool when a retrieval request is received, thereby achieving the purpose of sharing candidate containers.

[0044] Taking storing candidate container information in MySQL as an example, a data table, such as the DB table, can be created in MySQL. Each record in the data table represents an unused candidate container. The data table can store the container identifier (id), container name (pod_name), and container version number (mirror_version) of the candidate container.

[0045] It should be understood that when a container is created, the version number of the candidate container can be determined based on the version of the quantized container image used to create the container, and recorded in a data table. This allows the version information of each candidate container to be determined through the mirror_version field in the data table when the target container is obtained later, thereby filtering out the target container.

[0046] It should be understood that when there are multiple candidate containers that meet the version information, the target container can be selected from the multiple candidate containers according to preset rules. Among them, preset rules include, but are not limited to, random rules, rules according to ID order, etc., and this application does not specifically limit them.

[0047] Step 203: Send the execution instruction of the quantitative trading strategy to the target container so that the target container executes the quantitative trading strategy.

[0048] In other words, after the quantitative server obtains the target container through the container acquisition interface, it sends the execution instructions of the quantitative trading strategy to the target container, so that the target container executes the corresponding quantitative trading strategy based on the execution instructions of the quantitative trading strategy.

[0049] Therefore, the quantitative trading strategy operation method provided in this application, after receiving a request to obtain a target container, obtains the target container by determining the target container from the candidate containers already created in the quantitative cloud cluster. This not only ensures the purpose of providing a target container for the quantitative trading strategy and meets the user's needs for publishing the quantitative trading strategy, but also eliminates the need to wait for container creation time, greatly saving the user's online waiting time and improving the user experience.

[0050] In one feasible embodiment, even if the target container meets the version information requirements, there is still a possibility that it may not be able to run the quantitative trading strategy, for example, the target container has not yet completed the creation process.

[0051] Based on this, this application also proposes that after determining the target container from the candidate containers, the process further includes: obtaining the state information of the target container; and sending the execution instruction of the quantitative trading strategy to the target container, specifically including: identifying the state of the target container as the target state type, and then sending the execution instruction of the quantitative trading strategy to the target container.

[0052] It should be noted that the target container's status includes Running, Pending, and Failed. Only containers that have been created can directly run quantitative trading strategies; therefore, the target status type is Running. In other words, after obtaining the target container's status information, the type of the target container's status information is identified. If the target container's status information is Running, then the execution instruction for the quantitative trading strategy is sent to the target container, enabling the target container to directly run the quantitative trading strategy.

[0053] Therefore, this application embodiment, after obtaining the target container, identifies the state of the target container to ensure that the quantitative trading strategy can run effectively through the created container. This effectively avoids uncontrollable anomalies that may occur between the time the container is created and the time it is screened, thereby affecting the effective execution of the quantitative trading strategy and ensuring the reliability of the quantitative trading strategy.

[0054] In a preferred embodiment, when there are multiple candidate containers that meet the version information, in order to avoid redundancy caused by judging the container status for each target container, the attribute information in the target query condition also includes the ID limitation condition of the target container, wherein the ID limitation condition is the smallest ID, that is, the target container is a candidate container that meets the version information and has the smallest ID.

[0055] It should be understood that during the process of creating candidate containers, the ID order of multiple candidate containers corresponding to the same quantized container image version is consistent with the creation order of the candidate containers. That is, when creating candidate containers of the same version, the creation time is the same or similar. Therefore, if the status information of the container with the smallest ID is "creating", the status information of other containers cannot meet the conditions of the target status type.

[0056] Therefore, this application further enhances the target container screening by adding ID restrictions, which not only ensures the effective use of already created containers and avoids container omissions or shelving caused by random use, thus preventing resource waste, but also enables the prediction of the status of other containers of the same version through ID order, reducing the computational load of container screening and improving the efficiency of target container screening.

[0057] Furthermore, candidate containers with different resource distribution types can be pre-created in the quantitative cloud cluster. The amount of resources occupied by candidate containers with different resource distribution types varies across various resource dimensions. For example, resource dimensions include, but are not limited to, CPU resource dimensions, memory resource dimensions, and storage resource dimensions. Different resource distribution types may include, but are not limited to, a first candidate container with high CPU resource consumption and high memory / storage resource consumption, a second candidate container with high CPU resource consumption but low memory / storage resource consumption, and a third candidate container with low CPU resource consumption but high memory / storage resource consumption.

[0058] After receiving the request, the execution script of the quantitative trading strategy can be obtained based on the strategy identifier of the quantitative trading strategy carried in the request. Based on the script code information of the execution script of the quantitative trading strategy, the resource distribution information required to execute the quantitative trading strategy can be obtained. Then, based on the resource distribution information and the resource distribution type of each candidate container, the target container can be determined from the candidate containers.

[0059] Among them, the resource distribution information required by the quantitative trading strategy is used to indicate the amount of resources required by the quantitative trading strategy in each resource dimension, or to indicate the distribution differences required by the quantitative trading strategy in each resource dimension, that is, which resource dimension is more needed.

[0060] After obtaining the execution script of the quantitative trading strategy, the resource distribution information required to execute the strategy is obtained based on the script code information. Specifically, all called functions, their function information, and the relationships between them can be obtained from the script code information. Function information includes, but is not limited to, input data, output data, function type, and computational complexity of a single function. Then, the execution complexity of the quantitative trading strategy is obtained based on the function information and relationships between the called functions. Simultaneously, the data processing volume of the strategy is obtained based on the input and output data of each called function. Finally, the resource distribution information required by the quantitative trading strategy is determined based on its execution complexity and data processing volume.

[0061] Execution complexity can be used to indicate the computational complexity and amount of data calculation in a quantitative trading strategy. Higher execution complexity indicates greater computational complexity and amount of data calculation in the quantitative trading strategy, requiring more CPU resources; conversely, lower execution complexity indicates less computational complexity and amount of data calculation in the quantitative trading strategy, requiring less CPU resources. For example, the function complexity corresponding to different function types can be obtained. After obtaining the function information based on each called function and the relationships between called functions, the function complexity can be determined based on the function type corresponding to each called function. Then, based on the function complexity of each called function and the relationships between called functions, the execution complexity of the quantitative trading strategy can be determined. Furthermore, if the execution complexity is greater than a preset complexity threshold, the CPU resource usage information in the resource distribution information of the quantitative trading strategy is determined to be high usage; if the execution complexity is less than or equal to the preset complexity threshold, the CPU resource usage information in the resource distribution information of the quantitative trading strategy is determined to be low usage.

[0062] The data processing volume of a quantitative trading strategy can be used to indicate the amount of data transmitted during the execution of the strategy. A higher data processing volume indicates a larger data transmission volume and higher memory / storage resource requirements, while a lower data processing volume indicates a smaller data transmission volume and lower memory / storage resource requirements. For example, the data volume of market data input to the quantitative trading strategy can be obtained, and the data processing volume can be determined based on this data volume. Furthermore, if the data processing volume exceeds a preset data volume threshold, the memory / storage resource usage information in the resource distribution information of the quantitative trading strategy is determined to be high; if the data processing volume is less than or equal to the preset data volume threshold, the memory / storage resource usage information in the resource distribution information of the quantitative trading strategy is determined to be low.

[0063] By setting up candidate containers with different resource distribution types, and then selecting containers based on the resource distribution information required by the quantitative trading strategy, it is possible to avoid wasting computing resources due to excessive container computing resource allocation, and affecting the execution process of the quantitative trading strategy if computing resources are allocated too little.

[0064] In another feasible embodiment, based on the execution requirements of the quantitative trading strategy, the strategy needs to exclusively occupy the target container, meaning a container can only be allocated once. Therefore, before sending the execution instruction of the quantitative trading strategy to the target container, it is necessary to determine whether the target container is exclusively allocated.

[0065] Specifically, after determining the target container from the candidate containers, the process further includes: performing a preset deletion operation to delete the attribute information of the target container from the database table, obtaining the number of rows deleted returned by the preset deletion operation, and then sending a quantitative trading strategy execution instruction to the target container. Specifically, if the number of rows deleted is a preset number, then the quantitative trading strategy is sent to the target container.

[0066] The data table stores the attribute information for each candidate container.

[0067] The default deletion operation is a deletion operation based on the delete statement.

[0068] It should be noted that the delete statement is an atomic operation, and only one transaction can be successfully deleted by the delete statement. Therefore, when the delete statement is executed to delete the attribute information of the target container in the data table, if the delete statement returns 1 row of successfully deleted rows, it is determined that only the target container is allocated for the current retrieval request, thus ensuring that the target container will not be allocated repeatedly.

[0069] In a preferred embodiment, to avoid the target container being allocated but not effectively used, the state identification and exclusive allocation judgment of the target container can be performed sequentially. That is, when the state of the target container is determined to be the target state type, it is determined that the target container can be allocated to the current acquisition request. At this time, the deletion operation of the delete statement is executed to delete the target container from the data table, thereby realizing the allocation of the target container.

[0070] In some embodiments, when the target container is not identified from the candidate containers, or when the execution instruction for the quantitative trading strategy to be sent to the target container is not met, the method further includes: creating a new container in the quantitative cloud cluster based on the acquisition request, and sending an initialization instruction to the new container.

[0071] The initialization instruction includes the execution instructions for the quantitative trading strategy, so that the quantitative trading strategy can be run directly after the new container is created.

[0072] It should be understood that since no usable target container can be determined from the candidate containers, or the target container does not meet the requirements for sending the execution instructions of the quantitative trading strategy, it means that the quantitative trading strategy cannot be directly run using the already created container. Therefore, this application first creates a new container in the quantitative cloud cluster to execute the quantitative trading strategy through the newly created container, and adds the execution instructions of the quantitative trading strategy to the initialization instructions of the container creation. This allows the execution instructions of the quantitative trading strategy in the initialization instructions to be automatically executed after the container is created, without waiting for the container creation process to end. By concatenating the execution instructions of the quantitative trading strategy into the container initialization instructions, it is possible to ensure that the container can execute the quantitative trading strategy in an offline state.

[0073] In one specific embodiment, such as Figure 3 As shown, the system receives a retrieval request from the quantitative trading client, extracts the quantitative image version number from the request as a query condition, and searches for the container with the smallest ID that meets the version information from the candidate containers. If the query is successful, it calls the quantitative cloud cluster's status interface to obtain the container's status information. It checks if the container's status is "Running" to ensure the container's availability. If the container's status is "Running," it executes a delete statement to remove the container's information from the data table to ensure that the container is not repeatedly used by other transactions. It checks if the number of rows deleted is 1. If it is, it sends a quantitative trading strategy execution command to the container via network communication to remotely control the container to run the quantitative trading strategy. It checks if the execution command was sent successfully. If successful, it returns a message indicating that the target container was created successfully and returns the container's ID; otherwise, it returns a message indicating that the container creation failed.

[0074] If the query fails (e.g., there are no candidate containers in the quantitative cloud cluster or the version information of the candidate containers does not meet the requirements), or the container status is not Running (e.g., the container status is Pending or Failed), or the number of rows deleted by the delete statement is not 1, a new container is created in the quantitative cluster. The execution instructions of the quantitative trading strategy are appended to the initialization instructions of the new container so that the execution instructions of the quantitative trading strategy are automatically executed after the new container is initialized. The system checks whether the creation interface returns success. If successful, it returns a message indicating that the target container was created successfully and returns the container's ID; otherwise, it returns a message indicating that the container creation failed.

[0075] As can be seen from the above embodiments, the candidate containers in the quantitative cloud cluster can be empty, that is, the candidate containers in the quantitative cloud cluster are consumed and empty as different users continuously run quantitative trading strategies. Therefore, in order to ensure that there are enough candidate containers in the quantitative cloud cluster in a timely manner, this application also proposes a candidate container replenishment strategy.

[0076] Specifically, based on a first preset frequency, the current number of candidate containers is obtained. If the current number is less than the preset number, the target number of containers to be created is determined. Based on the target number, the quantitative cloud cluster is controlled to create candidate containers based on the latest quantitative container image with the latest version number.

[0077] In other words, the quantization server obtains the current number of candidate containers at a first preset frequency, determines whether the current number is less than the preset number n, and if the current number is less than the preset number n, then the target number of containers to be created is determined based on the difference between the preset number n and the current number. Then, the quantization cloud cluster is controlled to create the target number of candidate containers based on the latest version of the quantization container image. If the current number is greater than or equal to the preset number n, no action is taken.

[0078] Furthermore, the quantization server has multiple nodes, each of which can execute supplementary strategies for candidate containers. Based on this, such as Figure 4 As shown, a Redis distributed lock is added to multiple nodes in the quantitative server. It is determined whether the Redis distributed lock has been successfully acquired. If so, the current number of candidate containers is obtained from the data table. It is determined whether the current number is less than the preset number n. If so, the target number to be created is determined and the node in the quantitative server that acquires the Redis distributed lock is controlled to create candidate containers based on the latest version of the quantitative container image. The created candidate containers are written to the data table.

[0079] Therefore, this application embodiment can replenish sufficient candidate containers to the quantitative server in a timely manner according to a first preset frequency, and ensure that the replenished candidate containers are the latest version numbers, so as to meet the user's version requirements for obtaining candidate containers later, increase the likelihood that the user can run the quantitative trading strategy in a timely manner when it is released, and reduce the possibility of insufficient candidate containers when a request is received. At the same time, this application also uses Redis distributed locks to effectively avoid multiple nodes in the quantitative cloud cluster executing the replenishment strategy at the same time, causing an explosive surge in the data of candidate containers and resulting in redundancy in the number of candidate containers.

[0080] In another feasible embodiment, before a candidate container is identified as a target container, it may encounter an anomaly due to uncontrollable reasons, such as a "Failed" status or an update of the quantitative image container. These reasons can prevent the candidate container from being identified as a target container for users to publish quantitative trading strategies. Based on this, this application also proposes a cleanup strategy for unusable containers.

[0081] Specifically, based on the second preset frequency, the status type and / or attribute information of the candidate containers are obtained. If the status information and / or attribute information do not meet the corresponding retention conditions, a preset deletion operation is performed to delete the candidate containers that do not meet the corresponding retention conditions.

[0082] It should be noted that the retention conditions for status information include whether the status information is Running or Pending, and the retention condition for attribute information is the latest version number.

[0083] It should be understood that since the interface for creating candidate containers is asynchronous, candidate containers during the creation process will also be stored in the data table. At this time, we only need to wait for the container to be created before it can be correctly identified as the target container. Therefore, the retention conditions for the status information include Running and Pending.

[0084] In one specific embodiment, such as Figure 5As shown, the process retrieves the data table corresponding to the candidate containers, iterates through each candidate container in the data table, and for each candidate container, determines whether its status is "Failed". If so, the candidate container is added to the deletion list (need_delete_list). If not, it further checks whether the candidate container's version number is the latest version number. If not, meaning the candidate container's version number is an old version number, it is added to the deletion list (need_delete_list). If so, meaning the candidate container's version number is the latest version number, it then determines whether the deletion is complete. If the traversal is complete, return to check the next candidate container. If the traversal is complete, check if the need_delete_list is empty. If it is empty, end the process. If it is not empty, call the QQuant Cloud cluster's interface to release the containers in the need_delete_list. Check if the containers in the need_delete_list were released successfully. If successful, delete the containers in the need_delete_list from the data table. If unsuccessful, end the task.

[0085] It should be understood that if a container in the need_delete_list is not successfully released, it will be added back to the need_delete_list the next time the cleanup policy is started, and the deletion task will be executed again until the container is deleted.

[0086] It should also be understood that the first preset frequency and the second preset frequency can be the same or different. The execution timing of the supplementation strategy based on the first preset frequency can be delayed compared to the cleanup strategy based on the second preset frequency, so that if the candidate containers are insufficient after the cleanup strategy is executed, they can be supplemented in a timely manner by the supplementation strategy.

[0087] Therefore, this application embodiment can promptly clean up candidate containers that cannot be identified as target containers through a cleanup strategy, effectively avoiding resource waste. Simultaneously, by rationally setting the cleanup and replenishment strategies, it can ensure that the candidate containers in the quantitative cloud cluster are the latest versions and are sufficient in number, thereby effectively guaranteeing the allocation and utilization of containers by multiple users and improving user experience.

[0088] It should be noted that although the operation of the method of the present invention is described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in that specific order, or that all of the operations shown must be performed in order to achieve the desired result.

[0089] Figure 6 A schematic diagram of the structure of an operating device for a quantitative trading strategy provided in an embodiment of this application is shown.

[0090] like Figure 6 As shown, the operating device 10 for this quantitative trading strategy includes: The acquisition module 11 is used to acquire at least one candidate container in response to an acquisition request for the target container; the candidate container is a container that has been created in the quantitative cloud cluster based on a container image. The determining module 12 is used to determine the target container from the candidate containers based on the acquisition request; The instruction module 13 is used to send the execution instruction of the quantitative trading strategy to the target container so that the target container executes the quantitative trading strategy.

[0091] In some embodiments, the determining module 12 is further configured to: Based on the acquisition request, target query conditions are obtained; the target query conditions include the attribute information of the target container; Based on the target query conditions, the target container is determined from the candidate containers.

[0092] In some embodiments, the determining module 12 is further configured to: Obtain the status information of the target container; Instruction module 13 is also used for: If the state of the target container is identified as the target state type, then a quantitative trading strategy execution instruction is sent to the target container.

[0093] In some embodiments, the determining module 12 is further configured to: A preset deletion operation is performed to delete the attribute information of the target container from the database table, which stores the attribute information of each candidate container. Obtain the number of rows deleted returned by the preset deletion operation; Instruction module 13 is also used for: If the number of rows to be deleted is a preset number, then a command to run the quantitative trading strategy is sent to the target container.

[0094] In some embodiments, when the target container is not determined from the candidate containers, or when the conditions for sending the execution instruction of the quantitative trading strategy to the target container are not met, the instruction module 13 is further configured to: Based on the acquisition request, a new container is created in the quantitative cloud cluster; An initialization command is sent to the new container, which is concatenated with the execution command of the quantitative trading strategy, so that the quantitative trading strategy can be run directly after the new container is created.

[0095] In some embodiments, the acquisition module 11 is further configured to: Based on a first preset frequency, obtain the current number of candidate containers; Module 12 is also used for: If the current quantity is less than the preset quantity, determine the target quantity of containers to be created; Instruction module 13 is also used for: Based on the target quantity, the control quantization cloud cluster creates the candidate containers based on the latest version of the quantization container image.

[0096] In some embodiments, the acquisition module 11 is further configured to: Based on a second preset frequency, obtain the state type and / or attribute information of the candidate container; Instruction module 13 is also used for: If the state type and / or the attribute information do not meet the corresponding retention conditions, a preset deletion operation is performed to delete the candidate containers that do not meet the corresponding retention conditions.

[0097] It should be understood that the modules or modules described in the quantitative trading strategy operating device 10 and the reference Figure 2 The steps in the described method correspond accordingly. Therefore, the operations and features described above for the method also apply to the quantitative trading strategy running device 10 and its included modules, and will not be repeated here. The quantitative trading strategy running device 10 can be pre-implemented in the browser or other secure applications of an electronic device, or it can be loaded into the browser or its secure applications of an electronic device through download or other means. The corresponding modules in the quantitative trading strategy running device 10 can cooperate with the modules in the electronic device to implement the solution of the embodiments of this application.

[0098] The division of modules or units mentioned in the detailed description above is not mandatory. In fact, according to the embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0099] The following is for reference. Figure 7 , Figure 7 A schematic diagram of the structure of a computer system suitable for implementing the embodiments of this application is shown. like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. RAM 703 also stores various programs and data required for the system's operating instructions. The CPU 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0100] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 710 as needed so that computer programs read from it can be installed into storage section 708 as needed.

[0101] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 2 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program contains program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined in the system of this application.

[0102] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0103] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operational instructions of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two connected blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified functions or operational instructions, or using a combination of dedicated hardware and computer instructions.

[0104] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including an acquisition module, a determination module, and an instruction module. The names of these units or modules do not necessarily limit the unit or module itself. For example, an acquisition module can also be described as "in response to an acquisition request for a target container, acquiring at least one candidate container; the candidate container is a container created in the QuantCloud cluster based on a container image."

[0105] In another aspect, this application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not assembled into the electronic device. The aforementioned computer-readable storage medium stores one or more programs that, when used by one or more processors, execute the method for running the quantitative trading strategy described in this application.

[0106] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for operating a quantitative trading strategy, characterized in that, include: In response to a request to retrieve the target container, at least one candidate container is retrieved; The candidate containers are containers that have been created in the quantitative cloud cluster based on container images; Based on the acquisition request, the target container is determined from the candidate containers; Send a command to the target container to execute the quantitative trading strategy.

2. The method according to claim 1, characterized in that, The step of determining the target container from the candidate containers based on the acquisition request includes: Based on the acquisition request, target query conditions are obtained; the target query conditions include the attribute information of the target container; Based on the target query conditions, the target container is determined from the candidate containers.

3. The method according to claim 1, characterized in that, After determining the target container from the candidate containers, the method further includes: Obtain the status information of the target container; The step of sending the quantitative trading strategy execution instruction to the target container specifically includes: identifying the state of the target container as the target state type, and then sending the quantitative trading strategy execution instruction to the target container.

4. The method according to claim 1, characterized in that, After determining the target container from the candidate containers, the method further includes: A preset deletion operation is performed to delete the attribute information of the target container from the database table, which stores the attribute information of each candidate container. Obtain the number of rows deleted returned by the preset deletion operation; Sending the execution instruction of the quantitative trading strategy to the target container specifically includes: If the number of rows to be deleted is a preset number, then a command to run the quantitative trading strategy is sent to the target container.

5. The method according to any one of claims 1-4, characterized in that, When the target container is not identified from the candidate containers, or when the conditions for sending the execution instruction of the quantitative trading strategy to the target container are not met, the method further includes: Based on the acquisition request, a new container is created in the quantitative cloud cluster; An initialization command is sent to the new container, which is concatenated with the execution command of the quantitative trading strategy, so that the quantitative trading strategy can be run directly after the new container is created.

6. The method according to claim 1, characterized in that, Also includes: Based on a first preset frequency, obtain the current number of candidate containers; If the current quantity is less than the preset quantity, determine the target quantity of containers to be created; Based on the target quantity, the control quantization cloud cluster creates the candidate containers based on the latest version of the quantization container image.

7. The method according to claim 1, characterized in that, Also includes: Based on a second preset frequency, obtain the state type and / or attribute information of the candidate container; If the state type and / or the attribute information do not meet the corresponding retention conditions, a preset deletion operation is performed to delete the candidate containers that do not meet the corresponding retention conditions.

8. A device for operating a quantitative trading strategy, characterized in that, include: The acquisition module is used to acquire at least one candidate container in response to an acquisition request for the target container; The candidate containers are containers that have been created in the quantitative cloud cluster based on container images; A determining module is configured to determine the target container from the candidate containers based on the acquisition request; The instruction module is used to send execution instructions of the quantitative trading strategy to the target container, so that the target container executes the quantitative trading strategy.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for running the quantitative trading strategy as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method of running the quantitative trading strategy as described in any one of claims 1-7.