Market data processing method and device, equipment, medium and program product
By screening and merging subscription requests in the financial market foreign exchange market data processing system, generating target subscription requests and forwarding them, it solves the existing system's monolithic structure and high pressure problems in high-frequency trading, and improves processing efficiency and system performance.
Patent Information
- Application Number
- CN202410954377.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-09-10
AI Technical Summary
The existing foreign exchange market data processing system in the financial market has the problems of high coupling degree, low scalability, and poor concurrency tolerance of the single architecture in high-frequency trading. As a result, traders need to spend a lot of time performing template operations when subscribing in batches. System pressure is high.
By filtering and merging subscription requests on the server side, target subscription requests are generated and forwarded, and identification information is used to determine when multiple candidate subscription requests are the same and merged to improve processing efficiency.
It improves the processing efficiency of subscription requests, reduces system pressure, reduces traders' operating time, and improves the concurrency and scalability of the system.
Smart Images

Figure CN118628249A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, specifically to the field of data processing, and more specifically to a market data processing method, device, equipment, medium and program product. Background Art
[0002] With the continuous opening up of my country's financial market, high-frequency trading is becoming more and more involved in the market. Customers need to quickly and timely grasp the market changes they need and make trading decisions based on market changes.
[0003] At present, in order to accurately distribute and efficiently process foreign exchange market data in the financial market, traders need to use subscription and batch subscription functions a lot every day. Batch subscription involves some templated manual operations, and traders need to spend a lot of time to perform template-like operations. The monolithic architecture has high coupling, low scalability, and poor concurrency tolerance. The system is under great pressure when processing multiple subscriptions or a large number of market conditions. Summary of the invention
[0004] In view of this, the present disclosure provides a market data processing method, device, equipment, medium and program product.
[0005] According to a first aspect of the present disclosure, a market data processing method is provided, the method is applied to a server, the server is connected to at least one server in communication, and one server is connected to at least one client in communication, the method comprising: obtaining a first parameter of at least one initial subscription request initiated by each client, wherein the first parameter represents a subscription channel and a subscription element of the initial subscription request; when it is determined that the initial subscription request is a candidate subscription request, generating first data corresponding to the candidate subscription request according to the first parameter of the candidate subscription request, wherein the candidate subscription request represents that the server does not have request information identical to the initial subscription request, and the first data comprises identification information of the candidate subscription request; based on the identification information, when it is determined that multiple candidate subscription requests are identical, merging the multiple candidate subscription requests to obtain a target subscription request, and forwarding the target subscription request.
[0006] According to an embodiment of the present disclosure, based on identification information, when it is determined that multiple candidate subscription requests are the same, the multiple candidate subscription requests are merged to obtain a target subscription request, and the target subscription request is forwarded, including: when it is determined that a first initial subscription request in the initial subscription request satisfies a first preset condition, the first initial subscription request is deleted; when it is determined that the first initial subscription request does not satisfy a second preset condition, the first initial subscription request is forwarded.
[0007] According to an embodiment of the present disclosure, the method also includes: in response to obtaining the latest market information for the target subscription request, updating the latest market information to the first market table to obtain a second market table; according to the target subscription request, traversing the second market table to obtain the target market corresponding to the target subscription request; according to the second parameter of the target subscription request, sending the target market to the corresponding client, wherein the second parameter represents the corresponding relationship between the client and the server in the target subscription request.
[0008] According to an embodiment of the present disclosure, the method also includes: obtaining a first target subscription request among target subscription requests, wherein the first target subscription request represents a subscription request rejected by a transaction object; and generating prompt information corresponding to the first target subscription request when determining that the first target subscription request satisfies a third preset condition, wherein the third preset condition represents that the target subscription request is rejected by the transaction object to send market information.
[0009] According to an embodiment of the present disclosure, the method further includes: generating empty information corresponding to the first target subscription request when determining that the first target subscription request satisfies a fourth preset condition, wherein the fourth preset condition represents that the transaction object actively withdraws the market information for the target subscription request.
[0010] According to an embodiment of the present disclosure, based on identification information, when it is determined that multiple candidate subscription requests are the same, the multiple candidate subscription requests are merged to obtain a target subscription request, and the target subscription request is forwarded, and it also includes: when it is determined that the first initial subscription request satisfies a second preset condition, obtaining a second initial subscription request that is the same as the first initial subscription request from the server, wherein the second initial subscription request has the same first parameter as the first initial subscription request, but the second parameter is different, wherein the second parameter represents the correspondence between the client and the server in the initial subscription request; and updating the second initial subscription request according to the first initial subscription request.
[0011] According to an embodiment of the present disclosure, the method further includes: obtaining a second parameter of the initial subscription request when determining that the initial subscription request is not a candidate subscription request; and updating the candidate subscription request according to the second parameter of the initial subscription request.
[0012] A second aspect of the present disclosure provides a market data processing device, including: an acquisition module, used to acquire a first parameter of at least one initial subscription request initiated by each client, wherein the first parameter represents a subscription channel and a subscription element of the initial subscription request; a generation module, used to determine that the initial subscription request is a candidate subscription request, and generate first data corresponding to the candidate subscription request according to the first parameter of the candidate subscription request, wherein the candidate subscription request represents that there is no request information identical to the initial subscription request on the server side, and the first data includes identification information of the candidate subscription request; and a merging module, used to determine that multiple candidate subscription requests are identical based on the identification information, merge the multiple candidate subscription requests to obtain a target subscription request, and forward the target subscription request.
[0013] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned market data processing method.
[0014] The fourth aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned market data processing method.
[0015] The fifth aspect of the present disclosure further provides a computer program product, including a computer program, which implements the above-mentioned market data processing method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0017] Figure 1 The application scenario diagram of the market data processing method, device, equipment, medium and program product according to the embodiment of the present disclosure is schematically shown;
[0018] Figure 2 A flowchart of a market data processing method according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 3 A flowchart of a market data processing method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 4 A flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown;
[0021] Figure 5 A flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown;
[0022] Figure 6 A flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown;
[0023] Figure 7 A flowchart of a market data processing method according to yet another embodiment of the present disclosure is schematically shown;
[0024] Figure 8 A flowchart of a market data processing method according to yet another embodiment of the present disclosure is schematically shown;
[0025] Fig. 9 A structural block diagram of a market data processing device according to an embodiment of the present disclosure is schematically shown; and
[0026] Fig.10 A block diagram of an electronic device suitable for implementing a market data processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0028] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0029] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0030] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0031] The embodiment of the present invention provides a market data processing method. Before introducing the technical solution provided by the embodiment of the present invention, the related technology involved in the present invention is first described.
[0032] In related technologies, with the continuous opening of my country's financial market, high-frequency trading has become more and more involved in the market. Customers need to quickly and timely grasp the required market changes and make trading decisions based on market changes.
[0033] At present, in order to accurately distribute and efficiently process foreign exchange market data in the financial market, traders need to use subscription and batch subscription functions on a daily basis. Batch subscription involves some templated manual operations. The subscription process is handled by a single engine, and price subscription is realized by a linear processing process. Therefore, traders need to spend a lot of time to perform template-like operations, the monolithic architecture has a high degree of coupling, low scalability, and poor concurrency tolerance. The system pressure is relatively high when processing multiple subscriptions or a large number of market conditions.
[0034] The embodiment of the present disclosure provides a market data processing method, which is applied to a server, the server is connected to at least one server in communication, and one server is connected to at least one client in communication, and the method includes: obtaining a first parameter of at least one initial subscription request initiated by each client, wherein the first parameter represents the subscription channel and subscription element of the initial subscription request; when determining that the initial subscription request is a candidate subscription request, generating first data corresponding to the candidate subscription request according to the first parameter of the candidate subscription request, wherein the candidate subscription request represents that the server does not have the same request information as the initial subscription request, and the first data includes identification information of the candidate subscription request; based on the identification information, when determining that multiple candidate subscription requests are the same, merging multiple candidate subscription requests to obtain a target subscription request, and forwarding the target subscription request. After obtaining the initial subscription request initiated by the trader through the client, first determine whether there is a subscription (that is, determine whether the initial subscription request is a candidate subscription request), if not, generate new subscription request data (first data, which contains identification information), merge multiple initial subscription requests that do not have subscriptions according to the identification information, obtain the target subscription request, and then forward it. Before forwarding the initial subscription request, the initial subscription request is matched with the existing subscription requests (candidate subscription requests). If no match is successful, these unsuccessful subscription requests are subscribed and merged again before forwarding. The subscription requests can be automatically screened and merged, and the processing efficiency of subscription requests can be improved by the method of screening first and then matching.
[0035] Figure 1The application scenario diagram of the market data processing method, device, equipment, medium and program product according to the embodiments of the present disclosure is schematically shown.
[0036] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a client 101, a server 102 and a transaction end 103. The client 101, the server 102 and the transaction end 103 communicate with each other through a network. The network may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0037] Different traders can use different terminal devices 101a and 102b to interact with the transaction terminal 103 through the service terminal 102 to receive or send messages, etc. The terminal device 101 can be an electronic device with a display screen, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.
[0038] The service end 102 includes a server 102a and a server 102b. Multiple traders can interact with one server 102a or one server 102b, or one trader can interact with one server 102a / 102b. Multiple servers together constitute the service end 102. The service end 102 can integrate and process the information obtained by multiple servers, and can also return the market information obtained from multiple trading terminals 103a and 103b to the corresponding terminal devices 101a and 102b through different servers 102a and 102b.
[0039] The transaction end 103 includes a transaction end 103a and a transaction end 103b. The service end 102 forwards the subscription requests obtained from the multiple clients 101 to the corresponding transaction end 103 according to the type of the subscription request to obtain market information.
[0040] It should be noted that the market data processing method provided in the embodiment of the present disclosure can generally be executed by the server 102. Accordingly, the market data processing device provided in the embodiment of the present disclosure can generally be set in the server 102. The market data processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 102 and can communicate with the client 101a, 101b and / or the server 102a, 102b. Accordingly, the market data processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 102a, 102b and can communicate with the client 101a, 101b and / or the server 102a, 102b.
[0041] It should be understood that Figure 1The number of clients, servers and transaction terminals in the embodiment is only for illustration. Any number of clients, servers and transaction terminals may be provided according to the implementation requirements.
[0042] The following will be based on Figure 1 The scene described by Figure 2~Figure 8 The market data processing method of the disclosed embodiment is described in detail.
[0043] The method is applied to a service end, the service end is connected to at least one server for communication, a server is connected to at least one client for communication, and the service end is connected to at least one transaction end for communication.
[0044] Figure 2 The flowchart of the market data processing method according to the embodiment of the present disclosure is schematically shown.
[0045] like Figure 2 As shown, the market data processing method of this embodiment includes operations S210 to S240b.
[0046] In operation S210, a first parameter of at least one initial subscription request initiated by each client is obtained, wherein the first parameter represents a subscription channel and a subscription element of the initial subscription request.
[0047] In some embodiments, a server corresponds to multiple clients, a server includes multiple servers, and a server corresponds to multiple clients. Each server obtains an initial subscription request initiated by traders of multiple clients corresponding to it at a predetermined time. The subscription request takes the foreign exchange quotation as an example. For example, the first parameter includes a subscription channel and a subscription element. The subscription channel can be a financial institution that provides quotations for the foreign exchange product, and the subscription element can be the foreign exchange product, that is, the foreign exchange product whose quotation market the enterprise wants to know. Specifically, the subscription request can be the exchange rate between the euro and the US dollar of a foreign exchange bank.
[0048] In operation S220, it is determined whether the initial subscription request is a candidate subscription request.
[0049] In operation S230a, when it is determined that the initial subscription request is a candidate subscription request, first data corresponding to the candidate subscription request is generated according to a first parameter of the candidate subscription request, wherein the candidate subscription request indicates that the server does not have request information identical to the initial subscription request, and the first data includes identification information of the candidate subscription request.
[0050] In operation S240a, when it is determined based on the identification information that the multiple candidate subscription requests are the same, the multiple candidate subscription requests are merged to obtain a target subscription request, and the target subscription request is forwarded.
[0051] In some embodiments, according to the first parameter of the initial subscription request, it is determined whether the initial subscription request is the same as the existing subscription request. If the initial subscription request is not the same as the existing subscription request, the initial subscription request is a new subscription request. According to the first parameter, a server subscription request (first data) is generated according to the MD5 rule (Message-Digest Algorithm, referred to as MD5), and each server subscription request has unique identification information. According to the identification information, it is determined whether multiple server subscription requests transmitted to the server are the same. If the identification information of multiple server subscription requests is the same, the multiple server subscription requests are merged to obtain a target subscription request, and the target subscription request is forwarded to the transaction end.
[0052] In operation S230b, if it is determined that the initial subscription request is not a candidate subscription request, a second parameter of the initial subscription request is obtained.
[0053] The second parameter represents the corresponding relationship between the client and the server in the subscription request.
[0054] In operation S240b, the candidate subscription request is updated according to the second parameter of the initial subscription request.
[0055] In some embodiments, if the initial subscription request is the same as an existing subscription request, the initial subscription request is merged with the existing subscription request, and the mapping relationship between the server and the client corresponding to the initial subscription request (the second parameter) is recorded, and the mapping relationship between the server and the client corresponding to the initial subscription request is added to the mapping relationship set formed by the existing subscription request. The mapping relationship set is a collection of corresponding relationships formed when different clients send the same subscription request (the first parameter is the same) through different servers.
[0056] It is understandable that before forwarding the initial subscription request, the initial subscription request is first matched with the existing subscription requests (candidate subscription requests). If no match is successful, these unsuccessful subscription requests are subscribed and merged again before forwarding. The subscription requests can be automatically screened and merged, and the processing efficiency of the subscription requests can be improved by the method of screening first and then matching.
[0057] In other embodiments, after obtaining the initial subscription request initiated by the client, an atomic permission check is performed.
[0058] Specifically, when processing a subscription request, the server will perform a complete and indivisible check of the user's permissions. This check ensures that in the process of processing a subscription request, the server will check whether the user has sufficient permissions to perform the subscription operation to prevent unauthorized subscription requests from being executed. Through atomic permission verification, the system can effectively verify the user's identity and permissions, and ensure that these checks are consistent and complete at the same time point, thereby ensuring the legitimacy and security of the subscription request. This helps avoid potential security risks and improves the stability and reliability of the system.
[0059] Before operation S220, the method further includes: determining whether to perform subscription merging for the initial subscription request, and if necessary, performing operation S220; if not, recording a mapping relationship between the client and the server corresponding to the initial subscription request.
[0060] Figure 3 The flowchart of the market data processing method according to an embodiment of the present disclosure is schematically shown.
[0061] like Figure 3 As shown, when merging the same subscription requests between different servers, this embodiment determines based on identification information that multiple candidate subscription requests are the same, merges the multiple candidate subscription requests to obtain a target subscription request, and forwards the target subscription request, including operations S310 to S350b.
[0062] In operation S310, it is determined whether a first initial subscription request among the initial subscription requests satisfies a first preset condition.
[0063] In operation S320, if it is determined that a first initial subscription request among the initial subscription requests satisfies a first preset condition, the first initial subscription request is deleted.
[0064] If it is determined that the first initial subscription request in the initial subscription requests does not satisfy the first preset condition, operations S340b to S350b are performed.
[0065] In operation S330, it is determined whether the first initial subscription request satisfies a second preset condition.
[0066] In operation S340a, if it is determined that the first initial subscription request does not satisfy the second preset condition, the first initial subscription request is forwarded.
[0067] In operation S340b, when it is determined that the first target subscription request satisfies the second preset condition, a second initial subscription request that is the same as the first initial subscription request is obtained from the server.
[0068] In operation S350b, the second initial subscription request is updated according to the first initial subscription request.
[0069] In some embodiments, after the initial subscription request generates the first data, it is necessary to merge the subscriptions within the node and between nodes. The intra-node represents the subscriptions initiated by different clients in the same server for the same subscription request, and the inter-node subscription merge represents the subscriptions initiated by different servers for the same subscription request. The details are as follows.
[0070] First, determine whether any subscription request (first initial subscription request) among multiple initial subscription requests has expired (first preset condition). If it has expired (i.e., the first initial subscription request has expired), delete the first initial subscription request. If it has not expired (i.e., the first initial subscription request has expired), obtain the second initial subscription request that is the same as the first initial subscription request received in other servers in the server, and record the mapping relationship between the client and the server corresponding to the first initial subscription request. Add the mapping relationship to the mapping relationship set formed by the existing subscription request (second initial subscription request), that is, merge the subscriptions between nodes. It should be known that expiration means that the subscription request sent by the client to a certain transaction end has not been processed or confirmed within a certain period of time, resulting in the invalidation or expiration of the request. It may be caused by network delays, processing bottlenecks, system failures or other reasons.
[0071] Then, it is determined again whether the expired first initial subscription request meets the second preset condition, and the second preset condition refers to whether there is a second initial subscription request identical to the first initial subscription request in other servers on the service end. If there is a second initial subscription request, the mapping relationship between the client and the server corresponding to the first initial subscription request is recorded. The mapping relationship is added to the mapping relationship set formed by the existing subscription request (second initial subscription request), that is, subscription merging between nodes is performed. If there is no second initial subscription request, the mapping relationship between the client and the server corresponding to the first initial subscription request is recorded and cached. And the first initial subscription request is forwarded.
[0072] It should be noted that in operation S340a, the first initial subscription request is the target subscription request. In operation S350b, the updated second initial subscription request is the target subscription request, and here it is only necessary to return the market information returned by the second initial subscription request to the client of the first initial subscription request in a timely manner through the mapping relationship between the client and the server in the first initial subscription request.
[0073] Figure 4 The flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown.
[0074] like Figure 4 As shown, the market data processing method of this embodiment also includes operations S410 to S430.
[0075] In operation S410, in response to obtaining the latest market information for the target subscription request, the latest market information is updated to the first market table to obtain a second market table.
[0076] In operation S420, according to the target subscription request, the second market price table is traversed to obtain the target market price corresponding to the target subscription request.
[0077] In operation S430, the target market information is sent to the corresponding client according to the second parameter of the target subscription request, wherein the second parameter represents the corresponding relationship between the client and the server in the target subscription request.
[0078] Exemplarily, a quotation timing refresher is started, and after obtaining the latest foreign exchange quotation, the latest quotation (latest quotation information) is updated to the historical quotation table (first quotation table) to obtain the latest quotation table (second quotation table). The second quotation table includes the historical quotation information (historical quotation information) and the latest quotation information (latest quotation information) corresponding to the target subscription request. Each time the second quotation table is updated, according to the mapping relationship between multiple clients and multiple servers in each target subscription request, the target quotation (historical quotation information + latest quotation information) corresponding to the target subscription request is sent to the corresponding client.
[0079] Figure 5 The flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown.
[0080] like Figure 5 As shown, the market data processing method of this embodiment also includes operations S510 to S550.
[0081] In operation S510, a first target subscription request among the target subscription requests is acquired.
[0082] In operation S520, it is determined whether the first target subscription request satisfies the third, fourth or fifth preset condition.
[0083] In operation S530, when it is determined that the first target subscription request satisfies the third preset condition, prompt information corresponding to the first target subscription request is generated.
[0084] In operation S540, when it is determined that the first target subscription request satisfies the fourth preset condition, empty information corresponding to the first target subscription request is generated.
[0085] In operation S550, if it is determined that the first target subscription request satisfies the fifth preset condition, notification information corresponding to the first target subscription request is generated.
[0086] Specifically, the server obtains the Kafka message of the target subscription request (first target subscription request) rejected by the transaction end. The reason why the first target subscription request was rejected by the transaction end is determined. The first rejection reason, i.e., the third preset condition, means that the transaction end refuses to provide quotation information; the second rejection reason, i.e., the fourth preset condition, means that the transaction end actively withdraws the quotation information; the third rejection reason, i.e., the fifth preset condition, means that the transaction end returns no quotation information. If the transaction end refuses to provide quotation information, the subscription request memory is cleared according to the transaction end, and then a subscription rejection prompt message is sent to the client according to the mapping relationship between the client and the transaction end in the first target subscription request. If the transaction end actively withdraws the quotation information, the subscription request memory is cleared according to the transaction end, and then an empty quotation information is added to calculate the market. If the transaction end returns no quotation information, a notification that there is no market information for subscription is sent to the client according to the mapping relationship between the client and the transaction end in the first target subscription request.
[0087] In order to facilitate the understanding of the embodiments of the present disclosure, Figure 6-Figure 8 The embodiments of the present disclosure are described.
[0088] Figure 6 The flowchart of a market data processing method according to another embodiment of the present disclosure is schematically shown.
[0089] like Figure 6 As shown, the foreign exchange rate is used for explanation. In the stage of initiating a subscription request on the client side. The market data processing method of this embodiment is specifically as follows:
[0090] When multiple clients initiate initial subscription requests, the server performs atomic permission checks on the initial subscription requests initiated by the clients. After the checks are passed, it determines whether the multiple initial subscription requests need to be merged. If they do not need to be merged, the mapping relationship between the client and the server in the initial subscription request is cached in memory, and the subscription request is forwarded.
[0091] If merging is required, it is necessary to determine whether there is a candidate subscription request that is the same as the initial subscription request. If so, the subscription is merged, and the mapping relationship between the client and the server in the initial subscription request is cached in the memory. If not, the first data (i.e., the server subscription) is generated according to the first parameter (subscription channel and subscription element) of the initial subscription request according to the MD5 rule, and then the service node subscription is queried according to the service store subscription (i.e., whether there are the same subscription requests received by different servers). If so, it is determined whether the subscription requests of other server nodes are expired. If not, the subscription request is updated in the memory or database, and the mapping relationship between the client and the server in the initial subscription request is cached in the memory. If it is expired, the expired subscription request is deleted, and it is determined whether there are valid service nodes in other servers (i.e., the subscription request with the same first parameter as the deleted expired subscription request). If so, the subscription request is updated in the memory or database, and the mapping relationship between the client and the server in the initial subscription request is cached in the memory. If it does not exist, the subscription request is updated in the memory or database, and the mapping relationship between the client and the server in the initial subscription request is cached in the memory, and the subscription request is forwarded.
[0092] Figure 7 The flowchart of a market data processing method according to yet another embodiment of the present disclosure is schematically shown.
[0093] like Figure 7 As shown, after the trading terminal returns the market information. The market data processing method of this embodiment is as follows:
[0094] Start the quotation timer refresher and clean up the queue that previously broadcasted quotation information to the client. At the same time, move the latest quotation refresh list to the pending quotation refresh list (that is, update the latest quotation information to the historical quotation information table). Then get the updated price list. Traverse the latest price list, get the latest price information for the target subscription request (that is, multiple merged initial subscription requests with the same first parameter), and then broadcast it to the corresponding client according to the mapping relationship between the client and the server in the target subscription request. Once new price information is detected, traverse the list formed by multiple target subscription requests, and then get the corresponding client according to the mapping relationship between the client and the server of each target subscription request, and calculate the best price based on the historical price information and the latest price information, and assemble the quotation message. According to the mapping relationship, cache the quotation message to the different channels of the client's consent panel and broadcast it.
[0095] Figure 8 The following schematically shows a flow chart of a market data processing method according to yet another embodiment of the present disclosure.
[0096] like Figure 8 As shown, after the trading terminal returns the market information, if there is a rejected subscription request. The market data processing method of this embodiment is as follows:
[0097] The rejected subscription requests are sorted into Kafka messages, and then the reasons for the rejection of each subscription request are determined. When the trading end refuses to provide quotation information (p), the subscription request memory is cleared according to the trading end, and then a subscription rejection prompt is sent to the client according to the mapping relationship between the client and the trading end in the first target subscription request. When the trading end actively withdraws the quotation information (s / r), the subscription request memory is cleared according to the trading end, and then an empty quotation information is added to calculate the market. When the trading end returns no quotation information (q), a notification that there is no subscription market information is sent to the client according to the mapping relationship between the client and the trading end in the first target subscription request.
[0098] Based on the above market data processing method, the present disclosure also provides a market data processing device. Fig. 9 The device is described in detail.
[0099] Fig. 9 The structural block diagram of the market data processing device according to the embodiment of the present disclosure is schematically shown.
[0100] like Fig. 9 As shown, the market data processing device 900 of this embodiment includes a generating module 910 , an acquiring module 920 and an early warning module 930 .
[0101] The acquisition module 910 is used to acquire the first parameter of at least one initial subscription request initiated by each client, wherein the first parameter represents the subscription channel and subscription element of the initial subscription request. In one embodiment, the acquisition module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0102] The generating module 920 is used to determine that the initial subscription request is a candidate subscription request, and to generate first data corresponding to the candidate subscription request according to the first parameter of the candidate subscription request, wherein the candidate subscription request indicates that the server does not have the same request information as the initial subscription request, and the first data includes identification information of the candidate subscription request. In one embodiment, the generating module 920 can be used to perform the operations S220-S230a described above, which will not be repeated here.
[0103] The merging module 930 is used to merge the multiple candidate subscription requests to obtain a target subscription request and forward the target subscription request when determining that the multiple candidate subscription requests are the same based on the identification information. In one embodiment, the merging module 930 can be used to perform the operation S240a described above, which will not be repeated here.
[0104] According to an embodiment of the present disclosure, any multiple modules of the generation module 910, the acquisition module 920 and the early warning module 930 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the generation module 910, the acquisition module 920 and the early warning module 930 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the generation module 910, the acquisition module 920 and the early warning module 930 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0105] Fig.10 A block diagram of an electronic device suitable for implementing a market data processing method according to an embodiment of the present disclosure is schematically shown.
[0106] Fig.10 A block diagram of an electronic device suitable for implementing a market data processing method according to an embodiment of the present disclosure is schematically shown.
[0107] like Fig.10 As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 to a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0108] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0109] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The electronic device 1000 may further include one or more of the following components connected to the I / O interface 1005: an input portion 1006 including a keyboard, a mouse, etc.; an output portion 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk, etc.; and a communication portion 1009 including a network interface card such as a LAN card, a modem, etc. The communication portion 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage portion 1008 as needed.
[0110] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0111] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.
[0112] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the market data processing method provided by the embodiment of the present disclosure.
[0113] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1001. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0114] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0115] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0116] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0117] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0119] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A market data processing method, characterized in that: The method is applied to a server, the server is connected to at least one server for communication, and one of the servers is connected to at least one client for communication, and the method includes: Acquire a first parameter of at least one initial subscription request initiated by each of the clients, wherein the first parameter represents a subscription channel and a subscription element of the initial subscription request; When it is determined that the initial subscription request is a candidate subscription request, generating first data corresponding to the candidate subscription request according to a first parameter of the candidate subscription request, wherein the candidate subscription request indicates that the server does not have request information identical to the initial subscription request, and the first data includes identification information of the candidate subscription request; If it is determined based on the identification information that a plurality of the candidate subscription requests are the same, the plurality of candidate subscription requests are merged to obtain a target subscription request, and the target subscription request is forwarded.
2. A method according to claim 1, characterized in that The step of determining, based on the identification information, that a plurality of candidate subscription requests are the same, merging the plurality of candidate subscription requests to obtain a target subscription request, and forwarding the target subscription request includes: If it is determined that a first initial subscription request among the initial subscription requests meets a first preset condition, deleting the first initial subscription request; When it is determined that the first initial subscription request does not satisfy a second preset condition, the first initial subscription request is forwarded.
3. A method according to claim 1 or 2, characterized in that: The method further comprises: In response to acquiring the latest market information for the target subscription request, updating the latest market information to the first market table to obtain a second market table; According to the target subscription request, traverse the second market price table to obtain the target market price corresponding to the target subscription request; The target market information is sent to the corresponding client according to a second parameter of the target subscription request, wherein the second parameter represents a corresponding relationship between the client and the server in the target subscription request.
4. A method according to claim 1, characterized in that The method further comprises: Acquire a first target subscription request among the target subscription requests, wherein the first target subscription request represents a subscription request rejected by the transaction object; When it is determined that the first target subscription request satisfies a third preset condition, a prompt message corresponding to the first target subscription request is generated, wherein the third preset condition indicates that the target subscription request is rejected by the transaction object to send market information.
5. A method according to claim 4, characterized in that The method further comprises: When it is determined that the first target subscription request satisfies a fourth preset condition, empty information corresponding to the first target subscription request is generated, wherein the fourth preset condition indicates that the transaction object actively withdraws the market information for the target subscription request.
6. A method according to claim 2, characterized in that The method further comprises: determining, based on the identification information, that a plurality of candidate subscription requests are the same, merging the plurality of candidate subscription requests to obtain a target subscription request, and forwarding the target subscription request; When it is determined that the first initial subscription request satisfies a second preset condition, obtaining a second initial subscription request that is the same as the first initial subscription request from the server, wherein the second initial subscription request has the same first parameter as the first initial subscription request but is different from the second parameter, wherein the second parameter represents a corresponding relationship between the client and the server in the initial subscription request; The second initial subscription request is updated according to the first initial subscription request.
7. A method according to claim 1, characterized in that The method further comprises: When it is determined that the initial subscription request is not a candidate subscription request, obtaining a second parameter of the initial subscription request; The candidate subscription request is updated according to the second parameter of the initial subscription request.
8. A market data processing device, characterized in that: The device comprises: An acquisition module, configured to acquire a first parameter of at least one initial subscription request initiated by each of the clients, wherein the first parameter represents a subscription channel and a subscription element of the initial subscription request; a generating module, configured to generate, when determining that the initial subscription request is a candidate subscription request, first data corresponding to the candidate subscription request according to a first parameter of the candidate subscription request, wherein the candidate subscription request indicates that the server does not have request information identical to the initial subscription request, and the first data includes identification information of the candidate subscription request; and The merging module is used to merge the multiple candidate subscription requests to obtain a target subscription request and forward the target subscription request when determining that the multiple candidate subscription requests are the same based on the identification information.
9. An electronic device, comprising: one or more processors; a storage device for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
