Processing method and device for realizing programming language design for security programmed transaction, processor and computer readable storage medium thereof

By designing a programming language based on Java with dynamic compilation and hot update, the problems of high development threshold and large operation and maintenance costs in the existing technology are solved, efficient development and rapid iteration of securities programmatic transactions are realized, and policy codes are supported. Hot deployment and dynamic scaling.

CN119127134APending Publication Date: 2024-12-13GUOTAI JUNAN SECURITIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411239133.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing programming languages ​​have high development thresholds, low efficiency, error-prone in securities programmatic trading, and are difficult to achieve dynamic updates and expansion of strategy logic, resulting in high operation and maintenance costs.

Method used

A programming language for securities programmatic trading is designed. Based on Java language, dynamic compilation and hot update of the language is realized by predefined common data structures and operations, allowing policy code to be loaded and mutated during execution, and supporting policy code Hot deployment and dynamic scaling.

Benefits of technology

It greatly reduces the amount of repeated development, improves development efficiency and accuracy, reduces operation and maintenance difficulties, realizes rapid iteration and efficient operation and maintenance of policy code, and supports code updates and expansions without stopping services during operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127134A_ABST
    Figure CN119127134A_ABST
Patent Text Reader

Abstract

The invention relates to a processing method for realizing programming language design for security programmed transactions, which comprises the following steps of: realizing strategy transaction codes according to required business logic, and storing the codes; establishing a strategy by setting operation parameters; loading a logic code, and compiling a strategy code; executing strategy logic according to code logic operation; if the strategy logic needs to be updated or expanded, updating the newly realized strategy transaction code into a file or a database; code compiling and parameter filling are executed again, and the compiling result in the cache is replaced; and continuing to execute the strategy content according to the updated code logic. By adopting the processing method and device for realizing the programming language design for the security programmed transaction, the processor and the computer readable storage medium, the development of the programmed transaction is more efficient and accurate. Dynamic compiling of programming languages is achieved, strategy codes are allowed to be loaded and varied during execution, and therefore hot updating and dynamic expansion of the strategy codes are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial industry, and in particular to the field of securities programmed trading technology, and specifically refers to a processing method, device, processor and computer-readable storage medium thereof for implementing programming language design for securities programmed trading. Background Art

[0002] With the rapid development of the securities market, program trading has become an important means for market participants to gain competitive advantages. Program trading uses computer technology to analyze market data in real time through preset trading strategies, and automatically executes transactions based on the analysis results. Program trading cannot do without programming languages ​​to implement strategy logic. However, existing programming languages, such as Java, C++, Python, etc., have certain limitations in strategy writing, updating, expansion, iteration and testing. For example, 1) the above languages ​​are not specifically implemented for program trading. Programmers need to first define and implement the corresponding data structure and basic logic, such as K-line data acquisition logic, real-time market price acquisition logic, strategy entrustment logic, etc. The development threshold is high, the efficiency is low, and it is easy to make mistakes; 2) during the development process, the trading strategy may need to be adjusted in real time to observe the effect, and in the existing programming languages, the changes in the code need to be compiled and deployed again to take effect, and the efficiency of development and iteration is low; 3) trading strategies often need to run continuously for a period of time, and it is difficult for existing programming languages ​​to realize the dynamic update and expansion of strategy logic, and the secondary development and operation and maintenance costs of the system are high. When developing securities program trading, the existing programming languages ​​have problems such as low development efficiency, repeated development, and high operation and maintenance costs. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a processing method, device, processor and computer-readable storage medium designed for programming language implementation for securities programmed trading, which are efficient, accurate, easy to operate and have a wide range of applications.

[0004] In order to achieve the above-mentioned purpose, the processing method, device, processor and computer-readable storage medium thereof for implementing programming language design for securities programmed trading of the present invention are as follows:

[0005] The main feature of the processing method for implementing programming language design for securities program trading is that the method comprises the following steps:

[0006] (1) Implement strategy trading code according to required business logic and store the code;

[0007] (2) Create a strategy by setting operating parameters;

[0008] (3) Load the logic code and compile the strategy code;

