CN105653487B - Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system - Google Patents
Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system Download PDFInfo
- Publication number
- CN105653487B CN105653487B CN201510909721.9A CN201510909721A CN105653487B CN 105653487 B CN105653487 B CN 105653487B CN 201510909721 A CN201510909721 A CN 201510909721A CN 105653487 B CN105653487 B CN 105653487B
- Authority
- CN
- China
- Prior art keywords
- serial ports
- dcu
- communication
- station
- bypassed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4004—Coupling between buses
- G06F13/4009—Coupling between buses with data restructuring
- G06F13/4013—Coupling between buses with data restructuring with data re-ordering, e.g. Endian conversion
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses serial ports redundancy switching method, the apparatus and systems of security mask accelerator control system, comprising: S10, carries out bypass judgement to the current station DCU, determines the communication serial port communicated;S11, to the communication serial port send data acquisition command, and judge the communication serial port whether returned data;If S12, returned data, data parsing is carried out, and switches and sets next station DCU, enters step S14;If S13, non-returned data, error handle is carried out to the communication serial port, and determine whether that switching sets next DCU and stands according to processing result, S14 is entered step if allowing, if not allowing to enter step S10;S14, counter values add 1, and judge whether the counter values are maximum value, if so, the counter is set 1 and enters S10, if otherwise entering step S10;It can be improved the reliability and safety of rail safety screen door control system.
Description
Technical field
The present invention relates to data processing field, in particular to the serial ports redundancy switching side of a kind of security mask accelerator control system
Method, apparatus and system.
Background technique
At present in industrial automation, since serial communication interface is simple, program simplicity is write, it can be aobvious with computer
Show related commissioning information, do not need by other external hardwares, so as to easily carry out program debugging, so single-chip microcontroller
Serial port communication technology is widely used.But due to the anti-interference ability of accuracy and error and route by baud rate, shadow
The reliability of serial communication is rung.
And the prior art only proposes a kind of serial ports redundancy switching method based on autonomous redundant server, is not involved with
The serial ports redundancy handover scheme of serial ports redundancy switching method between single-chip microcontroller, more none main website to multiple slave stations.And it is existing
There is the serial ports redundancy switching method based on autonomous redundant server in technology, also not can be used directly on single-chip microcontroller.Therefore,
How to be switched using the serial ports redundancy of chip microcontroller rail safety screen door control system, is that those skilled in the art need to solve
Certainly the technical issues of.
Summary of the invention
The object of the present invention is to provide a kind of serial ports redundancy switching method of security mask accelerator control system, device and it is
System is able to solve in rail safety screen door control system double-serial port redundancy communication switching between communication card and the station multiple DCU
Problem, to improve the reliability and safety of rail safety screen door control system.
In order to solve the above technical problems, the present invention provides a kind of serial ports redundancy switching side of security mask accelerator control system
Method, comprising:
S10, bypass judgement is carried out to the current station DCU, determine the communication serial port communicated;
S11, to the communication serial port send data acquisition command, and judge the communication serial port whether returned data;
If S12, returned data, data parsing is carried out, and switches and sets next station DCU, enters step S14;
If S13, non-returned data, error handle is carried out to the communication serial port, and judge whether according to processing result
Allow to switch and set next station DCU, if permission, enters step S14, if not allowing, enter step S10;
S14, counter values add 1, and judge whether the counter values are maximum value, if so, by the counting
Device sets 1, and enters S10, if it is not, then entering step S10.
Wherein, the S10 includes:
Whether S101, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S102, if it is not, into
S103;
S102, judge whether serial ports A is bypassed;If so, into S104, if it is not, into S105;
S104, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S106;
S106, it sets the communication serial port currently communicated to serial ports B, and enters S11;
S105, judge whether serial ports B is bypassed;If so, into S107, if it is not, keeping the communication string currently communicated
Mouth enters S11;
S107, judge whether serial ports A is normal communication serial ports, if so, into S108, if it is not, into S14;
S108, it sets current communication serial port to serial ports A, and enters S11;
S103, judge whether serial ports B is bypassed;If so, into S109, if it is not, into S1010;
S109, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1011;
S1011, it sets the communication serial port currently communicated to serial ports A, and enters S11;
S1010, judge whether serial ports A is bypassed;If so, into S1012, if it is not, keeping the communication currently communicated
Serial ports enters S11;
S1012, judge whether serial ports B is normal communication serial ports, if so, into S1013, if it is not, into S14;
S1013, it sets current communication serial port to serial ports B, and enters S11.
Wherein, the S13 includes:
S131, judge whether current communication serial port is serial ports A;If so, into S132, if it is not, into S133;
S132, judge whether serial ports A is bypassed;If so, into S134, if it is not, into S135;
S135, it sets the state of serial ports A to error condition, and enters S134;
Whether S134, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S136, if it is not, into S14;
S136, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S137;
S137, serial ports B is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10;
S133, judge whether serial ports B is bypassed;If so, into S138, if it is not, into S139;
S139, it sets the state of serial ports B to error condition, and enters S138;
Whether S138, the principal communication serial ports for judging the current station DCU are serial ports B;If so, into S1310, if it is not, into
S14;
S1310, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1311;
S1311, serial ports A is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10.
Wherein, the S14 further include:
S15, the counter set 1, the problematic station DCU of principal communication serial ports are determined, according to the number at the station DCU to problematic
Principal communication serial ports be ranked up, and choose first principal communication serial ports pinged.
Wherein, the S15 includes:
Whether S151, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S152, if it is not, into
S153;
Whether the numerical value that S152, judgement ping counter is less than maximum value, if so, entering S155 if not into S154;
S154, the serial ports A that the communication serial port for judging whether there is the current station DCU is B and current DCU stands are not bypassed, if
In the presence of, S156 is carried out, if it does not exist, progress S157;
S157, counter values will be pinged add 1, and enter S152;
S156, serial ports A is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S153, judgement ping counter is less than maximum value, if so, entering S155 if not into S158;
S158, the serial ports B that the communication serial port for judging whether there is the current station DCU is A and current DCU stands are not bypassed, if
In the presence of, S159 is carried out, if it does not exist, progress S1510;
S1510, counter values will be pinged add 1, and enter S153;
S159, serial ports B is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S155, judgement ping counter is less than maximum value, if so, terminating;If it is not, by the number of logical counter
Value terminates after setting 1.
Wherein, the maximum value is 25 or 37.
The present invention provides a kind of serial ports redundancy switching device of security mask accelerator control system, comprising:
Judgment module is bypassed, for carrying out bypass judgement to the current station DCU, determines the communication serial port communicated;
Acquisition module for sending data acquisition command to the communication serial port, and judges whether the communication serial port returns
Return data;
Parsing module carries out data parsing if being used for returned data, and switches and set next station DCU, and flip-flop number
Device module;
Error handling module carries out error handle to the communication serial port, and according to processing if being used for non-returned data
As a result determine whether that next station DCU is set in switching, if allowing, flip-flop number module triggers bypass if not allowing
Judgment module;
Counter module adds 1 for counter values, and judges whether the counter values are maximum value, if so,
The counter is set 1, and triggers bypass judgment module, if it is not, then triggering bypass judgment module.
Wherein, further includes:
The main serial ports of problem pings module, for determining the problematic station DCU of principal communication serial ports, the number pair stood according to DCU
Problematic principal communication serial ports is ranked up, and is chosen first principal communication serial ports and pinged.
The present invention provides a kind of serial ports redundancy switching system of security mask accelerator control system, comprising:
The station DCU;
It is with the security mask door as described in any one of the above embodiments control that the station the DCU is connect by dual redundant serial communication
The serial ports redundancy switching device of system;
The track controller being connected with the serial ports redundancy switching device of the security mask accelerator control system;
The PC control machine being connected with the track controller.
Wherein, the number at the station DCU is 24 or 36.
Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system provided by the present invention, comprising:
S10, bypass judgement is carried out to the current station DCU, determine the communication serial port communicated;S11, data are sent to the communication serial port
Acquisition, and judge the communication serial port whether returned data;If S12, returned data carry out data parsing, and switch
Next station DCU is set, S14 is entered step;If S13, non-returned data, error handle, and root are carried out to the communication serial port
Determine whether that switching sets next station DCU and enters step S14 if allowing, if not allowing, enter according to processing result
Step S10;S14, counter values add 1, and judge whether the counter values are maximum value, if so, by the counting
Device sets 1, and enters S10, if it is not, then entering step S10;This method is able to solve in rail safety screen door control system and communicates
Between card and the station multiple DCU the problem of the switching of double-serial port redundancy communication, so that improves rail safety screen door control system can
By property and safety.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is the process of the serial ports redundancy switching method of security mask accelerator control system provided by the embodiment of the present invention
Figure;
Fig. 2 is the flow chart of bypass deterministic process provided by the embodiment of the present invention;
Fig. 3 is the flow chart of error processing procedure provided by the embodiment of the present invention;
Fig. 4 is the flow chart that principal communication serial ports provided by the embodiment of the present invention pings process;
Fig. 5 is the structural frames of the serial ports redundancy switching device of security mask accelerator control system provided by the embodiment of the present invention
Figure;
Fig. 6 is the knot of the serial ports redundancy switching device of another security mask accelerator control system provided by the embodiment of the present invention
Structure block diagram;
Fig. 7 is that the structure of the serial ports redundancy switching device of security mask accelerator control system provided by the embodiment of the present invention is shown
It is intended to;
Fig. 8 is the structural frames of the serial ports redundancy switching system of security mask accelerator control system provided by the embodiment of the present invention
Figure.
Specific embodiment
Core of the invention is to provide the serial ports redundancy switching method of security mask accelerator control system a kind of, device and is
System is able to solve in rail safety screen door control system double-serial port redundancy communication switching between communication card and the station multiple DCU
Problem, to improve the reliability and safety of rail safety screen door control system.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is the serial ports redundancy switching side of security mask accelerator control system provided by the embodiment of the present invention
The flow chart of method;This method may include:
S10, bypass judgement is carried out to the current station DCU, determine the communication serial port communicated;
Wherein, there are two communication interfaces at each station DCU, carry out redundancy setting, to improve the control of security mask door
The reliability of system.Here it is main communication interface that two communication interfaces at each station DCU, which are arranged one according to user demand, another
A slave communication interface as redundancy.Such as each station DCU possesses the master and slave two RS485 interfaces being mutually redundant.
And when the number at the station DCU here is greater than 1, if two communication interfaces at the station each DCU use serial ports A and string respectively
Mouth B is indicated, then the principal communication interface of each station DCU setting can be set as serial ports A or serial ports B, and each DCU stands
The difference that can be set;In order to convenient for management, under normal circumstances, the principal communication interface that all DCU can be stood is unified to be arranged
For serial ports A or uniformly it is set as serial ports B.
Wherein, the purpose for carrying out bypass judgement to each station DCU here is to be determined to carry out the logical of normal communication
Believe serial ports, the serial ports for being generally used for communication is all main serial ports;But it is required to change in time when main serial ports goes wrong
At from serial ports, or when emergency case occurs, the communication serial port communicated can be determined in time.Therefore, pass through bypass here
Whether judgement, two serial ports to determine the station DCU by the serial ports of system bypass forbid communication function by system bypass.Namely it is
Whenever the highest priority united to the Bypass Control of serial ports cannot all use the communication serial port being bypassed to be communicated.
Here bypass is carried out to judge can be to read by the numerical value of the bypass condition for two serial ports for standing to each DCU
It takes, and judges whether the serial ports is bypassed according to the numerical value, the serial ports not being bypassed is selected to be communicated, such as numerical value is 1 table
Show and be bypassed, numerical value is not that 1 expression is not bypassed;And further for more quickly and accurately selecting suitable serial ports to be led to
News, can also read again serial ports indicate normal communication state numerical value, and according to the numerical value determine the serial ports state whether
Normally, if such as numerical value is 0 to indicate normal, numerical value is 1600 to be expressed as error condition, and selection is not bypassed, also can be into
Serial ports of the serial ports of row normal communication as communication.Preferably, referring to FIG. 2, the detailed process for specifically carrying out bypass judgement can
With as follows: the S10 may include:
Whether S101, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S102, if it is not, into
S103;
S102, judge whether serial ports A is bypassed;If so, into S104, if it is not, into S105;
S104, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S106;
S106, it sets the communication serial port currently communicated to serial ports B, and enters S11;
S105, judge whether serial ports B is bypassed;If so, into S107, if it is not, keeping the communication string currently communicated
Mouth enters S11;
S107, judge whether serial ports A is normal communication serial ports, if so, into S108, if it is not, into S14;
S108, it sets current communication serial port to serial ports A, and enters S11;
S103, judge whether serial ports B is bypassed;If so, into S109, if it is not, into S1010;
S109, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1011;
S1011, it sets the communication serial port currently communicated to serial ports A, and enters S11;
S1010, judge whether serial ports A is bypassed;If so, into S1012, if it is not, keeping the communication currently communicated
Serial ports enters S11;
S1012, judge whether serial ports B is normal communication serial ports, if so, into S1013, if it is not, into S14;
S1013, it sets current communication serial port to serial ports B, and enters S11.
Wherein, when writing program com-state array can be indicated with Com_State [] [].One-dimensional representation DCU station number,
Two-dimensional representation serial port.For example, Com_State [1] [A]=1 indicates that the A serial ports at the station first DCU is bypassed, value 1 represents other
Line state;Value 1600 represents error condition;Value 0 indicates communication normal condition.COMA, COMB can indicate present communications serial ports A,
Serial ports B.
If judgement serial ports A is bypassed, judges whether B is bypassed, if then maintaining the original state end, be otherwise switched to string
Mouth B is as present communications serial ports;If serial ports A is not bypassed, judge whether B is bypassed, is if then judging the state of serial ports A
No is normal condition, if then switching to serial ports A as present communications serial ports, otherwise maintain the original state end.
S11, to the communication serial port send data acquisition command, and judge the communication serial port whether returned data;
Wherein, step 11 is normal the step of obtaining serial data, and can judge this by acquisition here
Whether the communication serial port is normal, if normal then can be with returned data, if mistake occurs in the serial ports, cannot normal returned data.
If S12, returned data, data parsing is carried out, and switches and sets next station DCU, enters step S14;
Wherein, the data are parsed after returned data, and prove the station the DCU present communications serial ports be it is normal,
It can continue to detect the communication serial port that next DCU stands.
If S13, non-returned data, error handle is carried out to the communication serial port, and judge whether according to processing result
Allow to switch and set next station DCU, if permission, enters step S14, if not allowing, enter step S10;
It wherein, going out to the current DCU communication serial port stood if mistake occurs in the present communications serial ports at the station the DCU
It wrong reason and another communication serial port can be switched to carries out judgement processing, and whether to be carried out according to the result judgement of processing
The detection at next station DCU, for example, then entering next DCU when two serial ports for finding the station are all bypassed and standing;Either
When discovery, another serial ports is not bypassed, then does not allow to be switched to next station DCU, need to carry out another serial ports again
Detection.Preferably, referring to FIG. 3, specific error processing procedure can be such that the S13 may include:
S131, judge whether current communication serial port is serial ports A;If so, into S132, if it is not, into S133;
S132, judge whether serial ports A is bypassed;If so, into S134, if it is not, into S135;
S135, it sets the state of serial ports A to error condition, and enters S134;
Whether S134, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S136, if it is not, into S14;
S136, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S137;
S137, serial ports B is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10;
S133, judge whether serial ports B is bypassed;If so, into S138, if it is not, into S139;
S139, it sets the state of serial ports B to error condition, and enters S138;
Whether S138, the principal communication serial ports for judging the current station DCU are serial ports B;If so, into S1310, if it is not, into
S14;
S1310, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1311;
S1311, serial ports A is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10.
Wherein, Primary_Com can indicate in the station DCU that two are mutually redundant master in serial ports when writing error processing procedure
Serial ports;StationCut: whether allow the station DCU switching mark.Assignment ALLOW expression allows to switch to the next station DCU,
UNALLOW expression does not allow the switching of the station DCU.System initialization default allows the switching of the station DCU.
Whether the communication serial port for starting to judge current erroneous is COMA, is then for COMA, is otherwise COMB.It is main below to be situated between
The communication serial port of current erroneous of continuing is this line of COMA, and COMB situation is similar with COMA.
If the communication serial port of current erroneous is COMA, first determine whether COMA is bypass, if then keeping COMA's
Former bypass condition is constant, and the state that COMA is set if not being bypassed is error condition.Next judge COMA serial ports whether be
Principal communication serial ports: it switches to if COMA is main communication serial port from communication serial port COMB, and judges whether COMB is bypassed, if other
Road keeps original COMB bypass condition constant, and otherwise switching communication serial port is COMB, while setting DCU switching mark StationCut and being
UNALLOW, so that communication card will be communicated by the COMB mouth of our station DCU with our station DCU after being back to beginning;If COMA is not
Principal communication serial ports then terminates to be recycled next time.
S14, counter values add 1, and judge whether the counter values are maximum value, if so, by the counting
Device sets 1, and enters S10, if it is not, then entering step S10.
Wherein, the number at the station DCU in this method can be any amount, according to setting for actual user,
The present invention is not defined the number at the station DCU.In existing situation, the general station DCU is both configured to 24 or 36;It is corresponding
Maximum value here can be set to 25 or 37.
Based on the above-mentioned technical proposal, the serial ports redundancy switching side of security mask accelerator control system provided in an embodiment of the present invention
Method, this method are able to solve in rail safety screen door control system double-serial port redundancy communication between communication card and the station multiple DCU
The problem of switching, to improve the reliability and safety of rail safety screen door control system.And the hardware of this method only needs
To switch there are two UART interface, serial ports redundancy and be realized completely by program, low in cost, easy to operate, high reliablity.
This method additionally provides single serial ports and bypasses incommunicado function, can restore to communicate after bypass.In addition, this method
Serial ports redundancy switching communication of the main website to multiple slave stations is realized, can also be used as one-to-one use.This serial ports redundancy is cut
The method of changing can be applied on the serial ports redundancy communication of any single-chip microcontroller.
Based on the above-mentioned technical proposal, this method can also include: after the S14
S15, the counter set 1, the problematic station DCU of principal communication serial ports are determined, according to the number at the station DCU to problematic
Principal communication serial ports be ranked up, and choose first principal communication serial ports pinged.
Wherein, i.e., the principal communication serial ports to go wrong can sequentially be put in the queue after each round detection,
A qualified principal communication serial ports is chosen in sequence to be pinged.It can guarantee the feelings being able to use in principal communication serial ports
Under condition, communicated as far as possible using principal communication serial ports.For example, one station 24, wheel DCU cycle detection is complete when there is 24 stations DCU
Later, it carries out once pinging operation.Preferably, referring to FIG. 4, specific principal communication serial ports ping process can be such that it is described
S15 may include:
Whether S151, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S152, if it is not, into
S153;
Whether the numerical value that S152, judgement ping counter is less than maximum value, if so, entering S155 if not into S154;
S154, the serial ports A that the communication serial port for judging whether there is the current station DCU is B and current DCU stands are not bypassed, if
In the presence of, S156 is carried out, if it does not exist, progress S157;
S157, counter values will be pinged add 1, and enter S152;
S156, serial ports A is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S153, judgement ping counter is less than maximum value, if so, entering S155 if not into S158;
S158, the serial ports B that the communication serial port for judging whether there is the current station DCU is A and current DCU stands are not bypassed, if
In the presence of, S159 is carried out, if it does not exist, progress S1510;
S1510, counter values will be pinged add 1, and enter S153;
S159, serial ports B is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S155, judgement ping counter is less than maximum value, if so, terminating;If it is not, by the number of logical counter
Value terminates after setting 1.
Wherein, writing ComErrNum when principal communication serial ports pings process can indicate that main serial ports DCU station number cycle detection becomes
Amount.According to Fig. 4, the process is broadly divided into main serial ports as COMA and COMB or so two parts, if main serial ports is COMA, enters
Left-hand component process, otherwise main serial ports is then COMB, hence into right-hand component process.Here main introduce is led to based on COMA
Believe the last split flow of serial ports, principal communication serial ports is the similar to COMA process of COMB.
If COMA is main serial ports, stand current communication serial port into each DCU of cycle detection, if present communications serial ports be from
Serial ports COMB, and main serial ports COMA is not bypassed, then the communication of main serial ports is unsuccessful before illustrating, thus be switched to from
Present communications serial ports is then switched to COMA by serial communication, is pinged counter and is added 1, and remember to ping Counter Value, jumps out and follow
Ring;Otherwise it pings counter and adds 1, recycled into while next time.Item is pinged in order to improve efficiency only to ping one every time and meet
The main communication serial ports of part.Pinging for a main communication serial ports is just carried out according to the systemic circulation of every completion of the sequence in queue.
Based on the above-mentioned technical proposal, bypass judges the side issued for judging whether to receive higher level's (such as track controller)
Road order, the serial port assignment ComPort [] that will do not bypassed.Bypass is to forbid the meaning of serial communication.If current serial ports is not received
To response, then through error handle, judges whether to be switched to next station DCU, be recycled next time if otherwise returning start over.
If sharing 24 stations DCU, initial station number is 1, so being initialized as 1 when station number StationAddr is more than or equal to 25.Problem string
The logical purpose of oral examination is: the problematic main serial ports at the station a DCU is pinged in a systemic circulation after often running through 24 stations DCU.
Based on the above-mentioned technical proposal, the serial ports redundancy switching side of security mask accelerator control system provided in an embodiment of the present invention
Method, this method are able to solve in rail safety screen door control system double-serial port redundancy communication between communication card and the station multiple DCU
The problem of switching, to improve the reliability and safety of rail safety screen door control system.And the hardware of this method only needs
To switch there are two interface, serial ports redundancy and be realized completely by program, low in cost, easy to operate, high reliablity.
The embodiment of the invention provides the serial ports redundancy switching methods of security mask accelerator control system, can be improved track peace
The reliability and safety of full-shield accelerator control system.
Below the serial ports redundancy switching device to security mask accelerator control system provided in an embodiment of the present invention and system into
Row is introduced, the serial ports redundancy switching device and system of security mask accelerator control system described below and above-described protective screen
The serial ports redundancy switching method for covering accelerator control system can correspond to each other reference.
Referring to FIG. 5, the serial ports redundancy that Fig. 5 is security mask accelerator control system provided by the embodiment of the present invention switches dress
The structural block diagram set;The apparatus may include:
Judgment module 100 is bypassed, for carrying out bypass judgement to the current station DCU, determines the communication serial port communicated;
Whether acquisition module 200 for sending data acquisition command to the communication serial port, and judges the communication serial port
Returned data;
Parsing module 300 carries out data parsing if being used for returned data, and switches and set next station DCU, and trigger
Counter module 500;
Error handling module 400, if being used for non-returned data, to communication serial port progress error handle, and according to
Processing result determines whether that next station DCU is set in switching, if allowing, flip-flop number module 500, if not allowing,
Triggering bypass judgment module 100;
Counter module 500 adds 1 for counter values, and judges whether the counter values are maximum value, if
It is the counter then to be set 1, and trigger bypass judgment module 100, if it is not, then triggering bypass judgment module 100.
Based on the above-mentioned technical proposal, referring to FIG. 6, the system can also include:
The main serial ports of problem pings module 600, for determining the problematic station DCU of principal communication serial ports, the number stood according to DCU
Problematic principal communication serial ports is ranked up, and chooses first principal communication serial ports and is pinged.
Wherein, the serial ports redundancy switching device namely address card of security mask accelerator control system here, specific one
A practical structures schematic diagram by standard ethernet interface with interchanger as shown in fig. 7, can be connected, interchanger can be with 2
The controller of mutual redundancy is connected, and processor MCU can have 40 channels DI, and 40 channels DO, specific number can root here
It is determined according to the model of chip, is connected by the standard RS485 interface of 2 mutual redundancies with the station each track DCU, track electricity
Source module is also connected with a standard RS485 interface.
Referring to FIG. 8, the serial ports redundancy that Fig. 8 is security mask accelerator control system provided by the embodiment of the present invention switches system
The structural block diagram of system, the system may include:
The station DCU;Namely track DCU module 700;
It is with the security mask door as described in any one of the above embodiments control that the station the DCU is connect by dual redundant serial communication
The serial ports redundancy switching device namely communication card module 800 of system;
The track controller 900 being connected with the serial ports redundancy switching device of the security mask accelerator control system;
The PC control machine 1000 being connected with the track controller.
Wherein, PC control machine 1000 can be communicated by Ethernet with track controller, track controller with communicate
Card can be communicated by Ethernet.
Optionally, the number at the station DCU is 24 or 36.
Based on the above-mentioned technical proposal, the serial ports redundancy of security mask accelerator control system provided in an embodiment of the present invention switches dress
It sets and system has the advantages that easy for operation, good reliability, display precision is high;And cost is relatively low for the system.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
Above to the serial ports redundancy switching method of security mask accelerator control system provided by the present invention, apparatus and system into
It has gone and has been discussed in detail.Used herein a specific example illustrates the principle and implementation of the invention, the above implementation
The explanation of example is merely used to help understand method and its core concept of the invention.It should be pointed out that for the general of the art
, without departing from the principle of the present invention, can be with several improvements and modifications are made to the present invention for logical technical staff, this
A little improvement and modification are also fallen within the protection scope of the claims of the present invention.
Claims (9)
1. a kind of serial ports redundancy switching method of security mask accelerator control system characterized by comprising
S10, bypass judgement is carried out to the current station DCU, determine the communication serial port communicated;
S11, to the communication serial port send data acquisition command, and judge the communication serial port whether returned data;
If S12, returned data, data parsing is carried out, and switches and sets next station DCU, enters step S14;
If S13, non-returned data, error handle is carried out to the communication serial port, and determine whether according to processing result
Switching sets next station DCU and enters step S14 if allowing, if not allowing, enter step S10;
S14, counter values add 1, and judge whether the counter values are maximum value, if so, the counter is set
1, and enter S10, if it is not, then entering step S10;The S13 includes:
S131, judge whether current communication serial port is serial ports A;If so, into S132, if it is not, into S133;
S132, judge whether serial ports A is bypassed;If so, into S134, if it is not, into S135;
S135, it sets the state of serial ports A to error condition, and enters S134;
Whether S134, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S136, if it is not, into S14;
S136, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S137;
S137, serial ports B is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10;
S133, judge whether serial ports B is bypassed;If so, into S138, if it is not, into S139;
S139, it sets the state of serial ports B to error condition, and enters S138;
Whether S138, the principal communication serial ports for judging the current station DCU are serial ports B;If so, into S1310, if it is not, into S14;
S1310, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1311;
S1311, serial ports A is set by current communication serial port, does not allow to switch and set next station DCU, and enters S10.
2. serial ports redundancy switching method as described in claim 1, which is characterized in that the S10 includes:
Whether S101, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S102, if it is not, into S103;
S102, judge whether serial ports A is bypassed;If so, into S104, if it is not, into S105;
S104, judge whether serial ports B is bypassed;If so, into S14, if it is not, into S106;
S106, it sets the communication serial port currently communicated to serial ports B, and enters S11;
S105, judge whether serial ports B is bypassed;If so, into S107, if it is not, keep the communication serial port currently communicated into
Enter S11;
S107, judge whether serial ports A is normal communication serial ports, if so, into S108, if it is not, into S14;
S108, it sets current communication serial port to serial ports A, and enters S11;
S103, judge whether serial ports B is bypassed;If so, into S109, if it is not, into S1010;
S109, judge whether serial ports A is bypassed;If so, into S14, if it is not, into S1011;
S1011, it sets the communication serial port currently communicated to serial ports A, and enters S11;
S1010, judge whether serial ports A is bypassed;If so, into S1012, if it is not, keeping the communication serial port currently communicated
Into S11;
S1012, judge whether serial ports B is normal communication serial ports, if so, into S1013, if it is not, into S14;
S1013, it sets current communication serial port to serial ports B, and enters S11.
3. serial ports redundancy switching method as described in claim 1, which is characterized in that the S14 further include:
S15, the counter set 1, the problematic station DCU of principal communication serial ports are determined, according to the number at the station DCU to problematic master
Communication serial port is ranked up, and is chosen first principal communication serial ports and pinged.
4. serial ports redundancy switching method as claimed in claim 3, which is characterized in that the S15 includes:
Whether S151, the principal communication serial ports for judging the current station DCU are serial ports A;If so, into S152, if it is not, into S153;
Whether the numerical value that S152, judgement ping counter is less than maximum value, if so, entering S155 if not into S154;
S154, the serial ports A that the communication serial port for judging whether there is the current station DCU is B and current DCU stands are not bypassed, and if it exists,
S156 is carried out, if it does not exist, carries out S157;
S157, counter values will be pinged add 1, and enter S152;
S156, serial ports A is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S153, judgement ping counter is less than maximum value, if so, entering S155 if not into S158;
S158, the serial ports B that the communication serial port for judging whether there is the current station DCU is A and current DCU stands are not bypassed, and if it exists,
S159 is carried out, if it does not exist, carries out S1510;
S1510, counter values will be pinged add 1, and enter S153;
S159, serial ports B is set by the current DCU communication serial port stood, counter values will be pinged and add 1, and enter S155;
Whether the numerical value that S155, judgement ping counter is less than maximum value, if so, terminating;If it is not, the numerical value of logical counter is set
Terminate after 1.
5. such as the described in any item serial ports redundancy switching methods of Claims 1-4, which is characterized in that the maximum value be 25 or
37。
6. a kind of serial ports redundancy switching device of security mask accelerator control system characterized by comprising
Judgment module is bypassed, for carrying out bypass judgement to the current station DCU, determines the communication serial port communicated;
Acquisition module for sending data acquisition command to the communication serial port, and judges whether the communication serial port returns to number
According to;
Parsing module carries out data parsing if being used for returned data, and switches and set next station DCU, and flip-flop number mould
Block;
Error handling module judges whether current communication serial port is serial ports A if being used for non-returned data;If current communication
Serial ports is serial ports A, then judges whether serial ports A is bypassed;If serial ports A is bypassed, judge that the principal communication serial ports at the current station DCU is
It is no to set error condition for the state of serial ports A if serial ports A is not bypassed for serial ports A, and judge the master at the current station DCU
Whether communication serial port is serial ports A;If the principal communication serial ports at the current station DCU is serial ports A, judge whether serial ports B is bypassed, if string
Mouth B is bypassed, then flip-flop number module sets serial ports B for current communication serial port, no if serial ports B is not bypassed
Allow to switch and set next station DCU, and triggers bypass judgment module;If the principal communication serial ports at the current station DCU is not serial ports A,
Flip-flop number module;
If current communication serial port is not serial ports A, judge whether serial ports B is bypassed;If serial ports B is bypassed, judgement is current
Whether the principal communication serial ports at the station DCU is serial ports B, if serial ports B is not bypassed, sets error condition for the state of serial ports B,
And judge whether the principal communication serial ports at the current station DCU is serial ports B;If the principal communication serial ports at the current station DCU is serial ports B, judge
Whether serial ports A is bypassed;If serial ports A is bypassed, flip-flop number module leads to current if serial ports A is not bypassed
Letter serial port setting is serial ports A, does not allow to switch and sets next station DCU, and triggers bypass judgment module;If the master at the current station DCU
Communication serial port is not serial ports B, then flip-flop number module;
Counter module adds 1 for counter values, and judges whether the counter values are maximum value, if so, by institute
It states counter and sets 1, and trigger bypass judgment module, if it is not, then triggering bypass judgment module.
7. serial ports redundancy switching device as claimed in claim 6, which is characterized in that further include:
The main serial ports of problem pings module, and for determining the station principal communication serial ports problematic DCU, number according to the station DCU is to asking
The principal communication serial ports of topic is ranked up, and is chosen first principal communication serial ports and pinged.
8. a kind of serial ports redundancy switching system of security mask accelerator control system characterized by comprising
The station DCU;
The security mask accelerator control system as claimed in claims 6 or 7 being connect with the station the DCU by dual redundant serial communication
Serial ports redundancy switching device;
The track controller being connected with the serial ports redundancy switching device of the security mask accelerator control system;
The PC control machine being connected with the track controller.
9. serial ports redundancy switching system as claimed in claim 8, which is characterized in that the number at the station DCU is 24 or 36
It is a.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510909721.9A CN105653487B (en) | 2015-12-09 | 2015-12-09 | Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510909721.9A CN105653487B (en) | 2015-12-09 | 2015-12-09 | Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105653487A CN105653487A (en) | 2016-06-08 |
CN105653487B true CN105653487B (en) | 2019-01-25 |
Family
ID=56481868
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510909721.9A Active CN105653487B (en) | 2015-12-09 | 2015-12-09 | Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105653487B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106896750A (en) * | 2017-03-16 | 2017-06-27 | 上海鼎桩新能源科技有限公司 | The serial ports redundancy switching method and device of a kind of controller system |
CN111007714B (en) * | 2019-12-06 | 2022-10-28 | 重庆川仪自动化股份有限公司 | Linux Ethernet-based redundant switching method for rail safety shielding door controller |
CN114244697A (en) * | 2021-11-15 | 2022-03-25 | 广西电网有限责任公司来宾兴宾供电局 | Distribution network automation terminal and system with automatic power-off restarting function |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103647781A (en) * | 2013-12-13 | 2014-03-19 | 大连理工计算机控制工程有限公司 | Mixed redundancy programmable control system based on equipment redundancy and network redundancy |
CN104612531A (en) * | 2014-12-31 | 2015-05-13 | 重庆川仪自动化股份有限公司 | Communication responding method of rail transit safety screen door control system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010117813A (en) * | 2008-11-12 | 2010-05-27 | Nec Electronics Corp | Debugging system, debugging method, debugging control method, and debugging control program |
CN104176066B (en) * | 2014-09-10 | 2016-08-24 | 上海自仪泰雷兹交通自动化系统有限公司 | The redundancy control system of train shield door and control method |
CN204552426U (en) * | 2015-02-02 | 2015-08-12 | 上海三意电机驱动技术有限公司 | A kind of rail transit platform screen door cell controller |
-
2015
- 2015-12-09 CN CN201510909721.9A patent/CN105653487B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103647781A (en) * | 2013-12-13 | 2014-03-19 | 大连理工计算机控制工程有限公司 | Mixed redundancy programmable control system based on equipment redundancy and network redundancy |
CN104612531A (en) * | 2014-12-31 | 2015-05-13 | 重庆川仪自动化股份有限公司 | Communication responding method of rail transit safety screen door control system |
Also Published As
Publication number | Publication date |
---|---|
CN105653487A (en) | 2016-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105653487B (en) | Serial ports redundancy switching method, the apparatus and system of security mask accelerator control system | |
CN105591857B (en) | A kind of method and apparatus of 485 multi-host communication | |
CN105556930A (en) | NVM EXPRESS controller for remote memory access | |
EP3113036A1 (en) | Data matching method and apparatus and computer storage medium | |
CN103441861B (en) | A kind of data record generation method and device | |
CN108780460A (en) | For the distribution index in distributed memory system and the method and apparatus of repositioning object segmentation | |
CN108153622A (en) | The method, apparatus and equipment of a kind of troubleshooting | |
JPS60500195A (en) | Method and device for smoothly interrupting digital communication links | |
CN104699577B (en) | For positioning the counter of failure tube core in distributed codeword storage system | |
CN107147538B (en) | Fault Locating Method based on RS485 bridge circuit device | |
CN107147553A (en) | Method of adjustment, adjusting apparatus and the adjusting device of slave station baud rate and frame format | |
WO2014012203A1 (en) | Method, device and system for determining drive letter | |
CN107203409A (en) | A kind of USB re-orientation processes method and system | |
CN106648851A (en) | IO management method and device used in multi-controller storage | |
CN104809250B (en) | A kind of loose formula data consistency verification method | |
CN103207801B (en) | The methods, devices and systems of virtual machine (vm) migration and fibre channel media | |
CN104251536B (en) | One-to-many current loop communication method and communication device | |
US9542200B2 (en) | Dynamic port naming in a chassis | |
WO2012163233A1 (en) | Loopback detection method and apparatus | |
US9692635B2 (en) | Identifying port misconnections on a network device | |
CN109657317A (en) | A kind of method, system and the equipment of CPLD pin assignments | |
CN108022398B (en) | Communication method for fire alarm system | |
CN104951385A (en) | Channel health state recording device of dynamic reconfigurable bus monitoring system | |
CN106708445A (en) | Link selection method and device | |
CN106774397A (en) | A kind of four redundance flight control systems computer synchronous method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |