CN113190481B - Data transmission method and device, electronic equipment and computer readable storage medium - Google Patents

Data transmission method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113190481B
CN113190481B CN202110749081.5A CN202110749081A CN113190481B CN 113190481 B CN113190481 B CN 113190481B CN 202110749081 A CN202110749081 A CN 202110749081A CN 113190481 B CN113190481 B CN 113190481B
Authority
CN
China
Prior art keywords
data
market data
currently
market
message
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.)
Active
Application number
CN202110749081.5A
Other languages
Chinese (zh)
Other versions
CN113190481A (en
Inventor
郭国峰
祝磊
申彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huayun Information System Technology Co ltd
Original Assignee
Shenzhen Huayun Information System Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Huayun Information System Co ltd filed Critical Shenzhen Huayun Information System Co ltd
Priority to CN202110749081.5A priority Critical patent/CN113190481B/en
Publication of CN113190481A publication Critical patent/CN113190481A/en
Application granted granted Critical
Publication of CN113190481B publication Critical patent/CN113190481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention relates to a data transmission method, a data transmission device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: when receiving market data sent by a data sender to a data receiver through any one path, determining whether the market data currently meets set data transmission conditions; when the data transmission condition is determined to be met currently, determining whether market data from any access is cached currently; if so, selecting the earliest cached market data to determine the market data to be transmitted as the target data to be transmitted, and caching the currently received market data; if not, determining the currently received market data as target data; and sending the target data to a data receiving party. Therefore, when the data sending party sends the market data to the data receiving party in a multi-channel transmission mode, the optimal and most reliable market data can be selected from the data transmitted on the multiple channels and sent to the data receiving party, and the data transmission efficiency and the data transmission reliability are improved.

Description

Data transmission method and device, electronic equipment and computer readable storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data transmission method and device, electronic equipment and a computer readable storage medium.
Background
The trading system can receive market data from a trading exchange, provide functions of holographic market, flexible market, market value-added application and the like by analyzing the market data, and provide market service with extremely low delay for quantitative investors, programmed investors, professional institutions and large households.
Currently, a trading system provides a trading exchange with multiple network access modes, such as a TCP access mode, a mirror access mode, and the like. In practice, for the same exchange, it can access the transaction system either in a single input mode or in a multiple input mode. In the prior art, in a scenario where a trading exchange accesses a trading system through a multi-channel input mode, the trading exchange selects market data transmitted on a reliable channel from market data transmitted on a plurality of channels by setting a message counter on each channel. Specifically, the larger the value of the message counter, the faster the data transmission rate of the path, which means the more messages transmitted on the path, and therefore, the exchange determines the path with the largest message counter value as the reliable path.
However, the above method is only suitable for the ideal situation, that is, the situation that the network does not have any problem, once the network has a problem, the market data may be lost and cannot be corrected by the data complementation between the paths, and at the same time, if the path switching occurs, the repeated data may be generated. The reliability of the market data received by the trading system is greatly reduced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data transmission method, an apparatus, an electronic device, and a computer-readable storage medium.
In a first aspect, an embodiment of the present invention provides a data transmission method, where the method includes:
when receiving market data sent to a data receiver by a data sender through any one path, determining whether the market data currently meets set data transmission conditions, wherein a plurality of paths are arranged between the data sender and the data receiver, and the data sender adopts a multi-path transmission mode to send the market data to the data receiver;
when the data transmission condition is determined to be met currently, determining whether market data from any of the paths are cached currently;
if so, selecting the earliest cached market data to determine the market data as the target data to be transmitted, and caching the currently received market data; if not, determining the currently received market data as the target data;
and sending the target data to the data receiver.
In a second aspect, an embodiment of the present invention provides a data transmission apparatus, where the apparatus includes:
the system comprises a first determining module, a second determining module and a sending module, wherein the first determining module is used for determining whether a set data transmission condition is met or not at present when market data sent to a data receiving party by a data sending party through any one path is received, a plurality of paths are arranged between the data sending party and the data receiving party, and the data sending party sends the market data to the data receiving party in a multi-path transmission mode;
a second determining module, configured to determine whether market data from any of the paths is currently cached when it is determined that the data transmission condition is currently satisfied;
the third determining module is used for selecting the earliest cached market data to be determined as the target data to be transmitted if the market data from any path is cached currently;
the cache module is used for caching the currently received market data if the market data from any path is determined to be cached currently;
a fourth determining module, configured to determine, if it is determined that the market data from any of the paths is not currently cached, the currently received market data as the target data;
and the data sending module is used for sending the target data to the data receiving party.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program stored in the memory, and when the computer program is executed, implementing the method of any of the first aspects above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the method according to any one of the first aspect.
The technical proposal provided by the embodiment of the invention determines whether the current data transmission condition is met or not when the market data transmitted to the data receiver by the data transmitter through any path is received, determines whether the market data from any path is cached or not when the data transmission condition is met, selects the earliest cached market data to be determined as the target data to be transmitted and caches the current received market data if the current data transmission condition is met, determines the current received market data as the target data if the current data is not cached, transmits the target data to the data receiver, realizes that the optimal and most reliable market data can be selected from the data transmitted on a plurality of paths to be transmitted to the data receiver when the data transmitter transmits the market data to the data receiver through a multi-path transmission mode, improves the data transmission efficiency, and data complementation among multiple channels can be realized, so that the reliability of data transmission is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a data transmission method according to an embodiment of the present invention;
fig. 2 is a flowchart of an embodiment of a data transmission method according to an embodiment of the present invention;
fig. 3A is a flowchart of another data transmission method according to an embodiment of the present invention;
fig. 3B is a flowchart of another data transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a switching mechanism of a data transmission state according to an embodiment of the present application;
fig. 5 is a block diagram of an embodiment of a data transmission apparatus according to the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic view of an application scenario of a data transmission method according to an embodiment of the present invention is provided. The application scenario shown in fig. 1 includes a data sender 11, a data receiver 12, and a data transmission system 13.
Furthermore, there are 3 paths between the data sender 11 and the data receiver 12, which are respectively denoted as path 1, path 2, and path 3, and the data sender 11 sends data to the data receiver 12 by using a multiplexing method, which means that data transmitted on different paths are kept consistent in data content under normal conditions. The data transmission system 13 includes network access modules 130-132, parsing modules 133-135, and a multi-channel data optimization module 16.
On this basis, the multiple data optimization module 16 may apply the data transmission method provided in this embodiment, and select the optimal and most reliable data from the data transmitted on the multiple paths to send to the data receiver 12, that is, for each data to be sent, although the data sender 11 adopts the multiple transmission method, the multiple data optimization module 16 only selects one path of data from the data to send to the data receiver 12, which not only can improve the data transmission efficiency, but also can make the data receiver 12 receive the complete data sent by the data sender 11 as much as possible, and there is no situation that the data receiver 12 repeatedly receives the same data.
It should be noted that, the 3 paths between the data sender 11 and the data receiver 12 in fig. 1 are only an exemplary illustration, in practice, there may be multiple paths between the data sender 11 and the data receiver 12, and the embodiment of the present application does not limit the specific number of paths.
It can be further understood that the data sender 11 sends data to the data receiver 12 by using a multi-path transmission method, and the reliability of data transmission can be improved compared with sending data to the data receiver 12 by using a single-path transmission method, for example, when a data packet is lost in one of the paths, the data receiver 12 can also receive data from the data sender 11 through the other path.
Still further, as shown in fig. 1, the multi-path data optimization module 16 includes: an arbitration module 161, transmission modules 162 to 164, a message queue 165, first buffer queues 166 to 168, and second buffer queues 169 to 171. The network access module 130, the parsing module 133, the transmission module 162, the first buffer queue 166, and the second buffer queue 169 correspond to the path 1; the network access module 131, the parsing module 134, the transmission module 163, the first buffer queue 167, and the second buffer queue 170 correspond to the path 2; the network access module 132, the parsing module 135, the transmission module 164, the first buffer queue 168, and the second buffer queue 171 correspond to the path 3; an arbitration module 161 and a message queue 165 correspond to each lane. Here, correspondence means: each module/queue described above is used to transmit data from its corresponding lane.
For example, for data transmitted from the data transmitter 11 to the data receiver 12 through the channel 1, the data is first transmitted to the analysis module 133 through the network access module 130, the analysis module 133 analyzes the data, and the analyzed data is transmitted to the multi-path data optimization module 16. In the multi-channel data optimization module 16, the arbitration module 161 collects data information of the data, makes an arbitration result for the data according to the data information, and sends the arbitration result to the transmission module 162. Then, the transmission module 162 processes the data according to the arbitration result of the arbitration module 161, where the processes include but are not limited to: discarding, buffering to a first buffer queue, buffering to a second buffer queue, directly transmitting to a data receiving side, taking out data from the first buffer queue to transmit to the data receiving side, taking out data from the second buffer queue to transmit to the data receiving side.
In practice, the multi-path data optimization module 16 may be implemented by an FPGA (Field-Programmable Gate Array). As for the detailed work flow of the above-mentioned multi-path data optimization module 16, it is explained below by a specific embodiment, and will not be detailed here.
The data transmission method provided by the present invention will be explained in detail by the following specific embodiments, which are not intended to limit the embodiments of the present invention.
Referring to fig. 2, a flowchart of an embodiment of a data transmission method according to an embodiment of the present invention is provided. As an embodiment, the method may be applied to the multiple data optimization module 16 in the application scenario shown in fig. 1, and in the application scenario shown in fig. 1, the data sender 11 may be a trading exchange (e.g., shanghai trading exchange, shenzhen trading exchange, etc.), the data receiver 12 may be a trading system, and the data sent by the data sender 11 to the data receiver 12 is market data. As shown in fig. 2, the method may include the steps of:
step 201, when receiving market data sent by a data sender to a data receiver through any one of the paths, determining whether the market data currently meets set data transmission conditions.
As can be seen from the description of the application scenario shown in fig. 1, after parsing, the market data sent by the data sender to the data receiver through each path first reaches the multi-path data optimization module provided in the embodiment of the present application, and then the multi-path data optimization module selects the optimal and most reliable data from the data transmitted through the multiple paths to send to the data receiver.
In the embodiment of the application, when receiving market data sent by a data sender to a data receiver through any one of the paths, the multi-path data optimization module firstly determines whether the set data transmission condition is met currently. The following description will be made, taking the Shanghai market quotation as an example, on how the multi-channel data optimization module determines whether the set data transmission condition is currently satisfied when receiving quotation data sent by a data sending party to a data receiving party through any one of the paths:
first, it is explained that a transaction exchange generally encapsulates market data using a step protocol or a bind protocol, in which the market data includes a product type (denoted ctgID) and a message number (denoted seqID), and the message number of the market data specifying the same product type is sequentially incremented from 1 (or 0), based on which the multi-path data optimization module can determine whether the received market data is continuous according to the ctgID and the seqID of the market data, and ensure the uniqueness of the market data sent to a data receiver according to the ctgID and the seqID of the market data. It can be understood that when it is determined that the received market data is continuous and not repeated, the received market data may be sent to a data receiving side, that is, the multi-path data optimization module may determine whether the set data transmission condition is currently satisfied according to the ctgID and seqID of the market data.
Specifically, in the embodiment of the present application, when the multi-channel data optimization module receives the market data sent by the data sender to the data receiver through any one of the channels, the arbitration module collects the ctgdid and the seqID (i.e., the data information described above) of the market data. Taking the market data of a certain product type (hereinafter referred to as a first product type) as an example, when the multi-path data optimization module receives the market data of the first product type sent to the data receiver by the data sender through any path for the first time, that is, the arbitration module collects the ctgID and the seqID of the market data of the first product type for the first time, the seqID of the currently collected market data (that is, the market data currently received by the multi-path data optimization module) is recorded as the first message identifier corresponding to the first product type, and when the market data of the first product type sent to the data receiver by the data sender through any path is not received for the first time, that is, the arbitration module does not collect the ctgID and the seqID of the market data of the first product type for the first time, the seqID of the currently collected market data (that is currently received by the multi-path data optimization module) is compared with N, here, N is the sum of the current first message identification and 1. If the seqID of the currently received market data is equal to N through comparison, updating the current first message identification to the seqID of the currently received market data; otherwise, if the seqID of the currently received market data is greater than or less than N by comparison, the current first message identifier is kept unchanged. Therefore, the first message identification is characterized in that for the market data of the first product type, the seqID which is continuous and maximum with the seqID of other market data in the market data currently received by the multi-path data preference module is selected.
For example, it is assumed that the multi-channel data optimization module receives 5 pieces of market data of the first product type sent by the data sender to the data receiver in sequence, and seqids of the 5 pieces of market data are 1, 2, 5, 3, and 4 in sequence. According to the above description, when a market message with the message sequence number of 1 is received from the data sender to the data receiver, the first message identifier is 1, when a market message with the message sequence number of 2 is received from the data sender to the data receiver, the first message identifier is updated from 1 to 2 because 2 is equal to the sum of the current first message identifiers 1 and 1, when a market message with the message sequence number of 5 is received from the data sender to the data receiver, the first message identifier is kept unchanged because 5 is greater than the sum of the current first message identifiers 2 and 1, when a market message with the message sequence number of 3 is received from the data sender to the data receiver, the first message identifier is updated from 2 to 3 because 3 is equal to the sum of the current first message identifiers 2 and 1, when a market message with the message sequence number of 4 is received from the data sender to the data receiver, since 4 is equal to the sum of the current first message identity 3 and 1, the first message identity is updated from 3 to 4.
Further, based on the above description, if the message sequence number of the currently received market data is compared to be equal to N, it means that the multi-channel data optimization module receives the market data for the first time, which means that the transmission speed of the current channel is the fastest, where the current channel is a channel through which the currently received market data is transmitted. It can be understood that the data transmission speed can be improved by transmitting the market data from the path with the highest transmission speed, that is, the market data received earliest, to the data receiving side.
If the message sequence number of the currently received market data is smaller than N, the multi-channel optimization system is not the first time market data is received, at this time, in order to avoid repeated transmission, the arbitration module can make an arbitration result of discarding the market data and send the arbitration result to a selector corresponding to the current channel, and the selector discards the market data based on the arbitration result.
If the message sequence number of the currently received market data is greater than N, the result indicates that the multi-channel data optimization module receives the market data for the first time, but the received market data are not continuous, and packet loss occurs on the current path. In this case, if the currently received market data is transmitted to the data receiver, the market data received by the data receiver is not continuous, and therefore, in this case, it is not suitable to transmit the currently received market data to the data receiver.
As can be seen from the above description, when the currently received market data is continuous with the previously received market data, it is determined that the set data transmission condition is currently satisfied. Based on this, in practice, the arbitration module may determine whether the current data transmission condition is satisfied according to the message sequence number of the currently received market data and the corresponding N. Specifically, the arbitration module compares the message serial number of the currently received market data with the corresponding N, and if the message serial number of the currently received market data is equal to N, the currently set data transmission condition is determined to be met; and if the message sequence number of the currently received market data is smaller or larger than the corresponding N, determining that the currently received market data does not meet the set data transmission condition. Here, N corresponding to the market data means: and N corresponding to the product type to which the market data belongs.
Step 202, when determining that the data transmission condition is met currently, determining whether market data from any path is cached currently; if yes, go to step 203, otherwise go to step 204.
Step 203, selecting the earliest cached market data to determine as the target data to be transmitted, and caching the currently received market data; step 205 is performed.
And step 204, determining the currently received market data as target data.
Step 205, sending the target data to the data receiving side.
Steps 202 to 204 are explained in a unified manner as follows:
in the embodiment of the application, when the condition that the data transmission is met currently is determined, whether the market data from any access is cached currently is determined, if yes, the earliest cached market data is selected to be determined as the target data to be transmitted, and the currently received market data is cached. Therefore, the currently cached market data is earlier than the currently received market data, and based on the situation, in order to realize the sequential transmission of the market data, the earliest cached market data is selected to be determined as the target data to be transmitted currently. On the contrary, if it is determined that the market data from any path is not currently cached, the currently received data can be directly used as the target data to be transmitted.
With reference to the multi-channel data optimization module illustrated in fig. 1, in this embodiment of the application, caching the currently received market data includes: storing the currently received market data into a first cache queue corresponding to the current path, and storing the path identifier of the current path into a set message queue. For example, when currently receiving the market data sent by the data sender through the path 1, the arbitration module 161 controls the transmission module 162 to store the market data into the first buffer queue 166 corresponding to the path 1, and store the path identifier of the path 1 into the message queue 165.
On the basis, determining whether market data from any path is cached currently comprises the following steps: determining whether the message queue is empty, and if the message queue is empty, determining that the market data from any path is not cached currently; and if the message queue is not empty, determining that the market data from any path is cached currently.
Further, selecting the earliest cached market data to be determined as the target data to be transmitted comprises: and reading a first-ranked path identifier from the message queue, and reading the first-ranked market data from a first cache queue corresponding to a target path as target data to be transmitted, wherein the target path refers to a path corresponding to the read path identifier.
With reference to the multi-channel data optimization module illustrated in fig. 1, when determining that the data transmission condition is currently satisfied and that the market data from any channel is currently cached, the arbitration module performs an arbitration result for caching the currently received market data, and sends the arbitration result to the transmission module corresponding to the current channel. The transmission module stores the currently received market data into the corresponding first cache queue based on the arbitration result, and stores the access identifier of the current access into the message queue. In this case, the arbitration module further reads the first-ranked path identifier from the message queue, then controls the transmission module corresponding to the target path, reads the first-ranked market data from the first buffer queue corresponding to the target path as the target data to be transmitted, and sends the target data to the data receiver.
And when the arbitration module determines that the data transmission condition is met currently and the current market data from any channel is not cached, the arbitration module makes an arbitration result of directly sending the market data to the data receiver and sends the arbitration result to the transmission module corresponding to the current channel. And the transmission module determines the currently received market data as target data to be transmitted based on the arbitration result and sends the target data to a data receiver.
The technical proposal provided by the embodiment of the invention determines whether the current data transmission condition is met or not when the market data transmitted to the data receiver by the data transmitter through any path is received, determines whether the market data from any path is cached or not when the data transmission condition is met, selects the earliest cached market data to be determined as the target data to be transmitted and caches the current received market data if the current data transmission condition is met, determines the current received market data as the target data if the current data is not cached, transmits the target data to the data receiver, realizes that the optimal and most reliable market data can be selected from the data transmitted on a plurality of paths to be transmitted to the data receiver when the data transmitter transmits the market data to the data receiver through a multi-path transmission mode, improves the data transmission efficiency, and data complementation among multiple channels can be realized, so that the reliability of data transmission is improved.
Referring to fig. 3A and fig. 3B, a flowchart of another data transmission method according to an embodiment of the present invention is provided, where the flowchart shown in fig. 3A and fig. 3B may include the following steps based on the flowchart shown in fig. 2:
step 301, when receiving market data of a first product type sent by a data sending party to a data receiving party through any one of the paths for the first time, recording a message sequence number of the currently received market data as a first message identifier corresponding to the first product type.
Step 302, when the market data of the first product type sent to the data receiver by the data sender through any one path is not received for the first time, comparing the message serial number of the currently received market data with N, wherein N is the sum of the current first message identifier and 1; if the message sequence number of the currently received market data is smaller than or larger than N, executing step 303; if the message sequence number of the currently received market data is equal to N, step 304 is executed.
Step 303, keeping the current first message identifier unchanged; step 305 is performed.
And step 304, updating the current first message identification to the message sequence number of the currently received market data.
Step 305, comparing the message sequence number of the currently received market data with the corresponding N, and if the message sequence number of the currently received market data is equal to the corresponding N, executing step 306; if the message sequence number of the currently received market data is smaller than the corresponding N, executing step 315; if the message sequence number of the currently received market data is greater than the corresponding N, step 316 is executed.
Step 306, determining that the set data transmission condition is currently met.
Step 307, determining whether the message queue is empty; if the message queue is determined to be empty, go to step 308; if it is determined that the message queue is not empty, step 312 is performed.
And step 308, determining that the market data from any path is not cached currently.
The detailed descriptions of the steps 301 to 308 can refer to the related descriptions in the flow shown in fig. 2, and are not repeated here.
Step 309, determining the current data transmission state; if the current data transmission state is determined to be the idle state, execute step 310; if the current data transmission status is determined to be the through status, step 311 is executed.
First, in the embodiment of the present application, an idle state, a pass-through state, and a buffer output state are defined. The idle state represents that the multi-channel data optimization module does not send market data to a data receiver currently; the straight-through state represents that the multi-path data optimization module sends currently received market data to a data receiver currently; and the buffer output state represents that the multi-path data optimization module currently sends the market data buffered in any first buffer queue to the data receiving party. As for the switching mechanism of the above three states, it will be described below, and will not be described in detail here.
Step 310, determining the currently received market data as target data, and switching the current data transmission state from an idle state to a direct connection state; step 314 is performed.
As can be seen from the above description, if it is determined that the current data transmission state is the idle state, the currently received market data may be determined as the target data, and step 314 is further executed to send the target data to the data receiving side. And simultaneously, switching the current data transmission state from an idle state to a direct connection state so as to represent that the multi-path data optimization module sends the currently received market data to the data receiver currently.
Step 311, storing the currently received market data into a first buffer queue corresponding to the current path, and storing the path identifier of the current path into a set message queue.
As can be seen from the above description, if it is determined that the current data transmission state is the direct connection state, it means that the multi-channel data optimization module currently sends the market data to the data receiver, so that the currently received market data may be temporarily sent to the data receiver, specifically, the currently received market data is stored in the first buffer queue corresponding to the current path, and the path identifier of the current path is stored in the set message queue.
Step 312, it is determined that the market data from any path is currently cached.
Step 313, reading the first-ranked way identifier from the message queue, and reading the first-ranked market data from the first buffer queue corresponding to the target way as the target data to be transmitted.
Step 314, sending the target data to a data receiver; and ending the flow.
Step 315, discarding the currently received market data; and ending the flow.
The detailed description of step 312 to step 315 can refer to the related description in the flow shown in fig. 2, and is not repeated here.
And step 316, storing the currently received market data into a second buffer queue corresponding to the current path.
As can be seen from the above description of step 305, when the message sequence number of the currently received market data is greater than the corresponding N, step 316 is executed, and when the message sequence number of the currently received market data is greater than the corresponding N, it means that the currently received market data is not continuous with the previously received market data, and at this time, the currently received market data may be suspended from being transmitted to the data receiving side. Specifically, the currently received market data is stored in the second buffer queue corresponding to the current path.
And 317, controlling the upper-level device to cache the received market data when receiving the market data sent by the data sender to the data receiver through the current path, so as to stop sending the market data sent by the data sender to the data receiver through the current path to the device.
In the embodiment of the present application, when it is determined that the message sequence number of the currently received market data is greater than the corresponding N, in addition to step 316, step 317 is further executed to control the upper level device to stop sending market data, which is sent to the data receiving side by the data sending side through the current path, to the present application.
In the application scenario illustrated in fig. 1, the device refers to a multi-path data optimization module, and the upper-level device refers to a parsing module.
Further, the parsing module may have a buffer, so that in this step 317, the upper level device is controlled to buffer the received market data when receiving the market data sent by the data sender to the data receiver through the current path.
And step 318, recording the message sequence number of the currently received market data as a second message identifier corresponding to the first product type.
For example, it is assumed that the multi-channel data optimization module receives 5 pieces of market data of the first product type sent by the data sender to the data receiver in sequence, and seqids of the 5 pieces of market data are 1, 2, 5, 3, and 4 in sequence. According to the above description, when the market information with the message sequence number of 5 sent by the data sender to the data receiver is received, since 5 is greater than the sum of the current first message identifications 2 and 1, the message sequence number of 5 is recorded as the second message identification corresponding to the first product type.
And 319, reading the market data from the second buffer queue when the set buffer release condition is determined to be met.
As an embodiment, determining that the set buffer release condition is satisfied includes: and when the message sequence number of the target data sent to the data receiving party is detected to be the difference value between the second message identifier and 1, determining that the set cache release condition is met. For example, in the above example, when it is detected that the message number of the target data to be transmitted to the data receiving side is 4, it means that the set buffer release condition is satisfied.
Therefore, when data packet loss occurs in a certain path, data complement can be performed through the market data in other paths, so that a data receiver can receive complete market data.
As another example, if the network rate is too large, the following may exist: before the target data with the message sequence number being the difference value between the second message identifier and 1 is sent to the data receiving party, the cache of the upper-level device is full or reaches a third set threshold value. That is, when it is detected that the data amount of the market data cached on the upper-level device reaches the third set threshold, it is determined that the set cache release condition is satisfied.
In addition, in this case, the message sequence number of the lost market information may be recorded for later debugging. Here, the message sequence number of the lost market message may be a message sequence number between the message sequence number of the last target data and the second message identifier, which is sent to the data receiving side only when it is determined that the set buffer release condition is satisfied.
And step 320, taking the quotation data read from the second cache queue as the currently received quotation data, and returning to execute the step 305.
According to the technical scheme provided by the embodiment of the application, when the currently received market data is discontinuous with the previously received market data, the currently received market data is temporarily suspended to be sent to the data receiving party, and in the period, the market data from other paths is continuously sent to the data receiving party, so that message complementation among multiple paths is realized, network packet loss is effectively reduced, and the data receiving party can receive complete data.
In addition, as can be seen from the description in the flows shown in fig. 3A and fig. 3B, when the current data transmission state is determined to be the pass-through state, if new market data is received, the currently received market data is suspended to be sent to the data receiving side, and the currently received market data is stored in the first buffer queue corresponding to the current path for subsequent sending.
However, in practice, there may be a situation that the network rate is too slow or other abnormal situations may cause the data transmission state to be in the pass-through state for a long time, and in the pass-through state for a long time, the first buffer queue/message queue may overflow or the data amount may reach the set threshold. Accordingly, the embodiment of the present application provides a data transmission timeout mechanism. The data transmission timeout mechanism is that:
when the data transmission timeout is determined, sending current transmitted market data to a data receiver is stopped, a first-ranked access identifier is read from a message queue, the first-ranked market data is read from a first cache queue corresponding to a target access to serve as target data to be transmitted, and then the newly determined target data is sent to the data receiver. Here, the target path refers to a path corresponding to the read path identifier.
Further, based on the above description, determining that a data transfer timeout occurs may include: when detecting that the data amount in the first cache queue of any path reaches a first set threshold value, determining that data transmission is overtime; or when the data quantity in the message queue is detected to reach a second set threshold value, determining that the data transmission timeout occurs.
Referring to fig. 4, a schematic diagram of a switching mechanism of a data transmission state provided in the embodiment of the present application is shown.
As shown in fig. 4, the data transfer state may be switched from the idle state S0 to the through state (S1, S2, S3), from the through state (S1, S2, S3) to the idle state S0, from the through state (S1, S2, S3) to the buffer output state (S4, S5, S6), and from the buffer output state (S4, S5, S6) to the idle state S0. Wherein S1 indicates that path 1 is in the pass-through state, S2 indicates that path 2 is in the pass-through state, and S3 indicates that path 3 is in the pass-through state; s4 indicates that way 1 is in the buffer out state, S5 indicates that way 2 is in the buffer out state, and S6 indicates that way 3 is in the buffer out state.
Specifically, the switching condition for switching from the idle state to the through state is as follows: and determining the currently received market data as target data, and sending the target data to a data receiver.
The switching condition for switching from the through state to the idle state is as follows: the sending of the current market data is completed and the message queue is empty. That is, under the condition that the current data transmission state is a direct-through state, whether the sending of the market data sent to the current data receiving party is finished is monitored, and when the sending is monitored to be finished, whether the message queue is empty is determined; and if the message queue is determined to be empty, switching the current data transmission state from the through state to the idle state.
And if the message queue is determined not to be empty, switching the current data transmission state from the through state to the buffer output state. That is, the switching condition for switching from the through state to the buffer output state is: and the current market data is sent completely, and the message queue is not empty.
The switching condition for switching the buffer output state to the idle state is as follows: the sending of the current market data is completed and the message queue is empty. That is, under the condition that the current data transmission state is the buffer output state, whether the sending of the market data currently sent to the data receiver is completed is monitored, when the sending is monitored to be completed, whether the message queue is empty is determined, and if the message queue is determined to be empty, the current data transmission state is switched from the buffer output state to the idle state.
And if the message queue is determined not to be empty, keeping the current data transmission state as the buffer output state.
Further, based on the above description, in this embodiment, it is further provided that, when the current data transmission state is the buffer output state, the following steps are executed according to a set cycle: reading a first-ranked path identifier from the message queue, and reading first-ranked market data from a first cache queue corresponding to a target path as target data to be transmitted, wherein the target path refers to a path corresponding to the read path identifier. Therefore, the data transmission state can be switched from the cache output state to the idle state under the condition that the current market data is sent and the message queue is empty.
Corresponding to the embodiment of the data transmission method, the invention also provides an embodiment of a data transmission device.
Referring to fig. 5, a block diagram of an embodiment of a data transmission apparatus according to an embodiment of the present invention is provided. As shown in fig. 5, the apparatus includes:
a first determining module 51, configured to determine whether a set data transmission condition is currently met when receiving market data sent by a data sender to a data receiver through any one of the paths, where a plurality of paths are provided between the data sender and the data receiver, and the data sender sends the market data to the data receiver in a multi-path transmission manner;
a second determining module 52, configured to determine whether market data from any of the ways is currently buffered when it is determined that the data transmission condition is currently satisfied;
a third determining module 53, configured to select the earliest cached market data to determine as the target data to be transmitted if it is determined that market data from any of the paths is currently cached;
the cache module 54 is configured to cache the currently received market data if it is determined that market data from any of the paths is currently cached;
a fourth determining module 55, configured to determine, if it is determined that the market data from any of the paths is not currently cached, the currently received market data as the target data;
and a data sending module 56, configured to send the target data to the data receiving side.
In a possible embodiment, the device further comprises (not shown in the figures):
the first recording module is used for recording the message serial number of the currently received market data as a first message identifier corresponding to a first product type when the market data of the first product type sent to the data receiver by the data sender through any one of the channels is received for the first time;
the first comparison module is used for comparing the message serial number of the currently received market data with N when the market data of the first product type sent to the data receiver by the data sender through any one of the channels is not received for the first time, wherein the N is the sum of the current first message identifier and 1;
the second recording module is used for updating the current first message identifier to the message serial number of the currently received market data if the message serial number of the currently received market data is compared to be equal to the N; if the message sequence number of the currently received market data is smaller than or larger than the N, keeping the current first message identifier unchanged;
the first determining module 51 determines whether a set data transmission condition is currently satisfied, including:
and determining whether the current set data transmission condition is met or not according to the message serial number of the currently received market data and the corresponding N.
In a possible implementation manner, the determining module 51 determines whether a set data transmission condition is currently met according to the message sequence number of the currently received market data and the corresponding N, including:
comparing the message sequence number of the currently received market data with the corresponding N;
and if the message serial number of the currently received market data is equal to the corresponding N, determining that the currently set data transmission condition is met.
In a possible embodiment, the caching module 54 caches the currently received market data, including:
storing the currently received market data into a first cache queue corresponding to any one of the paths, and storing a path identifier of any one of the paths into a set message queue;
the second determining module 52 determines whether market data from any of the ways is currently cached, including:
determining whether the message queue is empty;
if the message queue is determined to be empty, determining that the market data from any path is not cached currently; and if the message queue is not empty, determining that the market data from any path is cached currently.
In a possible embodiment, the third determining module 53 selects the least recently cached market data as the target data to be transmitted, and includes:
reading the path identification arranged at the head from the message queue;
and reading the quotation data arranged at the head from the first cache queue corresponding to the target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification.
In a possible implementation, the fourth determining module 55 determines the currently received market data as the target data, including:
determining the current data transmission state;
and if the current data transmission state is determined to be an idle state, determining the currently received market data as the target data, wherein the idle state represents that the market data is not sent to the data receiver currently.
In a possible embodiment, the device further comprises (not shown in the figures):
the second cache module is configured to store the currently received market data into the first cache queue corresponding to any one of the ways and store the way identifier of any one of the ways into a set message queue if it is determined that the current data transmission state is a pass-through state, where the pass-through state indicates that the currently received market data is currently sent to the data receiving side;
the overtime processing module is used for reading the path identifier arranged at the head from the message queue when the data transmission is determined to be overtime; and reading the quotation data arranged at the head from the first cache queue corresponding to the target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification.
In a possible implementation, the timeout processing module determines that a data transmission timeout occurs, including:
when detecting that the data amount in the first buffer queue of any one path reaches a first set threshold value, determining that data transmission is overtime; or when detecting that the data amount in the message queue reaches a second set threshold value, determining that the data transmission is overtime.
In a possible implementation manner, in a case that the currently received market data is determined to be the target data if it is determined that the current data transmission state is an idle state, the apparatus further includes:
and the state switching module is used for switching the current data transmission state from the idle state to the direct connection state.
In a possible embodiment, in the case that the current data transmission state is the pass-through state, the apparatus further includes (not shown in the figure):
the monitoring module is used for monitoring whether the sending of the market data currently sent to the data receiver is finished;
a fifth determining module, configured to determine whether the message queue is empty when it is monitored that the sending is completed;
the state switching module is further configured to switch the current data transmission state from the pass-through state to the idle state if it is determined that the message queue is empty; and if the message queue is determined not to be empty, switching the current data transmission state from the through state to a cache output state, wherein the cache output state represents that the market data cached in any first cache queue is currently sent to the data receiving party.
In a possible implementation manner, in a case that the current data transmission state is the buffer output state, the monitoring module is further configured to: monitoring whether the sending of the market data currently sent to the data receiver is finished;
the fifth determining module is further configured to: when the sending is monitored to be completed, determining whether the message queue is empty;
the state switching module is further configured to: if the message queue is determined to be empty, switching the current data transmission state from the cache output state to the idle state; and if the message queue is not determined to be empty, keeping the current data transmission state as the buffer output state.
In a possible implementation manner, in a case that the current data transmission state is the buffer output state, the apparatus further includes (not shown in the figure):
the reading module is used for executing the following steps according to a set period: reading the path identification arranged at the head from the message queue; and reading the quotation data arranged at the head from the first cache queue corresponding to the target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification.
In a possible embodiment, the device further comprises (not shown in the figures):
the discarding module is used for comparing that the message sequence number of the currently received market data is smaller than the corresponding N; discarding the currently received market data.
In a possible embodiment, the device further comprises (not shown in the figures):
and the suspension module is used for storing the currently received market data into a second cache queue corresponding to any one of the channels if the message sequence number of the currently received market data is larger than the corresponding N, and controlling the upper-level equipment to cache the received market data when receiving the market data sent to the data receiver by the data sender through any one of the channels so as to stop sending the market data sent to the equipment by the data sender to the data receiver through any one of the channels.
In a possible embodiment, the device further comprises (not shown in the figures):
the cache release module is used for reading market data from the second cache queue when the set cache release condition is determined to be met; and taking the market data read from the second cache queue as the currently received market data, and executing the steps of determining whether the currently set data transmission conditions are met or not and all the following steps.
In a possible embodiment, the device further comprises (not shown in the figures):
the second recording module is used for recording the message serial number of the currently received market data as a second message identifier corresponding to the first product type if the message serial number of the currently received market data is larger than the corresponding N;
the cache release module determines that a set cache release condition is met, and the cache release module comprises:
when detecting that the message sequence number of the target data sent to the data receiving party is the difference value between the second message identifier and 1, determining that a set cache release condition is met;
alternatively, the first and second electrodes may be,
and when detecting that the data volume of the market data cached on the upper-level equipment reaches a third set threshold value, determining that a set cache release condition is met.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 600 shown in fig. 6 includes: at least one processor 601, memory 602, at least one network interface 604, and other user interfaces 603. The various components in the electronic device 600 are coupled together by a bus system 605. It is understood that the bus system 605 is used to enable communications among the components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 605 in fig. 6.
The user interface 603 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It will be appreciated that the memory 602 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM) which functions as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (staticiram, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (syncronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM ), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and direct memory bus RAM (DRRAM). The memory 602 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an expanded set thereof: an operating system 6021 and application programs 6022.
The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application program 6022 includes various application programs such as a media player (MediaPlayer), a Browser (Browser), and the like, and is used to implement various application services. A program implementing the method of an embodiment of the invention can be included in the application program 6022.
In the embodiment of the present invention, by calling a program or an instruction stored in the memory 602, specifically, a program or an instruction stored in the application program 6022, the processor 601 is configured to execute the method steps provided by the method embodiments, for example, including:
when receiving market data sent to a data receiver by a data sender through any one path, determining whether the market data currently meets set data transmission conditions, wherein a plurality of paths are arranged between the data sender and the data receiver, and the data sender adopts a multi-path transmission mode to send the market data to the data receiver;
when the data transmission condition is determined to be met currently, determining whether market data from any of the paths are cached currently;
if so, selecting the earliest cached market data to determine the market data as the target data to be transmitted, and caching the currently received market data; if not, determining the currently received market data as the target data;
and sending the target data to the data receiver.
The method disclosed by the above-mentioned embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 601. The processor 601 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the method in combination with the hardware thereof.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The electronic device provided in this embodiment may be the electronic device shown in fig. 6, and may perform all the steps of the data transmission method shown in fig. 2, fig. 3A, and fig. 3B, so as to achieve the technical effects of the data transmission method shown in fig. 2, fig. 3A, and fig. 3B, for which specific reference is made to the related descriptions of fig. 2, fig. 3A, and fig. 3B, which are not repeated herein for brevity.
The embodiment of the invention also provides a computer readable storage medium. The storage medium herein stores one or more programs. Among others, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk; the memory may also comprise a combination of memories of the kind described above.
When one or more programs in the storage medium are executable by one or more processors, the data transmission method executed on the electronic device side is realized.
The processor is used for executing the data transmission program stored in the memory to realize the following steps of the data transmission method executed on the electronic equipment side:
when receiving market data sent to a data receiver by a data sender through any one path, determining whether the market data currently meets set data transmission conditions, wherein a plurality of paths are arranged between the data sender and the data receiver, and the data sender adopts a multi-path transmission mode to send the market data to the data receiver;
when the data transmission condition is determined to be met currently, determining whether market data from any of the paths are cached currently;
if so, selecting the earliest cached market data to determine the market data as the target data to be transmitted, and caching the currently received market data; if not, determining the currently received market data as the target data;
and sending the target data to the data receiver.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (16)

1. A method of data transmission, the method comprising:
when receiving market data sent to a data receiver by a data sender through any one path, determining whether the market data currently meets set data transmission conditions, wherein a plurality of paths are arranged between the data sender and the data receiver, and the data sender adopts a multi-path transmission mode to send the market data to the data receiver;
when the data transmission condition is determined to be met currently, determining whether market data from any of the paths are cached currently;
if so, selecting the earliest cached market data to determine the market data as the target data to be transmitted, and caching the currently received market data; if not, determining the currently received market data as the target data, wherein caching the currently received market data includes: storing the currently received market data into a first cache queue corresponding to any one of the paths, and storing a path identifier of any one of the paths into a set message queue; the determining whether market data from any of the ways is currently cached includes: determining whether the message queue is empty; if the message queue is determined to be empty, determining that the market data from any path is not cached currently; if the message queue is determined not to be empty, determining that the market data from any path is cached currently; the determining the currently received market data as the target data includes: determining the current data transmission state; if the current data transmission state is determined to be an idle state, determining the currently received market data as the target data, wherein the idle state represents that the market data are not sent to the data receiver currently; the method further comprises the following steps: if the current data transmission state is determined to be a through state, storing the currently received market data into a first cache queue corresponding to any one of the paths, and storing a path identifier of any one of the paths into a set message queue, wherein the through state represents that the currently received market data is sent to the data receiving party currently; when the data transmission time-out is determined to occur, reading the path identification arranged at the head from the message queue; reading the quotation data arranged at the head from the first cache queue corresponding to a target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification;
and sending the target data to the data receiver.
2. The method of claim 1, further comprising:
when the market data of a first product type sent to the data receiver by the data sender through any one of the channels is received for the first time, recording the message sequence number of the currently received market data as a first message identifier corresponding to the first product type;
when the market data of the first product type sent to the data receiver by the data sender through any one of the channels is not received for the first time, comparing the message sequence number of the currently received market data with N, wherein N is the sum of the current first message identifier and 1;
if the message sequence number of the currently received market data is equal to the N through comparison, updating the current first message identification to the message sequence number of the currently received market data; if the message sequence number of the currently received market data is smaller than or larger than the N, keeping the current first message identifier unchanged;
the determining whether the set data transmission condition is currently met includes:
and determining whether the current set data transmission condition is met or not according to the message serial number of the currently received market data and the corresponding N.
3. The method according to claim 2, wherein the determining whether a set data transmission condition is currently satisfied according to the currently received message sequence number of the market data and the corresponding N comprises:
comparing the message sequence number of the currently received market data with the corresponding N;
and if the message serial number of the currently received market data is equal to the corresponding N, determining that the currently set data transmission condition is met.
4. The method of claim 1, wherein selecting the least recently buffered market data to be determined as the target data to be transmitted comprises:
reading the path identification arranged at the head from the message queue;
and reading the quotation data arranged at the head from the first cache queue corresponding to the target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification.
5. The method of claim 1, wherein determining that a data transfer timeout has occurred comprises:
when detecting that the data amount in the first buffer queue of any one path reaches a first set threshold value, determining that data transmission is overtime; alternatively, the first and second electrodes may be,
and when detecting that the data amount in the message queue reaches a second set threshold value, determining that data transmission timeout occurs.
6. The method according to claim 1, wherein if it is determined that the current data transmission state is an idle state, the method further comprises, in a case where the currently received market data is determined to be the target data:
and switching the current data transmission state from the idle state to the through state.
7. The method according to claim 1 or 6, wherein in case that the current data transmission state is the pass-through state, the method further comprises:
monitoring whether the sending of the market data currently sent to the data receiver is finished;
when the sending is monitored to be completed, determining whether the message queue is empty;
if the message queue is determined to be empty, switching the current data transmission state from the direct connection state to the idle state;
and if the message queue is determined not to be empty, switching the current data transmission state from the through state to a cache output state, wherein the cache output state represents that the market data cached in any first cache queue is currently sent to the data receiving party.
8. The method of claim 7, wherein in the case that the current data transmission state is the buffer output state, the method further comprises:
monitoring whether the sending of the market data currently sent to the data receiver is finished;
when the sending is monitored to be completed, determining whether the message queue is empty;
if the message queue is determined to be empty, switching the current data transmission state from the cache output state to the idle state;
and if the message queue is not determined to be empty, keeping the current data transmission state as the buffer output state.
9. The method of claim 7, wherein in the case that the current data transmission state is the buffer output state, the method further comprises:
executing the following steps according to a set period:
reading the path identification arranged at the head from the message queue;
and reading the quotation data arranged at the head from the first cache queue corresponding to the target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification.
10. The method of claim 3, further comprising:
and if the message sequence number of the currently received market data is smaller than the corresponding N, discarding the currently received market data.
11. The method of claim 3, further comprising:
if the message sequence number of the currently received market data is larger than the corresponding N, storing the currently received market data into a second cache queue corresponding to any one of the channels, and controlling the upper-level equipment to cache the received market data when receiving the market data sent to the data receiver by the data sender through any one of the channels so as to stop sending the market data sent to the equipment by the data sender to the data receiver through any one of the channels.
12. The method of claim 11, further comprising:
reading market data from the second cache queue when the set cache release condition is determined to be met;
and taking the market data read from the second cache queue as the currently received market data, and executing the steps of determining whether the currently set data transmission conditions are met or not and all the following steps.
13. The method of claim 12, further comprising:
if the message serial number of the currently received market data is larger than the corresponding N, recording the message serial number of the currently received market data as a second message identifier corresponding to the first product type;
the determining that the set cache release condition is met includes:
when detecting that the message sequence number of the target data sent to the data receiving party is the difference value between the second message identifier and 1, determining that a set cache release condition is met;
alternatively, the first and second electrodes may be,
and when detecting that the data volume of the market data cached on the upper-level equipment reaches a third set threshold value, determining that a set cache release condition is met.
14. A data transmission apparatus, characterized in that the apparatus comprises:
the system comprises a first determining module, a second determining module and a sending module, wherein the first determining module is used for determining whether a set data transmission condition is met or not at present when market data sent to a data receiving party by a data sending party through any one path is received, a plurality of paths are arranged between the data sending party and the data receiving party, and the data sending party sends the market data to the data receiving party in a multi-path transmission mode;
a second determining module, configured to determine whether market data from any of the ways is currently buffered when it is determined that the data transmission condition is currently satisfied, where the determining whether market data from any of the ways is currently buffered includes: determining whether the message queue is empty; if the message queue is determined to be empty, determining that the market data from any path is not cached currently; if the message queue is determined not to be empty, determining that the market data from any path is cached currently;
the third determining module is used for selecting the earliest cached market data to be determined as the target data to be transmitted if the market data from any path is cached currently;
a cache module, configured to cache the currently received market data if it is determined that market data from any of the paths is currently cached, where caching the currently received market data includes: storing the currently received market data into a first cache queue corresponding to any one of the paths, and storing a path identifier of any one of the paths into a set message queue;
a fourth determining module, configured to determine, if it is determined that market data from any of the paths is not currently cached, the currently received market data as the target data, where the determining the currently received market data as the target data includes: determining the current data transmission state; if the current data transmission state is determined to be an idle state, determining the currently received market data as the target data, wherein the idle state represents that the market data are not sent to the data receiver currently; if the current data transmission state is determined to be a through state, storing the currently received market data into a first cache queue corresponding to any one of the paths, and storing a path identifier of any one of the paths into a set message queue, wherein the through state represents that the currently received market data is sent to the data receiving party currently; when the data transmission time-out is determined to occur, reading the path identification arranged at the head from the message queue; reading the quotation data arranged at the head from the first cache queue corresponding to a target access as target data to be transmitted, wherein the target access refers to the access corresponding to the read access identification;
and the data sending module is used for sending the target data to the data receiving party.
15. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing a computer program stored in the memory, and when executed, implementing the method of any of the preceding claims 1-13.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 13.
CN202110749081.5A 2021-07-02 2021-07-02 Data transmission method and device, electronic equipment and computer readable storage medium Active CN113190481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110749081.5A CN113190481B (en) 2021-07-02 2021-07-02 Data transmission method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110749081.5A CN113190481B (en) 2021-07-02 2021-07-02 Data transmission method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113190481A CN113190481A (en) 2021-07-30
CN113190481B true CN113190481B (en) 2021-10-29

Family

ID=76976962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110749081.5A Active CN113190481B (en) 2021-07-02 2021-07-02 Data transmission method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113190481B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114449045A (en) * 2021-12-29 2022-05-06 深圳达实智能股份有限公司 Internet of things edge gateway data caching method and device

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5819943A (en) * 1981-07-30 1983-02-05 Kokusai Electric Co Ltd Classification display device for time series information
CN105654383A (en) * 2016-01-07 2016-06-08 中国科学院信息工程研究所 Pipeline architecture-based low-latency FAST quotation decoding device and method
CN106296397A (en) * 2015-05-26 2017-01-04 南京艾科朗克信息科技有限公司 Forward quotations add speed system and accelerated method
CN108769141A (en) * 2018-05-09 2018-11-06 深圳市深弈科技有限公司 A kind of method of multi-source real-time deal market data receiver and merger processing
CN108768983A (en) * 2018-05-17 2018-11-06 上海金融期货信息技术有限公司 Mass network bursty data dissemination system based on FPGA
CN109413139A (en) * 2018-09-06 2019-03-01 高盈量化云科技(深圳)有限公司 A kind of distributed multi-channel market system
CN110278260A (en) * 2019-06-17 2019-09-24 武汉灯塔之光科技有限公司 A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data
CN111107165A (en) * 2019-12-30 2020-05-05 深圳市其乐游戏科技有限公司 Disconnection reconnection method, disconnection reconnection device and computer readable storage medium
CN111966486A (en) * 2020-07-01 2020-11-20 深圳华云信息系统有限公司 Data acquisition method, FPGA system and readable storage medium
CN111970092A (en) * 2020-08-12 2020-11-20 北京工业大学 Multi-protocol redundant network asynchronous communication method supporting reliability adjustment
CN112486888A (en) * 2020-12-11 2021-03-12 盛立金融软件开发(杭州)有限公司 Market data transmission method, device, equipment and medium
CN112532731A (en) * 2020-12-02 2021-03-19 上海英方软件股份有限公司 Automatic optimization method and device for multiple market data sources
CN112565430A (en) * 2020-12-08 2021-03-26 上证所信息网络有限公司 Low-delay reliable transmission method of multi-market data in wide area network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8036965B1 (en) * 2007-03-26 2011-10-11 Trading Technologies International, Inc. Distribution of electronic market data
CN112087470A (en) * 2020-09-27 2020-12-15 山东云海国创云计算装备产业创新中心有限公司 Market data transmission method and related device
CN112822256B (en) * 2020-12-31 2023-01-17 上海英方软件股份有限公司 Method and device for transmitting data stream of quotation file

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5819943A (en) * 1981-07-30 1983-02-05 Kokusai Electric Co Ltd Classification display device for time series information
CN106296397A (en) * 2015-05-26 2017-01-04 南京艾科朗克信息科技有限公司 Forward quotations add speed system and accelerated method
CN105654383A (en) * 2016-01-07 2016-06-08 中国科学院信息工程研究所 Pipeline architecture-based low-latency FAST quotation decoding device and method
CN108769141A (en) * 2018-05-09 2018-11-06 深圳市深弈科技有限公司 A kind of method of multi-source real-time deal market data receiver and merger processing
CN108768983A (en) * 2018-05-17 2018-11-06 上海金融期货信息技术有限公司 Mass network bursty data dissemination system based on FPGA
CN109413139A (en) * 2018-09-06 2019-03-01 高盈量化云科技(深圳)有限公司 A kind of distributed multi-channel market system
CN110278260A (en) * 2019-06-17 2019-09-24 武汉灯塔之光科技有限公司 A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data
CN111107165A (en) * 2019-12-30 2020-05-05 深圳市其乐游戏科技有限公司 Disconnection reconnection method, disconnection reconnection device and computer readable storage medium
CN111966486A (en) * 2020-07-01 2020-11-20 深圳华云信息系统有限公司 Data acquisition method, FPGA system and readable storage medium
CN111970092A (en) * 2020-08-12 2020-11-20 北京工业大学 Multi-protocol redundant network asynchronous communication method supporting reliability adjustment
CN112532731A (en) * 2020-12-02 2021-03-19 上海英方软件股份有限公司 Automatic optimization method and device for multiple market data sources
CN112565430A (en) * 2020-12-08 2021-03-26 上证所信息网络有限公司 Low-delay reliable transmission method of multi-market data in wide area network
CN112486888A (en) * 2020-12-11 2021-03-12 盛立金融软件开发(杭州)有限公司 Market data transmission method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Level_2证券行情数据分析系统的设计与实现;程磊;《中国优秀硕士学位论文全文数据库》;20090831;第6-8、38-39页 *

Also Published As

Publication number Publication date
CN113190481A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
US10868767B2 (en) Data transmission method and apparatus in optoelectronic hybrid network
CN108173938B (en) Server load distribution method and device
US10592298B2 (en) Method for distributing load in a multi-core system
CN113711551A (en) System and method for facilitating dynamic command management in a Network Interface Controller (NIC)
CN1910868B (en) Method and device for controlling alignment buffer
CN112492033A (en) File transmission method, system and computer readable storage medium
CN113190481B (en) Data transmission method and device, electronic equipment and computer readable storage medium
US20230283578A1 (en) Method for forwarding data packet, electronic device, and storage medium for the same
JP4786354B2 (en) iSCSI communication control method and storage system using the same
WO2020100581A1 (en) Evaluation device, evaluation method and evaluation program
WO2021197128A1 (en) Traffic rate-limiting method and apparatus
CN112433881A (en) Data recovery method and device for distributed storage system
US7870257B2 (en) Enhancing real-time performance for java application serving
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN115037700A (en) Complex network data packet transmission method, system, terminal and storage medium
JP2005115600A (en) Information processor and method
CN116233018A (en) Message processing method and device, electronic equipment and storage medium
US11546261B2 (en) Congestion control method and related device
WO2018023966A1 (en) Method and device for determining caching strategy
CN114490458B (en) Data transmission method, chip, server and storage medium
CN113297117B (en) Data transmission method, device, network system and storage medium
CN113992609B (en) Method and system for processing multilink service data disorder
CN114116583B (en) Serial communication method of double chips and system with double chips
CN115941615A (en) Data processing method, device, vehicle and storage medium
CN115576698A (en) Network card interrupt aggregation method, device, equipment and 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
CP03 Change of name, title or address

Address after: 9th Floor, Block A, Shenzhen National Engineering Laboratory Building, No. 20, Gaoxin South 7th Road, High-tech Zone Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Huayun Information System Technology Co.,Ltd.

Address before: No. 904, block a, national engineering laboratory building, Gaoxin South 7th road digital technology park, Yuehai street, Nanshan District, Shenzhen, Guangdong 518000

Patentee before: Shenzhen Huayun Information System Co.,Ltd.

CP03 Change of name, title or address