A method and system for sending liquidation quotation information that is easy to control
By configuring the market calendar and utilizing a variety of technical service systems, the problem that the liquidation market sending system cannot flexibly respond to when the Hong Kong Stock Exchange opens in extreme weather is solved, and flexible and timely liquidation market sending is achieved, improving the user experience.
Patent Information
- Application Number
- CN202111497576.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-12-09
AI Technical Summary
When the Hong Kong Stock Exchange's opening time was adjusted due to extreme weather in Hong Kong, the existing liquidation market sending system could not respond flexibly and promptly, resulting in invalid liquidation market data being sent to users, bringing users a bad experience.
By configuring the market calendar, read the opening time regularly, verify the opening time and construct the liquidation market, and finally push it to the user. The system includes a backend service system, a market decoding service system, a market calendar service system and a market push service system, and uses Mysql, grpc, Pb and Kafka to achieve flexible liquidation market sending.
Under normal circumstances, the liquidation market will be sent on time, and manually configure the opening time during extreme weather or market opening time adjustments, and flexibly respond to the opening time adjustments, avoid sending invalid liquidation market data and improve user experience.
Smart Images

Figure CN114331715B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of market data processing, and in particular to an easy-to-control liquidation market sending method and system. Background Art
[0002] Liquidation quotes are special quotes sent a few minutes before the market opens, reminding users that the market is about to open. Under normal circumstances, the Hong Kong Stock Exchange starts pre-market auction trading at 9 o'clock, and the quotation system will send liquidation quotes at 8:55, because the default opening time is 9 o'clock.
[0003] However, Hong Kong is prone to extreme weather such as typhoons and rainstorms. The Hong Kong Stock Exchange will delay opening according to weather conditions, or even close the market for the entire day. If liquidation quotes are sent to users in this situation, some fields of all stock quote data will be cleared (such as the increase or decrease range, the increase or decrease amount), which will bring a bad experience to users. Therefore, the liquidation quote system of securities firms should be able to flexibly and promptly respond to the opening time adjustment of the Hong Kong Stock Exchange to avoid sending such invalid liquidation quote data. Summary of the invention
[0004] In order to overcome the deficiencies of the prior art, the present invention provides an easy-to-control liquidation quotation sending method and system to solve the above-mentioned technical problems.
[0005] The technical method adopted by the present invention to solve its technical problem is: an easy-to-control liquidation quotation sending method, the improvement of which is that it includes the following steps: S1, configuring the quotation calendar; S2, regularly reading the quotation calendar and saving the opening time; S3, verifying the opening time and constructing the liquidation quotation; S4, pushing the liquidation quotation to the user.
[0006] In the above method, step S1 comprises the following steps:
[0007] S11. Open the market calendar configuration interface through a web browser, fill in the configuration parameters in the market calendar configuration interface, the parameters include date and opening time, and then submit the parameters through a POST request, which is an HTTP request method;
[0008] S12. After receiving the request from the web browser, the backend service system parses the parameters, including the date and opening time, and then calls the Mysql client library to connect to Mysql, and inserts the date and opening time as records into Mysql. Mysql is an open source relational database.
[0009] In the above method, step S2 comprises the following steps:
[0010] S21. The market decoding service system starts the first thread, and sends a grpc request to the market calendar service system at regular intervals, using today's date as a request parameter. grpc is a remote call framework open sourced by Google.
[0011] S22, after receiving the grpc request, the market calendar service system calls the Mysql client to connect to the Mysql data, takes the date in the request parameter as a condition, executes SQL, queries today's opening time, and returns the query result to the market decoding service system. SQL is a computer language used to access and process databases;
[0012] S23. The market decoding service system receives the returned result and obtains the opening time from the result.
[0013] In the above method, step S3 comprises the following steps:
[0014] S31, the market decoding service system starts a second thread, and the second thread triggers a timer at a fixed time every day;
[0015] S32. When the second thread triggers the timer, it determines whether the opening time is the normal opening time. If not, the liquidation process is terminated. If yes, the liquidation quotation is constructed and converted into Pb data format and sent to Kafka. Pb is protobuf, which is a Google open source mechanism for realizing automatic data serialization and deserialization.
[0016] In the above method, step S4 comprises the following steps:
[0017] S41, the market push service system consumes Pb data from Kafka and calls the Pb library to parse the liquidation market data;
[0018] S42. Push the liquidation market data to the user through the TCP connection. TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0019] The present invention also provides an easy-to-control liquidation quotation sending system, including a background service system, a quotation decoding service system, a quotation calendar service system and a quotation push service system.
[0020] The backend service system is used to parse the parameters filled in the backend market calendar configuration interface, including the date and opening time, and then call the Mysql client library to connect to Mysql, and insert the date and opening time as records into Mysql;
[0021] The market decoding service system is connected to the market calendar service system, and is used to start the first thread, and send a grpc request to the market calendar service system at regular intervals, using today's date as a request parameter; the market decoding service system is also used to receive the return result of the market calendar service system, and obtain the opening time from the result;
[0022] The market calendar service system is used to call the Mysql client to connect to the Mysql data after receiving the grpc request, and execute SQL to query today's opening time based on the date in the request parameter as a condition, and return the query result to the market decoding service system;
[0023] The market decoding service system is also used to start the second thread, which triggers the timer at a fixed time every day. When the second thread triggers the timer, it determines whether the opening time is the normal opening time. If not, the liquidation process is terminated. If yes, the liquidation market is constructed and converted into Pb data format and sent to Kafka;
[0024] The market push service system is used to consume Pb data from Kafka, call the Pb library to parse the liquidation market data, and push the liquidation market data to users through TCP connection.
[0025] The beneficial effects of the present invention are: under normal circumstances, liquidation quotes can be sent to users at normal times, and when abnormal circumstances prevent the market from opening normally, the opening time can be manually configured, so as to flexibly and timely respond to the adjustment of the opening time and realize flexible sending of liquidation quotes to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Attached Figure 1 The present invention is a flow chart of an easy-to-control liquidation quotation sending method. DETAILED DESCRIPTION
[0027] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0028] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.
[0029] Reference Figure 1 The present invention provides an easy-to-control liquidation quotation sending method, comprising the following steps:
[0030] S1. Configure the market calendar;
[0031] Specifically, the following steps are included:
[0032] S11. The administrator opens the market calendar configuration interface through a web browser, fills in the configuration parameters in the market calendar configuration interface, including the date and opening time, and then submits the parameters through a POST request, which is an HTTP request method;
[0033] S12. After receiving the request from the web browser, the backend service system parses the parameters, including the date and opening time, and then calls the Mysql client library to connect to Mysql, and inserts the date and opening time as records into Mysql. Mysql is an open source relational database.
[0034] S2. Read the market calendar regularly and save the opening time;
[0035] Specifically, the following steps are included:
[0036] S21. The market decoding service system starts the first thread. The market decoding service system is written in C++. At regular intervals, for example, every 1 minute, it sends a grpc request to the market calendar service system with today's date as a request parameter. grpc is a remote call framework open sourced by Google.
[0037] S22. After receiving the grpc request, the market calendar service system calls the Mysql client to connect to the Mysql data, takes the date in the request parameter as a condition, executes SQL, queries today's opening time, and returns the query result to the market decoding service system. SQL is a computer language for accessing and processing databases. The market calendar service system is written in Golang, which is an open source programming language developed by Google.
[0038] S23. The market decoding service system receives the returned result and obtains the opening time from the result.
[0039] S3. Verify the opening time and construct the liquidation quotation;
[0040] Specifically, the following steps are included:
[0041] S31. The market decoding service system starts the second thread, and the second thread triggers the timer at a fixed time every day. Since the Hong Kong market generally opens at 9 a.m., the fixed time for triggering the timer can be set to 8:55.
[0042] S32, when the second thread triggers the timer, it determines whether the opening time obtained in the step S23 is the normal opening time. For example, the normal opening time in Hong Kong is 9 am. If not, the liquidation process is terminated. If yes, the liquidation quotation is constructed and converted into Pb data format and sent to Kafka. Pb is protobuf, which is a Google open source mechanism for automatic data serialization and deserialization. Kafka is a high-throughput distributed publish-subscribe messaging system.
[0043] S4. Push liquidation quotation to users;
[0044] Specifically, the following steps are included:
[0045] S41, the market push service system consumes Pb data from Kafka and calls the Pb library to parse the liquidation market data;
[0046] S42. Pushing the liquidation market data to the user through the TCP connection realizes the flexible sending of the liquidation market data. TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0047] The present invention also provides an easy-to-control liquidation quotation sending system, including a background service system, a quotation decoding service system, a quotation calendar service system and a quotation push service system.
[0048] The backend service system is used to parse the parameters filled in the market calendar configuration interface, including the date and opening time, and then call the Mysql client library to connect to Mysql, and insert the date and opening time as records into Mysql;
[0049] The market decoding service system is connected to the market calendar service system, and is used to start the first thread, and send a grpc request to the market calendar service system at regular intervals, using today's date as a request parameter; the market decoding service system is also used to receive the return result of the market calendar service system, and obtain the opening time from the result;
[0050] The market calendar service system is used to call the Mysql client to connect to the Mysql data after receiving the grpc request, and execute SQL to query today's opening time based on the date in the request parameter as a condition, and return the query result to the market decoding service system;
[0051] The market decoding service system is also used to start the second thread, which triggers the timer at a fixed time every day. When the second thread triggers the timer, it determines whether the opening time is the normal opening time. If not, the liquidation process is terminated. If yes, the liquidation market is constructed and converted into Pb data format and sent to Kafka;
[0052] The market push service system is used to consume Pb data from Kafka, call the Pb library to parse the liquidation market data, and push the liquidation market data to users through TCP connection, realizing the flexible sending of liquidation market data.
[0053] Under normal circumstances, the Hong Kong Stock Exchange starts pre-market auction trading at 9 a.m., and the liquidation quotation sending system will send liquidation quotation to users at 8:55, because the default opening time is 9 a.m. However, in extreme weather such as typhoons, the opening time of the Hong Kong Stock Exchange is unknown. It is necessary to pay attention to the notification of the Hong Kong Stock Exchange in real time, manually configure the opening time, and make it effective quickly. For example, if you receive a notification from the Hong Kong Stock Exchange at 8:30, delaying the opening of the market and opening it at 10 a.m., you can manually configure the opening time of the day to 10 a.m., so that the liquidation quotation sending system knows that the opening time is 10 a.m., and will not send liquidation quotation to users at 8:55, avoiding a bad experience for users.
[0054] The present invention can send liquidation quotes to users at normal times under normal circumstances, and can flexibly and timely respond to opening time adjustments by manually configuring the opening time when abnormal circumstances prevent the market from opening normally, thereby realizing flexible sending of liquidation quotes to users.
[0055] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. An easy-to-control liquidation quotation sending method, characterized by: The steps include: S1. Configure the market calendar; The step S1 comprises the following steps: S11. Open the market calendar configuration interface through a web browser, fill in the configuration parameters in the market calendar configuration interface, the parameters include date and opening time, and then submit the parameters through a POST request, which is an HTTP request method; S12, after receiving the request from the web browser, the backend service system parses the parameters, including the date and opening time, and then calls the Mysql client library to connect to Mysql, and inserts the date and opening time as records into Mysql, which is an open source relational database; S2. Read the market calendar regularly and save the opening time; The step S2 comprises the following steps: S21. The market decoding service system starts the first thread, and sends a grpc request to the market calendar service system at regular intervals, using today's date as a request parameter. grpc is a remote call framework open sourced by Google. S22. After receiving the grpc request, the market calendar service system calls the Mysql client to connect to the Mysql data, takes the date in the request parameter as a condition, executes SQL, queries today's opening time, and returns the query result to the market decoding service system. SQL is a computer language used to access and process databases. S23, the market decoding service system receives the returned result and obtains the opening time from the result; S3. Verify the opening time and construct the liquidation quotation; The step S3 comprises the following steps: S31, the market decoding service system starts a second thread, and the second thread triggers a timer at a fixed time every day; S32, when the second thread triggers the timer, it determines whether the opening time is the normal opening time. If not, the liquidation process is terminated. If yes, the liquidation quotation is constructed and converted into Pb data format and sent to Kafka. Pb is protobuf, which is a Google open source mechanism for realizing automatic serialization and deserialization of data. S4. Push liquidation quotation to users; The step S4 comprises the following steps: S41, the market push service system consumes Pb data from Kafka and calls the Pb library to parse the liquidation market data; S42. Push the liquidation market data to the user through the TCP connection. TCP is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
2. An easy-to-control liquidation quotation sending system, characterized by: The system is used to implement an easy-to-control liquidation quotation sending method as claimed in claim 1; Including background service system, market decoding service system, market calendar service system and market push service system, The backend service system is used to parse the parameters filled in the market calendar configuration interface, including the date and opening time, and then call the Mysql client library to connect to Mysql, and insert the date and opening time as records into Mysql; The market decoding service system is connected to the market calendar service system, and is used to start the first thread, and send a grpc request to the market calendar service system at regular intervals, using today's date as a request parameter; the market decoding service system is also used to receive the return result of the market calendar service system, and obtain the opening time from the result; The market calendar service system is used to call the Mysql client to connect to the Mysql data after receiving the grpc request, and execute SQL to query today's opening time based on the date in the request parameter as a condition, and return the query result to the market decoding service system; The market decoding service system is also used to start the second thread, which triggers the timer at a fixed time every day. When the second thread triggers the timer, it determines whether the opening time is the normal opening time. If not, the liquidation process is terminated. If yes, the liquidation market is constructed and converted into Pb data format and sent to Kafka; The market push service system is used to consume Pb data from Kafka, call the Pb library to parse the liquidation market data, and push the liquidation market data to users through TCP connection.
Citation Information
Patent Citations
Real-time market data processing method, server and system
CN102790683A