CN116962513A - Financial quotation contract data receiving method and device - Google Patents
Financial quotation contract data receiving method and device Download PDFInfo
- Publication number
- CN116962513A CN116962513A CN202310920061.9A CN202310920061A CN116962513A CN 116962513 A CN116962513 A CN 116962513A CN 202310920061 A CN202310920061 A CN 202310920061A CN 116962513 A CN116962513 A CN 116962513A
- Authority
- CN
- China
- Prior art keywords
- contract
- financial quotation
- time stamp
- financial
- cache
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 230000008569 process Effects 0.000 claims abstract description 28
- 230000001502 supplementing effect Effects 0.000 claims description 14
- 238000012508 change request Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 4
- 238000001914 filtration Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 15
- 230000007246 mechanism Effects 0.000 abstract description 4
- 230000000295 complement effect Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000001960 triggered effect Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000005429 filling process Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 238000007792 addition Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000013589 supplement Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1804—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast for stock exchange and similar applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
- H04L12/1881—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with schedule organisation, e.g. priority, sequence management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a financial quotation contract data receiving method and device, aiming at uncertainty of actual transaction, a complete contract filling scheme is set and executed in the process of receiving financial quotation contracts, and the integrity of the received financial quotation contracts in order and set number is ensured by utilizing interpolation data, so that the subsequent decision process can be processed in parallel according to uniform data set number all the time, and realization of quick transaction is ensured. Meanwhile, when the financial quotation contract is distributed, data are screened according to the requirements of the user based on a subscription mechanism, invalid processing of the data in the subsequent application process is reduced, and the processing speed and the execution efficiency are improved.
Description
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a method and an apparatus for receiving financial quotation contract data.
Background
A financial market contract (Financial Market Contract) is a financial instrument in the financial market for the buying, selling, trading or settling of financial assets at a particular time and condition. During the trade time period, at intervals (e.g. 200 ms), the exchange will send the trade information of securities and futures in the period in multicast form, that is, according to the set order and number of the securities and futures. If some futures are close to not transacting in reality during this time, then the transacting information for the contract is not sent. Under the extremely fast transaction scene, the contract information and the quantity sent by the transaction are uncertain under the influence of the transaction condition in reality, so that the parallelization processing of the transaction strategy module is challenged. Meanwhile, a large amount of multicast data contains contract contents which are not needed by the user in the receiving process, and the transaction speed can be slowed down in the receiving and processing processes.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for receiving financial quotation contract data, so as to eliminate or improve one or more drawbacks existing in the prior art, and solve the problem that the prior art cannot meet requirements of quick transaction and parallelization processing in a financial quotation contract data transmission process.
In one aspect, the present application provides a method for receiving financial quotation contract data, the method is used for being executed on an analysis module of a user side, and the method comprises the following steps:
receiving a financial quotation contract based on a time sequence, wherein the financial quotation contract at least comprises a time stamp, a contract ID and contract data; in the process of generating the financial quotation contracts by a financial institution, the financial quotation contracts of the batch corresponding to each time stamp are generated according to business requirements according to a preset sequence and a set number;
for the received financial quotation contracts, checking contract IDs of batches corresponding to each time stamp, comparing and searching missing financial quotation contracts in the batches corresponding to each time stamp according to the preset sequence and the set number, and supplementing the missing financial quotation contracts by adopting specified data so as to execute decisions in parallel;
and sending the completed financial quotation contracts to the user according to the subscription requirements of the user according to a preset financial quotation contract subscription mode.
In some embodiments, checking the contract ID of each batch corresponding to the timestamp, comparing and searching the missing financial quotation contract in each batch corresponding to the timestamp according to the preset order and the set number, and filling in the missing financial quotation contract by using the specified data, including:
initializing a cache contract time stamp to 0 and initializing a cache contract ID to 0;
receiving the current financial quotation contract and sending the current financial quotation contract to a user according to the subscription requirement of the user;
when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, checking whether the financial quotation contract of the batch corresponding to the time stamp of the cache contract reaches the set number, and when the financial quotation contract does not reach the set number, supplementing the first type of missing financial quotation contract in the batch corresponding to the time stamp of the cache contract according to the preset order and the set number, and sending the first type of missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the first type of missing financial quotation contract is marked as a value of 0; resetting the cache contract ID to 0;
when the received time stamp of the current financial quotation contract is equal to the cache contract time stamp, and the contract ID of the current financial quotation contract is larger than the cache contract ID, judging whether the contract ID of the current financial quotation contract is continuous with the cache contract ID, and when the contract ID is continuous, updating the cache contract ID to be the contract ID of the current financial quotation contract; and when the contract is discontinuous, the cache contract ID is supplemented to a second type of missing financial quotation contract between the contract IDs of the current financial quotation contracts, the contract data of the second type of missing financial quotation contract is marked as a value of 0, and the supplemented second type of missing financial quotation contract is sent to the user according to the subscription requirement of the user.
In some embodiments, checking the contract ID of each batch corresponding to the timestamp, comparing and searching the missing financial quotation contract in each batch corresponding to the timestamp according to the preset order and the set number, and filling in the missing financial quotation contract by using the specified data, including:
judging whether a new financial quotation contract is received, initializing a cache contract time stamp to be 0 when the current financial quotation contract is received, and initializing a cache contract ID to be 0;
when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, updating the time stamp of the cache contract to the time stamp of the current financial quotation contract, and resetting the initialized cache contract ID to 0; judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, replenishing a third missing financial quotation contract between the cache contract ID and the contract ID of the current financial quotation contract and sending the third missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the third missing financial quotation contract is marked with a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user;
when the received time stamp of the current financial quotation contract is equal to the time stamp of the cache contract, judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, supplementing the cache contract ID to a fourth missing financial quotation contract between the contract IDs of the current financial quotation contracts and sending the fourth missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the fourth missing financial quotation contract is marked as a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user.
In some embodiments, the method further comprises, prior to initializing the cache contract timestamp and initializing the cache contract ID:
judging whether a new financial quotation contract is received, and when the new financial quotation contract is not received, maintaining an idle standby state, wherein the idle standby state comprises:
and judging whether the cache contract time stamp is initialized or not, if the initialization is completed, acquiring a current hardware time stamp, and when the current hardware time stamp is larger than the set time length of the cache hardware time stamp and the contract ID in the cache contract list does not reach the set number, replenishing the empty contract which is not output and remains in the cache hardware time stamp, wherein the contract data of the empty contract is marked as a 0 value, and updating the cache hardware time stamp as the current hardware time stamp.
In some embodiments, the method further comprises:
judging whether the cache contract time stamp is initialized or not, and if the initialization is not completed, judging whether a new financial quotation contract is received or not again;
and when the current hardware time stamp is smaller than or equal to the cached hardware time stamp or the contract ID in the cached contract list reaches the set number, judging whether a new financial quotation contract is received or not again.
In some embodiments, according to a preset financial quotation contract subscription mode, the sending of the completed financial quotation contract to the user according to the subscription requirement of the user includes:
acquiring a contract ID to be distributed after the financial quotation contract is analyzed;
filtering the contract ID to be distributed according to a subscription list preset by a user, outputting financial quotation contracts corresponding to the contract ID to be distributed in the subscription list, and discarding the rest.
In some embodiments, the method further comprises: and receiving a subscription change request sent by a user, and updating the subscription list according to the subscription change request.
In another aspect, the present application also provides a financial quotation contract data receiving device, including:
the receiving module is used for receiving financial quotation contracts issued by the data source;
the analysis module is used for executing the financial quotation contract data receiving method;
and the output module is used for sending the output of the analysis module to the processor end of the user through a PCIe protocol.
In some embodiments, the parsing module employs a field programmable gate array device.
In another aspect, the present application also provides a computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the steps of the above method.
The application has the advantages that:
according to the financial quotation contract data receiving method and device, aiming at uncertainty of actual transaction, a complete contract filling scheme is set and executed in the process of receiving financial quotation contracts, the integrity of the received financial quotation contracts in order and set number is ensured by utilizing the form of filling data, so that the subsequent decision process can be processed in parallel according to the unified data set number all the time, and realization of quick transaction is ensured. Meanwhile, when the financial quotation contract is distributed, data are screened according to the requirements of the user based on a subscription mechanism, invalid processing of the data in the subsequent application process is reduced, and the processing speed and the execution efficiency are improved.
Additional advantages, objects, and features of the application will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and drawings.
It will be appreciated by those skilled in the art that the objects and advantages that can be achieved with the present application are not limited to the above-described specific ones, and that the above and other objects that can be achieved with the present application will be more clearly understood from the following detailed description.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate and together with the description serve to explain the application. In the drawings:
fig. 1 is a flowchart of a method for receiving financial quotation contract data according to an embodiment of the application.
Fig. 2 is a schematic diagram of a filling flow in the method for receiving financial quotation contract data according to an embodiment of the application.
FIG. 3 is a schematic diagram illustrating a filling process in a financial contract data receiving method according to another embodiment of the application.
Fig. 4 is a schematic diagram of a subscription flow in a method for receiving financial quotation contract data according to an embodiment of the application.
Detailed Description
The present application will be described in further detail with reference to the following embodiments and the accompanying drawings, in order to make the objects, technical solutions and advantages of the present application more apparent. The exemplary embodiments of the present application and the descriptions thereof are used herein to explain the present application, but are not intended to limit the application.
It should be noted here that, in order to avoid obscuring the present application due to unnecessary details, only structures and/or processing steps closely related to the solution according to the present application are shown in the drawings, while other details not greatly related to the present application are omitted.
It should be emphasized that the term "comprises/comprising" when used herein is taken to specify the presence of stated features, elements, steps or components, but does not preclude the presence or addition of one or more other features, elements, steps or components.
It is also noted herein that the term "coupled" may refer to not only a direct connection, but also an indirect connection in which an intermediate is present, unless otherwise specified.
Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
The financial quotation is about in the transmission and application process, and mainly comprises two parts, wherein one part is based on a decision module to process a large amount of data issued in real time so as to make an overall decision, and the other part is based on the transaction judgment of the user according to the financial quotation contract concerned by the user. Under the extremely fast transaction scene, the contract information and the quantity sent by the transaction are uncertain under the influence of the actual transaction condition, so that the transaction policy module cannot process the contracts in a parallelization way, and the transaction speed is influenced. Meanwhile, because a large number of transactions which are not concerned by users exist in financial quotations issued by transaction exchange data sources, the users can consume a large amount of searching and screening data in the process of judging the transactions. Therefore, a quotation data supplementing function needs to be added in the quotation analysis module, the order and the quantity of contract IDs received by the strategy module are ensured to meet expectations, and a subscription mechanism is configured to feed the focused financial quotation contracts to the user.
The present application provides a financial quotation contract data receiving method, which is used for being executed on an analysis module of a user side, as shown in fig. 1, and comprises the following steps S101 to S103:
step S101: receiving a financial quotation contract based on the time sequence, wherein the financial quotation contract at least comprises a time stamp, a contract ID and contract data; in the process of generating financial quotation contracts by a financial institution, the financial quotation contracts of batches corresponding to each time stamp are generated according to the business requirements according to a preset sequence and a set number of bars.
Step S102: and for the received financial quotation contracts, checking contract IDs of the batches corresponding to each time stamp, comparing and searching the missing financial quotation contracts in the batches corresponding to each time stamp according to a preset sequence and a set number, and supplementing the missing financial quotation contracts by adopting specified data so as to execute decisions in parallel processing.
Step S103: and sending the completed financial quotation contracts to the user according to the subscription requirements of the user according to a preset financial quotation contract subscription mode.
In step S101, a financial market contract is a financial derivative in a financial market that deals with the price or index of a certain financial asset (e.g., stock, bond, commodity, currency, etc.) at a specific time in the future under specific contract specifications. Financial contracts are typically issued and managed by exchanges or financial institutions. The transactions conducted at the exchange generate real-time purchase orders and deals data reflecting the market participant's needs and supplies of financial assets. The real-time market data is updated continuously during the trade process, and investors can make trade decisions based on the data.
Financial contracts are typically generated according to specific transaction rules, so they are typically issued in batches in a set order and number of sets. However, in the actual transaction process, some transaction missing situations sometimes occur. The application supplements the received data based on the standardization of the financial quotation contract generation process so as to ensure that the financial quotation still presents completely at the receiving end, and can implement parallel processing on the data in the subsequent decision making process so as to ensure the speed of transaction decision making.
In step S102, financial quotation contracts generated according to the preset order and the set number in the specification may be missing due to transaction problems or reception problems in the actual transaction process, so the application supplements the financial quotation contracts according to the generation specification of the financial quotation contracts. In implementation, each financial quotation contract is added with a time stamp and a contract ID for identification as a unique identification thereof in the generation process. Wherein the time stamp is used to mark the lot and the contract ID is used to mark the order. The financial quotation contracts of each batch are identical in order and number of settings, for example, for a particular financial transaction, the contracts for settlement include five pieces of data with contract IDs of 0, 1, 2, 3 and 4 according to specifications, and during reception, the missing objects are checked by the contract IDs and corresponding pieces of data are filled in, and the contract data of the corresponding contracts are filled in the form of specified data. The purpose of filling by using the specified data is to distinguish the filled data from the real data, and in the practical application process, filling can be performed in a form of 0 or 1.
In some embodiments, checking contract IDs of batches corresponding to each timestamp, comparing and searching missing financial quotation contracts in batches corresponding to each timestamp according to a preset order and a set number, and filling the missing financial quotation contracts with specified data, as shown in fig. 2, including steps S201 to S204:
step S201: the initialization cache contract timestamp is 0 and the initialization cache contract ID is 0.
Step S202: and receiving the current financial quotation contract and sending the current financial quotation contract to the user according to the subscription requirement of the user.
Step S203: when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, checking whether the financial quotation contract of the batch corresponding to the time stamp of the cache contract reaches the set number, and when the financial quotation contract does not reach the set number, supplementing the first type of missing financial quotation contract in the batch corresponding to the time stamp of the cache contract according to the preset order and the set number, and sending the first type of missing financial quotation contract to the user according to the subscription requirement of the user, wherein the contract data of the first type of missing financial quotation contract is marked as a value of 0; and resets the cache contract ID to 0.
Step S204: when the received time stamp of the current financial quotation contract is equal to the time stamp of the cache contract, and the contract ID of the current financial quotation contract is larger than the cache contract ID, judging whether the contract ID of the current financial quotation contract is continuous with the cache contract ID, and when the contract ID is continuous, updating the cache contract ID to be the contract ID of the current financial quotation contract; and when the contract is discontinuous, the contract data of the second type of missing financial quotation contracts between the cache contract ID and the contract ID of the current financial quotation contract are complemented to be 0, and the complemented second type of missing financial quotation contracts are sent to the user according to the subscription requirements of the user.
It should be noted that, the filling process in steps S201 to S204 is a form of preferentially ensuring timely output of the current data, and the principle is that when each piece of data is received, the current contract is preferentially output, and then whether filling is needed is determined.
Illustratively, assume that the contract IDs are 0, 1, 2, 3, 4, the cache contract timestamp is initialized to 0, and the cache contract ID is initialized to 0.
Assume that the actual transaction issued a contract order of: contract 1: timestamp 500, contract ID of 0; contract 2: timestamp 500, contract ID of 2; contract 3: timestamp 500, contract ID 3; contract 4: time stamp 1000, contract ID 2.
According to the principle of current contract priority, after timely outputting after receiving the contracts, judging whether the contracts are missing or not and supplementing the contracts comprises the following steps:
1) Receiving contract 1, the buffer time stamp is 0, which is less than the current time stamp 500, updating the buffer time stamp to the current time stamp 500, normally outputting contract 1, because the ID is 0, i.e. the first contract, does not trigger the fill-in operation.
2) Receiving the contract 2, normally outputting the contract 2, because the time stamps are the same, the ID is 2, and the time stamp 500 and the filling data with the ID of 1 are needed to be filled if the ID is discontinuous with the last piece (the last piece is 0).
3) Receiving the contract 3, normally outputting the contract 3, wherein the ID is 3 and is continuous with the last piece because the time stamps are the same, and the filling operation is not triggered.
4) When receiving the contract 4, the contract 4 is normally output, because the time stamp is changed, the contract which is not output and is the last time stamp, namely the time stamp 500 and the filling data with the ID of 4 are filled in first.
5) Updating the cache time stamp to be the current time stamp (1000); judging that the current contract ID is 2 and the contract ID is not 0, so that contract data of 2 pieces of current time stamps need to be supplemented, namely: time stamp 1000, complement data with ID 0; and (3) the time stamp 1000 and the filling data with the ID of 1.
In some embodiments, checking the contract ID of each batch corresponding to the timestamp, comparing and searching the missing financial quotation contract in each batch corresponding to the timestamp according to the preset order and the set number, and filling the missing financial quotation contract with the specified data, referring to fig. 3, including steps S301 to S303:
step S301: judging whether a new financial quotation contract is received, initializing a buffer contract time stamp to be 0 when the current financial quotation contract is received, and initializing a buffer contract ID to be 0.
Step S302: when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, the time stamp of the cache contract is updated to be the time stamp of the current financial quotation contract, and the initialized cache contract ID is reset to 0; judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, replenishing a third missing financial quotation contract between the cache contract ID and the contract ID of the current financial quotation contract, and sending the third missing financial quotation contract to the user according to the subscription requirement of the user, wherein the contract data of the third missing financial quotation contract is marked as a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user.
Step S303: when the received time stamp of the current financial quotation contract is equal to the time stamp of the cache contract, judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, supplementing a fourth missing financial quotation contract between the cache contract ID and the contract ID of the current financial quotation contract and sending the fourth missing financial quotation contract to the user according to the subscription requirement of the user, marking contract data of the fourth missing financial quotation contract as a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user.
It should be noted that, the filling process in steps S301 to S303 is a form of strictly ensuring the data output order, and the principle is to preferentially determine whether to fill data when one piece of data is received, and then output the received data.
Illustratively, assume contract IDs are 0, 1, 2, 3, 4; the cache contract timestamp is initialized to 0 and the cache contract ID is initialized to 0.
Assume that the actual transaction issued a contract order of: contract 1: timestamp 500, contract ID of 0; contract 2: timestamp 500, contract ID of 2; contract 3: timestamp 500, contract ID 3; contract 4: time stamp 1000, contract ID 2.
Wherein, contracts 1, 2 and 3 are transmitted at the same time, and contract 4 is transmitted 500ms after contracts 1, 2 and 3.
The contracts output after the patch are:
a) Receiving the contract 1, wherein the buffer time stamp is 0 and is smaller than the current time stamp 500, and updating the buffer time stamp to be the current time stamp 500; since the ID is 0, i.e., the first contract, the contract 1 is normally output, and the patch operation is not triggered.
B) When receiving the contract 2, since the time stamp is the same, the ID is 2, and the ID is not continuous with the last (last is 0), the repair data with the time stamp of 500 and the ID of 1 is required to be repaired, and then the contract 2 is normally output.
C) Receiving the contract 3, wherein the ID is 3 and is continuous with the last piece because the time stamps are the same, the complement operation is not triggered, and the contract 3 is normally output;
d) After a certain time, such as 10ms, passes after receiving the contract 3, no new contract is received, a filling operation is triggered, and the remaining contracts of the current timestamp are filled, namely: and the timestamp 500, and the complement data with the ID of 4.
E) Receiving the contract 4, changing the time stamp, and updating the buffer time stamp to 1000 as the current time stamp; and the current contract ID is 2, and the non-start contract ID is 0, so contract data of 2 pieces of current time stamps need to be complemented, namely: time stamp 1000, complement data with ID 0; time stamp 1000, padding data with id 1. And normally outputting the contract 4 after completion of the complement.
In some embodiments, the method further comprises, with reference to fig. 3, before initializing the cache contract timestamp and initializing the cache contract ID, step S304: judging whether a new financial quotation contract is received, and when the new financial quotation contract is not received, maintaining an idle standby state, wherein the idle standby state comprises: and judging whether the cache contract time stamp is initialized or not, if the initialization is completed, acquiring the current hardware time stamp, and when the current hardware time stamp is longer than the set time length of the cache hardware time stamp and the contract ID in the cache contract list does not reach the set number, supplementing the empty contract which is not output and remains in the cache hardware time stamp, marking the contract data of the empty contract as a 0 value, and updating the cache hardware time stamp as the current hardware time stamp.
Step S304 is to set an idle standby state, and keep an operation state by using less resources, so as to ensure that financial quotation contracts can be received and processed at any time, respond in time and realize quick processing.
In some embodiments, the method further comprises steps S305 and S306:
step S305: and judging whether the buffer contract time stamp is initialized, and if the initialization is not completed, judging whether a new financial quotation contract is received again.
Step S306: and when the current hardware time stamp is smaller than or equal to the cached hardware time stamp or the contract ID in the cached contract list reaches the set number, judging whether a new financial quotation contract is received again.
In some embodiments, in step S103, the completed financial quotation contract is sent to the user according to the subscription requirement of the user according to the preset financial quotation contract subscription mode, including steps S401 to S402:
step S401: and acquiring the contract ID to be distributed after the financial quotation contract is analyzed.
Step S402: filtering contract IDs to be distributed according to a subscription list preset by a user, outputting financial quotation contracts corresponding to the contract IDs to be distributed in the subscription list, and discarding the rest.
According to the embodiment, the FPGA acceleration card is arranged, after market data are received on the FPGA card, the payload data are filtered according to contract ID after being processed by the network part in a pipeline mode, and only contract data subscribed by a user are analyzed and reported to the CPU end.
The whole process of contract subscription is divided into two parts, namely initialization and starting by an analysis module. The initialization module is responsible for issuing the subscription contract list to a storage module in the FPGA chip, and then starting the FPGA analysis module.
The analytic pipeline is divided into three modules: the device comprises a receiving module, an analyzing module and an output module. The receiving module is responsible for receiving the network data packet and transmitting the payload data to the parsing module. The processing flow of the analysis module is shown in fig. 4, and when the module is initialized, the CPU transmits the subscribed contract list to the analysis module of the FPGA acceleration card through Pcie; after the analysis module is started, matching is carried out according to the analyzed contract ID and the contract list, and if matching is successful, the contract data is transmitted to the output module; otherwise, the data is discarded. And the output module returns the received data to the CPU end through the Pcie to complete the contract subscription flow.
In some embodiments, subscription may also be implemented using WebSocket protocol, the steps comprising:
1.1 establishing a WebSocket connection: the user application program establishes WebSocket connection with the data source server by using a WebSocket API. This may be achieved by initiating a WebSocket handshake request at the client. The handshake request includes an HTTP header specifying the WebSocket protocol and version, as well as other necessary information.
1.2 making a subscription request: once the WebSocket connection is established successfully, the user terminal can send a subscription request to the server. This may be an application-specific protocol or message format for specifying the content or topic to be subscribed to.
1.3 the server confirms the subscription: after receiving the subscription request, the data source server verifies the request and confirms the subscription. The data source server may send a confirmation message to the client indicating that the subscription was successful.
1.4 push data: once the user side has successfully subscribed, the data source server may begin pushing relevant data to the user side. The data may be updated information, events or other content in real time, depending on the needs of the application.
1.5 processing push data: after receiving the data pushed by the data source server, the user application program can process and display the data as required. This may involve updating the user interface, performing certain operations, or using the data for other purposes.
1.6 maintain connection and handle errors: webSocket connections typically remain active so that the data source server can continue pushing data to the client. The client and the data source server should handle disconnection, error and reconnection and take appropriate measures to ensure reliable subscription.
In some embodiments, the method further comprises: receiving a subscription change request sent by a user, and updating the subscription list according to the subscription change request.
In another aspect, the present application also provides a financial quotation contract data receiving device, including:
the receiving module is used for receiving financial quotation contracts issued by the data source;
the analysis module is used for executing the financial quotation contract data receiving method;
and the output module is used for sending the output of the analysis module to the processor end of the user through a PCIe protocol.
In some embodiments, the parsing module employs a field programmable gate array device (FPGA).
In another aspect, the present application also provides a computer readable storage medium having stored thereon a computer program, characterized in that the program when executed by a processor implements the steps of the above method.
In summary, according to the method and the device for receiving financial quotation contract data, aiming at uncertainty of actual transaction, a complete contract interpolation scheme is set and executed in the process of receiving financial quotation contracts, and the integrity of the received financial quotation contracts in order and set number is ensured by utilizing interpolation data, so that the subsequent decision process can be processed in parallel according to the unified data set number all the time, and realization of quick transaction is ensured. Meanwhile, when the financial quotation contract is distributed, data are screened according to the requirements of the user based on a subscription mechanism, invalid processing of the data in the subsequent application process is reduced, and the processing speed and the execution efficiency are improved.
Accordingly, the present application also provides an apparatus/system comprising a computer device including a processor and a memory, the memory having stored therein computer instructions for executing the computer instructions stored in the memory, the apparatus/system implementing the steps of the method as described above when the computer instructions are executed by the processor.
The embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the edge computing server deployment method described above. The computer readable storage medium may be a tangible storage medium such as Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, floppy disks, hard disk, a removable memory disk, a CD-ROM, or any other form of storage medium known in the art.
Those of ordinary skill in the art will appreciate that the various illustrative components, systems, and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or a combination of both. The particular implementation is hardware or software dependent on the specific application of the solution and the design constraints. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave.
It should be understood that the application is not limited to the particular arrangements and instrumentality described above and shown in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after appreciating the spirit of the present application.
In this disclosure, features that are described and/or illustrated with respect to one embodiment may be used in the same way or in a similar way in one or more other embodiments and/or in combination with or instead of the features of the other embodiments.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, and various modifications and variations can be made to the embodiments of the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. A financial quotation contract data receiving method, which is characterized in that the method is used for being executed on an analysis module of a user side, and comprises the following steps:
receiving a financial quotation contract based on time sequence, wherein the financial quotation contract at least comprises a time stamp, a contract ID and contract data corresponding to a contract batch; in the process of generating the financial quotation contracts by a financial institution, the financial quotation contracts of the batch corresponding to each time stamp are generated according to business requirements according to a preset sequence and a set number;
for the received financial quotation contracts, checking contract IDs of batches corresponding to each time stamp, comparing and searching missing financial quotation contracts in the batches corresponding to each time stamp according to the preset sequence and the set number, and supplementing the missing financial quotation contracts by adopting specified data so as to execute decisions in parallel;
and sending the completed financial quotation contracts to the user according to the subscription requirements of the user according to a preset financial quotation contract subscription mode.
2. The method of claim 1, wherein checking contract IDs of batches corresponding to each time stamp, comparing and searching for missing financial contracts in the batches corresponding to each time stamp according to the preset order and the set number, and supplementing the missing financial contracts with specified data, comprising:
initializing a cache contract time stamp to 0 and initializing a cache contract ID to 0;
receiving the current financial quotation contract and sending the current financial quotation contract to a user according to the subscription requirement of the user;
when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, checking whether the financial quotation contract of the batch corresponding to the time stamp of the cache contract reaches the set number, and when the financial quotation contract does not reach the set number, supplementing the first type of missing financial quotation contract in the batch corresponding to the time stamp of the cache contract according to the preset order and the set number, and sending the first type of missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the first type of missing financial quotation contract is marked as a value of 0; resetting the cache contract ID to 0;
when the received time stamp of the current financial quotation contract is equal to the cache contract time stamp, and the contract ID of the current financial quotation contract is larger than the cache contract ID, judging whether the contract ID of the current financial quotation contract is continuous with the cache contract ID, and when the contract ID is continuous, updating the cache contract ID to be the contract ID of the current financial quotation contract; and when the contract is discontinuous, the cache contract ID is supplemented to a second type of missing financial quotation contract between the contract IDs of the current financial quotation contracts, the contract data of the second type of missing financial quotation contract is marked as a value of 0, and the supplemented second type of missing financial quotation contract is sent to the user according to the subscription requirement of the user.
3. The method of claim 1, wherein checking contract IDs of batches corresponding to each time stamp, comparing and searching for missing financial contracts in the batches corresponding to each time stamp according to the preset order and the set number, and supplementing the missing financial contracts with specified data, comprising:
judging whether a new financial quotation contract is received, initializing a cache contract time stamp to be 0 when the current financial quotation contract is received, and initializing a cache contract ID to be 0;
when the received time stamp of the current financial quotation contract is later than the time stamp of the cache contract, updating the time stamp of the cache contract to the time stamp of the current financial quotation contract, and resetting the initialized cache contract ID to 0; judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, replenishing a third missing financial quotation contract between the cache contract ID and the contract ID of the current financial quotation contract and sending the third missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the third missing financial quotation contract is marked with a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user;
when the received time stamp of the current financial quotation contract is equal to the time stamp of the cache contract, judging whether the contract ID of the current financial quotation contract is larger than the cache contract ID, if so, supplementing the cache contract ID to a fourth missing financial quotation contract between the contract IDs of the current financial quotation contracts and sending the fourth missing financial quotation contract to a user according to the subscription requirement of the user, wherein the contract data of the fourth missing financial quotation contract is marked as a value of 0, and if not, sending the current financial quotation contract to the user according to the subscription requirement of the user.
4. The method of claim 3, further comprising, prior to initializing the cache contract time stamp and initializing the cache contract ID:
judging whether a new financial quotation contract is received, and when the new financial quotation contract is not received, maintaining an idle standby state, wherein the idle standby state comprises:
and judging whether the cache contract time stamp is initialized or not, if the initialization is completed, acquiring a current hardware time stamp, and when the current hardware time stamp is larger than the set time length of the cache hardware time stamp and the contract ID in the cache contract list does not reach the set number, replenishing the empty contract which is not output and remains in the cache hardware time stamp, wherein the contract data of the empty contract is marked as a 0 value, and updating the cache hardware time stamp as the current hardware time stamp.
5. The financial contract data receiving method according to claim 4, characterized in that said method further includes:
judging whether the cache contract time stamp is initialized or not, and if the initialization is not completed, judging whether a new financial quotation contract is received or not again;
and when the current hardware time stamp is smaller than or equal to the cached hardware time stamp or the contract ID in the cached contract list reaches the set number, judging whether a new financial quotation contract is received or not again.
6. The method for receiving financial quotation contract data according to claim 1, wherein the step of transmitting the completed financial quotation contract to the user according to the subscription requirement of the user according to the preset financial quotation contract subscription mode comprises:
acquiring a contract ID to be distributed after the financial quotation contract is analyzed;
filtering the contract ID to be distributed according to a subscription list preset by a user, outputting financial quotation contracts corresponding to the contract ID to be distributed in the subscription list, and discarding the rest.
7. The financial contract data receiving method of claim 6, further comprising:
and receiving a subscription change request sent by a user, and updating the subscription list according to the subscription change request.
8. A financial quotation contract data receiving apparatus, comprising:
the receiving module is used for receiving financial quotation contracts issued by the data source;
a parsing module for executing the financial quotation contract data receiving method according to any one of claims 1 to 7;
and the output module is used for sending the output of the analysis module to the processor end of the user through a PCIe protocol.
9. The financial contract data receiving apparatus of claim 8, wherein the parsing module employs a field programmable gate array device.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310920061.9A CN116962513B (en) | 2023-07-25 | 2023-07-25 | Financial quotation contract data receiving method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310920061.9A CN116962513B (en) | 2023-07-25 | 2023-07-25 | Financial quotation contract data receiving method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116962513A true CN116962513A (en) | 2023-10-27 |
CN116962513B CN116962513B (en) | 2024-04-19 |
Family
ID=88461485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310920061.9A Active CN116962513B (en) | 2023-07-25 | 2023-07-25 | Financial quotation contract data receiving method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116962513B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180308094A1 (en) * | 2017-04-19 | 2018-10-25 | Baton Systems, Inc. | Time stamping systems and methods |
CN113065958A (en) * | 2021-02-20 | 2021-07-02 | 上海金融期货信息技术有限公司 | Theme market situation business data streaming system |
CN115357629A (en) * | 2022-10-20 | 2022-11-18 | 成都宽邦科技有限公司 | Processing method, system, electronic device and storage medium for financial data stream |
CN115456781A (en) * | 2022-09-16 | 2022-12-09 | 中国建设银行股份有限公司 | Market data processing method and device, electronic equipment and storage medium |
-
2023
- 2023-07-25 CN CN202310920061.9A patent/CN116962513B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180308094A1 (en) * | 2017-04-19 | 2018-10-25 | Baton Systems, Inc. | Time stamping systems and methods |
CN113065958A (en) * | 2021-02-20 | 2021-07-02 | 上海金融期货信息技术有限公司 | Theme market situation business data streaming system |
CN115456781A (en) * | 2022-09-16 | 2022-12-09 | 中国建设银行股份有限公司 | Market data processing method and device, electronic equipment and storage medium |
CN115357629A (en) * | 2022-10-20 | 2022-11-18 | 成都宽邦科技有限公司 | Processing method, system, electronic device and storage medium for financial data stream |
Also Published As
Publication number | Publication date |
---|---|
CN116962513B (en) | 2024-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6757781B2 (en) | Communication latency leveling devices, methods, and systems | |
US20190259099A1 (en) | System and method for a semi-lit market | |
US10621666B2 (en) | System and method for facilitation cross orders | |
US8874479B2 (en) | Systems and methods for testing a financial trading system | |
US20150039489A1 (en) | Electronic Trading Platform and Method Thereof | |
WO2005013104A2 (en) | System and method for improved electronic trading | |
CN102246194A (en) | Improved automated trading system | |
WO2023207146A1 (en) | Service simulation method and apparatus for esop system, and device and storage medium | |
US20090313160A1 (en) | Hardware accelerated exchange order routing appliance | |
US20240242279A1 (en) | Dynamic format electronic confirmations | |
US20230037390A1 (en) | Techniques to provide streaming data resiliency utilizing a distributed message queue system | |
CN108230149B (en) | System and method for accelerating financial transaction based on SOC FPGA | |
CN113312649A (en) | Message processing method, device, equipment, system and storage medium | |
CN107800667B (en) | Information processing method and access processing device | |
CN112991023B (en) | Order data processing method and device, computer equipment and storage medium | |
CN116962513B (en) | Financial quotation contract data receiving method and device | |
US20160267590A1 (en) | Methods and systems of performing risk management of transactions | |
CN113590243A (en) | Energy enterprise project creation method and device, computer equipment and medium | |
CN114238209A (en) | Test method and device for snapshot market data, electronic equipment and storage medium | |
AU2014337424B2 (en) | Customizable macro-based order entry protocol and system | |
US20150269678A1 (en) | Trading opportunities based on public ticker data | |
CN111144977A (en) | Stock order processing method and device | |
US20240046343A1 (en) | Method, apparatus and system for auction of assets | |
US11822838B1 (en) | Method and system for securely exchanging print job information | |
CN117829996A (en) | Data synchronization method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |