CN108983695A - A kind of master-slave switching method and device based on Complex Programmable Logic Devices - Google Patents
A kind of master-slave switching method and device based on Complex Programmable Logic Devices Download PDFInfo
- Publication number
- CN108983695A CN108983695A CN201810813362.0A CN201810813362A CN108983695A CN 108983695 A CN108983695 A CN 108983695A CN 201810813362 A CN201810813362 A CN 201810813362A CN 108983695 A CN108983695 A CN 108983695A
- Authority
- CN
- China
- Prior art keywords
- controller
- programmable logic
- logic devices
- complex programmable
- local
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/052—Linking several PLC's
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/058—Safety, monitoring
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Programmable Controllers (AREA)
Abstract
The embodiment of the present application discloses a kind of master-slave switching method and device based on Complex Programmable Logic Devices, two controllers of target component are respectively the first controller and second controller, respectively correspond the first Complex Programmable Logic Devices and the second Complex Programmable Logic Devices, communication is established between two Complex Programmable Logic Devices, when carrying out dual controller master-slave swap, any of two Complex Programmable Logic Devices can be used as target Complex Programmable Logic Devices, the controller of target Complex Programmable Logic Devices monitoring is as local controller, another controller is used as to controller;Target Complex Programmable Logic Devices can obtain local controller by the communication that has built up and to the essential information of controller, and then according to local controller and to the essential information of controller, local controller be arranged and to the master slave mode between controller.This method be from hardware view change dual controller master slave mode, can rapidly, efficiently realize master-slave swap.
Description
Technical field
This application involves data processing fields, more particularly to a kind of master-slave swap based on Complex Programmable Logic Devices
Method and apparatus.
Background technique
For some component controls, such as power supply control, monitoring temperature, fan control, light emitting diode (Light
Emitting Diode, abbreviation LED) control etc., in order to preferably control these components, dual control can be used for these components
Device control processed based on one controller, controls component, another controller when using dual controller control unit
For from, do not execute temporarily to component control operation, once one of controller breaks down, can also by another control
Device controls component, avoids losing the control to component.
However, when using dual controller control unit, in order to guarantee that there can be no two controllers at any time
The phenomenon that being all main, bus collision is prevented, so as to cause accidentally alerting, or even the case where damage common unit, dual controller
Between need regular to do master-slave swap.Currently, master-slave swap mainly passes through bottom micro-control unit (Micro
Controller Unit, abbreviation MCU) etc. software controls realize.
The switching time of software-based switching method by the second grade as unit of, overlong time spent by master-slave swap, mistake
The long master-slave swap time be easy to cause occur two controllers be all from the phenomenon that, to lose the monitoring and control to component
System.
Summary of the invention
In order to solve the above-mentioned technical problem, this application provides a kind of master-slave swaps based on Complex Programmable Logic Devices
Method and apparatus, this method be based on Complex Programmable Logic Devices carry out master-slave swap when, be from hardware view rather than software layer
Face changes dual controller master slave mode, and therefore, the switching consuming time is very short, rapidly, efficiently realizes master-slave swap, avoids the occurrence of
Two controllers be all from the phenomenon that, effective monitoring and control can be carried out to component during master-slave swap.
The embodiment of the present application discloses following technical solution:
In a first aspect, the embodiment of the present application provides a kind of master-slave switching method based on Complex Programmable Logic Devices,
Two controllers of target component are respectively the first controller and second controller, the first Complex Programmable Logic Devices monitoring the
One controller, the second Complex Programmable Logic Devices monitor second controller, and the first Complex Programmable Logic Devices is multiple with second
Communication is established between miscellaneous programmable logic device, which comprises
Local controller is obtained by target Complex Programmable Logic Devices and to the essential information of controller, the target
Complex Programmable Logic Devices is in first Complex Programmable Logic Devices and second Complex Programmable Logic Devices
Either one or two of, the local controller is the controller of target Complex Programmable Logic Devices monitoring, described to controller
For another controller of the target component described in addition to the local controller;
According to local controller and to the essential information of controller, local controller is set and to the principal and subordinate between controller
State.
Optionally, the essential information includes the information in place, the mark of controller, the state of micro-control unit of controller
At least one in information.
Optionally, described according to local control if including at least the information in place of the controller in the essential information
Local controller is arranged and to the master slave mode between controller in device and essential information to controller, comprising:
Judge whether the local controller is in place according to the essential information of the local controller, and according to described right
Whether the essential information of controller judges described in place to controller;
If the local controller is in place and described not in place to controller, it is arranged based on the local controller, it is right
Controller be from.
Optionally, it if judging the local controller and described in place to controller, is at least wrapped in the essential information
The information in place of the controller and the mark of the controller are included, the method also includes:
Judge the local controller mark and it is described to controller identify whether it is identical;
If it is different, the local controller and the master slave mode to controller is arranged according to preset rules;
If they are the same, according to the local controller and the negotiation result to controller be arranged the local controller and
The master slave mode to controller.
Optionally, described according to local if including at least the status information of the micro-control unit in the essential information
Local controller is arranged and to the master slave mode between controller in controller and essential information to controller, comprising:
Judge whether the target Complex Programmable Logic Devices occurs event according to the status information of the micro-control unit
Barrier;
If so, the local controller and institute is arranged according to the local controller and the negotiation result to controller
State the master slave mode to controller.
Optionally, described to be controlled according to the local controller with the negotiation result setting local to controller
Device and the master slave mode to controller, comprising:
It sends from main switching command to controller;
If receiving the confirmation character instruction sent to controller, it is arranged based on the local controller, it is described
Confirm that character instruction is described described to controller response from the transmission of main switching command;
If not receiving the confirmation character instruction sent to controller within a preset time, the local controller is set
For from.
Optionally, described by target Complex Programmable Logic Devices acquisition local controller and to the basic letter of controller
Breath, comprising:
Obtain the essential information for the local controller that the target Complex Programmable Logic Devices detects;
The essential information to controller received by the target Complex Programmable Logic Devices is obtained, it is described
Essential information to controller is that the monitoring Complex Programmable Logic Devices to controller examines controller to described
It measures.
Second aspect, the embodiment of the present application provide a kind of master-slave swap device based on Complex Programmable Logic Devices,
Two controllers of target component are respectively the first controller and second controller, the first Complex Programmable Logic Devices monitoring the
One controller, the second Complex Programmable Logic Devices monitor second controller, and the first Complex Programmable Logic Devices is multiple with second
Communication is established between miscellaneous programmable logic device, described device includes acquiring unit and setting unit:
The acquiring unit, for obtaining local controller by target Complex Programmable Logic Devices and to controller
Essential information, the target Complex Programmable Logic Devices are first Complex Programmable Logic Devices and second complexity
Any of programmable logic device, the local controller are the control of target Complex Programmable Logic Devices monitoring
Device, described is another controller of the target component in addition to the local controller to controller;
The setting unit, for according to local controller and to the essential information of controller, be arranged local controller and
To the master slave mode between controller.
Optionally, the essential information includes the information in place, the mark of controller, the state of micro-control unit of controller
At least one in information.
Optionally, if including at least the information in place of the controller in the essential information, the setting unit is used for
Judge whether the local controller is in place according to the essential information of the local controller, and according to described to controller
Whether essential information judges described in place to controller;If the local controller is in place and described not in place to controller,
Be arranged based on the local controller, to controller be from.
Optionally, if the local controller and described in place to controller, the setting unit is also used to judge institute
State local controller mark and it is described to controller identify whether it is identical;If it is different, being arranged described according to preset rules
Ground controller and the master slave mode to controller;If they are the same, according to the local controller and the association to controller
The local controller and the master slave mode to controller is arranged in quotient's result.
Optionally, if including at least the status information of the micro-control unit in the essential information, the setting unit,
For judging whether the micro-control unit breaks down according to the status information of the micro-control unit;If so, according to described
The local controller and the master slave mode to controller is arranged in local controller and the negotiation result to controller.
Optionally, the setting unit, for sending from main switching command to controller;If receiving described pair of control
The confirmation character instruction that device is sent, then be arranged based on the local controller, and the confirmation character instruction is described to controller
It is sent described in response from main switching command;If not receiving the confirmation character instruction sent to controller within a preset time,
Then be arranged the local controller be from.
Optionally, the acquiring unit, for obtaining described in the target Complex Programmable Logic Devices detects
The essential information of local controller;Obtain received by the target Complex Programmable Logic Devices it is described to controller
Essential information, the essential information to controller are the monitoring Complex Programmable Logic Devices to controller to described right
What controller was detected.
The embodiment of the present application has the advantage that it can be seen from above-mentioned technical proposal
Two controllers of target component are respectively the first controller and second controller, the first complicated programmable logic device
Part monitors the first controller, and the second Complex Programmable Logic Devices monitors second controller, the first Complex Programmable Logic Devices
It establishes and communicates between the second Complex Programmable Logic Devices, when carrying out dual controller master-slave swap, the first complexity can be compiled
Any of journey logical device and the second Complex Programmable Logic Devices can be used as target Complex Programmable Logic Devices, this
Sample, as local controller, another controller is used as to control the controller of the target Complex Programmable Logic Devices monitoring
Device processed;By the communication between Complex Programmable Logic Devices, the available local control of target Complex Programmable Logic Devices
Device and essential information to controller, and then according to local controller and to the essential information of controller, local controller is set
And to the master slave mode between controller.It is from hardware layer when due to carrying out master-slave swap based on Complex Programmable Logic Devices
Face rather than software view change dual controller master slave mode, and therefore, it is very short that switching expends the time, rapidly, efficiently realize principal and subordinate
Switching, avoid the occurrence of two controllers be all from the phenomenon that, during master-slave swap can to component carry out effective monitoring
And control.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, 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
Some embodiments of application without any creative labor, may be used also for those of ordinary skill in the art
To obtain other drawings based on these drawings.
Fig. 1 is a kind of process of the master-slave switching method based on Complex Programmable Logic Devices provided by the embodiments of the present application
Figure;
Fig. 2 is the flow chart of the method provided by the embodiments of the present application for negotiating to realize master-slave swap based on dual controller;
Fig. 3 is a kind of process of the master-slave switching method based on Complex Programmable Logic Devices provided by the embodiments of the present application
Figure;
Fig. 4 is a kind of structure of the master-slave swap device based on Complex Programmable Logic Devices provided by the embodiments of the present application
Block diagram.
Specific embodiment
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application
Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only this
Apply for a part of the embodiment, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art exist
Every other embodiment obtained under the premise of creative work is not made, shall fall in the protection scope of this application.
Currently, the master-slave switching method based on software controls such as bottom MCU, switching time, principal and subordinate was cut as unit of second grade
Change spent overlong time, the too long master-slave swap time be easy to cause occur two controllers be all from the phenomenon that, thus
Lose the monitoring and control to component.
For this purpose, the embodiment of the present application provides one kind based on Complex Programmable Logic Devices (ComplexProgrammable
Logic Device, abbreviation CPLD) master-slave switching method, which is from hardware view rather than software view changes
Become dual controller master slave mode, therefore, the switching consuming time is very short, rapidly, efficiently realizes master-slave swap, avoids the occurrence of two
Controller be all from the phenomenon that, effective monitoring and control can be carried out to component during master-slave swap.
With reference to the accompanying drawing, the master-slave switching method provided by the embodiments of the present application based on CPLD is described in detail.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of the master-slave switching method based on CPLD provided by the embodiments of the present application,
In this method, two controllers of target component are respectively the first controller and second controller, the first complex programmable logic
Device monitors the first controller, and the second Complex Programmable Logic Devices monitors second controller, the first complicated programmable logic device
It establishes and communicates between part and the second Complex Programmable Logic Devices, on this basis, this method comprises:
S101, local controller is obtained by target Complex Programmable Logic Devices and to the essential information of controller.
The target Complex Programmable Logic Devices is first Complex Programmable Logic Devices and second complexity
Any of programmable logic device, the local controller are the control of target Complex Programmable Logic Devices monitoring
Device, described is another controller of the target component in addition to the local controller to controller.
For example, the first controller is if target Complex Programmable Logic Devices is the first Complex Programmable Logic Devices
Local controller, second controller are to controller.
Dual-wire communications can be established between first CPLD and the 2nd CPLD by both threads, both threads can be set to
Signal0 and Signal1, wherein Signal0 is clock line, and Signal1 is data line, and dual-wire communications can be using integrated electricity
Road bus (Inter-Integrated Circuit, abbreviation I2C)/System Management Bus (System Management Bus,
Abbreviation SMBus), or using the simple protocol of self-defining.
It should be noted that may include the information in place of controller, the mark of controller, micro-control in the essential information
At least one in the status information of unit processed.
Wherein, the information in place of controller can be used to indicate that whether controller is connected to designated position, so as to just
Often work, if determining that controller is in place according to information in place, illustrates that controller is connected to designated position, can work normally,
Otherwise, illustrate that controller is not attached to designated position, can not work normally.
The mark of controller can be identity number (Identification, abbreviation ID), under normal circumstances, difference control
The ID of device processed is different.ID can use digital representation, such as 0,1 ..., naturally it is also possible to other symbol logos.
The status information of micro-control unit MCU can be used for reflecting whether MCU breaks down.
It is understood that due to establishing communication between the corresponding CPLD of different controllers, then to the basic of controller
Information can obtain this by target Complex Programmable Logic Devices by the CPLD of Double wire transmission to local controller, therefore
It ground controller and the detection of target Complex Programmable Logic Devices is described to be may is that the mode of the essential information of controller local controls
The essential information of device processed;Target Complex Programmable Logic Devices receives the essential information to controller, described to controller
Essential information be that the monitoring Complex Programmable Logic Devices to controller detects controller to described.
S102, according to local controller and to the essential information of controller, local controller is set and between controller
Master slave mode.
In the present embodiment, can be according to the difference for the content for including in essential information, the mode that master slave mode is arranged can
With different, next, by the mode of various possible setting master slave modes is introduced.
In one implementation, if including at least the information in place of the controller in the essential information, described
According to local controller and to the essential information of controller, local controller and the mode to the master slave mode between controller are set
It may is that judge whether the local controller is in place according to the essential information of local controller, and controlled according to described Dui
Whether the essential information of device judges described in place to controller;If the local controller is in place and described does not exist to controller
Position, then be arranged based on the local controller, to controller be from.
It is understood that information in place can reflect out whether controller is connected to designated position, if it is determined that control
Device processed is not in place, then, controller can not work normally, at this point, can be incited somebody to action to component be controlled and be monitored
Based on local controller setting.
In one implementation, if judging the local controller and described in place to controller, the basic letter
May be used also after judging the two in place in breath including at least the mark of the information in place of the controller and the controller
To continue the determining local controller of mark according to controller and principal and subordinate's shape to controller too, it is specifically as follows: the target
Complex Programmable Logic Devices judge the local controller mark and it is described to controller identify whether it is identical;If no
Together, the local controller and the master slave mode to controller are set according to preset rules;If they are the same, according to the local
The local controller and the master slave mode to controller is arranged in controller and the negotiation result to controller.
Wherein, preset rules can be mark for regulation local controller it is different with mark to controller when, which
Based on the corresponding controller of a mark, which identify corresponding controller be from.For example, mark can be indicated with ID, ID can be with
It is 0,1, preset rules are as follows: if local controller ID is 0 and is 1 to controller ID, be arranged based on local controller, be arranged
To controller be from;If local controller ID is 1 and is 0 to controller, setting is to based on controller, being arranged local control
Device be from.
If local controller is identical with the mark to controller, such as ID is 0 or is 1, at this point it is possible to think
It breaks down, then needs to determine the master slave mode of the two by local controller and to the negotiation result that controller is negotiated.
In one implementation, if including at least the status information of the micro-control unit, institute in the essential information
It states according to local controller and to the essential information of controller, local controller is set and to the master slave mode between controller
Implementation, which may is that, judges whether the MCU breaks down according to the status information of the micro-control unit (MCU);If so,
The local controller is set according to the local controller and the negotiation result to controller and described to controller
Master slave mode.
In one implementation, although MCU does not break down, MCU can be controlled from master with active transmission order and be cut
It changes, in this way, in order to avoid local controller and to controller all active transmission control from the order of main switching, and lead to local control
Device processed and there are double main phenomenons to controller, in the case where MCU active transmission order is controlled from main switching, this can also be passed through
Ground controller and the local controller and the master slave mode to controller are arranged to the negotiation result of controller.
Next, how negotiation result setting control principal and subordinate's shape will be obtained through consultation to local controller and to controller
State is introduced.
Referring to fig. 2, Fig. 2 shows a kind of method flow diagrams for negotiating control master slave mode, this method comprises:
S201, it sends from main switching command to controller.
From main switching command can be local controller send, for indicate local controller wish switching be main state
Order.
If S202, receiving the confirmation character instruction sent to controller, it is arranged based on the local controller,
The confirmation character instruction is described described to controller response from the transmission of main switching command.
If S203, not receiving the confirmation character instruction sent to controller within a preset time, the local is set
Controller be from.
Controller is received after main switching command, if to controller agree to local controller switching based on,
Confirmation character instruction (Acknowledgement, abbreviation ACK) can be sent to controller, after receiving ACK, could be aware that pair
Controller will be set as from being not in double main phenomenons therefore can controller based on agreeing to switch local controller
Based on local controller to be arranged.If not receiving the ACK sent to controller within a preset time, could be aware that control
Controller is wished based on device setting processed or also based on setting, in order to avoid there are double main phenomenons, then local controller is set
For from.Wherein, preset time can be with self-defining, such as it is 100us that preset time, which can be set,.
The embodiment of the present application has the advantage that it can be seen from above-mentioned technical proposal
Two controllers of target component are respectively the first controller and second controller, the first complicated programmable logic device
Part monitors the first controller, and the second Complex Programmable Logic Devices monitors second controller, the first Complex Programmable Logic Devices
It establishes and communicates between the second Complex Programmable Logic Devices, when carrying out dual controller master-slave swap, the first complexity can be compiled
Any of journey logical device and the second Complex Programmable Logic Devices can be used as target Complex Programmable Logic Devices, this
Sample, as local controller, another controller is used as to control the controller of the target Complex Programmable Logic Devices monitoring
Device processed;By the communication between Complex Programmable Logic Devices, the available local control of target Complex Programmable Logic Devices
Device and essential information to controller, and then according to local controller and to the essential information of controller, local controller is set
And to the master slave mode between controller.It is from hardware layer when due to carrying out master-slave swap based on Complex Programmable Logic Devices
Face rather than software view change dual controller master slave mode, and therefore, it is very short that switching expends the time, rapidly, efficiently realize principal and subordinate
Switching, avoid the occurrence of two controllers be all from the phenomenon that, during master-slave swap can to component carry out effective monitoring
And control.
Next, will be in conjunction with specific application example, to the whole of the master-slave switching method based on Complex Programmable Logic Devices
A process is introduced.Wherein, essential information includes the information in place of controller and the mark of controller, and controller is identified as
Controller ID, referring to Fig. 3, which comprises
S301, local controller and the essential information to controller are obtained.
S302, judge it is whether in place to controller, if it is not, then execute S303, if so, executing S304.
Based on S303, setting local controller.
S304, judge local controller whether based on, if it is not, then execute S305, if so, executing S306.
S305, setting local controller be from.
S306, judge to controller whether based on, if so, execute S307, if it is not, then executing S308.
S307, setting local controller be from.
S308, judge whether that local controller ID is 0 and is 1 to controller ID, if so, S309 is executed, if it is not, then holding
Row S310.
Based on S309, setting local controller.
S310, judge whether that local controller ID is 1 and is 0 to controller ID, if so, S311 is executed, if it is not, then holding
Row S312.
S311, setting local controller be from.
S312, judge whether send controller from main switching command, if so, S313 is executed, if it is not, then executing
S314。
S313, setting local controller are from reply ACK.
S314, local controller send from main switching and order.
S315, judge whether to receive the ACK for sending controller, if so, S316 is executed, if it is not, then executing S317.
Based on S316, setting local controller.
S317, judge whether to be more than preset time, if it is not, S315 is then executed, if so, executing S318.
S318, setting local controller be from.
Due to based on Complex Programmable Logic Devices carry out master-slave swap when, be from hardware view rather than software view change
Dual controller master slave mode, therefore, switching consuming time are very short, rapidly, efficiently realize master-slave swap, avoid the occurrence of two controls
Device processed be all from the phenomenon that, effective monitoring and control can be carried out to component during master-slave swap.
Based on the master-slave switching method based on Complex Programmable Logic Devices that previous embodiment provides, the embodiment of the present application
A kind of master-slave swap device 400 based on Complex Programmable Logic Devices is provided, two controllers of target component are respectively
First controller and second controller, the first Complex Programmable Logic Devices monitor the first controller, and the second complex programmable is patrolled
It collects device and monitors second controller, established between the first Complex Programmable Logic Devices and the second Complex Programmable Logic Devices
Communication, described device 400 include acquiring unit 401 and setting unit 402:
The acquiring unit 401, for obtaining local controller by target Complex Programmable Logic Devices and to control
The essential information of device, the target Complex Programmable Logic Devices are first Complex Programmable Logic Devices and described second
Any of Complex Programmable Logic Devices, the local controller are target Complex Programmable Logic Devices monitoring
Controller, described is another controller of the target component in addition to the local controller to controller;
The setting unit 402, for local controller to be arranged according to local controller and to the essential information of controller
And to the master slave mode between controller.
Optionally, the essential information includes the information in place, the mark of controller, the state of micro-control unit of controller
At least one in information.
Optionally, if including at least the information in place of the controller in the essential information, the setting unit is used for
Judge whether the local controller is in place according to the essential information of the local controller, and according to described to controller
Whether essential information judges described in place to controller;If the local controller is in place and described not in place to controller,
Be arranged based on the local controller, to controller be from.
Optionally, if the local controller and described in place to controller, the setting unit is also used to judge institute
State local controller mark and it is described to controller identify whether it is identical;If it is different, being arranged described according to preset rules
Ground controller and the master slave mode to controller;If they are the same, according to the local controller and the association to controller
The local controller and the master slave mode to controller is arranged in quotient's result.
Optionally, if including at least the status information of the micro-control unit in the essential information, the setting unit,
For judging whether the micro-control unit breaks down according to the status information of the micro-control unit;If so, according to described
The local controller and the master slave mode to controller is arranged in local controller and the negotiation result to controller.
Optionally, the setting unit, for sending from main switching command to controller;If receiving described pair of control
The confirmation character instruction that device is sent, then be arranged based on the local controller, and the confirmation character instruction is described to controller
It is sent described in response from main switching command;If not receiving the confirmation character instruction sent to controller within a preset time,
Then be arranged the local controller be from.
Optionally, the acquiring unit, for obtaining described in the target Complex Programmable Logic Devices detects
The essential information of local controller;Obtain received by the target Complex Programmable Logic Devices it is described to controller
Essential information, the essential information to controller are the monitoring Complex Programmable Logic Devices to controller to described right
What controller was detected.
The embodiment of the present application has the advantage that it can be seen from above-mentioned technical proposal
Two controllers of target component are respectively the first controller and second controller, the first complicated programmable logic device
Part monitors the first controller, and the second Complex Programmable Logic Devices monitors second controller, the first Complex Programmable Logic Devices
It establishes and communicates between the second Complex Programmable Logic Devices, when carrying out dual controller master-slave swap, the first complexity can be compiled
Any of journey logical device and the second Complex Programmable Logic Devices can be used as target Complex Programmable Logic Devices, this
Sample, as local controller, another controller is used as to control the controller of the target Complex Programmable Logic Devices monitoring
Device processed;By the communication between Complex Programmable Logic Devices, the available local control of target Complex Programmable Logic Devices
Device and essential information to controller, and then according to local controller and to the essential information of controller, local controller is set
And to the master slave mode between controller.It is from hardware layer when due to carrying out master-slave swap based on Complex Programmable Logic Devices
Face rather than software view change dual controller master slave mode, and therefore, it is very short that switching expends the time, rapidly, efficiently realize principal and subordinate
Switching, avoid the occurrence of two controllers be all from the phenomenon that, during master-slave swap can to component carry out effective monitoring
And control.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through
The relevant hardware of program instruction is completed, and foregoing routine can be stored in a computer readable storage medium, which exists
When execution, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned can be at least one in following media
Kind: read-only memory (English: read-only memory, abbreviation: ROM), RAM, magnetic or disk etc. are various to be can store
The medium of program code.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment it
Between same and similar part may refer to each other, each embodiment focuses on the differences from other embodiments.
For equipment and system embodiment, since it is substantially similar to the method embodiment, so describe fairly simple,
The relevent part can refer to the partial explaination of embodiments of method.Equipment and system embodiment described above is only schematic
, wherein unit may or may not be physically separated as illustrated by the separation member, it is shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.Some or all of the modules therein can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
Those of ordinary skill in the art can understand and implement without creative efforts.
The above, only a kind of specific embodiment of the application, but the protection scope of the application is not limited thereto,
Within the technical scope of the present application, any changes or substitutions that can be easily thought of by anyone skilled in the art,
Should all it cover within the scope of protection of this application.Therefore, the protection scope of the application should be with scope of protection of the claims
Subject to.
Claims (10)
1. a kind of master-slave switching method based on Complex Programmable Logic Devices, which is characterized in that two controls of target component
Device is respectively the first controller and second controller, and the first Complex Programmable Logic Devices monitors the first controller, and second is complicated
Programmable logic device monitors second controller, the first Complex Programmable Logic Devices and the second Complex Programmable Logic Devices it
Between establish communication, which comprises
Local controller is obtained by target Complex Programmable Logic Devices and to the essential information of controller, the target is complicated
Programmable logic device is appointing in first Complex Programmable Logic Devices and second Complex Programmable Logic Devices
One, the local controller be the target Complex Programmable Logic Devices monitoring controller, it is described to controller be except
Another controller of the target component outside the local controller;
According to local controller and to the essential information of controller, local controller is set and to principal and subordinate's shape between controller
State.
2. the method according to claim 1, wherein the essential information includes the information in place of controller, control
At least one in the mark of device processed, the status information of micro-control unit.
3. according to the method described in claim 2, it is characterized in that, if including at least the controller in the essential information
Information in place, it is described according to local controller and to the essential information of controller, local controller is set and between controller
Master slave mode, comprising:
Judge whether the local controller is in place according to the essential information of the local controller, and is controlled according to described Dui
Whether the essential information of device judges described in place to controller;
If the local controller is in place and described not in place to controller, it is arranged based on the local controller, to control
Device be from.
4. according to the method described in claim 3, it is characterized in that, if judging the local controller and described equal to controller
In place, including at least the mark of the information in place of the controller and the controller in the essential information, the method is also
Include:
Judge the local controller mark and it is described to controller identify whether it is identical;
If it is different, the local controller and the master slave mode to controller is arranged according to preset rules;
If they are the same, the local controller and described is arranged according to the local controller and the negotiation result to controller
To the master slave mode of controller.
5. according to the method described in claim 2, it is characterized in that, if including at least the microcontroller list in the essential information
The status information of member, it is described according to local controller and to the essential information of controller, local controller is set and to controller
Between master slave mode, comprising:
Judge whether the micro-control unit breaks down according to the status information of the micro-control unit;
If so, the local controller and described right is arranged according to the local controller and the negotiation result to controller
The master slave mode of controller.
6. method according to claim 4 or 5, which is characterized in that described to be controlled according to the local controller and described pair
The local controller and the master slave mode to controller is arranged in the negotiation result of device processed, comprising:
It sends from main switching command to controller;
If receiving the confirmation character instruction sent to controller, the confirmation based on the local controller is set
Character instruction is described described to controller response from the transmission of main switching command;
If not receiving the confirmation character instruction sent to controller within a preset time, the local controller, which is arranged, is
From.
7. method described in -5 any one according to claim 1, which is characterized in that described to pass through target complex programmable logic
Device obtains local controller and the essential information to controller, comprising:
Obtain the essential information for the local controller that the target Complex Programmable Logic Devices detects;
Obtain the essential information to controller received by the target Complex Programmable Logic Devices, described pair of control
The essential information of device processed is that the monitoring Complex Programmable Logic Devices to controller detect to controller to described
It arrives.
8. a kind of master-slave swap device based on Complex Programmable Logic Devices, which is characterized in that two controls of target component
Device is respectively the first controller and second controller, and the first Complex Programmable Logic Devices monitors the first controller, and second is complicated
Programmable logic device monitors second controller, the first Complex Programmable Logic Devices and the second Complex Programmable Logic Devices it
Between establish communication, described device includes acquiring unit and setting unit:
The acquiring unit, for obtaining local controller by target Complex Programmable Logic Devices and to the basic of controller
Information, the target Complex Programmable Logic Devices are that first Complex Programmable Logic Devices and second complexity can be compiled
Any of journey logical device, the local controller are the controller of target Complex Programmable Logic Devices monitoring,
Described is another controller of the target component in addition to the local controller to controller;
The setting unit, for local controller being arranged and to control according to local controller and to the essential information of controller
Master slave mode between device processed.
9. device according to claim 8, which is characterized in that the essential information includes the information in place of controller, control
At least one in the mark of device processed, the status information of micro-control unit.
10. device according to claim 9, which is characterized in that if including at least the controller in the essential information
Information in place, the setting unit, for judging that the local controller is according to the essential information of the local controller
It is no in place, and judged according to the essential information to controller described whether in place to controller;If the local control
Device is in place and described not in place to controller, then is arranged based on the local controller, to controller be from.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810813362.0A CN108983695A (en) | 2018-07-23 | 2018-07-23 | A kind of master-slave switching method and device based on Complex Programmable Logic Devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810813362.0A CN108983695A (en) | 2018-07-23 | 2018-07-23 | A kind of master-slave switching method and device based on Complex Programmable Logic Devices |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108983695A true CN108983695A (en) | 2018-12-11 |
Family
ID=64550188
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810813362.0A Pending CN108983695A (en) | 2018-07-23 | 2018-07-23 | A kind of master-slave switching method and device based on Complex Programmable Logic Devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108983695A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112269313A (en) * | 2020-11-09 | 2021-01-26 | 西安热工研究院有限公司 | Method for identifying controller double masters by IO module |
WO2021232237A1 (en) * | 2020-05-19 | 2021-11-25 | 华为技术有限公司 | Control method and device |
WO2023273146A1 (en) * | 2021-06-29 | 2023-01-05 | 深圳市商汤科技有限公司 | Data processing apparatus, system, method, and board card |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090089469A1 (en) * | 2007-09-28 | 2009-04-02 | Inventec Corporation | Parallel burunig system and method |
CN104579774A (en) * | 2014-12-31 | 2015-04-29 | 北京山石网科信息技术有限公司 | Switching method and device for main control equipment |
CN105974879A (en) * | 2016-06-27 | 2016-09-28 | 北京广利核系统工程有限公司 | Redundancy control equipment of digital instrument control system, digital instrument control system and control method |
CN107688547A (en) * | 2017-08-23 | 2018-02-13 | 郑州云海信息技术有限公司 | A kind of method and system of controller active-standby switch |
-
2018
- 2018-07-23 CN CN201810813362.0A patent/CN108983695A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090089469A1 (en) * | 2007-09-28 | 2009-04-02 | Inventec Corporation | Parallel burunig system and method |
CN104579774A (en) * | 2014-12-31 | 2015-04-29 | 北京山石网科信息技术有限公司 | Switching method and device for main control equipment |
CN105974879A (en) * | 2016-06-27 | 2016-09-28 | 北京广利核系统工程有限公司 | Redundancy control equipment of digital instrument control system, digital instrument control system and control method |
CN107688547A (en) * | 2017-08-23 | 2018-02-13 | 郑州云海信息技术有限公司 | A kind of method and system of controller active-standby switch |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021232237A1 (en) * | 2020-05-19 | 2021-11-25 | 华为技术有限公司 | Control method and device |
CN112269313A (en) * | 2020-11-09 | 2021-01-26 | 西安热工研究院有限公司 | Method for identifying controller double masters by IO module |
WO2023273146A1 (en) * | 2021-06-29 | 2023-01-05 | 深圳市商汤科技有限公司 | Data processing apparatus, system, method, and board card |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7029356B2 (en) | How to handle impedance abnormalities in power adapters, terminals and charging circuits | |
US8375148B2 (en) | Computer system, device sharing method, and device sharing program | |
CN105103061B (en) | The method of control and data transmission set, processing unit and the process control for redundancy with dispersion redundancy | |
CN104570721B (en) | Redundant manipulator master slave mode determines method | |
CN108983695A (en) | A kind of master-slave switching method and device based on Complex Programmable Logic Devices | |
CN106339058A (en) | Dynamic power supply management method and system | |
US9170569B2 (en) | Method for electing an active master device from two redundant master devices | |
CN105306605B (en) | A kind of double host server systems | |
JP2017506489A (en) | Power adapter, terminal and charging circuit abnormality handling method | |
CN107948063B (en) | Method for establishing aggregation link and access equipment | |
CN107957692B (en) | Controller redundancy method, device and system | |
US10741860B2 (en) | Fuel cell apparatus, fuel cell system, and control method for fuel cell system | |
US10691562B2 (en) | Management node failover for high reliability systems | |
US20190207413A1 (en) | Information processing system, battery module, control method, and program | |
CN111341063A (en) | Intelligent control system, method and device for safety early warning and monitoring of electric equipment and terminal equipment | |
CN113645048B (en) | Network card switching method and device and field programmable gate array FPGA | |
CN106126362B (en) | A kind of optical module I2C bus unrest sequential diagnosis method and device | |
CN115543872A (en) | Equipment management method and device and computer storage medium | |
CN109557453B (en) | Multi-master-control-chip identification processing method and system | |
CN115987999A (en) | Master-slave competition method and device for multi-machine system, ARM and storage medium | |
CN212623703U (en) | Display screen monitoring device, display screen monitoring chip and display screen monitor | |
CN110749046B (en) | Air conditioner control method and device, air conditioner and computer readable storage medium | |
US10635840B2 (en) | Banner notification in locked host monitor | |
CN113138581A (en) | Display screen monitoring method and device, display screen monitoring chip and display screen monitor | |
CN210721145U (en) | Unmanned vehicle |
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: 20181211 |