[0009] (4) Run according to the code logic and execute the strategy logic;

[0010] (5) If the strategy logic needs to be updated or expanded, the newly implemented strategy trading code is updated to the file or database;

[0011] (6) Triggering the updated code content loaded from a file or database, re-executing code compilation and parameter filling, and replacing the compilation result in the cache;

[0012] (7) Continue to execute the policy content according to the updated code logic.

[0013] Preferably, the step (3) specifically comprises the following steps:

[0014] Automatically load strategy trading codes from files, databases or other media, compile and fill in relevant parameters, and cache the compiled results in memory.

[0015] Preferably, the strategy logic of step (4) includes market information acquisition, trigger condition judgment, and order placement strategy logic.

[0016] The main feature of the device for implementing programming language design processing for securities programmed trading is that the device comprises:

[0017] a processor configured to execute computer executable instructions;

[0018] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the processing method designed for implementing a programming language for programmed securities trading are implemented.

[0019] The processor for implementing programming language design processing for programmed securities trading has the main feature that the processor is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the various steps of the above-mentioned processing method for implementing programming language design for programmed securities trading are implemented.

[0020] The main feature of the computer-readable storage medium is that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned processing method designed in a programming language for implementing programmed trading of securities.

[0021] The processing method, device, processor and computer-readable storage medium for programming language design for securities program trading of the present invention are adopted. Based on the foundation and mechanism of Java language, a programming language for securities program trading is created. According to the daily securities program development experience, the more commonly used data and operations are summarized and analyzed, and some data objects and methods that are often needed in the securities program trading process are predefined, which greatly reduces the amount of repeated development by users and makes the development of program trading more efficient and accurate. At the same time, based on Java's reflection mechanism and compiler API, this patent realizes the dynamic compilation of programming language, allowing the strategy code to be loaded and mutated during execution, thereby realizing the hot update and dynamic expansion of the strategy code. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flowchart of a processing method designed for a programming language for implementing programmed securities trading according to the present invention. DETAILED DESCRIPTION

[0023] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.

[0024] The processing method for implementing programming language design for securities programmed trading of the present invention comprises the following steps:

[0025] (1) Implement strategy trading code according to required business logic and store the code;

[0026] (2) Create a strategy by setting operating parameters;

[0027] (3) Load the logic code and compile the strategy code;

[0028] (4) Run according to the code logic and execute the strategy logic;

[0029] (5) If the strategy logic needs to be updated or expanded, the newly implemented strategy trading code is updated to the file or database;

[0030] (6) Triggering the updated code content loaded from a file or database, re-executing code compilation and parameter filling, and replacing the compilation result in the cache;

[0031] (7) Continue to execute the policy content according to the updated code logic.

[0032] As a preferred embodiment of the present invention, the step (3) specifically comprises the following steps:

[0033] Automatically load strategy trading codes from files, databases or other media, compile and fill in relevant parameters, and cache the compiled results in memory.

[0034] As a preferred embodiment of the present invention, the strategy logic of step (4) includes the strategy logic of market information acquisition, trigger condition judgment, and order placement.

[0035] The device for implementing programming language design processing for securities programmed trading of the present invention, wherein the device comprises:

[0036] a processor configured to execute computer executable instructions;

[0037] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the processing method designed for implementing a programming language for programmed securities trading are implemented.

[0038] The processor of the present invention is used to implement programming language design processing for programmed trading of securities, wherein the processor is configured to execute computer-executable instructions, and when the computer-executable instructions are executed by the processor, the various steps of the above-mentioned processing method for implementing programming language design for programmed trading of securities are implemented.

[0039] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned processing method designed for programming language for implementing programmed trading of securities.

[0040] In the specific implementation of the present invention, in order to achieve rapid iteration and efficient operation and maintenance of securities program trading programs, a programming language suitable for implementing program trading strategy logic is designed. By implementing high-frequency data structures and methods, users can efficiently and accurately implement program trading strategy logic. At the same time, based on the reflection mechanism and compiler API of the Java language, dynamic compilation of the programming language is implemented to achieve the effect of efficient hot update and dynamic expansion of strategy code.

