CN109872138A - A kind of method, apparatus and storage medium of digital cash transaction - Google Patents
A kind of method, apparatus and storage medium of digital cash transaction Download PDFInfo
- Publication number
- CN109872138A CN109872138A CN201910129165.1A CN201910129165A CN109872138A CN 109872138 A CN109872138 A CN 109872138A CN 201910129165 A CN201910129165 A CN 201910129165A CN 109872138 A CN109872138 A CN 109872138A
- Authority
- CN
- China
- Prior art keywords
- transaction
- interface
- digital cash
- wss
- coin
- 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
- 238000000034 method Methods 0.000 title claims abstract description 36
- 230000002159 abnormal effect Effects 0.000 claims abstract description 67
- 230000007246 mechanism Effects 0.000 claims abstract description 33
- 230000001960 triggered effect Effects 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims description 25
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 5
- 230000004044 response Effects 0.000 abstract description 5
- 238000004590 computer program Methods 0.000 description 13
- 230000006870 function Effects 0.000 description 12
- 238000013461 design Methods 0.000 description 8
- 238000009434 installation Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 239000008186 active pharmaceutical agent Substances 0.000 description 4
- 125000001033 ether group Chemical group 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000009356 qixian Substances 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 230000002269 spontaneous effect Effects 0.000 description 1
Landscapes
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The present invention provides the method, apparatus and storage medium of a kind of transaction of digital cash, this method comprises: when transaction system normal operation, it calls wss interface to obtain market data and transation report-back, and rest interface is called to be placed an order, remove list and account inquiries;When the market data and order status traded according to digital cash determine that digital cash transaction is abnormal, abnormal mechanism is triggered using event, this digital cash transaction being abnormal is handled using wss interface or rest interface by policy selection;The coin of each digital cash of internal system is uniquely determined to by tri- parts symbol+market+type, such as: it can be identified respectively with ethbtc_huobi_coin and ethbtc_huobi_coin in system, btc is in okex when week and next week contract, btc_okex_thiswee can be used in system respectively, btc_okex_nextweek is identified, it carries out cross-market with can be convenient in this way, shows spread strategy exploitation and transaction across phase and various phases.By using this programme, it is capable of handling Network Abnormal, improves transaction system signal response speed and accuracy.
Description
Technical field
The method, apparatus and storage medium traded the present invention relates to stock exchange field more particularly to a kind of digital cash.
Background technique
The function of digital cash quantization transaction system concentrates on data collection module and returns to survey in module.And quantify transaction
Demand constantly rises, and digital cash is not mature enough as emerging Object of Transaction, market;And digital number moneytary operations
Irregular, the ununified transaction interface of institute.1token.trade transaction system and botvs transaction system are used at present.Its
In, the integrated API of multiple exchange's data is obtained using 1token.trade transaction system, by API acquisition data, still
The API only has data acquisition function, without trading function, acts on relatively simple.In addition, needing to pass through when obtaining data
The server of 1token.trade oneself could obtain data, therefore, in delay present on data acquisition, be unfavorable for high-frequency
Transaction.Although botvs transaction system copes with the scene of Network Abnormal, when Network Abnormal, it is only limitted to continue to make
It attempts to connect with single face, becomes uncontrollable so as to cause the stateful transaction during Network Abnormal.
It can be seen that the stability of the transaction system in current mechanism is lower, it is easy connection exchange's sales counter broken string
Abnormal phenomenon is unfavorable for the development of entire digital cash trade market.
Summary of the invention
The embodiment of the invention provides the method, apparatus and storage medium of a kind of transaction of digital cash, are used for digital cash
Transaction, the stability for being able to solve transaction system in current mechanism is lower, and the exception for being easy connection exchange's sales counter broken string is existing
As the problem of being unfavorable for the development of entire digital cash trade market.
In a first aspect, the present invention provides a kind of methods of digital cash transaction, which comprises
When transaction system operates normally, wss interface is called to obtain market data and transation report-back, and rest is called to connect
Mouth is placed an order, removes list and account inquiries;
When the wss described in the transaction system operational process or rest interface calling are abnormal, event is used
Triggering abnormal mechanism in Selection and call wss interface or calls rest interface to handle this digital cash being abnormal by strategy
Transaction;Inside the transaction system coin of each digital cash to by tri- parts symbol+market+type uniquely determine Lai
Facilitate various cross-markets, across phase, the demand of He Qixian spread strategy transaction.
When the type of transaction of digital cash transaction is stock, symbol+market+coin is used, wherein subscribe to
Target is ether mill currency, and when fiery coin and okex Liang Ge exchange are traded, ethbtc_ is used inside transaction system
Huobi_coin and ethbtc_okex_coin are identified respectively, and to the ethbtc_huobi_coin and described
Ethbtc_okex_coin carries out the transaction that places an order;
When the type of transaction of digital cash transaction is futures, using symbol+market+due, subscribing to target is
For bit coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, btc_okex_ is can be used in internal system
Thisweek and btc_huobi_nextweek are identified respectively, and to the btc_okex_thisweek and the btc_
Huobi_nextweek trades.
It is described when digital cash transaction is abnormal in a kind of possible design, passed through using exception handling
Policy selection calls wss interface or calling interface to handle the digital cash transaction that this is abnormal, comprising:
When with the wss interface disconnect and reconnection success before, by event trigger notice system call described in
Rest interface executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing
And order status;
When being disconnected with the rest interface and before retrying successful connection, passes through event trigger notice strategy and handle
Current order.
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through
Wss interface continuous business.
It is described to notify the transaction system rest interface to hold by event triggering abnormal mechanism in a kind of possible design
After row redundancy scheme, the method also includes:
After being restored by the connection of reconnection and the wss interface, notified described in transaction system by event trigger policy
Rest interface stops executing the redundancy scheme;
After the rest interface stops executing the redundancy scheme, pass through digital cash described in the wss interface polls
The market data and order status of transaction.
It is described to be notified described in the transaction system system by event trigger notice mechanism in a kind of possible design
After rest interface starts redundancy scheme, the method also includes:
After the connection with the rest interface is abnormal or failure, bill/remove list is handled by the event trigger policy
The exception of failure;It is described that the exception that bill/remove singly fails is handled by event trigger policy, include at least following implementations it
One:
If the digital cash transaction is supported to place an order in the wss interface, selected by the event trigger policy logical
It crosses the wss interface and is placed an order or removed single operation;
Alternatively, selection is attempted to be placed an order or removed single operation by the rest interface;
Alternatively, abandoning the transaction of this digital cash.
In a kind of possible design, the coin of each digital cash is determined to by symbol, market and type.
Second aspect, the present invention provide a kind of digital cash the transaction device, have and realize that corresponding to above-mentioned first aspect mentions
The function of the method for the digital cash transaction of confession.The function can also be executed corresponding by hardware realization by hardware
Software realization.Hardware or software include one or more modules corresponding with above-mentioned function, and the module can be software
And/or hardware.Described device includes:
Module is obtained, for operating normally when transaction system
When normal, wss interface is called to obtain market data and transation report-back, and rest interface is called to be placed an order, removed
List and account inquiries;
Processing module, for determining the digital goods when the market data and order status traded according to the digital cash
When coin transaction is abnormal, rest interface in Selection and call wss interface or is called by strategy using event triggering abnormal mechanism
Handle this digital cash transaction being abnormal;The coin of each digital cash is to by symbol+ inside the transaction system
Tri- parts market+type uniquely determine:
The processing module is also used to:
When the type of transaction of digital cash transaction is stock, symbol+market+coin is used, wherein subscribe to
Target is ether mill currency, and when fiery coin and okex Liang Ge exchange are traded, ethbtc_ is used inside transaction system
Huobi_coin and ethbtc_okex_coin are identified respectively, and to the ethbtc_huobi_coin and described
Ethbtc_okex_coin carries out the transaction that places an order;
When the type of transaction of digital cash transaction is futures, using symbol+market+due, subscribing to target is
For bit coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, btc_okex_ is can be used in internal system
Thisweek and btc_huobi_nextweek are identified respectively, and to the btc_okex_thisweek and the btc_
Huobi_nextweek trades.
In a kind of possible design, the processing module is used for:
After disconnecting with the wss interface and carrying out reconnection, abnormal mechanism is triggered by event and notifies the transaction
System rest interface executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing
And order status;
When being disconnected with the rest interface and before retrying successful connection, passes through event trigger notice strategy and handle
Current order.
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through
Wss interface continuous business.
In a kind of possible design, the processing module is notifying the transaction system by event triggering abnormal mechanism
After rest interface executes redundancy scheme, it is also used to:
After being restored by the connection of reconnection and the wss interface, abnormal mechanism is triggered by event and notifies the transaction
System rest interface stops executing the redundancy scheme;
After the rest interface stops executing the redundancy scheme, pass through digital cash described in the wss interface polls
The market data and order status of transaction.
In a kind of possible design, the processing module is notifying the transaction system by event triggering abnormal mechanism
After rest interface starts redundancy scheme, it is also used to:
After the connection with the rest interface is abnormal or failure, bill/remove list is handled by the event trigger policy
The exception of failure;It is described that the exception that bill/remove singly fails is handled by event trigger policy, include at least following implementations it
One:
If the digital cash transaction is supported to place an order in the wss interface, selected by the event trigger policy logical
It crosses the wss interface and is placed an order or removed single operation;
Alternatively, selection is attempted to be placed an order or removed single operation by the rest interface;
Alternatively, abandoning the transaction of this digital cash.
In a kind of possible design, the coin of each digital cash is determined to by symbol, market and type.
Said one or multiple technical solutions in the embodiment of the present invention at least have following one or more technology effects
Fruit:
In the technical solution of the embodiment of the present invention, when the wss or the rest interface calling be abnormal normal when,
It calls wss interface to obtain market data and transation report-back, and rest interface is called to be placed an order, remove list and account inquiries;
When the wss or rest interface calling are abnormal, used by strategy in selection using event triggering abnormal mechanism
Wss interface or rest interface handle this digital cash transaction being abnormal;When type of transaction is cross-market arbitrage deal,
The market data that target is ethbtc_huobi_coin and ethbtc_okex_coin are subscribed to, the transaction that places an order is carried out to the two;When
When type of transaction schedules to last now arbitrage deal, subscribing to target is btc_huobi_coin and the row as week btc_okex_thisweek
Feelings data, trade to the two.As it can be seen that going to obtain number of deals using different interfaces under different scenes by switchover policy
According to trade, be capable of handling Network Abnormal, improve transaction system signal response speed and accuracy.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the method for the digital cash transaction in the embodiment of the present invention;
Fig. 2 is a kind of block schematic illustration of the money transaction system in the embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of the digital cash the transaction device in the embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the digital cash the transaction device in the embodiment of the present invention.
Specific embodiment
Technical solution of the present invention is described in detail below by attached drawing and specific embodiment, it should be understood that the application
Specific features in embodiment and embodiment are the detailed description to technical scheme, rather than to present techniques
The restriction of scheme, in the absence of conflict, the technical characteristic in the embodiment of the present application and embodiment can be combined with each other.
The embodiment of the invention provides the method, apparatus and storage medium of a kind of transaction of digital cash.To solve above-mentioned skill
Art problem, the present invention the following technical schemes are provided:
Money transaction system accesses rest interface and wss interface simultaneously to each exchange, that is, it is spontaneous to build an energy
To abnormality processing and support cross-market arbitrage, the phase shows the money transaction system of arbitrage and the transaction of traditional trend strategy.Pass through
Rest interface and wss both cooperate with each other, and form complementary mode to handle logical transaction when Network Abnormal, so that being
Signal of uniting is accordingly as rapid as possible, accurately.Strategy Development is made not depend on any exchange by the interface protocol of unified standard,
Simplified strategy exploitation, and more strategy operations are supported simultaneously.The money transaction system is properly termed as digital cash the transaction device, the goods
Coin transaction system includes data and transaction modules, position in storehouse and order management module and trading strategies module, money transaction system quilt
It is encapsulated in Transaction apparatus local.In addition, the coin pair of digital cash is uniquely determined according to tri- parts symbol+market+type, with
Realize cross-market transaction and futures spot exchange.
Embodiment
With reference to Fig. 1, the method for first introducing the transaction of one of embodiment of the present invention digital cash below, the method packet
It includes:
101, when transaction system operates normally, wss interface is called to obtain market data and transation report-back, and call
Rest interface is placed an order, removes list and account inquiries.
Wherein 102, wss interface refers to Web Socket Secure, can be realized information sharing and document association for creating
The engine of the Web site of work.In embodiments of the present invention, wss interface is mainly responsible for the acquisition of market data and transation report-back.
Rest interface refers to for standardizing using how in HTTP layers and API provider's progress data interaction.Rest description
The data interaction rule at client and server end in HTTP layers;Client is requested by sending HTTP (s) to server end,
A HTTP interaction is completed in the response for receiving server.In this interactive process, REST framework arranges two importances and is exactly
The used method of HTTP request, and the link of request.In embodiments of the present invention, rest interface, which is mainly responsible for, places an order, and removes
The work such as list and account inquiries.
The market data include position in storehouse ratio, rest Interface status and wss Interface status.Under the state of order includes
List removes the information such as list, conclusion of the business order, transation report-back and buying signals.Market data can be by trading strategies module from flow of event
Extraction obtains, and order status can have trading strategies module to obtain from position in storehouse and management module.
The coin of each digital cash is uniquely determined to by tri- parts symbol+market+type inside transaction system, than
If eth-btc is in the Object of Transaction of Huo Bi exchange, can be identified with ethbtc_huobi_coin in transaction system;eth-
Btc can be identified in the Object of Transaction of okex exchange in transaction system with ethbtc_huobi_coin.Btc works as okex's
Zhou Heyue is identified with btc_okex_thiswee, and next week contract of the btc in okex is identified with btc_okex_nextweek, this
Sample carries out cross-market, shows spread strategy exploitation and transaction across phase and various phases in which can be convenient.1023, when the transaction system
Wss described in operational process or the rest interface call the market data traded according to the digital cash and order status true
When the fixed digital cash transaction is abnormal, using event triggering abnormal mechanism by strategy in Selection and call wss interface or
Rest interface is called to handle the digital cash transaction that this is abnormal.
Wherein, the coin of each digital cash inside transaction system is stated to by symbol+marke
103, when the type of transaction of digital cash transaction is stock, symbol+market+coin is used.
Wherein, subscribing to target is ether mill currency, when fiery coin and okex Liang Ge exchange are traded, in transaction system
Portion is identified respectively using ethbtc_huobi_coin and ethbtc_okex_coin, and to the ethbtc_huobi_
Coin and the ethbtc_okex_coin carry out the transaction that places an order;
104, when the type of transaction of digital cash transaction is futures, symbol+market+due is used.
For example, subscribe to target be bit coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, in system
Btc_okex_thisweek can be used in portion and btc_huobi_nextweek is identified respectively, and to the btc_okex_
Thisweek and the btc_huobi_nextweek trade.
To the above mark independent assortment, realization can be convenient in the same system to various cross-markets, across phase and phase
The demand of existing spread strategy transaction.
Compared with current mechanism, in the embodiment of the present invention, when the market data and order status traded according to digital cash
When determining that digital cash transaction is normal, wss interface is called to obtain market data and transation report-back, and rest interface is called to carry out
It places an order, remove list and account inquiries;When the market data and order status traded according to digital cash determine that digital cash is traded
When being abnormal, abnormal mechanism is triggered using event, this hair is handled using wss interface or rest interface in selection by strategy
Raw abnormal digital cash transaction;When type of transaction is cross-market arbitrage deal, subscription target is ethbtc_huobi_coin
With the market data of ethbtc_okex_coin, the transaction that places an order is carried out to the two;When type of transaction schedules to last now arbitrage deal, order
Readding target is btc_huobi_coin and the market data as week btc_okex_thisweek, is traded to the two.As it can be seen that
It goes to obtain transaction data and trade using different interfaces under different scenes by switchover policy, it is different to be capable of handling network
Often, transaction system signal response speed and accuracy are improved.
Optionally, in some embodiments of the invention, described when digital cash transaction is abnormal, it is touched using event
Hair abnormal mechanism handles the digital cash that this is abnormal in Selection and call wss interface or calling interface by strategy and trades,
Include:
After disconnecting with the wss interface and carrying out reconnection, abnormal mechanism is triggered by event and notifies the transaction
System rest interface executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing
And order status;
When being disconnected with the rest interface and before retrying successful connection, passes through event trigger notice strategy and handle
Current order.
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through
Wss interface continuous business.
Optionally, in some embodiments of the invention, described to notify that the transaction is by event triggering abnormal mechanism
After rest interface of uniting executes redundancy scheme, the method also includes:
After being restored by the connection of reconnection and the wss interface, abnormal mechanism is triggered by event and notifies the transaction
System rest interface stops executing the redundancy scheme;
After the rest interface stops executing the redundancy scheme, pass through digital cash described in the wss interface polls
The market data and order status of transaction.
Optionally, in some embodiments of the invention, described to notify that the transaction is by event triggering abnormal mechanism
After rest interface starting redundancy scheme of uniting, the method also includes:
After the connection with the rest interface is abnormal or failure, bill/remove list is handled by the event trigger policy
The exception of failure;It is described that the exception that bill/remove singly fails is handled by event trigger policy, include at least following implementations it
One:
If the digital cash transaction is supported to place an order in the wss interface, selected by the event trigger policy logical
It crosses the wss interface and is placed an order or removed single operation;
Alternatively, selection is attempted to be placed an order or removed single operation by the rest interface;
Alternatively, abandoning the transaction of this digital cash.
For ease of understanding, below by taking specific application scenarios as an example, a kind of money transaction system as shown in Figure 2 is multiple
Exchange accesses the money transaction system.The trading strategies module of the money transaction system is configured with trading strategies (including plan
Omit 1, strategy 2 and strategy 3), and money transaction system is configured with wss interface and rest interface, wss interface access market 1, market
2.... market n, rest interface access market 1, the market market 2.... n.When wss interface is normal, flow of event passes through wss interface
Transmitting, if detecting, wss market are abnormal, start rest interface, and when executing trading strategies, buying signals enter rest interface,
Pass through the rest interface polls order status, order return and timing inquiry market.It, can be from position in storehouse and order pipe when implementation strategy
Position in storehouse ratio and order information are got in reason module.During enabling rest interface, wss interface continues reconnection to repair wss
Interface, until stopping enabling rest interface, being switched to wss interface after wss interface reconnection success.Or the generation of rest interface is different
Often, then the selection of trading strategies module continues through rest interface bill, can also be switched to the successful wss interface of reconnection.As it can be seen that
Money transaction system of the invention can support more markets, multi items, shifty moneytary operations transaction, and it is different to be capable of handling network
Often, so that system signal responds as far as possible quickly and accurately.
Referring to Fig. 3, Fig. 3 is a kind of for detecting the structural representation of the device 30 of information of vehicles disclosed in one embodiment
Figure.As shown in Figure 3, wherein device 30 described in Fig. 3 can be used for executing digital cash counterparty described in Fig. 1 or Fig. 2
Step some or all of in method, the specific associated description referring to Figure 1 or in Fig. 2, details are not described herein.As shown in figure 3, should
Device 30 may include:
Module is obtained, for calling wss interface to obtain market data and at returning when transaction system operates normally normal
Report, and rest interface is called to be placed an order, remove list and account inquiries;
Processing module, for determining the digital goods when the market data and order status traded according to the digital cash
When coin transaction is abnormal, rest interface in Selection and call wss interface or is called by strategy using event triggering abnormal mechanism
Handle this digital cash transaction being abnormal;The coin of each digital cash is to by symbol+ inside the transaction system
Tri- parts market+type uniquely determine:
The processing module is also used to:
When the type of transaction of digital cash transaction is stock, symbol+market+coin is used, wherein subscribe to
Target is ether mill currency, and when fiery coin and okex Liang Ge exchange are traded, ethbtc_ is used inside transaction system
Huobi_coin and ethbtc_okex_coin are identified respectively, and to the ethbtc_huobi_coin and described
Ethbtc_okex_coin carries out the transaction that places an order;
When the type of transaction of digital cash transaction is futures, using symbol+market+due, such as mark is subscribed to
Be bit coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, btc_okex_ can be used in internal system
Thisweek and btc_huobi_nextweek are identified respectively, and to the btc_okex_thisweek and the btc_
Huobi_nextweek trades.
In the embodiment of the present invention, when the market data and order status traded according to digital cash determine that digital cash is traded
When normal, processing module calls wss interface to obtain market data and transation report-back, and rest interface is called to be placed an order, removed
List and account inquiries;When the market data and order status traded according to digital cash determine that digital cash transaction is abnormal
When, abnormal mechanism, which is triggered, using event handles what this was abnormal using wss interface or rest interface in selection by strategy
Digital cash transaction;When type of transaction be cross-market arbitrage deal when, subscribe to target be ethbtc_huobi_coin and
The market data of ethbtc_okex_coin carry out the transaction that places an order to the two;When type of transaction schedules to last now arbitrage deal, subscribe to
Target is btc_huobi_coin and the market data as week btc_okex_thisweek, is traded to the two.As it can be seen that logical
It crosses switchover policy to go to obtain transaction data and trade using different interfaces under different scenes, it is different to be capable of handling network
Often, transaction system signal response speed and accuracy are improved.
Optionally, in some embodiments of the invention, the processing module is used for:
When disconnected with the wss interface and reconnection success after, by event trigger abnormal mechanism notify the friendship
Easy system rest interface executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing
And order status;
When being disconnected with the rest interface and before retrying successful connection, passes through event trigger notice strategy and handle
Current order.
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through
Wss interface continuous business.
Optionally, in some embodiments of the invention, the processing module is triggering abnormal mechanism notice by event
After the transaction system rest interface executes redundancy scheme, it is also used to:
After being restored by the connection of reconnection and the wss interface, abnormal mechanism is triggered by event and notifies the transaction
System rest interface stops executing the redundancy scheme;
After the rest interface stops executing the redundancy scheme, pass through digital cash described in the wss interface polls
The market data and order status of transaction.
Optionally, in some embodiments of the invention, the processing module is triggering abnormal mechanism notice by event
After the transaction system rest interface starting redundancy scheme, it is also used to:
After the connection with the rest interface is abnormal or failure, bill/remove list is handled by the event trigger policy
The exception of failure;It is described that the exception that bill/remove singly fails is handled by event trigger policy, include at least following implementations it
One:
If the digital cash transaction is supported to place an order in the wss interface, selected by the event trigger policy logical
It crosses the wss interface and is placed an order or removed single operation;
Alternatively, selection is attempted to be placed an order or removed single operation by the rest interface;
Alternatively, abandoning the transaction of this digital cash.
Server-side and client in the embodiment of the present application are described respectively from the angle of modular functionality entity above, with
Under from hardware point of view introduce a kind of examination client, comprising: processor, memory and input-output unit and be stored in described
In memory and the computer program that can run on the processor.The processor is realized when executing the computer program
The all or part of operation realized in embodiment corresponding to above-mentioned Fig. 3 by examination client, alternatively, the processor executes institute
The function of each module in the client of embodiment corresponding to above-mentioned Fig. 3 is realized when stating computer program.
Illustratively, the computer program can be divided into one or more module/units, one or more
A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more
A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute
State implementation procedure of the computer program in the computer installation.
The digital cash the transaction device may include, but be not limited only to, processor, memory.Those skilled in the art can
To understand, the signal is only the example of computer installation, does not constitute the restriction to server, may include than illustrating more
More or less component perhaps combines certain components or different components, such as the server can also include that input is defeated
Equipment, network access equipment, bus etc. out.
The processor can be central processing unit (Central Processing Unit, CPU), can also be it
His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor
Deng the processor is the control centre of the computer installation, utilizes various interfaces and the entire computer installation of connection
Various pieces.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes
Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization
The various functions of computer installation.The memory can mainly include storing program area and storage data area, wherein storage program
It area can application program (such as sound-playing function, image player function etc.) needed for storage program area, at least one function
Deng;Storage data area, which can be stored, uses created data (such as audio data, video data etc.) etc. according to mobile phone.This
Outside, memory may include high-speed random access memory, can also include nonvolatile memory, such as hard disk, memory, insert
Connect formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory
Block (Flash Card), at least one disk memory, flush memory device or other volatile solid-state parts.
The input-output unit can also be replaced with receiver and transmitter, can be real for same or different physics
Body.When for identical physical entity, input-output unit may be collectively referred to as.The memory can integrate in the processor
In, it can also be provided separately with the processor.The input-output unit can be transceiver.
The embodiment of the present invention also provides a kind of computer readable storage medium, is stored thereon with computer program, when this hair
Digital cash the transaction device in bright embodiment is realized in the form of SFU software functional unit and sells or make as independent product
Used time can store in a computer readable storage medium.Based on this understanding, the present invention realize above-mentioned Fig. 1 or
The all or part of the process realized in embodiment corresponding to Fig. 2 by digital cash the transaction device can also pass through computer journey
Sequence is completed to instruct relevant hardware, and the computer program can be stored in a computer readable storage medium, the meter
Calculation machine program is when being executed by processor, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program packet
Include computer program code, the computer program code can for source code form, object identification code form, executable file or
Certain intermediate forms etc..The computer-readable medium may include: any reality that can carry the computer program code
Body or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-
Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and
Software distribution medium etc..It should be noted that the content that the computer-readable medium includes can be according in jurisdiction
Legislation and the requirement of patent practice carry out increase and decrease appropriate, such as in certain jurisdictions, according to legislation and patent practice, meter
Calculation machine readable medium does not include electric carrier signal and telecommunication signal.
Although various embodiments of the present invention have been described, once a person skilled in the art knows substantially creative
Concept, then additional changes and modifications may be made to these embodiments.So it includes implementing that the following claims are intended to be interpreted as
Example and all change and modification for falling into the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (10)
1. a kind of method of digital cash transaction, which is characterized in that the described method includes:
When transaction system operates normally, wss interface is called to obtain market data and transation report-back, and call rest interface into
Row places an order, removes list and account inquiries;
When the wss described in the transaction system operational process or rest interface calling are abnormal, triggered using event
Abnormal mechanism calls wss interface or rest interface is called to handle the digital cash that this is abnormal and trades by policy selection;
The coin of each digital cash is uniquely determined to by tri- parts symbol+market+type inside the transaction system:
When the type of transaction of digital cash transaction is stock, using symbol+market+coin, subscribe to target be with
Too mill currency, when fiery coin and okex Liang Ge exchange are traded, inside transaction system using ethbtc_huobi_coin and
Ethbtc_okex_coin is identified respectively, and to the ethbtc_huobi_coin and the ethbtc_okex_coin
Carry out the transaction that places an order;
When the type of transaction of digital cash transaction is futures, using symbol+market+due, subscription target is bit
For coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, btc_okex_thisweek is can be used in internal system
It is identified respectively with btc_huobi_nextweek, and to the btc_okex_thisweek and the btc_huobi_
Nextweek trades.
2. the method as described in claim 1, which is characterized in that it is described when digital cash transaction is abnormal, use event
Triggering exception handling calls wss interface or calling interface to handle the digital cash that this is abnormal and hands over by policy selection
Easily, comprising:
When being disconnected with the wss interface and before reconnection success, passes through event trigger notice system and call the rest
Interface executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing and are ordered
Single state;
When being disconnected with the rest interface and before retrying successful connection, handled by event trigger notice strategy current
Order;
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through wss
Interface continuous business.
3. method according to claim 2, which is characterized in that described to notify that the transaction is by event triggering abnormal mechanism
After rest interface of uniting executes redundancy scheme, the method also includes:
After restoring by the connection of reconnection and the wss interface, pass through rest described in transaction system described in event trigger notice
Interface stops executing the redundancy scheme;
After the rest interface stops executing the redundancy scheme, traded by digital cash described in the wss interface polls
Market data and order status.
4. method according to claim 2, which is characterized in that described to notify that the transaction is by event triggering abnormal mechanism
After rest interface starting redundancy scheme of uniting, the method also includes:
After the connection with the rest interface is abnormal or failure, bill/remove single failure is handled by the event trigger policy
Exception;It is described that the exception that bill/remove singly fails is handled by event trigger policy, include at least one of following implementations:
If the digital cash transaction is supported to place an order in the wss interface, institute is passed through by event trigger policy selection
It states wss interface and is placed an order or removed single operation;
Alternatively, selection is attempted to be placed an order or removed single operation by the rest interface;
Alternatively, abandoning the transaction of this digital cash.
5. the method as described in claim 1, which is characterized in that the coin of each digital cash is to true by symbol, market and type
It is fixed.
6. a kind of digital cash the transaction device, which is characterized in that described device includes:
Module is obtained, for calling wss interface to obtain market data and transation report-back when transaction system operates normally normal,
And rest interface is called to be placed an order, remove list and account inquiries;
Processing module, for determining that the digital cash is handed over when the market data and order status traded according to the digital cash
When being easily abnormal, in Selection and call wss interface or rest interface is called to handle by strategy using event triggering abnormal mechanism
The transaction of this digital cash being abnormal;The coin of each digital cash is to by symbol+market+ inside the transaction system
Tri- parts type uniquely determine:
The processing module is also used to:
When the type of transaction of digital cash transaction is stock, symbol+market+coin is used, wherein subscribe to target
Ethbtc_huobi_ is used inside transaction system when fiery coin and okex Liang Ge exchange are traded for ether mill currency
Coin and ethbtc_okex_coin are identified respectively, and to the ethbtc_huobi_coin and the ethbtc_
Okex_coin carries out the transaction that places an order;
When the type of transaction of digital cash transaction is futures, using symbol+market+due, subscription target is bit
For coin futures in okex as Zhou Heyue and in the next week contract of fiery coin, btc_okex_thisweek is can be used in internal system
It is identified respectively with btc_huobi_nextweek, and to the btc_okex_thisweek and the btc_huobi_
Nextweek trades.
7. device as claimed in claim 6, which is characterized in that the processing module is used for:
When being disconnected with the wss interface and after reconnection success, abnormal mechanism is triggered by event and notifies transaction system
Rest interface of uniting executes redundancy scheme;
When executing the redundancy scheme, the market data of the digital cash transaction are inquired by the rest interface timing and are ordered
Single state;
When being disconnected with the rest interface and before retrying successful connection, handled by event trigger notice strategy current
Order;
When executing the strategy processing current order, if the exchange supports wss bill to remove list, strategy may be selected to pass through wss
Interface continuous business.
8. device as claimed in claim 7, which is characterized in that the processing module is notified by event trigger notice mechanism
After rest interface described in the transaction system system executes redundancy scheme, it is also used to:
After being restored by the connection of reconnection and the wss interface, stopped by rest interface described in event trigger notice system
Execute the redundancy scheme;
After the rest interface stops executing the redundancy scheme, traded by digital cash described in the wss interface polls
Market data and order status.
9. device according to claim 7, which is characterized in that the processing module is logical by event trigger notice mechanism
After knowing that rest interface described in the transaction system system executes redundancy scheme, it is also used to:
After being restored by the connection of reconnection and the wss interface, stopped by rest interface described in event trigger notice system
Execute the redundancy scheme;
After the rest interface stops executing the redundancy scheme, traded by digital cash described in the wss interface polls
Market data and order status.
10. a kind of computer storage medium, which is characterized in that it includes instruction, when described instruction executes on computers, is made
It obtains the computer and executes the method as described in any one of claim 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910129165.1A CN109872138A (en) | 2019-02-21 | 2019-02-21 | A kind of method, apparatus and storage medium of digital cash transaction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910129165.1A CN109872138A (en) | 2019-02-21 | 2019-02-21 | A kind of method, apparatus and storage medium of digital cash transaction |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109872138A true CN109872138A (en) | 2019-06-11 |
Family
ID=66919026
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910129165.1A Pending CN109872138A (en) | 2019-02-21 | 2019-02-21 | A kind of method, apparatus and storage medium of digital cash transaction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109872138A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115037500A (en) * | 2022-04-07 | 2022-09-09 | 水利部信息中心 | Method for detecting mining caving host based on configuration file |
-
2019
- 2019-02-21 CN CN201910129165.1A patent/CN109872138A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115037500A (en) * | 2022-04-07 | 2022-09-09 | 水利部信息中心 | Method for detecting mining caving host based on configuration file |
CN115037500B (en) * | 2022-04-07 | 2024-02-13 | 水利部信息中心 | Method for detecting main machine of mining subsidence based on configuration file |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108540536B (en) | Block chain-based network mass service processing method, equipment and storage medium | |
US9459860B2 (en) | Mixed mode session management | |
CN109598598A (en) | Transaction processing method and device, electronic equipment based on block chain | |
US20080072226A1 (en) | Systems, Methods, and Computer Program Products for Transaction Based Load Balancing | |
CN111698315B (en) | Data processing method and device for block and computer equipment | |
CN109598504A (en) | Transaction processing method and device, electronic equipment based on block chain | |
US9978047B2 (en) | Integrating payment aggregators with e-commerce platform | |
AU2014321533A1 (en) | Techniques for facilitating electronic trading | |
WO2016044603A1 (en) | System and method for facilitation cross orders | |
CN110111095B (en) | Payment transaction weight judging method and payment system | |
CN105139194A (en) | Method and system of connection establishment, and electronic devices | |
CN103312549A (en) | Transaction management method, device and system | |
CN107194810B (en) | Asset configuration system and method of operation | |
CN112446786A (en) | Abnormal transaction processing method and device, electronic equipment and readable storage medium | |
CN105677675A (en) | Business processing method and device | |
WO2022012405A1 (en) | Order generation method and apparatus | |
CN110517145A (en) | Data trade method and relevant device based on multi-tiling interchain | |
CN107067559A (en) | A kind of method and apparatus for realizing charging pile interconnection charging | |
CN111292178B (en) | Demand matching method and device, storage medium and electronic equipment | |
CN112596801B (en) | Transaction processing method, device, equipment, storage medium and database | |
CN106294611A (en) | Core banking system and the old and new's core system data exchange method | |
KR102117498B1 (en) | Teller server of transferring additional consultation to other consultant during financial consultation by using ATM and method of providing consultation service | |
CN107066175A (en) | Method and device for generating display interface of securities | |
CN107578327A (en) | Method, equipment and the system that information pushes in a kind of link of bidding | |
CN109872138A (en) | A kind of method, apparatus and storage medium of digital cash transaction |
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: 20190611 |