CN110278260A - A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data - Google Patents
A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data Download PDFInfo
- Publication number
- CN110278260A CN110278260A CN201910520995.7A CN201910520995A CN110278260A CN 110278260 A CN110278260 A CN 110278260A CN 201910520995 A CN201910520995 A CN 201910520995A CN 110278260 A CN110278260 A CN 110278260A
- Authority
- CN
- China
- Prior art keywords
- market
- data packet
- securities
- market data
- forwarding
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- 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/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47217—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- Signal Processing (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- General Business, Economics & Management (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computational Linguistics (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Software Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to technical field of data transmission, and in particular to a kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data, method include: to realize to log in respectively to the market source of different securities markets, and then extract multiple complete market data packets;The market data packet extracted is cached, and the market data packet extracted is transmitted to multiple client by the way of multichannel forwarding and is used;The market data packet that different securities markets extract is stored as local file according to unified format;Wherein, one index file of corresponding storage of each securities market each day of trade and a data file, index file store the corresponding data packet length of each market data packet, market time and initial position.The present invention makes the market data forwarding recorded broadcast generalization of different securities markets, and when the access of newly-increased securities market is greatly reduced, market forward the development and maintenance workload of recording and broadcasting system, ensure that the stability of forwarding recorded broadcast function.
Description
[technical field]
The present invention relates to technical field of data transmission, and in particular to a kind of forwarding recorded broadcast side of difference securities market data
Method, system and device.
[background technique]
The forwarding of securities market data is the indispensable function of quotation background system deployment, and recording playing function can be
Market system development, test provide convenience and indispensable pith.Due to different stock exchange quotation access sides
Formula is different, and market data protocol is different, therefore, in previous market forwarding recording and broadcasting system, generally divides different securities markets
Respectively realize that exchange's protocol analysis obtains market data (such as Shanghai and Shenzhen dbf, txt, fast, binary agreement, domestic futures ctp
Binary protocol, port stock in America OMD-C binary protocol etc.), then realize forwarding recorded broadcast function;In this case, Analytic Traveling
Feelings data procedures are extremely complex, and the implementation method of different securities markets and process are also different, can not be general.
As investment securities category is increasingly diversified, the securities market of market background system access is more and more, every access
One new markets, market forwarding recording and broadcasting system will be developed once again.Not only development cost is high for this mode, later maintenance
It is extremely inconvenient, therefore there is an urgent need to there is a kind of general, suitable for different securities markets market forwarding recording and broadcasting system, to reduce
Market recording and broadcasting system develops maintenance workload, and can guarantee recorded broadcast function-stable.
In consideration of it, overcoming defect present in the above-mentioned prior art is the art urgent problem to be solved.
[summary of the invention]
The technical problem to be solved in the invention is:
The market access way of different securities markets is different, in previous market forwarding recording and broadcasting system, different securities markets
It need to respectively realize that exchange's protocol analysis obtains market data, then realize forwarding recorded broadcast function, cause entirely to parse market data
Process is complicated, and different securities markets can not be general, and one new markets of every access, row will be developed once again, and not only be developed
At high cost, later maintenance is also inconvenient.
The present invention reaches above-mentioned purpose by following technical solution:
In a first aspect, the present invention provides a kind of forwarding recorded broadcast methods of different securities market datas, comprising:
The market source of different securities markets is realized respectively and is logged in, to extract multiple complete market data packets;Wherein,
Market data packet particular content is no longer parsed;
The market data packet extracted is cached, and is transmitted to the market data packet extracted by the way of multichannel forwarding
Multiple client uses;
The market data packet that different securities markets extract is stored as local file according to unified format;
Wherein, one index file of corresponding storage of each securities market each day of trade and a data file;The rope
Quotation part stores the corresponding data packet length of each market data packet, market time and initial position in the data file.
Preferably, in the index file, when the market time is with current machine when receiving market data packet
Between it is identical;Wherein, it when storing new market data packet every time, is stored by the way of additional write-in.
Preferably, described realize respectively to the market source of different securities markets logs in, to extract multiple complete market
Data packet, specifically:
It is separately connected the market gateway of different securities markets, and carries out login authentication, is pushed away to receive different securities markets
The data sent;
Complete data packet is extracted from the data flow that each securities market is sent, if data packet is heartbeat, is returned
Multiple heartbeat message;If data packet is market data packet, recording current machine time is the market time, and stores market data
Packet.
Preferably, local is stored as according to unified format in the market data packet for extracting different securities markets
After file, the method also includes:
According to parameter set by user, market data packet is navigated to from the index file and is played out;Wherein, institute
Stating parameter includes securities market, playback duration and the playback rate for needing to play back.
Preferably, described according to parameter set by user, market data packet is navigated to from the index file and is carried out
It plays, specifically includes:
User sets securities market, playback duration and the playback rate for needing to play back;
Corresponding index file is found according to securities market set by user and playback duration;
From corresponding index file, corresponding market packet content is played according to playback rate set by user.
It is preferably, described to play corresponding market packet content according to playback rate set by user, specifically:
Dummy row feelings system time is calculated according to system start-up time and playback rate set by user;
When the market time of the market data packet in manipulative indexing file being less than or equal to the dummy row feelings system time,
Corresponding market data packet reaches broadcast request, then plays in corresponding market data packet according to playback rate set by user
Hold;
When the market time of the market data packet in manipulative indexing file be greater than the dummy row feelings system time when, then after
It is continuous that the dummy row is waited to be with one's heart at the passage of system time, until reaching broadcast request, phase is played according to playback rate set by user
The market packet content answered.
Preferably, when current machine time is the t0 moment, tv=t0;When current machine time is the t1 moment, tv=t0+
(t1-t0)*r;
Wherein, tv is dummy row feelings system time, when t0 is that system start-up time or market packet content start to play
Machine time, r be playback rate set by user;
As market time th≤tv of the market data packet in manipulative indexing file, corresponding market data packet reaches
Broadcast request.
Second aspect, the present invention provides a kind of forwarding recording and broadcasting system of different securities market datas, including receiving module,
Data cache module, records module and playing module at forwarding module;
The receiving module setting is multiple, connects respectively from different securities markets, for the market to different securities markets
Source, which is realized, to be logged in, and then extracts multiple complete market data packets;
The data cache module is for caching the market data packet that the receiving module extracts, and by market data packet
Pass to the forwarding module and the recording module;
The forwarding module is used to for received market data packet to be transmitted to multiple client and use;
The market data packet for recording the different securities markets that module is used to receive is stored according to unified format
For local file;Wherein, one index file of corresponding storage of each securities market each day of trade and a data file, it is described
Index file stores the corresponding data packet length of each market data packet, market time and start bit in the data file
It sets;
The playing module is used to navigate to market data packet from the index file simultaneously according to parameter set by user
It plays out;Wherein, the parameter includes securities market, playback duration and the playback rate for needing to play back.
Preferably, at most only has a module starting in same time, the receiving module and the playing module;
Wherein, if system is forward mode, start the receiving module, and the playing module does not start;If system
For playback mode, then start the playing module, and the receiving module does not start.
The third aspect, the present invention provides a kind of forwarding recorded broadcast devices of different securities market datas, including at least one
Processor and memory are connected between at least one described processor and memory by data/address bus, the memory storage
There is the instruction that can be executed by least one described processor, described instruction by the processor after being executed, for completing first
The forwarding recorded broadcast method of different securities market datas described in aspect.
The beneficial effects of the present invention are:
In market data forwarding recorded broadcast method and system provided by the invention, the market data of different exchanges are carried out whole
Packet extracts, without parsing to market data particular content, using indexed mode to different market data according to unified format
Storage realizes a variety of securities market forwarding recorded broadcast processes and data storage to cast aside complicated different market resolution logic
Uniform format makes the market data forwarding recorded broadcast generalization of different securities markets, when the access of newly-increased securities market is greatly reduced,
Market forward the development and maintenance workload of recording and broadcasting system, and smaller due to changing, and ensure that the stability of forwarding recorded broadcast function.
[Detailed description of the invention]
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will make below to required in the embodiment of the present invention
Attached drawing is briefly described.It should be evident that drawings described below is only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 is a kind of forwarding recorded broadcast method flow diagram of different securities market datas provided in an embodiment of the present invention;
Fig. 2 is the system schematic that a kind of different quotation data forwardings provided in an embodiment of the present invention are recorded;
Fig. 3 is a kind of system schematic of different quotation data readbacks provided in an embodiment of the present invention;
Fig. 4 is the method flow diagram that a kind of different quotation data forwardings provided in an embodiment of the present invention are recorded;
Fig. 5 is a kind of method flow diagram of different quotation data readbacks provided in an embodiment of the present invention;
Fig. 6 is a kind of architecture diagram of the forwarding recorded broadcast device of different securities market datas provided in an embodiment of the present invention.
[specific embodiment]
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In addition, as long as technical characteristic involved in the various embodiments of the present invention described below is each other not
Constituting conflict can be combined with each other.Just with reference to drawings and examples, in conjunction with coming, the present invention will be described in detail below.
Embodiment 1:
The embodiment of the invention provides a kind of forwarding recorded broadcast methods of different securities market datas, can solve different security cities
The problem of field ticker, forwarding, unified formatted storage and playback, keep the market data forwarding recorded broadcast of different securities markets logical
With change.Wherein, it is the forwarding recorded broadcast for realizing market data, market access layer, market data buffer storage layer, market hair can be respectively set
Layer, data recording layer and data broadcast layer are sent, data receiver, data buffer storage, data forwarding, data recording and data are respectively corresponded
Playing flow.
As shown in Figure 1, market data forwarding recorded broadcast method provided in an embodiment of the present invention specifically includes:
Step 201, the market source of different securities markets is realized respectively and is logged in, and then extract multiple complete market numbers
According to packet.
The step is primarily to from acquired market data of trading.There are two types of the market data of current various securities markets
Presentation mode: one is document forms, directly generate local file (such as Shanghai Stock Exchange in real time by exchange's market gateway
Mktdt00.txt file), for this mode, market access layer directly scans local file, reads file content when having variation
And it compresses, then storing data;Another kind is data-stream form, this form more universal (such as Shanghai Stock Exchange step data, deep friendship
Institute step and binary data, country's futures ctp interface data), for this mode, market gateway need to be connected, is extracted complete
Data packet storage, it is specific as follows:
Firstly, being separately connected the market gateway of different securities markets using market access layer, and login authentication is carried out, verified
The data of different securities markets push ready to receive after success.Then, it is extracted from the data flow that each securities market is sent
Complete data packet replys heartbeat message if data packet is heartbeat;If data packet is market data packet, record is worked as
Preceding machine time is the market time, and stores market data packet.It is real herein for the market data of different exchange's different agreements
The whole packet of row extracts, without parsing to market data particular content, to cast aside complicated different market resolution logic, favorably
It is unified in a variety of securities markets forwarding recorded broadcast processes of realization and data memory format.
Step 202, the market data packet extracted, and the market data that will be extracted by the way of multichannel forwarding are cached
Packet is transmitted to multiple client use.
There are two worker thread in market data buffer storage layer, the market data that a worker thread is responsible for extract are delayed
It deposits to data packet queue;Another worker thread is then responsible for taking out market data from queue, and the data packet in caching is transmitted
Layer is sent to market, if user's setting needs to record market, which is also responsible for for data packet being transferred to data recording layer, holds
Row step 203.Wherein, after market transmission layer receives market data packet, market data packet can be transmitted to multiple client makes
With the step synchronous with the recording of step 203 can execute, non-interference.Here by forwarding capability is introduced, market data are realized
Multichannel forwarding, solve the problems, such as exchange's list account authorization and can not many places log in and use.
Step 203, the market data packet that different securities markets extract is stored as local file according to unified format.
After data recording layer receives market data packet, point different securities market is by day of trade timing storage market data
Packet, each securities market can establish a file.Wherein, one index text of corresponding storage of each securities market each day of trade
Part and a data file (such as xxxx.ind, xxxx.dat), to facilitate subsequent positioning to read;It is stored in the index file every
The corresponding data packet length of a market data packet, market time and initial position in the data file.In this way, solve
The problem of different security market conditions data unify formatted storage.
Further, since market are present quotation, the market time in index file be can consider and current system machine
The device time is identical, therefore this place market time is replaced with current machine time, avoids parsing complicated market data protocol acquisition row
The feelings time.Wherein, it when storing new market data packet every time, is stored by the way of additional write-in.It stores herein all
It is exchange's raw data packets, no data loss facilitates the later period to carry out depth analysis or data mining.
By step 201- step 203, it can be achieved that the forwarding and recording of different securities market datas, are while realizing difference
Quotation play back (market broadcasting), continue to refer to figure 1, the market data packet for extracting different securities markets according to
Unified format is stored as after local file, i.e., after step 203, the method also includes:
Step 204, according to parameter set by user, market data packet is navigated to from the index file and is broadcast
It puts.
It is literary comprising data packet length, market time and in data in index due to use indexed mode storing data packet
Initial position in part, therefore can realize quick positioning playback function.Wherein, the parameter includes the security city for needing to play back
Field, playback duration and playback rate.Specific implementation process is as follows: firstly, after system start-up, user sets the card for needing to play back
Certificate market, playback duration and playback rate;Then, data playback layer is looked for according to securities market set by user and playback duration
To the index file of corresponding storage market data packet;Finally, from corresponding index file, according to playback speed set by user
Rate plays corresponding market packet content.
Playing process herein refers specifically to: data playback layer, will be in market data packet according to playback rate set by user
Hold and read to market data buffer storage layer, one of worker thread is by the market data buffer storage read to data packet team at this time
Column, another worker thread, which then reads market data from queue and is transferred to market, sends layer, and then sending layer by market will
Market data packet is transmitted to multiple client, and so far market data playback finishes.Market playback is added herein, when being convenient for nontransaction
Duan Kaifa or Bug reappears, repairs verifying work.
In conjunction with step 201- step 204 it is found that a new markets market forward recorded broadcast function if realizing, need to only realize again
Market source logs in and data packet extracts part (i.e. data receiver), and forward, records and playing flow is all generally applicable, therefore change
It is smaller.
In above-mentioned market data forwarding recorded broadcast method provided by the invention, whole packet is carried out to the market data of different exchanges
It extracts, without being parsed to market data particular content, different market data is deposited according to unified format using indexed mode
Storage realizes a variety of securities market forwarding recorded broadcast processes and data storage lattice to cast aside complicated different market resolution logic
Formula is unified, makes the market data forwarding recorded broadcast generalization of different securities markets, when the access of newly-increased securities market is greatly reduced, row
Feelings forward the development and maintenance workload of recording and broadcasting system, ensure that the stability of forwarding recorded broadcast function.
It should be noted that playing flow and reception process can not start simultaneously: if system is forward mode, starting
Data receiver, data buffer storage, data forwarding and data recording process close data playback process;In other words, starting market access
When layer, data playback layer does not start.If system is playback mode, log-on data caching, data forwarding and data playing flow,
Close data receiver process;In other words, when log-on data broadcast layer, data receiver layer does not start.
Further, due to market data packet in trading session and non-homogeneous publication, for example, in some time bracket
Interior, if it is active to strike a bargain, market data packet number is more;If transaction is lonely, market data packet is few or does not have.This spy
Property it is different from video frame rate (frame number each second) fixed characteristic, therefore playback method is also different.It therefore, is solution market number
The problem of controlling according to variable playback, realization market are broadcast fastly or slow multicast function, introduce the concept of dummy row feelings system time herein.Then
It is described to play corresponding market packet content according to playback rate set by user, specifically:
Dummy row feelings system time is calculated according to system start-up time and playback rate set by user;Work as manipulative indexing
When the market time of market data packet in file is less than or equal to the dummy row feelings system time, illustrate corresponding market data
Packet reaches broadcast request, then plays corresponding market packet content according to playback rate set by user;When manipulative indexing text
When the market time of market data packet in part is greater than the dummy row feelings system time, then continues waiting for the dummy row and be with one's heart at
The passage of system time plays corresponding market packet content according still further to playback rate set by user until reaching broadcast request.
Wherein, the concept explanation of the dummy row feelings system time is specific as follows:
Dummy row feelings system time is indicated with tv, indicates that system start-up time or market packet content start to play with t0
When machine time, playback rate set by user is indicated with r.It is then described according to system start-up time and playback set by user
Speedometer calculates dummy row feelings system time, specifically: when current machine time is the t0 moment, tv=t0;Current machine time
When for the t1 moment, tv=t0+ (t1-t0) * r.Assuming that the market time of the market data packet in current manipulative indexing file is th,
Then as th≤tv, corresponding market data packet reaches broadcast request;Otherwise, dummy row need to be continued waiting for and is with one's heart at system time flow
It dies, until th > tv, reaches broadcast request, and then solves the problems, such as that market data variable playback controls.
In conclusion forwarding recorded broadcast method provided in an embodiment of the present invention has the advantage that
It solves the problems, such as different security market conditions receptions, forwarding, unified formatted storage and playback, makes different security cities
Field market forward recorded broadcast generalization, when there is the access of newly-increased market, need to only realize that market source logs in and data packet extraction unit again
Point, other forwarding, storage, playing flow it is general, reduce market forwarding recording and broadcasting system development and maintenance workload, and due to
Change smaller, the stability of guarantee forwarding recorded broadcast function;
Wherein, it carries out whole packet for the market data of different exchange's different agreements to extract, without specific to market data
Content is parsed, to cast aside complicated different market resolution logic, is advantageously implemented a variety of securities market forwarding recorded broadcast streams
Journey and data memory format are unified;Forwarding capability is introduced, the multichannel forwarding of market data is realized, solves exchange's list account and award
Power and can not many places log in use the problem of;Storage is exchange's raw data packets, and no data loss facilitates the later period to carry out deep
Degree analysis or data mining;Using indexed mode storing data packet, comprising data packet length, market time and in number in index
According to the initial position in file, it can be achieved that quick positioning playback function;It introduces dummy row and is with one's heart at system concept of time, market can be solved
The problem of data variable playback controls, realization market are broadcast fastly or slow multicast function.
Embodiment 2:
On the basis of embodiment 1, the embodiment of the invention provides a kind of forwarding recorded broadcast systems of different securities market datas
System can be used for completing the forwarding recorded broadcast method of different securities market datas described in embodiment 1, make the market of different securities markets
Data forwarding recorded broadcast generalization.
As shown in Figures 2 and 3, forwarding recording and broadcasting system provided in an embodiment of the present invention includes receiving module, data buffer storage mould
Block, records module and playing module at forwarding module;Wherein, it for the processing of the market data of different securities markets, only receives
Module is different, and other each modules are general.It is specific as follows:
The receiving module is mainly responsible for from acquired market data of trading, and receiving module setting is multiple, respectively with difference
Securities market connection, realizes for the market source to different securities markets and logs in, and then extract multiple complete market data
Packet.By taking Fig. 2 as an example, the receiving module setting is N number of, is connected respectively Shanghai Stock Exchange, Shen Zhen Stock Exchange, DengNGe exchange, Hong Kong Stock Exchange,
To obtain the market data of each exchange.There are two types of presentation modes for the market data of current various securities markets: one is
Document form directly generates local file (such as Shanghai Stock Exchange mktdt00.txt file) in real time by exchange's market gateway, for this
Kind mode, the receiving module directly scan local market file, have and read file content when variation and compress, are then stored in
Data cache module;Another kind is data-stream form, this form more universal (such as Shanghai Stock Exchange step data, Shen Zhen Stock Exchange step
With binary data, country's futures ctp interface data), for this mode, the receiving module need to connect market gateway, complete
At login authentication, when receiving market data, complete data packet storage is extracted to data cache module.
The data cache module (Cache) will be gone for caching the market data packet that the receiving module extracts
Feelings data packet passes to the forwarding module and the recording module.Wherein, there are two active lines in the data cache module
Journey, a worker thread are responsible for the market data buffer storage that will be extracted to data packet queue;Another worker thread then be responsible for from
Market data are taken out in queue, the data packet in caching is passed into the forwarding module one by one, if user's setting needs to record
Data packet is then transferred to the recording module simultaneously and stored by market.
The forwarding module is used to for received market data packet to be transmitted to multiple client and use, i.e. institute in Fig. 2 and Fig. 3
Client1, Client2 for showing ..., ClientN.Wherein, the forwarding module is switched on one for each independent securities market
A tcp/ip listening port is connected with management client with being responsible for receiving, and the data cache module is corresponded to securities market
Data be sent to all clients connected.
The market data packet for recording the different securities markets that module is used to receive is stored according to unified format
For local file.Wherein, one index file of corresponding storage of each securities market each day of trade and a data file, with side
Continue positioning after an action of the bowels to read;The index file store the corresponding data packet length of each market data packet, the market time and
Initial position in data file, to realize quick positioning playback function.
The playing module is used to navigate to market data packet from the index file simultaneously according to parameter set by user
It plays out.Wherein, the parameter includes securities market, playback duration and the playback rate for needing to play back, the playing module
Corresponding index file is found according to securities market set by user and playback duration, then according to playback rate set by user
By market reading data to the data cache module, market data packet is finally transmitted to multiple clients by the forwarding module
End, market data playback finish.
It should be noted that the playing module and the receiving module can not start simultaneously, that is, in the same time,
At most only has a module starting in the receiving module and the playing module.If system be forward mode, starting described in
Receiving module, and the playing module does not start, corresponding workflow can refer to Fig. 2;If system is playback mode, start
The playing module, and the receiving module does not start, corresponding workflow can refer to Fig. 3.
In forwarding recording and broadcasting system provided in an embodiment of the present invention, processing for the market data of different securities markets, only
Have that receiving module is different, and other each modules are general, solves that different security market conditions receive, forwarding, unified format are deposited
The problem of storage and playback, makes different security market conditions forwarding recorded broadcast generalizations, reduces the exploitation of market forwarding recording and broadcasting system
With maintenance workload, and due to change it is smaller, guarantee forwarding recorded broadcast function stability.
Embodiment 3:
By embodiment 1 and embodiment 2 it is found that during the forwarding recorded broadcast of market data, playing flow and reception process
It can not carry out simultaneously, i.e., the described playing module and the receiving module cannot start simultaneously.In embodiment 1 and embodiment 2
On the basis of, the embodiment of the present invention provides a kind of forwarding of different security market conditions data for not starting playing flow
Method for recording, with specific reference to Fig. 2 and Fig. 4, comprising the following steps:
Step 301, start quotation forwarding recording and broadcasting system as described in example 2.
Step 302, each module of initialization forwarding recording and broadcasting system, sets each securities market link address;It is arranged simultaneously
System operating mode is forward mode, and is arranged and whether records market and recorded file archive path.
Step 303, start receiving module, data cache module, record module and forwarding module.
Step 304, each receiving module receives the data of corresponding securities market.By taking Shen Zhen Stock Exchange's ticker as an example, handing over
The easy period, after certain receiving module connects Shen Zhen Stock Exchange's market gateway and successful log verifying, it will persistently receive Shen Zhen Stock Exchange and pushed
The data come.Other securities market logics are similar, and details are not described herein.
Step 305, each receiving module extracts market data packet from the data received, finally can be obtained multiple complete
Market data packet.Still by taking Shen Zhen Stock Exchange's market as an example, a complete data packet is extracted from the data flow that Shen Zhen Stock Exchange is sent, such as
Fruit data packet is heartbeat, then replys heartbeat message, if data packet is market data packet, recording current machine time is market
Time, to carry out data storage.
Step 306, the market data packet extracted is stored into the data cache module.In the data cache module
There are two worker threads, and one of thread has a data packet queue, for storing market data packet;Another worker thread
Then it is responsible for taking out market data packet from queue, the data packet in caching is transferred to the forwarding module and records module.
Step 307, judge whether to need to record market;If it is not required, then not handling, if it is desired, the then data
Market data packet is transferred to the recording module by cache module, executes step 308.
Step 308, market data packet is stored as local file according to unified format by the recording module.Specifically divide market
And date storage, each securities market build a file, each securities market each day of trade corresponding one index text of storage
Part and a data file;Index file store the length of each data packet, the market time and in the data file rise
Beginning position stores additional write-in when new data packet every time.
Step 309, while the recording module carries out market recording, the forwarding module will send market data packet to
All clients connected use.
Step 310, this step indicates that a data packet is disposed to this, comes back to step 304 later and is followed
Ring starts the process flow of next data packet.
By the above method, solves the problems, such as different security market conditions receptions, forwarding and unified formatted storage, make
Generalization is recorded in different security market conditions forwardings.
Embodiment 4:
On the basis of embodiment 3 embodiment 1-, the embodiment of the present invention provides one kind for not starting and receive process
The back method of different security market conditions data, with specific reference to Fig. 3 and Fig. 5, comprising the following steps:
Step 401, start quotation forwarding recording and broadcasting system as described in example 2.
Step 402, each module of initialization forwarding recording and broadcasting system, setting system operating mode is playback mode, and is set
The parameters such as the securities market, playback duration and the playback rate that need to play back.
Step 403, log-on data cache module, forwarding module and playing module, and record the starting time.
Step 404, the playing module finds the history file of corresponding market and time, reads index file content,
The market time, which is played, according to starting set by user finds in index file the starting that first market time is more than or equal to setting
Play the index of market time.
Step 405, it is indicated according to index file, reads the packet content of an index indicating length every time.
Step 406, judge whether current data packet meets playing condition.System is calculated according to starting time and playback rate
Dummy row feelings system time out is less than or equal to dummy row feelings system time when the data packet market time that the playing module is read
When, corresponding data packet meets playing condition, thens follow the steps 407;Otherwise continue to re-execute the steps 405.
Step 407, the market data packet for meeting playing condition is stored to the data cache module.Specifically, described
Playing module reads the market data packet for meeting playing condition to the data buffer storage mould according to playback rate set by user
In block, market data packet is stored in the data packet queue of the data cache module, and by another thread from queue
Market data packet is taken out, the forwarding module is then passed to.
Step 408, received market data packet is sent to all clients connected and used by the forwarding module.
Step 409, so far, a data packet playback finishes, and then branches to step 405 and carries out loop play, until text
Part finishes, and playback terminates.
By the above method, make different security market conditions playback forwarding generalizations, convenient for the exploitation of nontransaction period or
Bug reappears, repairs verifying work.
Embodiment 5:
On the basis of the forwarding recorded broadcast method for the different securities market datas that above-described embodiment 1 provides, the present invention is also mentioned
A kind of forwarding recorded broadcast device of different securities market datas that can be used for realizing the above method is supplied, as shown in fig. 6, being the present invention
The device architecture schematic diagram of embodiment.The forwarding recorded broadcast device of the different securities market datas of the present embodiment includes one or more
Processor 21 and memory 22.Wherein, in Fig. 6 by taking a processor 21 as an example.
The processor 21 can be connected with the memory 22 by bus or other modes, by total in Fig. 6
For line connection.
The memory 22 is readable as a kind of forwarding recorded broadcast method non-volatile computer of different securities market datas
Storage medium can be used for storing non-volatile software program, non-volatile computer executable program and module, such as embodiment
The forwarding recorded broadcast method of different securities market datas in 1.The processor 21 is stored in the memory 22 by operation
Non-volatile software program, instruction and module, thereby executing different securities market datas forwarding recorded broadcast device it is various
Functional application and data processing, i.e. the forwarding recorded broadcast method of the different securities market datas of realization embodiment 1 and embodiment 2.
The memory 22 may include high-speed random access memory, can also include nonvolatile memory, such as
At least one disk memory, flush memory device or other non-volatile solid state memory parts.In some embodiments, described
Optional memory 22 includes the memory remotely located relative to the processor 21, these remote memories can pass through network
It is connected to the processor 21.The example of above-mentioned network includes but is not limited to internet, intranet, local area network, moves and lead to
Letter net and combinations thereof.
Described program instruction/module is stored in the memory 22, is held when by one or more of processors 21
When row, the forwarding recorded broadcast method of the different securities market datas in above-described embodiment 1 is executed, for example, executing figure described above
1, Fig. 4 and each step shown in fig. 5.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of embodiment is can to lead to
Program is crossed to instruct relevant hardware and complete, which can be stored in a computer readable storage medium, storage medium
May include: read-only memory (ROM, ReadOnlyMemory), random access memory (RAM,
RandomAccessMemory), disk or CD etc..
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.
Claims (10)
1. a kind of forwarding recorded broadcast method of difference securities market data characterized by comprising
The market source of different securities markets is realized respectively and is logged in, to extract multiple complete market data packets;
The market data packet extracted is cached, and is transmitted to the market data packet extracted by the way of being forwarded using multichannel multiple
Client uses;
The market data packet that different securities markets extract is stored as local file according to unified format;
Wherein, one index file of corresponding storage of each securities market each day of trade and a data file;The index text
Part stores the corresponding data packet length of each market data packet, market time and initial position in the data file.
2. the forwarding recorded broadcast method of difference securities market data according to claim 1, which is characterized in that in the index
In file, the market time is identical as current machine time when receiving market data packet;Wherein, new row is stored every time
When feelings data packet, stored by the way of additional write-in.
3. the forwarding recorded broadcast method of difference securities market data according to claim 1, which is characterized in that described right respectively
The market source of different securities markets, which is realized, to be logged in, to extract multiple complete market data packets, specifically:
It is separately connected the market gateway of different securities markets, and carries out login authentication, to receive different securities market push
Data;
Complete data packet is extracted from the data flow that each securities market is sent, if data packet is heartbeat, replys the heart
Hop-information;If data packet is market data packet, recording current machine time is the market time, and stores market data packet.
4. it is according to claim 1 difference securities market data forwarding recorded broadcast method, which is characterized in that it is described will not
After being stored as local file according to unified format with the market data packet that securities market extracts, the method also includes:
According to parameter set by user, market data packet is navigated to from the index file and is played out;Wherein, the ginseng
Number includes securities market, playback duration and the playback rate for needing to play back.
5. it is according to claim 4 difference securities market data forwarding recorded broadcast method, which is characterized in that it is described according to
The parameter of family setting, navigates to market data packet and is played out from the index file, specifically included:
User sets securities market, playback duration and the playback rate for needing to play back;
Corresponding index file is found according to securities market set by user and playback duration;
From corresponding index file, corresponding market packet content is played according to playback rate set by user.
6. it is according to claim 5 difference securities market data forwarding recorded broadcast method, which is characterized in that it is described according to
The playback rate of family setting plays corresponding market packet content, specifically:
Dummy row feelings system time is calculated according to system start-up time and playback rate set by user;
When the market time of the market data packet in manipulative indexing file being less than or equal to the dummy row feelings system time, accordingly
Market data packet reach broadcast request, then play corresponding market packet content according to playback rate set by user;
When the market time of the market data packet in manipulative indexing file being greater than the dummy row feelings system time, then continue
It is with one's heart at the passage of system time to the dummy row, until reaching broadcast request, is played according to playback rate set by user corresponding
Market packet content.
7. the forwarding recorded broadcast method of difference securities market data according to claim 6, which is characterized in that when current machine
Between be the t0 moment when, tv=t0;When current machine time is the t1 moment, tv=t0+ (t1-t0) * r;
Wherein, tv is dummy row feelings system time, and t0 starts machine when playing for system start-up time or market packet content
Device time, r are playback rate set by user;
As market time th≤tv of the market data packet in manipulative indexing file, corresponding market data packet reaches broadcasting
It is required that.
8. a kind of forwarding recording and broadcasting system of difference securities market data, which is characterized in that including receiving module, data buffer storage mould
Block, records module and playing module at forwarding module;
The receiving module setting is multiple, connects respectively from different securities markets, real for the market source to different securities markets
It now logs in, and then extracts multiple complete market data packets;
The data cache module transmits market data packet for caching the market data packet that the receiving module extracts
To the forwarding module and the recording module;
The forwarding module is used to for received market data packet to be transmitted to multiple client and use;
The market data packet for recording the different securities markets that module is used to receive is stored as this according to unified format
Ground file;Wherein, one index file of corresponding storage of each securities market each day of trade and a data file, the index
File stores the corresponding data packet length of each market data packet, market time and initial position in the data file;
The playing module is used to navigate to market data packet from the index file according to parameter set by user and carry out
It plays;Wherein, the parameter includes securities market, playback duration and the playback rate for needing to play back.
9. the forwarding recording and broadcasting system of difference securities market data according to claim 8, which is characterized in that in same a period of time
Between, at most only have a module starting in the receiving module and the playing module;
Wherein, if system is forward mode, start the receiving module, and the playing module does not start;If system is back
Mode playback then starts the playing module, and the receiving module does not start.
10. a kind of forwarding recorded broadcast device of difference securities market data, which is characterized in that including at least one processor and storage
Device, between at least one described processor and memory by data/address bus connect, the memory be stored with can by it is described extremely
The instruction that a few processor executes, described instruction by the processor after being executed, for completing any institute of claim 1-7
The forwarding recorded broadcast method for the different securities market datas stated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910520995.7A CN110278260A (en) | 2019-06-17 | 2019-06-17 | A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910520995.7A CN110278260A (en) | 2019-06-17 | 2019-06-17 | A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110278260A true CN110278260A (en) | 2019-09-24 |
Family
ID=67960885
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910520995.7A Pending CN110278260A (en) | 2019-06-17 | 2019-06-17 | A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110278260A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104594A (en) * | 2019-12-12 | 2020-05-05 | 上海金纳信息科技有限公司 | Market quotation pushing method and device |
CN111552622A (en) * | 2020-04-30 | 2020-08-18 | 上海英方软件股份有限公司 | Playback device and method of market data |
CN112132681A (en) * | 2020-07-02 | 2020-12-25 | 上海金融期货信息技术有限公司 | Market source unified access system |
CN112131161A (en) * | 2020-09-14 | 2020-12-25 | 山东产研集成电路产业研究院有限公司 | Hardware analysis method for Binary protocol data stream |
CN112967142A (en) * | 2021-03-31 | 2021-06-15 | 上海英方软件股份有限公司 | Method and device for forwarding market information stream |
CN113064884A (en) * | 2020-12-02 | 2021-07-02 | 上海金融期货信息技术有限公司 | Dual-source market repetition removing method and system based on user-defined hash |
CN113190481A (en) * | 2021-07-02 | 2021-07-30 | 深圳华云信息系统有限公司 | Data transmission method and device, electronic equipment and computer readable storage medium |
CN116455997A (en) * | 2023-06-12 | 2023-07-18 | 深圳华锐分布式技术股份有限公司 | STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium |
CN117827740A (en) * | 2024-03-05 | 2024-04-05 | 上海特高信息技术有限公司 | Modularized market data playback method and system based on FPGA |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070203720A1 (en) * | 2006-02-24 | 2007-08-30 | Amardeep Singh | Computing a group of related companies for financial information systems |
CN101267281A (en) * | 2008-04-25 | 2008-09-17 | 北京中企开源信息技术有限公司 | A transmission method and system for securities market data |
CN103455636A (en) * | 2013-09-27 | 2013-12-18 | 浪潮齐鲁软件产业有限公司 | Automatic capturing and intelligent analyzing method based on Internet tax data |
CN106294486A (en) * | 2015-06-04 | 2017-01-04 | 交通银行股份有限公司 | The processing method of finance market data and system |
CN106446085A (en) * | 2016-09-09 | 2017-02-22 | 北京高地信息技术有限公司 | Big data management system |
CN106776837A (en) * | 2016-11-25 | 2017-05-31 | 国云科技股份有限公司 | A kind of method of the security real-time deal association analysis based on MongoDB |
CN106920166A (en) * | 2017-02-13 | 2017-07-04 | 深圳市蛟龙出海科技有限公司 | The whole valency of power again of stock is calculated and K line record location method and systems |
CN108769141A (en) * | 2018-05-09 | 2018-11-06 | 深圳市深弈科技有限公司 | A kind of method of multi-source real-time deal market data receiver and merger processing |
CN109274747A (en) * | 2018-09-29 | 2019-01-25 | 上海中畅信息科技有限公司 | Market gateway system and its processing method |
CN109472695A (en) * | 2018-09-07 | 2019-03-15 | 珠海凡泰极客科技有限责任公司 | A kind of security multi-protocols transaction gateway system |
-
2019
- 2019-06-17 CN CN201910520995.7A patent/CN110278260A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070203720A1 (en) * | 2006-02-24 | 2007-08-30 | Amardeep Singh | Computing a group of related companies for financial information systems |
CN101267281A (en) * | 2008-04-25 | 2008-09-17 | 北京中企开源信息技术有限公司 | A transmission method and system for securities market data |
CN103455636A (en) * | 2013-09-27 | 2013-12-18 | 浪潮齐鲁软件产业有限公司 | Automatic capturing and intelligent analyzing method based on Internet tax data |
CN106294486A (en) * | 2015-06-04 | 2017-01-04 | 交通银行股份有限公司 | The processing method of finance market data and system |
CN106446085A (en) * | 2016-09-09 | 2017-02-22 | 北京高地信息技术有限公司 | Big data management system |
CN106776837A (en) * | 2016-11-25 | 2017-05-31 | 国云科技股份有限公司 | A kind of method of the security real-time deal association analysis based on MongoDB |
CN106920166A (en) * | 2017-02-13 | 2017-07-04 | 深圳市蛟龙出海科技有限公司 | The whole valency of power again of stock is calculated and K line record location method and systems |
CN108769141A (en) * | 2018-05-09 | 2018-11-06 | 深圳市深弈科技有限公司 | A kind of method of multi-source real-time deal market data receiver and merger processing |
CN109472695A (en) * | 2018-09-07 | 2019-03-15 | 珠海凡泰极客科技有限责任公司 | A kind of security multi-protocols transaction gateway system |
CN109274747A (en) * | 2018-09-29 | 2019-01-25 | 上海中畅信息科技有限公司 | Market gateway system and its processing method |
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111104594A (en) * | 2019-12-12 | 2020-05-05 | 上海金纳信息科技有限公司 | Market quotation pushing method and device |
CN111552622A (en) * | 2020-04-30 | 2020-08-18 | 上海英方软件股份有限公司 | Playback device and method of market data |
CN111552622B (en) * | 2020-04-30 | 2023-11-07 | 上海英方软件股份有限公司 | Playback device and method for quotation data |
CN112132681A (en) * | 2020-07-02 | 2020-12-25 | 上海金融期货信息技术有限公司 | Market source unified access system |
CN112132681B (en) * | 2020-07-02 | 2024-03-26 | 上海金融期货信息技术有限公司 | Unified access system for quotation sources |
CN112131161B (en) * | 2020-09-14 | 2022-03-29 | 山东产研集成电路产业研究院有限公司 | Hardware analysis method for Binary protocol data stream |
CN112131161A (en) * | 2020-09-14 | 2020-12-25 | 山东产研集成电路产业研究院有限公司 | Hardware analysis method for Binary protocol data stream |
CN113064884A (en) * | 2020-12-02 | 2021-07-02 | 上海金融期货信息技术有限公司 | Dual-source market repetition removing method and system based on user-defined hash |
CN113064884B (en) * | 2020-12-02 | 2023-09-05 | 上海金融期货信息技术有限公司 | Double-source quotation duplication removing method and system based on custom hash |
CN112967142A (en) * | 2021-03-31 | 2021-06-15 | 上海英方软件股份有限公司 | Method and device for forwarding market information stream |
CN113190481A (en) * | 2021-07-02 | 2021-07-30 | 深圳华云信息系统有限公司 | Data transmission method and device, electronic equipment and computer readable storage medium |
CN113190481B (en) * | 2021-07-02 | 2021-10-29 | 深圳华云信息系统有限公司 | Data transmission method and device, electronic equipment and computer readable storage medium |
CN116455997A (en) * | 2023-06-12 | 2023-07-18 | 深圳华锐分布式技术股份有限公司 | STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium |
CN116455997B (en) * | 2023-06-12 | 2023-08-22 | 深圳华锐分布式技术股份有限公司 | STEP market multipath forwarding method, STEP market multipath forwarding device, STEP market multipath forwarding equipment and STEP market multipath forwarding medium |
CN117827740A (en) * | 2024-03-05 | 2024-04-05 | 上海特高信息技术有限公司 | Modularized market data playback method and system based on FPGA |
CN117827740B (en) * | 2024-03-05 | 2024-05-14 | 上海特高信息技术有限公司 | Modularized market data playback method and system based on FPGA |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110278260A (en) | A kind of forwarding recorded broadcast mthods, systems and devices of difference securities market data | |
WO2023024834A1 (en) | Game data processing method and apparatus, and storage medium | |
CN108848060B (en) | Multimedia file processing method, processing system and computer readable storage medium | |
US10922127B2 (en) | Transactional messaging support in connected messaging networks | |
US7240121B2 (en) | Content providing apparatus and content providing method | |
US7426192B2 (en) | Network conference system, conference server, record server, and conference terminal | |
US9203734B2 (en) | Optimized bi-directional communication in an information centric network | |
EP2383941B1 (en) | Client terminal, method and system for downloading streaming media | |
EP2457349B1 (en) | Method and device for a light host management protocol on multicast capable router | |
US20160044368A1 (en) | Method, apparatus and system for acquiring playback data stream of real-time video communication | |
CN104936004B (en) | Video recording method and device | |
CN102547239A (en) | Android mobile terminal-based video monitoring system | |
WO2019056203A1 (en) | Low-delay audio and video transmission method, device and computer readable storage medium | |
CN107612982B (en) | A kind of method, storage medium, equipment and system reducing function pages request number of times | |
CN112118266A (en) | Distributed state synchronization method based on cooperation of HTTP and WebSocket | |
CN109274747A (en) | Market gateway system and its processing method | |
CN103108008A (en) | Method of downloading files and file downloading system | |
CN111209467A (en) | Data real-time query system under multi-concurrency multi-channel environment | |
US6704790B1 (en) | Server-side stream switching | |
CN112333475A (en) | Processing method and processing system of streaming media data and storage server | |
CN105208004A (en) | Data input method based on OBD equipment | |
CN100446567C (en) | Apparatus and method for realizing P2P stream broadcasting in information family appliances | |
CN102655510A (en) | Application layer multicast system on basis of p-tractert source path discovery technology | |
CN115297095B (en) | Back source processing method, device, computing equipment and storage medium | |
CN102739701B (en) | Media Stream access control method and reciprocity stream media system |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190924 |