[0041] In the process of developing strategy logic for programmatic trading, various securities information related data are often needed, such as securities codes, real-time prices, opening prices, etc. The present invention predefines common data structures and implements the loading and acquisition of corresponding data, so that users can quickly obtain relevant information without spending effort on development and implementation. The implemented common data structures include but are not limited to the following:

[0042] 1. Stock object Stock: used to represent the basic information of securities, including stock code (stockCode), stock name (stockName), latest price (price), securities financial capital information and other attributes;

[0043] 2. Kline object Kline: used to represent K-line data, including opening price (openPrice), closing price (closePrice), highest price (maxPrice), lowest price (minPrice), trading volume (volume) and other attributes;

[0044] 3. Market slice object Tick: used to represent real-time market data, including the latest price (price), transaction volume (volume), buySell and other information.

[0045] At the same time, during the development process, it is inevitable to perform some operations related to securities trading, such as entrustment, withdrawal, obtaining entrustment results, obtaining account funds usage, etc. The specific logic of implementing these operations from scratch is often complicated, and it is easy to make mistakes during the implementation process, resulting in abnormal transactions. The present invention implements many common operations in the process of securities programmatic trading, and has been fully verified in the actual production environment. Users can quickly implement related trading operations of programmatic trading by directly calling these methods.

[0046] In order to solve the problems of high development threshold, low iteration efficiency, high secondary development and operation and maintenance costs in the process of implementing programmatic trading in existing programming languages, the present invention realizes dynamic compilation of the language based on Java's reflection mechanism and compiler API: there is no need to load and compile strategy code in advance, but the code can be dynamically loaded and compiled into memory during execution, and the corresponding code can be executed.

[0047] Based on the above dynamic compilation characteristics, the present invention can realize the dynamic update of strategy trading logic and hot deployment of the system. Figure 1 As shown:

[0048] (1) The strategy trading execution logic code is stored in the database, and the corresponding strategy code can be obtained according to the specific strategy information query;

[0049] (2) When executing the strategy, the strategy execution code is queried from the database for compilation and the corresponding logic is executed;

[0050] (3) Cache compiled code to improve policy execution efficiency;

[0051] (4) When an update or expansion is required, replace the policy code in the database, trigger policy reloading, compile new code, replace the cache and execute the new code logic.

[0052] The technical problem to be solved by the present invention is to provide a programming language that pre-implements a variety of commonly used data structures and business methods in the field of programmatic securities strategy trading. At the same time, based on the Java reflection mechanism and compiler API, dynamic compilation of the language is realized, so that the core logic code of programmatic trading can be hot deployed and dynamically expanded. It effectively reduces the repeated development when implementing the logic of programmatic trading strategies, improves the accuracy of code implementation, improves programming efficiency, and reduces the difficulty of operation and maintenance.

[0053] The code hot deployment and dynamic expansion method implemented by the present invention is as follows Figure 1 As shown, the specific process is as follows steps S101-S107:

[0054] S101: Implement the strategy transaction code V1.0 according to the required business logic, and store the code in a file, database or other persistent media;

[0055] S102: Create a strategy by setting the running parameters, executing the strategy transaction code acquisition path or method; wherein, the execution strategy transaction code acquisition path or method refers to the specific storage method of the strategy code, such as file, database or other methods. If it is a file or other method, the file storage location must also be specified to ensure that the correct corresponding strategy code can be obtained according to different strategies;

[0056] S103: The program automatically loads the strategy trading code from a file, database or other medium, compiles and fills in relevant parameters, and caches the compiled result in the memory;

[0057] S104: The system runs according to the code logic, executing market information acquisition, trigger condition judgment, order placement and other strategic logic;

[0058] S105: When the strategy logic needs to be updated or expanded, the newly implemented strategy trading code V2.0 is updated to the file or database;

[0059] S106: triggering the system to load updated code content from a file or database through an interface call or other means, re-execute code compilation and parameter filling, and replace the compilation result in the cache;

