| With the rapid development of China's securities market and deepening of financial innovation,institutional investors are faced with fierce market competition and profit pressure.At the same time,with the expansion of capital scale,the market risk is exacerbated and the market conditions fluctuate frequently.Based solely on the manual operation of the asset management model ushered in a serious challenge,more and more institutional investors choose to use high-frequency trading,algorithmic trading and other program trading software to solve operational efficiency,risk management and other issues.Under the circumstance that the application of program trading is more and more widely and meanwhile the trading strategies converge,the institutions that can judge the timing first and place orders to the exchanges will gain higher returns,so the trading users raise the performance of trading channels higher and higher.The traditional centralized securities trading system based on database has not been able to satisfy the demand for program trading with low latency trading channels.This thesis studies the low latency trading system to design a fast securities order processing system with sub-millisecond latency and high availability.In terms of functions,the fast securities order processing system provides trading clients with the functions of user access,order,withdrawal,basic data and transaction data query,and notifies the trading client when the exchange feedbacks the result of order,withdrawal and deal.At the same time,it provides basic data maintenance and order data query functions for securities company business managers.In terms of performance,the fast securities order processing system needs to achieve less than 0.5 milliseconds latency for order processing,and less than 1 millisecond latency for deal processing,to meet the program trading system's need for extremely low transaction latency.In terms of avaliability,each module of the fast securities order processing system needs to support no single point of failure.This thesis introduces the technologies used in fast securities order processing system,such as messaging oriented middleware,distributed coordination system,and Command Query Responsibility Segregation mechanism.This thesis analyzes the requirements of the system and the architecture design.This thesis also introduces the design and implementation of key functions and key technologies of fast securities order processing system.The functional,performance,and usability of the system is tested,the test results prove the system have achieved the desired requirements.Compared with other securities trading system,the work of this thesis has the following characteristics:1.The system is developed based on Command Query Responsibility Segregation mechanism to seperate order processing and query functions.The system is generally divided into three parts: the trading subsystem,the trading API dynamic library,and the management subsystem.The trading subsystem is responsible for the order processing functions.After the order processing is completed,the orders information is pushed to the trading API dynamic library and management subsystem.The query functions are implemented in the trading API dynamic library and management subsystem respectively,so that the query function does not affect the order processing performance.2.The trading subsystem adopts a full memory processing mechanism.The basic data and transaction data used in order processing are stored in memory.Various indexing mechanisms are used to achieve high-performance order processing,and transaction of order processing is guaranteed.3.Adopting active-replication mechanisms to achieve high availability of trading services,the system is based on total ordering mechanism of Apache ActiveMQ to ensure that multiple trading service process instances receive the same sequence of messages,all trading service process messages at the same time to maintain the same memory state,the system uses Apache ZooKeeper to implement master elections,only the master process sends out processing result messages,and trading service support automatic failover. |