Summary of the invention
The object of the present invention is to provide a kind of double-collection device system and two acquisition method thereof of two-node cluster hot backup, it can main harvester hinder for some reason stop collecting work after, can directly switch to main harvester from harvester, therefore can guarantee under the situation that a harvester breaks down, still can make whole harvester system normally to move, thereby solved the insecurity of single harvester system operating mode, and the shared same group of sensing sources of double-collection device, and have acquisition controller LAN data and two-node cluster hot backup function simultaneously.
The object of the present invention is achieved like this:
A kind of double-collection device system of two-node cluster hot backup comprises: sensing sources, and this sensing sources is made up of a plurality of sensors; Gather the harvester of sensing sources data; With the controller local area network that sensing sources and harvester link together, this controller local area network is made up of with the main cable that is connected with groups of nodes groups of nodes; And, power supply; Be characterized in:
Groups of nodes in the described controller local area network is made up of a plurality of nodes, and the input end of each node is connected with corresponding sensor, and the output terminal of each node is connected with main cable; Described harvester is formed by main harvester with from harvester; Described power supply is made up of double switch power, and a holding circuit is set between double switch power; Also comprise: a jointing, this jointing is with sensing sources, main harvester and be connected from harvester.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, described jointing is a three-way connection, the port of this three-way connection by controller local area network and sensing sources a plurality of sensors and connect, the port of three-way connection and port respectively with main harvester be connected from harvester.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, described groups of nodes is made up of towards node, winch node, 12 analog input nodes pump, and the input end of each node is connected with corresponding sensor, and the output terminal of each node is connected with main cable; End at main cable is provided with a terminal resistance.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, described main harvester comprises embedded computer, liquid crystal display, touch-screen, capture card, anti-explosion alarming loudspeaker and card extender; Embedded computer is connected with touch-screen and capture card are two-way, and the output terminal of embedded computer is connected with the input end of card extender, and the liquid crystal display input end is connected with the card extender output terminal, and the anti-explosion alarming loudspeaker are connected with the touch-screen output terminal.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, describedly comprise industrial computer and be arranged on capture card the industrial computer bus duct that from harvester industrial computer is connected with capture card is two-way; Be connected with printer by industrial computer from harvester.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, the signal end 1 of the signal end 1 of capture card and capture card from harvester is connected with the high level signal H end of groups of nodes in the described main harvester, and the signal end 2 of the signal end of capture card and capture card from harvester is connected with the low level signal L end of groups of nodes in the main harvester.
In the double-collection device system of above-mentioned two-node cluster hot backup, wherein, the input end of Switching Power Supply is connected with the output terminal of stabilized voltage supply respectively in the described power supply, the output terminal of double switch power respectively with main harvester be connected from the power end of harvester and the main cable of controller local area network, dc supply is provided; The described holding circuit that is arranged between the double switch power is made up of two diode D1 and D2; the anode of diode D1 is connected with the double switch power output terminal; the anode of diode D2 is connected with the double switch power output terminal; negative terminal and the main cable of diode D1 and D2 connect altogether, to provide operating voltage to controller local area network.
A kind of two acquisition methods of two-node cluster hot backup are characterized in may further comprise the steps:
Step 1 is opened main harvester, and the capture card of main harvester is carried out initialization, and communication baud rate, mode of operation are set;
Step 2 is carried out initialization to main harvester parameter, and read sensor nominal data from configuration file is set default value to all kinds of thresholdings, and the sensor node in the controller local area network is added up and identified;
Step 3 activates each sensor node in the LAN (Local Area Network), by program each sensor node is sent activation command each node of sensor is activated, and each sensor node sends the Frame of the current acquisition parameter value of each sensor to bus with timing mode;
Step 4, main harvester enters major cycle, beginning data acquisition, calculating, demonstration, storage and transmission work;
Step 5, main harvester constantly characterize its online signal working properly to sending from harvester;
Step 6 is opened from harvester, and the capture card from harvester is carried out initialization, and communication baud rate, mode of operation are set;
Step 7 to carrying out initialization from the harvester parameter, is set default value to all kinds of thresholdings, and read sensor nominal data from configuration file is added up and identified the node in the LAN (Local Area Network);
Normally whether step 8 detects the online communication signal that main harvester sends from harvester, judge duty that main harvester sends out, and carry out corresponding slave working routine or host work program;
Step 9 quits a program according to user instruction, sends to main harvester or from harvester by program to exit command, and main harvester and quit a program respectively from harvester, out of service.
In two acquisition methods of above-mentioned two-node cluster hot backup, wherein, in described step 8,
When detect the online communication signal that main harvester sends from harvester, judge that the duty that main harvester sends out is normal, be the slave duty from harvester, carry out corresponding slave working routine, backup reception data does not send any order to bus;
When main harvester breaks down, promptly do not detect the online communication signal that main harvester sends from harvester, judge the working state abnormal of main harvester, switch to the host work state from harvester, carry out corresponding main harvester working routine, open the function that sends order to bus, send activation command to each sensor node, enter major cycle, begin normal data acquisition, calculating, demonstration, storage and transmission work; Simultaneously, constantly detect main harvester from harvester and whether send online communication signal;
When main harvester fault is eliminated, promptly detect the online communication signal that main harvester sends from harvester, judge that the duty of main harvester recovered normal, switch to the slave duty from harvester, promptly withdraw from major cycle, return to, carry out the slave working routine from the harvester duty, backup reception data no longer sends any order to bus.
In two acquisition methods of above-mentioned two-node cluster hot backup, wherein, in described step 8, main harvester and carry out from the capture card of the communication between the harvester by separately, the online communication signal comprises a receiving code " 01101000 " and a mask off code " 00001111 " between two capture cards of principal and subordinate's harvester; Between two capture cards of principal and subordinate's harvester is both-way communication, and is set in synchronization and has only a harvester to send order to controller local area network.
The double-collection device system of two-node cluster hot backup of the present invention and two acquisition method thereof make it compared with prior art owing to adopted above-mentioned technical scheme, have following advantage and good effect:
1. the present invention is because double-collection device has acquisition controller LAN data and two-node cluster hot backup function simultaneously, therefore when main harvester break down stop collecting work after, rise to main harvester from the harvester automatic switchover and continue the operation collecting work, thereby can guarantee the normal operation of total system;
2. the present invention is owing to adopt double-collection device both-way communication mode, by controller local area network directly by both-way communication between two capture cards that are located at respectively in the master and slave harvester, not only faster and accurate, and avoided the wrong report phenomenon that produces because of other communication media or communication appliance fault;
3. the present invention is because the correct communication of master and slave harvester and in time switching, and guaranteed that thus LAN node has only an order center at synchronization, thereby prevents the mix of commanding in many ways;
4. the present invention makes two even the shared same set of sensing sources of more a plurality of acquisition system owing to adopted controller local area network and three-way connection line, has therefore both saved the sensing sources resource, and has alleviated the installation and maintenance work of situ of drilling well sensing sources;
5. therefore the present invention can preserve two sets of data at petroleum prospecting scene timely and accurately because the double-collection device that adopts has acquisition controller LAN data and two-node cluster hot backup function simultaneously, has avoided factor according to losing the loss that causes.
Embodiment
See also Fig. 2 and shown in Figure 3, they are the schematic block diagram and the circuit block diagram of the double-collection device system of two-node cluster hot backup of the present invention.Double-collection device of the present invention system comprises sensing sources 1, harvester 2, the controller local area network 3 that is connected with sensing sources 1 and harvester 2 respectively, jointing 4 and power supply 4.
Described sensing sources 1 is made of the sensor of situ of drilling well, in the present embodiment, selected 14 sensor structures of situ of drilling well for use, comprised that pump is towards sensor 101, drawworks sensor 102, speed probe 103, weight transduser 104, upright pressure sensor 105, rate of discharge sensor 106, torque sensor 107, tongs torque sensor 108, total hydrocarbon sensor 109, pond volume sensor 110, H2S sensor 111, density sensor 12, temperature sensor 113, conductivity sensor 114.
(English name is Lontroller Area Network to described controller local area network 3, be called for short the CAN bus) be the serial communication network of a kind of effective support dcs or real-time control, in the present embodiment, controller local area network 3 is multi-master bus, in order to sensing sources 1 and double-collection device 2 are linked to be network system.On the controller local area network 3 any node all can be at any one time initiatively other nodes on network send data, be regardless of the principal and subordinate, communication flexibly; If when bus collision, promptly when multinode simultaneously when bus sends, determine to take the node of bus by the bus arbitration mode, it adopts nondestructive bus arbitration, be that the low node of priority initiatively stops the data transmission, and the high node of priority can continue to send data insusceptibly; It can be implemented in the reliable transmission of remote real time data under the electromagnetic interference environment by simple agreement; The controller local area network communication distance can reach 10km farthest, and the highest scooter 1Mbit/s communicates by letter; LAN (Local Area Network) is packaged into message with business datum and sends, the effective word joint number of each message is 8, this small messages mode has the transmission time short, the real-time height, reduce because of being disturbed the probability of retransmitting message, make mistakes number of times during greater than some when node, can withdraw from bus operation automatically, make wrong node drop to minimum the interference of bus.Controller local area network 3 is that the CAN bus generally is used for serial communication network for this reason.
In the present embodiment, controller local area network 3 is made up of with the main cable 32 that is connected with groups of nodes 31 groups of nodes 31, and groups of nodes 31 is made up of a plurality of nodes, to adapt to the on-the-spot numerous sensor of petroleum prospecting.At the petroleum prospecting scene, not only the sensor degree of scatter is higher, and sensor type is more, the present invention has used three kinds of intelligent nodes, comprise: pump is towards node (model is SK-9N02), winch node (model is SK-9N01-Ex), analog input node (model is SK-9N03-Ex), to adapt to various sensors.In the present embodiment, groups of nodes 31 is become by 14 node masters: comprise that pump is towards node 3101, winch node 3102 and 12 analog input nodes 313 to 3114, the input end of node 3101 to 3114 respectively with pairing pump towards sensor 101, drawworks sensor 102, speed probe 103, weight transduser 104, upright pressure sensor 105, rate of discharge sensor 106, torque sensor 107, tongs torque sensor 108, total hydrocarbon sensor 109, pond volume sensor 110, H2S sensor 111, density sensor 12, temperature sensor 113, the output terminal of conductivity sensor 114 connects; The output terminal of node 3101 to 3114 and the main cable 32 of field controller LAN (Local Area Network) 3 also connect.General maximum 64 nodes that articulate take logical address 0~No. 63 on the controller local area network 3.Adopt on the controller local area network 3 and connect the mode of a plurality of sensors, simplified system architecture, it is complicated to have solved the like product wiring, the problem of Scalable Performance difference.The end of the main cable 32 of bus 3 is provided with a terminal resistance 33.
Described jointing 4 is three-way connections 4; The end 41 of three-way connection 4 is connected with main cable 32 by controller local area network 3, the output terminal of main cable 32 and 14 nodes also connects, the input end of 14 nodes is connected with 14 sensor output terminals of sensing sources 1 respectively, make three-way connection 4 ports 41 by controller local area network 3 and sensing sources 1 each sensor and connect; The end 42 of three-way connection 4 and port 43 respectively with main harvester 21 be connected from harvester 22.
Please cooperate referring to Fig. 3, shown in Figure 4, described harvester 2 is formed by main harvester 21 with from harvester 22.
Main harvester 21 is by commercially available embedded computer (model is SEM/SPT2) 211, liquid crystal display 212 (model is I-SFT60.15XP), touch-screen (model is 15C) 213, capture card 214 (model is SEM/CSM-X), anti-explosion alarming loudspeaker 215 and card extender 216 are formed.Embedded computer 211 and touch-screen 213,214 two-way connections of capture card, the output terminal of embedded computer 211 is connected with card extender 216 input ends, liquid crystal display 212 input ends are connected with card extender 216 output terminals, and anti-explosion alarming loudspeaker 215 are connected with main harvester 21 output terminals.Main harvester 21 is arranged on situ of drilling well, is connected with sensing sources 1 by tool area network bus 3.
Form industrial computer 221 and 222 two-way connections of capture card from harvester 22 by CONTEC industrial computer 221 (model is IPC-88E), the capture card 222 (model is PCI7841) that is arranged on industrial computer 221 bus ducts.Be connected with printer 7 by industrial computer 221 from harvester 22.Be arranged on the place of safety from harvester 22, the high level H end of the signal end 1 of capture card 214 and groups of nodes 31 and connecing the signal end 1 of capture cards 222 and the main harvester 21 in harvester 22; The low level L end of the signal end 2 of capture card 214 and groups of nodes 31 and connecing the signal end 2 of capture cards 222 and the main harvester 21 in harvester 22; Realize both-way communications by capture card in the main harvester 21 214 and the capture card 222 in harvester 22, make controller local area network 3 can realize both-way communication between the master and slave harvester.
Described power supply 5 is made up of double switch power 51 and 52 (model is SLFLD25-512HI, SPS-SKGY100-5), two groups of Switching Power Supplies 51 and 52 are separately positioned in principal and subordinate's harvester, Switching Power Supply 51 is connected with the output terminal of stabilized voltage supply 6 respectively with 52 input ends, the output terminal of double switch power 51 is connected with the power end of 21 embedded computer 211 of main harvester, liquid crystal display 212, touch-screen 213, capture card 214 respectively by lead, and 5V is provided working power; The output terminal of double switch power 52 is connected respectively with from the industrial computer 221 of harvester 22, the power end of capture card 222 by lead, and 5V is provided working power; Another output terminal of double switch power 51,52 is connected with main cable 32, provides 24V dc supply to controller local area network 3.Between double switch power 51 and 52, be connected in series and be provided with holding circuit 8.Holding circuit 8 is made up of two diode D1 and D2; the anode of diode D1 is connected with double switch power (51) output terminal; the anode of diode D2 is connected with double switch power (52) output terminal; the negative terminal of diode D1 and D2 and main cable (32) connect altogether, to provide operating voltage to controller local area network (3).
Double switch power 51 and 52 is for controller local area network 3, main harvester 21, provide working power from each parts of harvester 22; by this dual power supply mode; improved the reliability of power supply; when two harvesters are working properly; diode D1 and diode D2 play the reverse protection effect; when in two harvesters a harvester operation irregularity being arranged wherein, suppose the abnormal electrical power supply of main harvester 21, then power by the Switching Power Supply 52 of harvester 22.
See also shown in Figure 5ly, this is the control circuit schematic diagram of the double-collection device system of two-node cluster hot backup of the present invention.Be provided with bus interface J3 in the embedded computer 211 of main harvester 21, this bus interface J3 is an industry standard interface, and bus interface J3 is connected with the bus interface J2 of capture card 214 is two-way by main cable 32; In embedded computer 211, also be provided with Low Voltage Differential Signal interface J4, the port one of Low Voltage Differential Signal interface J4 is distinguished corresponding connections with the port one of card extender 216 to port 6 to port 6, and the port 7 of Low Voltage Differential Signal interface J4 to port one 2 is distinguished corresponding connections with port 7 to the port one 2 of card extender 216; In embedded computer 211, also be provided with serial ports J8, by the both-way communication of serial ports J8 realization with touch-screen 213; Be provided with touch screen interface J9 in the touch-screen 213 (model is 15C), the port 3,5,9,10 of the serial ports J8 of embedded computer 211 and 3,5,9, the 10 corresponding connections respectively of the port of touch screen interface J9; Embedded computer 211 is connected with each associated components by above-mentioned interface, realizes functions such as control, adjusting, calculating, demonstration, printing, warning.
Liquid crystal display (model is I-SFT60.15XP) 212 is provided with shows signal interface J5, and the input end of shows signal interface J5 is connected by lead with the shows signal output terminal of card extender 216; The function of card extender 216 is that the Low Voltage Differential Signal (LVDS) that embedded computer 211 is imported is converted to the liquid crystal display signal, by shows signal interface J5 video data or chart on liquid crystal display.
The capture card 214 of main harvester 21 (model is SEM/CSM-X) is provided with the bus interface J2 of interface J1, capture card 214, and this bus interface J2 is an industry standard interface.
Form by industrial computer 221 (model is IPC-88E) and the capture card 222 (model is PCI7841) and the power supply 52 that are arranged on industrial computer 221 bus ducts from harvester 22; Groups of nodes 31 also comprises a bus interface J6; The port one of main harvester 21 capture cards 214 interface J1 is connected with the port one from harvester 22 capture cards 222, the port 2 of main harvester 21 capture cards 214 interface J1 and the port of groups of nodes 31 interface J6 2 and from the port 2 of harvester 22 capture cards 222 mutually and connect; Be provided with interface J7 in the industrial computer 221, this interface J7 is connected with capture card 222 by main cable 32.
The holding circuit 8 that two diode D1 and D2 form is serially connected between the double switch power 51,52; D1, D2 are that its model of diode is 1N5404; the anode of diode D1 is connected with the port 3 of double switch power 51; the port 4 of the negative terminal of the negative terminal of diode D1 and diode D2 and bus interface J6 also connects, and the anode of diode D2 is connected with the port one of double switch power 51.The port one of the port 4 of double switch power 51, the port 2 of double switch power 52 and bus 3 interface J6 and ground also connect.
Foreground master's harvester among the present invention can work independently, and realizes carrying out functions such as data acquisition, processing, demonstration, printing by controller local area network, also can work from harvester with the backstage by controller local area network, realizes the two acquisition functions of two-shipper.The capture card that is provided with respectively in the master and slave harvester can be realized communication by controller local area network, interworking, and by controller local area network with the data transmission that collects to each associated components; Embedded computer 211 links to each other with card extender 216 by low-voltage differential signal interface J4, displaying contents is organized low-voltage differential signals through J4 output more, through card extender 216 low-voltage differential signal that receives is converted to red, green, blue color data signal, input display interface J5 again, thus realize the demonstration of liquid crystal display data, chart; Embedded computer 211 is connected with the corresponding interface J9 of touch-screen end by serial ports J8, and touch-screen is realized man-machine conversation.Link to each other with the capture card 214 of controller local area network and main harvester 21 by capture card 222 realizations that are inserted in the PCI slot from the industrial computer 221 of harvester 22, directly transmit information.
See also shown in the accompanying drawing 6, this is the process flow diagram of two acquisition methods of two-node cluster hot backup of the present invention.Two acquisition methods of two-node cluster hot backup of the present invention may further comprise the steps:
Step 1 is opened main harvester, and the capture card of main harvester is carried out initialization, and communication baud rate, mode of operation are set;
Step 2 is carried out initialization to main harvester parameter, and read sensor nominal data from configuration file is set default value to all kinds of thresholdings, and the sensor node in the controller local area network is added up and identified;
Step 3 activates each sensor node in the LAN (Local Area Network), by program each sensor node is sent activation command each node of sensor is activated, and each sensor node sends the Frame of the current acquisition parameter value of each sensor to bus with timing mode;
Step 4, main harvester enters major cycle, beginning data acquisition, calculating, demonstration, storage and transmission work;
Step 5, main harvester constantly characterizes its online signal working properly to sending from harvester, main harvester and carry out from the capture card of the communication between the harvester by separately, main harvester and from realizing mutual online communication by the online communication signal of setting between two capture cards of harvester;
Step 6 is opened from harvester, and the capture card from harvester is carried out initialization, and communication baud rate, mode of operation are set;
Step 7 to carrying out initialization from the harvester parameter, is set default value to all kinds of thresholdings, and read sensor nominal data from configuration file is added up and identified the node in the LAN (Local Area Network);
Normally whether step 8 detects the online communication signal that main harvester sends from harvester, judge duty that main harvester sends out, and carry out corresponding slave working routine or host work program; Comprise,
When detect the online communication signal that main harvester sends from harvester, judge that the duty that main harvester sends out is normal, be the slave duty from harvester, carry out corresponding slave working routine, backup reception data does not send any order to bus;
When main harvester breaks down, promptly do not detect the online communication signal that main harvester sends from harvester, judge the working state abnormal of main harvester, just switch to the host work state from harvester, carry out corresponding main harvester working routine, open the function that sends order to bus, send activation command to each sensor node, enter major cycle, begin normal data acquisition, calculating, demonstration, storage and transmission work; Simultaneously, constantly detect main harvester from harvester and whether send online communication signal;
When main harvester fault is eliminated, promptly detect the online communication signal that main harvester sends from harvester, judge that the duty of main harvester recovered normal, switch to the slave duty from harvester, promptly withdraw from major cycle, return to, carry out the slave working routine from the harvester duty, backup reception data no longer sends any order to bus;
In above-mentioned steps eight, be both-way communication between two capture cards of principal and subordinate's harvester, and be set in synchronization and have only a harvester to send order to controller local area network;
Step 9 quits a program according to user instruction, sends to main harvester or from harvester by program to exit command, and main harvester and quit a program respectively from harvester, out of service.
In above-mentioned steps eight, main harvester and carry out from the capture card of the communication between the harvester by separately, in the present embodiment, the online communication signal comprises a receiving code " 01101000 " and a mask off code " 00001111 " between two capture cards of principal and subordinate's harvester, promptly adopt higher one on the logical address to receive shielding, concrete method to set up is as follows:
Capture card initialization from harvester when two-shipper is gathered is provided with:
| Identifier first byte | Identifier second byte |
Receiving code | 01101000(0x68) | 00000000(0x00) |
Mask off code | 00001111(0x0f) | 11111111(0xff) |
This shows that main harvester and realized not conflicting with any node (0~No. 63) from the communication signal between the harvester (i.e. Frame) has improved the reliability of communication.
The double-collection device system of two-node cluster hot backup of the present invention and the principle of work of two acquisition methods thereof are:
When the operation work of double-collection device system, for realize main harvester with from the correct communication of harvester, promptly and accurately switch, require both sides by the controller local area network transmission signals, adopted main harvester to send communication signal, receive only the mode of communication signal from harvester, promptly main harvester ceaselessly on controller local area network, send one not with 0~No. 63 afoul Frame of node, when utilizing the capture card initialization, harvester is provided with receiving code and mask off code, can receive this Frame, thereby the promptly main harvester duty of existence that characterizes main harvester is normal; The embedded computer of principal and subordinate's harvester is controlled capture card by bus, the sensing data that capture card collects by bus, by bus the data that collect are sent to embedded computer again, by embedded computer data are handled, and the data after will handling are sent on the liquid crystal display and show, observe for the operator; The onsite alarming signal of the embedded computer output of main harvester is rung by alarming horn, by the printer output text, the touch-screen of main harvester is imported capture card with the data of operator's input by the serial port of embedded computer and by bus corresponding sensor is regulated control from the data of the embedded computer of harvester output.Send communication signal from harvester if can not receive main harvester in a period of time (10~30 seconds), just automatically switch into the host work state from harvester, carry out the working routine of main harvester, thereby not only guarantee the acquisition system safe and reliable operation but also realized the two-node cluster hot backup function.
In sum, the double-collection device system of two-node cluster hot backup of the present invention and two acquisition method thereof, because double-collection device has acquisition controller LAN data and two-node cluster hot backup function simultaneously, therefore when main harvester break down stop collecting work after, rise to main harvester from the harvester automatic switchover and continue the operation collecting work, thereby can guarantee the normal operation of total system; Simultaneously, owing to adopt double-collection device both-way communication mode, make it faster and accurate; In addition,, make two even the shared same set of sensing sources of more a plurality of acquisition system, the installation and maintenance work of the situ of drilling well that therefore not only economized on resources but also alleviated owing to adopted controller local area network and three-way connection line; And, because double-collection device has acquisition controller LAN data and two-node cluster hot backup function simultaneously, therefore can preserve two sets of data at petroleum prospecting scene timely and accurately, avoided factor according to losing the loss that causes; Therefore very practical.