[0060] S107: The system continues to execute the policy content according to the updated code logic.

[0061] Through the above steps, hot deployment and dynamic expansion of programmatic trading codes can be achieved. In the above process, updating the core logic of the program does not require redeployment of the system, users are unaware of it, and it does not affect the normal execution of the program logic.

[0062] This technical solution has the following characteristics:

[0063] Domain-specific language design: This programming language is designed specifically for writing stock trading strategies, including securities basic information data types, operators and built-in functions to simplify the writing process of trading strategies. (For example, data structures such as Stock and Tick, execution of entrustment operations, order withdrawal operations, entrustment result acquisition, etc.)

[0064] Readability: The syntax of the language designed by this patent is very similar to Java, and has many of the same concepts and programming paradigms. Developers with a Java programming foundation can almost immediately understand and get started, and can quickly adapt to this new language and use existing programming knowledge to write code.

[0065] Ease of use: Unlike Java, which needs to be compiled before running, the language designed in this patent is an interpreted execution language that can quickly write and test code without the need for a compilation step, which is very helpful for rapid prototyping and iteration.

[0066] Hot update capability: This is the most significant advantage of the language. During operation, the code can be directly replaced or updated without stopping the service, which greatly reduces the downtime for maintenance and updates. The new code can be deployed to the production environment without the user's awareness, which improves the user experience.

[0067] Fast iteration and efficient debugging: Developers can quickly modify and test the code and see the effect of the modification immediately, which speeds up the development iteration. Debugging can be performed without stopping the program, and the program status can be observed in real time, which helps to quickly locate and fix problems.

[0068] Simplified deployment process: Reduces the number of steps in the deployment process and allows updates to be applied without restarting the system, simplifying operation and maintenance.

[0069] Dynamic extensibility: New functions or modules can be added dynamically at runtime, which improves the flexibility and extensibility of the program.

[0070] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.

[0071] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0072] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0073] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0074] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0075] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.

[0076] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0077] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0078] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0079] The processing method, device, processor and computer-readable storage medium for programming language design for securities program trading of the present invention are adopted. Based on the foundation and mechanism of Java language, a programming language for securities program trading is created. According to the daily securities program development experience, the more commonly used data and operations are summarized and analyzed, and some data objects and methods that are often needed in the securities program trading process are predefined, which greatly reduces the amount of repeated development by users and makes the development of program trading more efficient and accurate. At the same time, based on Java's reflection mechanism and compiler API, this patent realizes the dynamic compilation of programming language, allowing the strategy code to be loaded and mutated during execution, thereby realizing the hot update and dynamic expansion of the strategy code.

[0080] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.

Claims

1. A method for designing a programming language for securities program trading, characterized in that: The method comprises the following steps: (1) Implement strategy trading code according to required business logic and store the code; (2) Create a strategy by setting operating parameters; (3) Load the logic code and compile the strategy code; (4) Run according to the code logic and execute the strategy logic; (5) If the strategy logic needs to be updated or expanded, the newly implemented strategy trading code is updated to the file or database; (6) Triggering the updated code content loaded from a file or database, re-executing code compilation and parameter filling, and replacing the compilation result in the cache; (7) Continue to execute the policy content according to the updated code logic.

2. The method for designing a programming language for implementing programmed securities trading according to claim 1, characterized in that: The step (3) specifically comprises the following steps: Automatically load strategy trading codes from files, databases or other media, compile and fill in relevant parameters, and cache the compiled results in memory.

3. The method for designing a programming language for implementing programmed securities trading according to claim 1, characterized in that: The strategy logic of step (4) includes market information acquisition, trigger condition judgment, and order placement strategy logic.

4. A device for implementing programming language design processing for securities programmed trading, characterized in that: The device comprises: a processor configured to execute computer executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the processing method designed for a programming language for programmed trading of securities as described in any one of claims 1 to 3 are implemented.

5. A processor for implementing programming language design processing for securities program trading, characterized in that: The processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the processing method designed for a programming language for programmed trading of securities as described in any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the processing method designed for a programming language for programmed trading of securities as described in any one of claims 1 to 3.