CN109586832A - Wireless synchronization method, wireless slave, wireless host and wireless synchronization master - Google Patents
Wireless synchronization method, wireless slave, wireless host and wireless synchronization master Download PDFInfo
- Publication number
- CN109586832A CN109586832A CN201811533731.7A CN201811533731A CN109586832A CN 109586832 A CN109586832 A CN 109586832A CN 201811533731 A CN201811533731 A CN 201811533731A CN 109586832 A CN109586832 A CN 109586832A
- Authority
- CN
- China
- Prior art keywords
- wireless
- status command
- synchronous
- slave
- cpu
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 230000001360 synchronised effect Effects 0.000 claims abstract description 169
- 230000005540 biological transmission Effects 0.000 claims abstract description 19
- 238000012545 processing Methods 0.000 claims description 37
- 230000001934 delay Effects 0.000 claims description 31
- 238000012795 verification Methods 0.000 claims description 17
- 238000012790 confirmation Methods 0.000 claims description 8
- 230000001960 triggered effect Effects 0.000 description 18
- 238000004891 communication Methods 0.000 description 14
- 230000003111 delayed effect Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 7
- 238000013480 data collection Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000009434 installation Methods 0.000 description 2
- GOLXNESZZPUPJE-UHFFFAOYSA-N spiromesifen Chemical compound CC1=CC(C)=CC(C)=C1C(C(O1)=O)=C(OC(=O)CC(C)(C)C)C11CCCC1 GOLXNESZZPUPJE-UHFFFAOYSA-N 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0644—External master-clock
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a kind of wireless synchronization method, wireless slave, wireless host and wireless synchronization masters.Wireless synchronization method of the invention, wireless slave and wireless host, which are established, to be wirelessly connected, and is received the synchronous external sync for preparing the enabled CPU of status command that wireless host is sent by wireless connection and interrupted.The synchronous status command that starts is received after enabled and generates interrupt signal, and is interrupted according to the external sync that interrupt signal triggers CPU, and simultaneously operating is started.The present invention passes through the synchronization of the multiple wireless slaves of hardware layer implement of interruption function, can effectively improve synchronization accuracy, and without progress time complexity curve.In addition, required synchronizer is few, and structure is simple by the way of being wirelessly connected, and without estimating that wireless signal handles the time, without consideration routing policy and error condition.Compared to the mode of wired synchronization, the cost of isochronous controller and high-precision transmission line can reduce, and can adapt to a variety of different working environments.
Description
Technical field
The present invention relates to wireless synchronization technical fields, and in particular to a kind of wireless synchronization method, wireless slave, wireless host
And wireless synchronization master.
Background technique
Simultaneous techniques Channels Synchronous Data Acquisition System, data communication, safety in production, in terms of have extensively
Application.Traditional simultaneous techniques has same using simultaneous techniques, GPS simultaneous techniques and main website the broadcast clock synchronization of public clock line
Step technology.Wherein, higher using the simultaneous techniques synchronization accuracy of public clock line, but the technology needs to be routed, building ring
Border will affect the installation work of staff, when working environment does not allow installation work, then can not synchronize work.Separately
Outside, GPS simultaneous techniques can only all realize the synchronous of application layer with the implementation that main website broadcasts clock synchronization simultaneous techniques substantially, synchronous
Precision is not high enough, is unable to satisfy the demand of special synchronous working.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind
State a kind of wireless synchronization method, wireless slave, wireless host and the wireless synchronization master of problem.
According to one aspect of the present invention, a kind of wireless synchronization method is provided, is applied in wireless slave, this method packet
It includes:
It establishes and is wirelessly connected with wireless host;
It is wirelessly connected the synchronous preparation status command for receiving the wireless host and sending by described, and enabled CPU's is outer
Portion's sync break;
It is wirelessly connected the synchronous beginning status command for receiving the wireless host and sending by described, generates interrupt signal;
It is interrupted according to the external sync that the interrupt signal triggers CPU, starts simultaneously operating.
Preferably, the method also includes:
During simultaneously operating, the external sync of CPU is forbidden to interrupt.
Preferably, this method further include:
After the external sync of enabled CPU is interrupted, the return of Xiang Suoshu wireless host, which synchronizes, is ready to complete instruction, so that described
Wireless host is ready for sending synchronous beginning status command.
Preferably, the synchronous status command for preparing includes verification in the data packet for the data packet of message format
Code;
It is described to be wirelessly connected the synchronous preparation status command for receiving the wireless host and sending, and enabled CPU by described
External sync interruption include:
The check code in the data packet is obtained, the external sync of enabled CPU is interrupted after verification is correct.
Preferably, the method also includes:
After the external sync of enabled CPU is interrupted, start to be delayed at the first time;
If synchronous beginning status command is not received in first time is delayed, after first time delay
The external sync of CPU is forbidden to interrupt.
Preferably, the synchronous status command that starts includes synchronization in the data packet for the data packet of message format
Word;
It is described to be wirelessly connected the synchronous beginning status command for receiving the wireless host and sending by described, it generates and interrupts letter
Number include: the synchronization character obtained in the message data packet, and exports interrupt signal.
Preferably, the simultaneously operating includes: to carry out data acquisition;It, will be collected after the second time delays
Data are sent to the wireless host.
Another aspect according to the present invention provides a kind of wireless synchronization method, is applied in wireless host, this method packet
It includes:
It establishes and is wirelessly connected at least two wireless slaves;
Synchronous preparation status command is sent by described be wirelessly connected to each wireless slave;
After each wireless slave of confirmation is synchronized and is ready to complete, sent out by described be wirelessly connected to each wireless slave
Send synchronous beginning status command.
Preferably, the synchronous status command and/or the synchronous status command that starts of preparing is the data of message format
Packet, the data packet are sent using broadcast mode;It include check code and synchronization character in the data packet.
Preferably, the method also includes: synchronous prepare is being sent by described be wirelessly connected to each wireless slave
After status command, start third time delays;
Each wireless slave of the confirmation synchronize be ready to complete include: received in the third time delays it is each described
Wireless synchronizing for slave return is ready to complete instruction;
If not receiving any one or more than one wireless the synchronizing for slave return being ready to complete instruction,
After third time delays, synchronous preparation status command is sent again by described be wirelessly connected to each wireless slave.
Preferably, the method also includes: by it is described be wirelessly connected to synchronize to each wireless slave transmission start
After status command, start the second time delays;
After the second time delays, the acquisition data that each wireless slave is sent are received.
According to the present invention in another aspect, providing a kind of wireless slave, this is wireless, and slave includes the nothing being electrically connected to each other
Wire module and CPU processing module;
The wireless module is wirelessly connected for establishing with wireless host;It is received by the wireless connection described wireless
The synchronous preparation status command that host is sent;The synchronization beginning state for receiving the wireless host and sending is wirelessly connected by described
Instruction generates interrupt signal;
The CPU processing module, for according to the synchronous external sync interruption for preparing status command and enabling CPU;And root
It is interrupted according to the external sync of interrupt signal triggering CPU, starts simultaneously operating.
Preferably, the CPU processing module, is also used to during simultaneously operating, and the external sync of CPU is forbidden to interrupt.
Preferably, the wireless module is also used to after the external sync of enabled CPU is interrupted, and Xiang Suoshu wireless host returns
It returns to synchronize and is ready to complete instruction, so that the wireless host is ready for sending synchronous beginning status command.
Preferably, the synchronous status command for preparing includes verification in the data packet for the data packet of message format
Code;The CPU processing module, for obtaining the check code in the data packet, the external sync of enabled CPU after verification is correct
It interrupts.
Preferably, the CPU processing module is also used to after the external sync of enabled CPU is interrupted, and starts to prolong at the first time
When;If not receiving synchronous beginning status command in first time is delayed, forbid after first time delay
The external sync of CPU is interrupted.
Preferably, the synchronous status command that starts includes synchronization in the data packet for the data packet of message format
Word;
The wireless module for obtaining the synchronization character in the message data packet, and exports interrupt signal.
Preferably, the wireless slave further includes simultaneously operating module, and the simultaneously operating module and the CPU handle mould
Block electrical connection;
The simultaneously operating module, for carrying out data acquisition;
The CPU processing module is also used to after the second time delays, by being wirelessly connected collected data
It is sent to the wireless host.
Another aspect according to the present invention, provides a kind of wireless host, which includes the nothing being electrically connected to each other
Wire module and CPU processing module;
The wireless module is wirelessly connected for establishing at least two wireless slaves;
The CPU processing module, for sending synchronous preparation state by described be wirelessly connected to each wireless slave
Instruction;After each wireless slave of confirmation is synchronized and is ready to complete, sent by described be wirelessly connected to each wireless slave
It is synchronous to start status command.
Preferably, the synchronous status command and/or the synchronous status command that starts of preparing is the data of message format
Packet, the data packet are sent using broadcast mode;It include check code and synchronization character in the data packet.
Preferably, the CPU processing module is also used to send together by described be wirelessly connected to each wireless slave
After step prepares status command, start third time delays;Each wireless slave is received in the third time delays to return
Synchronize and be ready to complete instruction;
If not receiving any one or more than one wireless the synchronizing for slave return being ready to complete instruction,
After third time delays, synchronous preparation status command is sent again by described be wirelessly connected to each wireless slave.
Preferably, the CPU processing module is also used to send together by described be wirelessly connected to each wireless slave
After step starts status command, start the second time delays;After the second time delays, receives each wireless slave and send
Acquisition data.
According to the present invention in another aspect, providing a kind of wireless synchronization master, which includes:
Two or more are such as the wireless slave of any of the above-described and the wireless host of a such as any of the above-described;
The third time of wireless host is greater than the first time of wireless slave.
It is wirelessly connected it can be seen from the above, technical solution of the present invention, wireless slave and wireless host are established;By wirelessly connecting
The synchronous preparation status command that wireless host is sent is received, and the external sync of enabled CPU is interrupted;It is received by being wirelessly connected
The synchronous beginning status command that wireless host is sent, generates interrupt signal;In the external sync for triggering CPU according to interrupt signal
It is disconnected, start simultaneously operating.Technical solution of the present invention passes through the synchronization of the multiple wireless slaves of hardware layer implement of interruption function, Neng Gouyou
Effect ground improves synchronization accuracy, and without progress time complexity curve.In addition, required synchronizing is set by the way of being wirelessly connected
Standby few, structure is simple, and without estimating that wireless signal handles the time, without consideration routing policy and error condition.It compares
In the mode of wired synchronization, the cost of isochronous controller and high-precision transmission line can reduce, and can adapt to various differences
Working environment.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field
Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention
Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow diagram of wireless synchronization method according to an embodiment of the invention;
Fig. 2 shows a kind of flow diagrams of wireless synchronization method in accordance with another embodiment of the present invention;
Fig. 3 shows a kind of structural schematic diagram of wireless slave according to an embodiment of the invention;
Fig. 4 shows a kind of structural schematic diagram of wireless host according to an embodiment of the invention;
Fig. 5 shows a kind of structural schematic diagram of wireless synchronization master according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Fig. 1 shows a kind of flow diagram of wireless synchronization method according to an embodiment of the invention.It is same that this is wireless
One step process is applied in wireless slave, as shown in Figure 1, this method comprises:
Step S110 is established with wireless host and is wirelessly connected.
Wireless slave is the concrete operations object for synchronizing movement, and wireless host controls wireless slave, is realized
The simultaneously operating of more wireless slaves.Such as in the power system, wireless slave is usually data collection station, is carried out specific
Data acquisition operations;Wireless host is tidal data recovering terminal, and more wireless slaves of control realize synchronous acquisition in synchronization
Data.Wireless slave and wireless host pass through the data communication for being wirelessly connected both realizations, such as wireless slave by wirelessly connecting
The control instruction of wireless host is received, and sends data etc. to wireless host.Wireless connection can pass through radio-frequency antenna skill
Art, infrared technology etc. realize that, using the data communication realized between wireless host and wireless slave is wirelessly connected, structure is simple
It is single, and it is adapted to different working environments.
Step S120, by being wirelessly connected the synchronous preparation status command for receiving wireless host and sending, and enabled CPU's is outer
Portion's sync break.
Wireless host of the present invention is made in the synchronous execution of multiple wireless slaves by sending external interrupt request to wireless slave
Disconnected service routine, realizes the simultaneously operating of wireless slave.Therefore, it is necessary to enable the external interrupt of wireless slave, it is ensured that wirelessly from
The external interrupt of machine can be triggered, and wireless slave can respond the external interrupt request of wireless host.Synchronous preparation state
Instruction is to enable the instruction of the external interrupt of wireless slave, and wireless slave is according to the synchronous outside for preparing the open CPU of status command
It interrupts, the external interrupt of CPU is allow to be triggered.After the external interrupt of wireless slave CPU is enabled, the CPU of wireless slave is connect
External interrupt signal is received, that is, can trigger the external interrupt of wireless slave, wireless slave is made to execute an external service program.
Step S130 generates interrupt signal by being wirelessly connected the synchronous beginning status command for receiving wireless host and sending;
It is interrupted according to the external sync that interrupt signal triggers CPU, starts simultaneously operating.
The synchronous status command that starts is the external interrupt request that wireless host is sent to wireless slave.Wireless slave according to
The synchronization starts status command and generates interrupt signal, and interrupt signal triggers the external interrupt of CPU, CPU is made to respond the external interrupt
Request executes interrupt service routine.When multiple wireless slaves receive the synchronization and start status command simultaneously, then each wireless slave
The request of the CPU sync response external interrupt execute interrupt service routine, each wireless slave realizes a simultaneously operating.This
In external sync interrupt, that is, refer to multiple wireless same external interrupts of slave sync response, it is synchronous execute it is identical outer
Portion's interrupt service routine.
In the specific example of above-mentioned electric system, multiple wireless slaves is needed to synchronously complete difference portion in electric system
When the data acquisition operations of door, wireless host sends the synchronous of data acquisition to multiple wireless slaves simultaneously and starts status command.
Each wireless slave starts status command according to the synchronization, triggers the external interrupt of CPU, starts the data acquisition for executing corresponding department
Interrupt service routine synchronizes and is acquired data manipulation.Wireless slave receives synchronous beginning status command by radio-cell, and
It generates interrupt signal and is input to CPU, the external sync for triggering CPU is interrupted.Synchronize the reception, interrupt signal for starting status command
It generates, occurs in the hardware layer of wireless slave, pass through the same of the multiple wireless slaves of the hardware layer implement of interruption function of wireless slave
Step can effectively improve synchronization accuracy, and without progress time complexity curve.
The wireless synchronization method of the present embodiment, wireless slave and wireless host, which are established, to be wirelessly connected, and passes through wireless connection
The synchronous external sync for preparing the enabled CPU of status command that wireless host is sent is received to interrupt.It receives to synchronize after enabled and start
Status command generates interrupt signal, and is interrupted according to the external sync that interrupt signal triggers CPU, starts simultaneously operating.This technology
Scheme can effectively improve synchronization accuracy by the synchronization of the multiple wireless slaves of hardware layer implement of interruption function, and without when carrying out
Between correct.In addition, required synchronizer is few, and structure is simple by the way of being wirelessly connected, and without estimation wireless communication
Number processing time and consider routing policy and error condition.Compared to the mode of wired synchronization, can reduce isochronous controller and
The cost of high-precision transmission line, and can adapt to a variety of different working environments.
In one embodiment of the invention, in method as shown in Figure 1, the wireless synchronization method further include: in synchronization
In operating process, the external sync of CPU is forbidden to interrupt.
Simultaneously operating process is that the CPU of wireless slave executes the process of interrupt service routine.In this process, in order to ensure
The synchronization of each wireless slave forbids the external sync of wireless slave CPU to interrupt.Namely during simultaneously operating, wirelessly from
The external interrupt of machine CPU is illegal state, no longer responds other external interrupt requests.
In above-mentioned example, in multiple wireless slave synchronous acquisitions, if one of them wireless slave A has responded other
External interrupt request return again to acquisition data, the data that will result in the wireless slave A and other wireless slaves in this way acquire
It is asynchronous, to influence the result of synchronous acquisition.Therefore, by forbidding the external sync of CPU to interrupt, it is ensured that it is each wirelessly from
The simultaneously operating of machine is consistent.
In one embodiment of the invention, in method as shown in Figure 1, the wireless synchronization method further include: enabled
After the external sync of CPU is interrupted, is synchronized to wireless host return and be ready to complete instruction, synchronized out so that wireless host is ready for sending
Beginning status command.
It is synchronized to wireless host return and is ready to complete instruction, wireless host is made to confirm that the external interrupt of each wireless slave has been opened
It puts, the external interrupt of wireless slave can be triggered, and accurately execute simultaneously operating, and further increase simultaneously operating synchronizes essence
Degree.For example, synchronous data collection work is carried out by three wireless slaves, wireless host needs receive all three wireless slaves
Synchronize and be ready to complete instruction, it is ensured that the external sync interruption of the CPU of each wireless slave can be triggered.Then, wireless host
Synchronous beginning status command could be sent.Any one wireless slave, which does not return to synchronize, if it exists is ready to complete instruction, explanation
The external interrupt of wireless slave may be not enabled on, and can not start simultaneously operating.Wireless host can send again and synchronize standard at this time
Standby status command, the external sync for making wireless slave enable CPU again are interrupted.
In one embodiment of the invention, in method as shown in Figure 1, the synchronous status command for preparing is message format
Data packet includes check code in data packet.By being wirelessly connected the synchronous preparation status command for receiving wireless host and sending, and
It includes: the check code obtained in data packet that the external sync of enabled CPU, which is interrupted, the external sync of enabled CPU after verification is correct
It interrupts.
Message is used to exchange data information when made requests between different systems with response.Message has certain lattice
Formula, generally lead code+synchronization character+data field+check code, wherein check code to the data in checking prediction message data packet whether
Effectively.Prepare in status command synchronous, wireless slave responds check code therein.Wireless slave obtains in message data packet
Check code is verified, if verification is correct, illustrates that the data in the message data packet are valid data, wireless slave enables immediately
The external sync of CPU is interrupted.If verification failure, illustrates that the data in message data packet are invalid data, then can not enable CPU's
External sync is interrupted.
In one embodiment of the invention, in method as shown in Figure 1, the wireless synchronization method further include: enabled
After the external sync of CPU is interrupted, start to be delayed at the first time;If not receiving synchronous beginning state in first time is delayed to refer to
It enables, then forbids the external sync of CPU to interrupt after being delayed first time.
Setting is delayed at the first time, can be asked with further ensuring that between multiple wireless slaves with sync response external interrupt
It asks, improves the synchronization accuracy between multiple wireless slaves.That is, the CPU's of wireless slave is outer in first time delay
It is enabled state that portion, which is interrupted, can be triggered.If wireless slave does not receive synchronous beginning state and refers in first time delay
It enables, after being delayed first time, then the external interrupt of the CPU of wireless slave is prohibited, and wireless slave no longer responds wirelessly
The external interrupt of host is requested.This requires wireless hosts must be synchronous to each wireless Slave Broadcast in first time delay
Start status command, and ensure that each wireless slave receives, the synchronous error between each wireless slave is controlled at first with this
Between delay in.It can be arranged as the case may be at the first time, such as setting 10ms, 20ms or 50ms etc..
By taking above-mentioned electric system as an example, wireless host starts status command to three wireless Slave Broadcasts are synchronous, in 10ms
First time delay in, the first wireless slave and the second wireless slave receive it is synchronous start status command, start synchronous behaviour
Make.And the wireless slave of third does not receive synchronous beginning status command in first time delay, if the wireless slave of third is not prohibited
Only external sync is interrupted, and the synchronous status command that starts is received after 20ms and starts simultaneously operating, then the wireless slave of third is same
Step operation is asynchronous with the first wireless slave and the second wireless slave, influences the synchronization accuracy between wireless slave.Therefore exist
After the delay of 10ms, forbids the external sync of the wireless slave of third to interrupt, can be effectively prevented and above situation occur.
The simultaneously operating that wireless host can be returned according to wireless slave is asked as a result, sending external interrupt to wireless slave again
It asks, all wireless slaves is made to execute external interrupt service routine again.For example, after the external sync for forbidding CPU is interrupted, nothing
Line host can send synchronous preparation status command again, and the external sync for making wireless slave enable CPU is interrupted.
In one embodiment of the invention, in method as shown in Figure 1, the synchronous status command that starts is message format
Data packet includes synchronization character in data packet.Synchronizing out for wireless host transmission is received by being wirelessly connected in step S130
Beginning status command, generating interrupt signal includes: the synchronization character obtained in message data packet, and exports interrupt signal.
The synchronous status command that starts also uses message format, and format is identical as the synchronous preparation format of status command: leading
Code+synchronization character+data field+check code.Start in status command synchronous, wireless slave responds synchronization character therein.It synchronizes out
Beginning status command and synchronous preparation status command use identical format, can be in order to transmitting and parse.Wireless slave receives
Interrupt signal is generated when synchronization character and is input to CPU, triggers the external interrupt of CPU.For example, during wirelessly the wireless module of slave has
Disconnected output pin IRQ, the interrupt output pin IRQ connection of interruption the input pin IN1 and wireless module of CPU processing module, nothing
Wire module receives synchronous beginning status command, generates interrupt signal after getting synchronization character therein.Interrupt signal passes through interruption
Output pin IRQ is input to the terminal input pin IN1 of CPU, so that the external sync for triggering CPU is interrupted.
In one embodiment of the invention, in method as shown in Figure 1, the simultaneously operating in step S130 include: into
The acquisition of row data;After the second time delays, collected data are sent to wireless host.
Simultaneously operating specifically can be data acquisition operations, such as in the specific example of above-mentioned electric system, need more
A wireless slave synchronously completes the data acquisition operations of different departments in electric system, and wireless host triggers the outer of each wireless slave
Portion's sync break, each wireless slave execute interrupt service routine, synchronize and be acquired data manipulation.Passing through the second time delays
Afterwards, wireless slave sends data to wireless host.Second time can be arranged as the case may be, such as 10ms, 20ms etc..
Fig. 2 shows a kind of flow diagrams of wireless synchronization method according to an embodiment of the invention.It is same that this is wireless
One step process applied in no wireless host, as shown in Fig. 2, this method comprises:
Step S210 is established at least two wireless slaves and is wirelessly connected;
Wireless host carries out data communication with wireless slave by being wirelessly connected, such as by being wirelessly connected to wireless slave
Send control instruction etc..Being wirelessly connected can be realized using radio-frequency antenna technology, infrared technology etc..
Step S220 sends synchronous preparation status command by being wirelessly connected to each wireless slave;
Wireless host of the present invention is made in the synchronous execution of multiple wireless slaves by sending external interrupt request to wireless slave
Disconnected service routine, realizes the simultaneously operating of wireless slave.Therefore, it is necessary to enable the external interrupt of wireless slave, it is ensured that wirelessly from
The external interrupt of machine can be triggered, and wireless slave can respond the external interrupt request of wireless host.Synchronous preparation state
Instruction is to enable the instruction of the external interrupt of wireless slave, and wireless host sends it to wireless slave by being wirelessly connected, makes
Wireless slave can be triggered according to the synchronous external interrupt for preparing the open CPU of status command, the external interrupt of CPU.
Step S230 is sent after each wireless slave of confirmation is synchronized and is ready to complete by being wirelessly connected to each wireless slave
It is synchronous to start status command.
It synchronizes to be ready to complete and refers to that the CPU for completing wireless slave is enabled, wireless host confirms that wireless slave synchronization has prepared
At illustrating that the external interrupt of wireless slave CPU can be triggered.At this time to wireless slave send external interrupt request, wirelessly from
Machine can respond and execute corresponding external interrupt service routine.The synchronous status command that starts is wireless host to wireless slave
The external interrupt of transmission is requested.Wireless slave starts status command according to the synchronization and generates interrupt signal, and interrupt signal triggers CPU
External interrupt, make CPU respond the external interrupt request execute interrupt service routine.
In the wireless synchronization method of the present embodiment, wireless host and at least two wireless slaves are established and are wirelessly connected, and are passed through
It is wirelessly connected to each wireless slave and sends synchronous preparation status command.After each wireless slave of confirmation is synchronized and is ready to complete, then to
Each wireless slave sends synchronous beginning status command.Wireless host may be implemented in wireless connection and the data of multiple wireless slaves are logical
Letter carries out data communication compared to using connection, and wireless connection structure is simple, and more convenient and efficient, can effectively mention
High synchronization accuracy.And can reduce the cost of isochronous controller and high-precision transmission line, adapt to a variety of different building rings
Border.
In one embodiment of the invention, synchronous to prepare status command and/or synchronize out in method as shown in Figure 2
Beginning status command is the data packet of message format, and data packet is sent using broadcast mode;It include check code in data packet and same
Walk word.
Message is used to exchange data information when made requests between different systems with response.Message has certain lattice
Formula, it is synchronous to start status command with synchronous preparation status command using identical format: lead code+synchronization character+data field+verification
Code, in this way convenient for transmission and parsing.Certainly the synchronous status command that starts can also be with synchronous preparation status command using different
Data packet format.Prepare in status command synchronous, wireless slave response synchronizes the check code prepared in status command, to school
Whether the data tested in message data packet are effective.The check code that wireless slave obtains in message data packet is verified, if verification
Correctly, illustrate that the data in the message data packet are valid data, the external sync that wireless slave enables CPU immediately is interrupted.If
Verification failure illustrates that the data in message data packet are invalid data, then the external sync that can not enable CPU is interrupted.And same
Step starts in status command, and wireless slave responds synchronization character therein, exports external interrupt signal extremely when detecting synchronization character
CPU。
Broadcast mode may be implemented a wireless host and send message data packet to all wireless slaves simultaneously, with synchronous touching
The external interrupt for sending out wireless slave each.
In one embodiment of the invention, in method as shown in Figure 2, the wireless synchronization method further include: passing through
It is wirelessly connected after each wireless slave transmission synchronization preparation status command, starts third time delays.Wherein, in step S230
Confirm that each wireless slave synchronizes that be ready to complete include: to receive the synchronization that each wireless slave returns in third time delays to have prepared
At instruction;If not receiving any one or more than one wireless synchronizing for slave return being ready to complete instruction, in third
After time delays, synchronous preparation status command is sent again by being wirelessly connected to each wireless slave.
After wireless host sends synchronous preparation status command, into wait state, the waiting time is the delay of third time
Time.The third time can be according to practical specific setting, such as 50ms, 1s etc..In the wait state, wireless host, which is switched to, connects
Receipts mode confirms that a wireless slave synchronizes and is ready to complete to receive the message that each wireless slave returns.In the delay of third time
Interior, wireless host, which receives each wireless slave return and synchronizes, is ready to complete instruction, illustrates that the external interrupt of wireless slave CPU has made
It can complete, wireless host can start broadcast synchronization and start status command.If do not receive it is one or more wirelessly from
Synchronizing for machine return is ready to complete instruction, illustrates that the external interrupt there are wireless slave CPU is not enabled on, and can not start synchronous behaviour
Make.Therefore, after the delay of third time, wireless host is switched to sending mode, and broadcast synchronization preparation state refers to again
It enables, the external sync for making wireless slave enable CPU again is interrupted, it is ensured that the external sync interruption of each wireless slave CPU is to make
It can state.The delay of third time is set, the waiting time of wireless host is limited, improves the working efficiency of wireless host.It needs
Illustrate, the third time of wireless host is greater than the first time of wireless slave, it is ensured that wireless host receive wirelessly from
Synchronizing for machine return is ready to complete instruction.
In one embodiment of the invention, in method as shown in Figure 2, the wireless synchronization method further include: passing through
It is wirelessly connected after each wireless slave transmission synchronization beginning status command, starts the second time delays;In the second time delays knot
Shu Hou receives the acquisition data that each wireless slave is sent.
After wireless host sends synchronous beginning status command, it is again introduced into wait state, the waiting time was the second time
Delay time, second time delays are synchronous with the second time delays of wireless slave.The delay time of second time can basis
Actual conditions are specifically arranged, such as 10ms, 20ms etc..After the delay of the second time, wireless host is switched to reception mould
Formula, it is open to receive program, receive the data of each wireless slave acquisition.
Fig. 3 shows a kind of structural schematic diagram of wireless slave according to an embodiment of the invention.As shown in figure 3, should
Wireless slave 300 includes the wireless module 310 being electrically connected to each other and CPU processing module 320;
Wireless module 310 is wirelessly connected for establishing with wireless host;Receive what wireless host was sent by being wirelessly connected
It is synchronous to prepare status command;By being wirelessly connected the synchronous beginning status command for receiving wireless host and sending, interrupt signal is generated.
CPU processing module 320, for according to the synchronous external sync interruption for preparing status command and enabling CPU;And according to
The external sync that interrupt signal triggers CPU is interrupted, and simultaneously operating is started.
Wireless slave is the concrete operations object for synchronizing movement, and wireless host controls wireless slave, is realized
The simultaneously operating of more wireless slaves.Such as in the power system, wireless slave is usually data collection station, is carried out specific
Data acquisition operations;Wireless host is tidal data recovering terminal, and more wireless slaves of control realize synchronous acquisition in synchronization
Data.Wireless slave and wireless host pass through the data communication for being wirelessly connected both realizations, such as wireless slave by wirelessly connecting
The control instruction of wireless host is received, and sends data etc. to wireless host.Wireless module can use CC1100 system
Wireless module, SI443X series wireless module or SI446X system wireless module etc. are realized with wireless host and are wirelessly connected.Using
It is wirelessly connected the data communication realized between wireless host and wireless slave, structure is simple, and is adapted to different work
Environment.
Wireless host of the present invention is made in the synchronous execution of multiple wireless slaves by sending external interrupt request to wireless slave
Disconnected service routine, realizes the simultaneously operating of wireless slave.Therefore, it is necessary to enable the external interrupt of wireless slave, it is ensured that wirelessly from
The external interrupt of machine can be triggered, and wireless slave can respond the external interrupt request of wireless host.Synchronous preparation state
Instruction is to enable the instruction of the external interrupt of wireless slave, and wireless slave is according to the synchronous outside for preparing the open CPU of status command
It interrupts, the external interrupt of CPU is allow to be triggered.After the external interrupt of wireless slave CPU is enabled, the CPU of wireless slave is connect
External interrupt signal is received, that is, can trigger the external interrupt of wireless slave, wireless slave is made to execute an external service program.
The synchronous status command that starts is the external interrupt request that wireless host is sent to wireless slave.Wireless module 310
Start status command according to the synchronization and generate interrupt signal, CPU processing module 320 is triggered according to interrupt signal in the outside of CPU
It is disconnected, so that CPU is responded external interrupt request and executes interrupt service routine.Start when multiple wireless slaves receive this and synchronize simultaneously
Status command, then the CPU sync response of each wireless slave external interrupt request execute interrupt service routine, and each wireless slave is
Realize a simultaneously operating.Here external sync is interrupted, that is, refers to multiple wireless same outsides of slave sync response
It interrupts, it is synchronous to execute identical external interrupt service routine.
In the specific example of above-mentioned electric system, multiple wireless slaves is needed to synchronously complete difference portion in electric system
When the data acquisition operations of door, wireless host sends the synchronous of data acquisition to multiple wireless slaves simultaneously and starts status command.
Each wireless slave starts status command according to the synchronization, triggers the external interrupt of CPU, starts the data acquisition for executing corresponding department
Interrupt service routine synchronizes and is acquired data manipulation.Wireless slave receives synchronous beginning status command by radio-cell, and
It generates interrupt signal and is input to CPU, the external sync for triggering CPU is interrupted.Synchronize the reception, interrupt signal for starting status command
It generates, occurs in the hardware layer of wireless slave, pass through the same of the multiple wireless slaves of the hardware layer implement of interruption function of wireless slave
Step can effectively improve synchronization accuracy, and without progress time complexity curve.
The wireless slave 300 of the present embodiment is established by wireless module 310 and wireless host and is wirelessly connected;By wireless
Connection receives the synchronous of wireless host transmission and prepares status command, and CPU processing unit 320 is enabled according to the synchronous status command for preparing
The external sync of CPU is interrupted.After enabled, start status command by being wirelessly connected the synchronous of reception wireless host transmission, generate
Interrupt signal;CPU processing unit 320 is interrupted according to the external sync that interrupt signal triggers CPU, starts simultaneously operating.This technology
Scheme can effectively improve synchronization accuracy by the synchronization of the multiple wireless slaves of hardware layer implement of interruption function, and without when carrying out
Between correct.In addition, required synchronizer is few, and structure is simple by the way of being wirelessly connected, and without estimation wireless communication
Number processing time and consider routing policy and error condition.Compared to the mode of wired synchronization, can reduce isochronous controller and
The cost of high-precision transmission line, and can adapt to a variety of different working environments.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, CPU processing module 320 is also used to
During simultaneously operating, the external sync of CPU is forbidden to interrupt.
Simultaneously operating process is that the CPU of wireless slave executes the process of interrupt service routine.In this process, in order to ensure
The synchronization of each wireless slave, CPU processing module 320 forbid the external sync of wireless slave CPU to interrupt.Namely in simultaneously operating
In the process, the external interrupt of wireless slave CPU is illegal state, no longer responds other external interrupt requests.
In above-mentioned example, in multiple wireless slave synchronous acquisitions, if one of them wireless slave A has responded other
External interrupt request return again to acquisition data, the data that will result in the wireless slave A and other wireless slaves in this way acquire
It is asynchronous, to influence the result of synchronous acquisition.Therefore, by forbidding the external sync of CPU to interrupt, it is ensured that it is each wirelessly from
The simultaneously operating of machine is consistent.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, wireless module 310 is also used to make
After the external sync of energy CPU is interrupted, is synchronized to wireless host return and be ready to complete instruction, so that wireless host is ready for sending synchronization
Start status command.
It is synchronized to wireless host return and is ready to complete instruction, wireless host is made to confirm that the external interrupt of each wireless slave has been opened
It puts, the external interrupt of wireless slave can be triggered, and accurately execute simultaneously operating, and further increase simultaneously operating synchronizes essence
Degree.For example, synchronous data collection work is carried out by three wireless slaves, wireless host needs receive all three wireless slaves
Synchronize and be ready to complete instruction, it is ensured that the external sync interruption of the CPU of each wireless slave can be triggered.Then, wireless host
Synchronous beginning status command could be sent.Any one wireless slave, which does not return to synchronize, if it exists is ready to complete instruction, explanation
The external interrupt of wireless slave may be not enabled on, and can not start simultaneously operating.Wireless host can send again and synchronize standard at this time
Standby status command, the external sync for making wireless slave enable CPU again are interrupted.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, the synchronous status command for preparing is report
The data packet of literary format includes check code in data packet;CPU processing module 320 is used to obtain the check code in data packet,
The external sync of enabled CPU is interrupted after verification is correct.
Message is used to exchange data information when made requests between different systems with response.Message has certain lattice
Formula, generally lead code+synchronization character+data field+check code, wherein check code is arranged in the end of message, to checking prediction message number
It is whether effective according to the data in packet.Prepare in status command synchronous, wireless slave responds check code therein.Specifically, CPU
The check code that processing module 320 obtains in message data packet is verified, if verification is correct, illustrates the number in the message data packet
According to for valid data, the external sync that CPU processing module enables CPU immediately is interrupted.If verification failure, illustrates in message data packet
Data be invalid data, then can not enable CPU external sync interrupt.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, CPU processing module 320 is also used to
After the external sync of enabled CPU is interrupted, start to be delayed at the first time;Start if not receiving to synchronize in first time is delayed
Status command then forbids the external sync of CPU to interrupt after being delayed first time.
Setting is delayed at the first time, can be asked with further ensuring that between multiple wireless slaves with sync response external interrupt
It asks, improves the synchronization accuracy between multiple wireless slaves.That is, the CPU's of wireless slave is outer in first time delay
It is enabled state that portion, which is interrupted, can be triggered.If wireless slave does not receive synchronous beginning state and refers in first time delay
It enables, after being delayed first time, then the external interrupt of the CPU of wireless slave is prohibited, and wireless slave no longer responds wirelessly
The external interrupt of host is requested.This requires wireless hosts must be synchronous to each wireless Slave Broadcast in first time delay
Start status command, and ensure that each wireless slave receives, the synchronous error between each wireless slave is controlled at first with this
Between delay in.It can be arranged as the case may be at the first time, such as setting 10ms, 20ms or 50ms etc..
By taking above-mentioned electric system as an example, wireless host starts status command to three wireless Slave Broadcasts are synchronous, in 10ms
First time delay in, the first wireless slave and the second wireless slave receive it is synchronous start status command, start synchronous behaviour
Make.And the wireless slave of third does not receive synchronous beginning status command in first time delay, if the wireless slave of third is not prohibited
Only external sync is interrupted, and the synchronous status command that starts is received after 20ms and starts simultaneously operating, then the wireless slave of third is same
Step operation is asynchronous with the first wireless slave and the second wireless slave, influences the synchronization accuracy between wireless slave.Therefore exist
After the delay of 10ms, forbids the external sync of the wireless slave of third to interrupt, can be effectively prevented and above situation occur.
The simultaneously operating that wireless host can be returned according to wireless slave is asked as a result, sending external interrupt to wireless slave again
It asks, all wireless slaves is made to execute external interrupt service routine again.For example, after the external sync for forbidding CPU is interrupted, nothing
Line host can send synchronous preparation status command again, and the external sync for making wireless slave enable CPU is interrupted.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, the synchronous status command that starts is report
The data packet of literary format includes synchronization character in data packet.Wireless module 310 is used to obtain the synchronization character in message data packet,
And export interrupt signal.
The synchronous status command that starts also uses message format, and format is identical as the synchronous preparation format of status command: leading
Code+synchronization character+data field+check code, synchronous status command and the synchronous preparation status command of starting, can be with using identical format
Convenient for transmitting and parsing.Start in status command synchronous, the corresponding synchronization character therein of wireless slave.Specifically, wireless module
310 generate interrupt signal when receiving synchronization character, and the external interrupt of CPU is triggered according to interrupt signal.For example, the nothing of wireless slave
Wire module 310 has in the interruption input pin IN1 and wireless module 310 of interrupt output pin IRQ, CPU processing module 320
Disconnected output pin IRQ connection, wireless module 310 receive it is synchronous start status command, get after synchronization character therein in generation
Break signal.Interrupt signal is input to the interruption input pin IN1 of CPU processing module 320 by interrupt output pin IRQ, thus
The external sync for triggering CPU is interrupted.
In one embodiment of the invention.In wireless slave 300 as shown in Figure 3, wireless slave further includes synchronous behaviour
Make module, simultaneously operating module is electrically connected with CPU processing module 320.Simultaneously operating module, for carrying out data acquisition;At CPU
Module 320 is managed, is also used to that collected data are sent to wireless master by being wirelessly connected after the second time delays
Machine.
Simultaneously operating specifically can be data acquisition operations, such as in the specific example of above-mentioned electric system, need more
A wireless slave synchronously completes the data acquisition operations of different departments in electric system, and wireless host triggers the outer of each wireless slave
Portion's sync break, each wireless slave execute interrupt service routine, synchronize and be acquired data manipulation.Passing through the second time delays
Afterwards, wireless slave sends data to wireless host.Second time can be arranged as the case may be, such as 10ms, 20ms etc..
Fig. 4 shows a kind of structural schematic diagram of wireless host according to an embodiment of the invention.As shown in figure 4, should
Wireless host 400 includes the wireless module 410 being electrically connected to each other and CPU processing module 420.
Wireless module 410 is wirelessly connected for establishing at least two wireless slaves.
Wireless host is established by wireless module 410 and wireless slave and is wirelessly connected, and data communication is carried out.Such as pass through nothing
Line connects to wireless slave and sends control instruction etc..Wireless module can be using CC1100 system wireless module, SI443X series
Wireless module or SI446X system wireless module etc. are realized with multiple wireless hosts and are wirelessly connected.
CPU processing module 420, for preparing status command by being wirelessly connected to send to synchronize to each wireless slave;True
Recognize after each wireless slave synchronizes and be ready to complete, synchronous starts status command by being wirelessly connected to send to each wireless slave.
Wireless host of the present invention is made in the synchronous execution of multiple wireless slaves by sending external interrupt request to wireless slave
Disconnected service routine, realizes the simultaneously operating of wireless slave.It is therefore desirable to enable the external interrupt of wireless slave, it is ensured that wireless
The external interrupt of slave can be triggered, and wireless slave can respond the external interrupt request of wireless host.It is synchronous to prepare shape
State instruction is to enable the instruction of the external interrupt of wireless slave, and wireless host sends it to wireless slave by being wirelessly connected,
Make wireless slave according to the synchronous external interrupt for preparing the open CPU of status command, the external interrupt of CPU can be triggered.
It synchronizes to be ready to complete and refers to that the CPU for completing wireless slave is enabled, wireless host confirms that wireless slave synchronization has prepared
At illustrating that the external interrupt of wireless slave CPU can be triggered.At this time to wireless slave send external interrupt request, wirelessly from
Machine can respond and execute corresponding external interrupt service routine.The synchronous status command that starts is wireless host to wireless slave
The external interrupt of transmission is requested.Wireless slave starts status command according to the synchronization and generates interrupt signal, and interrupt signal triggers CPU
External interrupt, make CPU respond the external interrupt request execute interrupt service routine.
In the wireless host 400 of the present embodiment, wirelessly connected by wireless module 410 and at least two wireless slave foundation
It connects, CPU processing module 420 sends synchronous preparation status command by being wirelessly connected to each wireless slave.Confirm it is each wirelessly from
Machine synchronizes be ready to complete after, then by being wirelessly connected to send to each wireless slave synchronous start status command.Being wirelessly connected can be with
The data communication for realizing wireless host and multiple wireless slaves carries out data communication compared to using connection, is wirelessly connected knot
Structure is simple, and more convenient and efficient, can effectively improve synchronization accuracy.And it can reduce isochronous controller and high-precision biography
The cost of defeated line adapts to a variety of different working environments.
In one embodiment of the invention, in wireless host as shown in Figure 4, the synchronous status command and/or same of preparing
Step starts the data packet that status command is message format, and data packet is sent using broadcast mode;It include check code in data packet
And synchronization character.
Message is used to exchange data information when made requests between different systems with response.Message has certain lattice
Formula, it is synchronous to start status command with synchronous preparation status command using identical format: lead code+synchronization character+data field+verification
Code, in this way convenient for transmission and parsing.Wireless slave response synchronizes the check code prepared in status command, to checking prediction message data
Whether the data in packet are effective.The check code that wireless slave obtains in message data packet is verified, if verification is correct, illustrates this
Data in message data packet are valid data, and the external sync that wireless slave enables CPU immediately is interrupted.If verification failure, says
Data in contract quotation text data packet are invalid data, then the external sync that can not enable CPU is interrupted.And refer in synchronous beginning state
In order, wireless slave responds synchronization character therein, and external interrupt signal is exported when detecting synchronization character to CPU.
Broadcast mode may be implemented a wireless host and send message data packet to all wireless slaves simultaneously, with synchronous touching
The external interrupt for sending out wireless slave each.
In one embodiment of the invention, in wireless host as shown in Figure 4, CPU processing module 420 is also used to logical
Cross wireless connection to each wireless slave send it is synchronous prepare status command after, start third time delays;In third time delays
Interior each wireless synchronizing for slave return of reception is ready to complete instruction;If not receiving any one or more than one wireless slave
Synchronizing for returning is ready to complete instruction, then after third time delays, sends out again by being wirelessly connected to each wireless slave
Send synchronous preparation status command.
After wireless host sends synchronous preparation status command, into wait state, the waiting time is the delay of third time
Time.The third time can be according to practical specific setting, such as 50ms, 1s etc..In the wait state, wireless host, which is switched to, connects
Receipts mode confirms that a wireless slave synchronizes and is ready to complete to receive the message that each wireless slave returns.In the delay of third time
Interior, wireless host, which receives each wireless slave return and synchronizes, is ready to complete instruction, illustrates that the external interrupt of wireless slave CPU has made
It can complete, wireless host can start broadcast synchronization and start status command.If do not receive it is one or more wirelessly from
Synchronizing for machine return is ready to complete instruction, illustrates that the external interrupt there are wireless slave CPU is not enabled on, and can not start synchronous behaviour
Make.Therefore, after the delay of third time, wireless host is switched to sending mode, and broadcast synchronization preparation state refers to again
It enables, the external sync for making wireless slave enable CPU again is interrupted, it is ensured that the external sync interruption of each wireless slave CPU is to make
It can state.The delay of third time is set, the waiting time of wireless host is limited, improves the working efficiency of wireless host.It needs
Illustrate, the third time of wireless host is greater than the first time of wireless slave, it is ensured that wireless host receive wirelessly from
Synchronizing for machine return is ready to complete instruction.
In one embodiment of the invention, in wireless host as shown in Figure 4, CPU processing module 420 is also used to
After sending synchronous beginning status command to each wireless slave by wireless connection, start the second time delays;Prolong in the second time
When after, receive the acquisition data that each wireless slave is sent.
After wireless host sends synchronous beginning status command, it is again introduced into wait state, the waiting time was the second time
Delay time, second time delays are synchronous with the second time delays of wireless slave.The delay time of second time can basis
Actual conditions are specifically arranged, such as 10ms, 20ms etc..After the delay of the second time, wireless host is switched to reception mould
Formula, it is open to receive program, receive the data of each wireless slave acquisition.
Fig. 5 shows a kind of structural schematic diagram of wireless synchronization master according to an embodiment of the invention.Such as Fig. 5 institute
Show, which includes: two or more such as the wireless slave 300 of any of the above-described and one as above
State the wireless host 400 of any one;The third time of wireless host is greater than the first time of wireless slave.
In wireless synchronization master 500, each wireless slave 300 carries out data communication with wireless host 400, realizes wireless synchronization
Method.Specific structure, function and the data communication mode of wireless slave 300 and wireless host 400 referring to above-described embodiment, this
Place repeats no more.
It is wirelessly connected in conclusion wireless synchronization method of the invention, wireless slave and wireless host are established, and passes through nothing
Line connection receives the external sync that the synchronous preparation status command that wireless host is sent enables CPU and interrupts.Nothing is received after enabled
The synchronous status command that starts that line host is sent generates interrupt signal, and is interrupted according to the external sync that interrupt signal triggers CPU,
Start simultaneously operating.The technical program can be effectively improved same by the synchronization of the multiple wireless slaves of hardware layer implement of interruption function
Precision is walked, and without carrying out time complexity curve.In addition, required synchronizer is few, and structure is simple by the way of being wirelessly connected,
And without the estimation wireless signal processing time and consider routing policy and error condition.Compared to the mode of wired synchronization,
It can reduce the cost of isochronous controller and high-precision transmission line, and can adapt to a variety of different working environments.
The above description is merely a specific embodiment, under above-mentioned introduction of the invention, those skilled in the art
Other improvement or deformation can be carried out on the basis of the above embodiments.It will be understood by those skilled in the art that above-mentioned tool
Body description only preferably explains that the purpose of the present invention, protection scope of the present invention should be subject to the protection scope in claims.
Claims (10)
1. a kind of wireless synchronization method is applied in wireless slave, which is characterized in that this method comprises:
It establishes and is wirelessly connected with wireless host;
It is wirelessly connected the synchronous preparation status command for receiving the wireless host and sending by described, and the outside of enabled CPU is same
Step is interrupted;
It is wirelessly connected the synchronous beginning status command for receiving the wireless host and sending by described, generates interrupt signal;
It is interrupted according to the external sync that the interrupt signal triggers CPU, starts simultaneously operating.
2. the method according to claim 1, wherein the method also includes:
During simultaneously operating, the external sync of CPU is forbidden to interrupt.
3. the method according to claim 1, wherein this method further include:
After the external sync of enabled CPU is interrupted, the return of Xiang Suoshu wireless host, which synchronizes, is ready to complete instruction, so that described wireless
Host is ready for sending synchronous beginning status command.
4. the method according to claim 1, wherein the synchronous status command for preparing is the data of message format
It wraps, includes check code in the data packet;
It is described to be wirelessly connected the synchronous preparation status command for receiving the wireless host and sending by described, and enabled CPU's is outer
Portion's sync break includes:
The check code in the data packet is obtained, the external sync of enabled CPU is interrupted after verification is correct.
5. a kind of wireless synchronization method is applied in wireless host, which is characterized in that this method comprises:
It establishes and is wirelessly connected at least two wireless slaves;
Synchronous preparation status command is sent by described be wirelessly connected to each wireless slave;
After each wireless slave of confirmation is synchronized and is ready to complete, sent together by described be wirelessly connected to each wireless slave
Step starts status command.
6. according to the method described in claim 5, it is characterized in that, described synchronous prepare status command and/or described synchronize out
Beginning status command is the data packet of message format, and the data packet is sent using broadcast mode;
It include check code and synchronization character in the data packet.
7. according to the method described in claim 5, it is characterized in that, the method also includes:
By it is described be wirelessly connected to each wireless slave send it is synchronous prepare status command after, starting the third time prolongs
When;
Each wireless slave of confirmation, which synchronizes to be ready to complete, includes:
Each wireless synchronizing for slave return is received in the third time delays is ready to complete instruction;
If not receiving any one or more than one wireless the synchronizing for slave return being ready to complete instruction, in third
After time delays, synchronous preparation status command is sent again by described be wirelessly connected to each wireless slave.
8. a kind of wireless slave, which is characterized in that this is wireless, and slave includes the wireless module being electrically connected to each other and CPU processing mould
Block;
The wireless module is wirelessly connected for establishing with wireless host;The wireless host is received by the wireless connection
The synchronous of transmission prepares status command;Referred to by the synchronization beginning state for being wirelessly connected the reception wireless host transmission
It enables, generates interrupt signal;
The CPU processing module, for according to the synchronous external sync interruption for preparing status command and enabling CPU;And according to institute
The external sync for stating interrupt signal triggering CPU is interrupted, and simultaneously operating is started.
9. a kind of wireless host, which is characterized in that the wireless host includes the wireless module being electrically connected to each other and CPU processing mould
Block;
The wireless module is wirelessly connected for establishing at least two wireless slaves;
The CPU processing module, for sending synchronous preparation status command by described be wirelessly connected to each wireless slave;
After each wireless slave of confirmation is synchronized and is ready to complete, synchronized out by described be wirelessly connected to each wireless slave transmission
Beginning status command.
10. a kind of wireless synchronization master, which is characterized in that the system includes:
Two or more wireless slaves as claimed in claim 8 and a wireless master as claimed in claim 9
Machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811533731.7A CN109586832B (en) | 2018-12-14 | 2018-12-14 | Wireless synchronization method, wireless slave, wireless master and wireless synchronization system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811533731.7A CN109586832B (en) | 2018-12-14 | 2018-12-14 | Wireless synchronization method, wireless slave, wireless master and wireless synchronization system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109586832A true CN109586832A (en) | 2019-04-05 |
CN109586832B CN109586832B (en) | 2023-11-14 |
Family
ID=65928073
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811533731.7A Active CN109586832B (en) | 2018-12-14 | 2018-12-14 | Wireless synchronization method, wireless slave, wireless master and wireless synchronization system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109586832B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113110140A (en) * | 2021-03-26 | 2021-07-13 | 苏州振畅智能科技有限公司 | Instruction synchronization system based on 5G and satellite time service and execution method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101610145A (en) * | 2009-07-03 | 2009-12-23 | 中兴通讯股份有限公司 | A kind of method and system of realizing the Synchronization Control of distributed system |
CN103326802A (en) * | 2013-05-31 | 2013-09-25 | 燕山大学 | Wireless network system for achieving synchronous acquisition, synchronous acquisition device and method |
CN103810828A (en) * | 2012-11-09 | 2014-05-21 | 中国科学院沈阳计算技术研究所有限公司 | Wireless communication system and method for Internet-of-Things aggregation node of machine tool |
CN105024892A (en) * | 2015-06-09 | 2015-11-04 | 上海冉能自动化科技有限公司 | A method and system realizing wireless communication between an instrument and a host computer |
CN105578383A (en) * | 2015-05-25 | 2016-05-11 | 上海归墟电子科技有限公司 | 2.4G-based networking communication system and communication method |
CN209072511U (en) * | 2018-12-14 | 2019-07-05 | 广州智光自动化有限公司 | A kind of wireless slave, wireless host and wireless synchronization master |
-
2018
- 2018-12-14 CN CN201811533731.7A patent/CN109586832B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101610145A (en) * | 2009-07-03 | 2009-12-23 | 中兴通讯股份有限公司 | A kind of method and system of realizing the Synchronization Control of distributed system |
CN103810828A (en) * | 2012-11-09 | 2014-05-21 | 中国科学院沈阳计算技术研究所有限公司 | Wireless communication system and method for Internet-of-Things aggregation node of machine tool |
CN103326802A (en) * | 2013-05-31 | 2013-09-25 | 燕山大学 | Wireless network system for achieving synchronous acquisition, synchronous acquisition device and method |
CN105578383A (en) * | 2015-05-25 | 2016-05-11 | 上海归墟电子科技有限公司 | 2.4G-based networking communication system and communication method |
CN105024892A (en) * | 2015-06-09 | 2015-11-04 | 上海冉能自动化科技有限公司 | A method and system realizing wireless communication between an instrument and a host computer |
CN209072511U (en) * | 2018-12-14 | 2019-07-05 | 广州智光自动化有限公司 | A kind of wireless slave, wireless host and wireless synchronization master |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113110140A (en) * | 2021-03-26 | 2021-07-13 | 苏州振畅智能科技有限公司 | Instruction synchronization system based on 5G and satellite time service and execution method |
CN113110140B (en) * | 2021-03-26 | 2022-09-23 | 苏州振畅智能科技有限公司 | Execution method of instruction synchronization system based on 5G and satellite time service |
Also Published As
Publication number | Publication date |
---|---|
CN109586832B (en) | 2023-11-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103634150B (en) | A kind of high security CAN communication means of redundancy | |
CN103746889B (en) | Half competitive mode RS-485 bus multi-master communication system and its working method | |
CN100538683C (en) | The method and apparatus and the corresponding bus system that are used for the control bus system | |
CN105743757A (en) | Free networking method of RS485 communication terminal | |
CN110334046A (en) | A kind of communication means, the apparatus and system of SPI full duplex | |
EP2541428A1 (en) | Parallel communication device and communication method thereof | |
US11362859B2 (en) | In-vehicle communication device and in-vehicle system | |
DE102015214915A1 (en) | Flexible planning method and device in LIN communication | |
CN111708296A (en) | Synchronous control and data voting method based on two-channel safety PLC | |
CN114265352A (en) | Automatic configuration system and method for CAN bus ID | |
CN209072511U (en) | A kind of wireless slave, wireless host and wireless synchronization master | |
CN109902046B (en) | Communication method for serial peripheral bus system, related equipment and system | |
CN109586832A (en) | Wireless synchronization method, wireless slave, wireless host and wireless synchronization master | |
KR101958477B1 (en) | Lin communication system for vehicle and method for driving slave module in the system | |
CN111159086A (en) | System and method for communication between multiple hosts and multiple slaves | |
CN106878467B (en) | Method for remotely controlling equipment and remote control system | |
CN106953809B (en) | 485 time-sharing communication-based equipment resource acquisition method | |
WO2017049556A1 (en) | Data transmission method and mobile terminal | |
US9762445B2 (en) | Device and method for automatic switching of communication protocol of network devices based on user action | |
US20190386762A1 (en) | Date processing system and method | |
CN107465487B (en) | Bus data sending method, system and sub-equipment | |
CN110572440B (en) | Method and device for data transmission, household appliance and storage medium | |
CN104243189A (en) | Multi-device communication method based on same channel and communication system thereof | |
CN105718400A (en) | SPI based communication method | |
CN114281739A (en) | Data exchange system and method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |