CN108650296A - The means of communication, device and system - Google Patents
The means of communication, device and system Download PDFInfo
- Publication number
- CN108650296A CN108650296A CN201810294345.0A CN201810294345A CN108650296A CN 108650296 A CN108650296 A CN 108650296A CN 201810294345 A CN201810294345 A CN 201810294345A CN 108650296 A CN108650296 A CN 108650296A
- Authority
- CN
- China
- Prior art keywords
- equipment
- slave devices
- online
- sent
- duration
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
- H04L67/62—Establishing a time schedule for servicing the requests
-
- 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/0652—Synchronisation among time division multiple access [TDMA] nodes, e.g. time triggered protocol [TTP]
-
- 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/0658—Clock or time synchronisation among packet nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- 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/0647—Synchronisation among TDM nodes
- H04J3/065—Synchronisation among TDM nodes using timestamps
-
- 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/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
- H04J3/0664—Clock or time synchronisation among packet nodes using timestamps unidirectional timestamps
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a kind of means of communication, device and systems, belong to field of computer technology.The means of communication include:If host equipment does not receive data in the sending cycle for reaching synchronous package, synchronous package is sent at least one slave devices;In at least one slave devices any slave devices according to queue number of any slave devices in all online equipments of the host equipment determine next equipment state packet etc. duration to be sent;Alternatively, any slave devices according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;Any slave devices send the equipment state packet of the slave devices according to the duration to be sent such as described to the host equipment;The host equipment is interacted according to the equipment state packet with any slave devices.It solves the multi computer communication demand that cannot be satisfied current every field in the related technology, has achieved the effect that realize multi computer communication.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of means of communication, device and system.
Background technology
In Internet of Things, the information exchange between equipment is essential.
Short distance point-to-point communication generally uses universal asynchronous receiving-transmitting transmitter (Universal in industry at present
Asynchronous Receiver/Transmitter, UART).Micro-control unit (Microcontroller in the market
Unit, MCU) it is only usually configured with a UART interface, it can be connected with RS232 lines.Standard UART generally uses simple one
To a communication modes, the multimachine of current every field (for example, home wiring control industry, automation equipment control field) cannot be satisfied
Communication need.
Invention content
In order to solve the problems, such as to cannot be satisfied the multi computer communication demand of current every field in the prior art, the present invention is implemented
Example provides a kind of means of communication, device and system.The technical solution is as follows:
In a first aspect, a kind of means of communication are provided, the method includes:
If not receiving data in the sending cycle for reaching synchronous package, sends and synchronize at least one slave devices
Packet;
Receive the equipment state packet that any slave devices are sent;
It is interacted with any slave devices according to the equipment state packet;
Wherein, any slave devices send time of the equipment state packet by any slave devices according to institute
It states the receiving time of synchronous package, determined from the queue number in all online equipments of the host equipment;Alternatively, by institute
Any slave devices are stated to be determined according to receiving time, the online slave quantity of the host equipment of the synchronous package.
Optionally, the synchronous package includes the online equipment queue table of the host equipment, the online equipment queue table
Device identification, device type and the queue number for including each online slave devices receive any slave devices transmission described
Equipment state packet after, the method further includes:
The device type of any slave devices is obtained from the equipment state packet;
If the online equipment queue table does not include the device type of any slave devices, for it is described it is any from
Machine equipment distribution queue is numbered, and the device type of any slave devices is added in the online equipment queue table, from institute
State device identification and the queue number of any slave devices obtained in equipment state packet.
Optionally, it if receiving data in the sending cycle for reaching synchronous package, is parsed after receiving data
Whether the data received include equipment state packet.
Second aspect provides a kind of means of communication, the method includes:
The synchronous package that receiving host equipment is sent;
According to the queue number in all online equipments of the host equipment determine next equipment state packet etc.
Duration to be sent;Alternatively, according to the online slave quantity of the host equipment determine next equipment state packet etc. it is to be sent
Duration;
The equipment state packet of the slave devices is sent to the host equipment according to the duration to be sent such as described.
Optionally, the synchronous package includes the online equipment queue table of the host equipment, the online equipment queue table
Include the device type and queue number of each online slave devices, it is described true according to the online slave quantity of the host equipment
Fixed next equipment state packet etc. duration to be sent, including:
When the online equipment queue table does not include the device type of the slave devices, arranged according to the online equipment
Table determines the total quantity of online slave and the host equipment;
Priority is corresponded to according to the corresponding number of the device type of the slave devices, the device type of the slave devices
Any of and the total quantity determine the duration to be sent such as described.
Optionally, the synchronous package includes the online equipment queue table of the host equipment, the online equipment queue table
Include device identification, device type and the queue number of each online slave devices, it is described according to the slave devices described
Queue number in all online equipments of host equipment determine next equipment state packet etc. duration to be sent, including:
If the online equipment queue table includes the device type of the slave devices, in the online equipment queue
In the case that table includes the device identification of the slave devices, in the equipment state packet for receiving other slave devices, according to
The equipment state packet of other slave devices obtains queue of other the described slave devices in the online equipment list and compiles
Number;
It is true according to the queue number of other described slave devices and the slave devices in the online equipment list
Determine the duration to be sent such as described;And/or according to queue number of the slave devices in the online equipment list, described
Queue number of the host equipment in the online equipment list determines the duration to be sent such as described.
Optionally, other slave devices and the slave devices described in the basis are in the online equipment list
Queue number determines the duration to be sent such as described, including:
Calculating duration to be sent, first formula such as described using the first formula is:
T1=(Q2-Q1-a)×T0;
Wherein, T1For next equipment state packet etc. duration to be sent, Q2It is the slave devices described online
Queue number in list of devices, Q1For queue number of other the described slave devices in the online equipment list, T0To prolong
When time parameter, a be queue number of the host equipment in the online equipment list.
Optionally, described sent to the host equipment according to the duration to be sent such as described sets described in the slave devices
Standby state packet, including:
If asynchronous receiving-transmitting transmitter UART does not receive data when waiting one to be achieved duration to be sent such as described,
Next equipment state packet of the slave devices is sent to the host equipment, otherwise, data is received in the UART
After parse the data packet that receives whether be synchronous package or be other slave devices equipment state packet.
Optionally, the synchronous package includes the online equipment queue table of the host equipment, the online equipment queue table
Include the queue number of each online slave devices, after the synchronous package that the receiving host equipment is sent, the method is also wrapped
It includes:
The total quantity of online slave devices and host equipment is determined according to the online equipment list;
Using the second formula calculate the slave devices send broadcast packet or control inquiry packet etc. duration to be sent, institute
Stating the second formula is:
T2=(Q2+A+M)×T0;
Wherein, T2For the broadcast packet or control inquiry packet etc. duration to be sent, Q2It is the slave devices described
Queue number in online equipment list, A are the total quantity, and M is preset offset value, T0For delay time parameter.
The third aspect, provides a kind of communication device, and described device includes:
Memory and processor;
At least one program instruction is stored in the memory;
The processor, by loading and executing at least one program instruction to realize first aspect and first party
The means of communication involved by any optional real-time mode in face.
Fourth aspect, provides a kind of communication device, and described device includes:
Memory and processor;
At least one program instruction is stored in the memory;
The processor, by loading and executing at least one program instruction to realize second aspect and second party
The means of communication involved by any optional real-time mode in face.
5th aspect, provides a kind of communication system, the communication system includes that host equipment and at least one slave are set
It is standby, wherein:
If the host equipment does not receive data in the sending cycle for reaching synchronous package, at least one slave
Equipment sends synchronous package;
In at least one slave devices any slave devices according to any slave devices in the host equipment
All online equipments in queue number determine next equipment state packet etc. duration to be sent;Alternatively, it is described it is any from
Machine equipment according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;
Any slave devices send the slave devices according to the duration to be sent such as described to the host equipment
The equipment state packet;
The host equipment is interacted according to the equipment state packet with any slave devices.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
If data are not received in the sending cycle for reaching synchronous package by host equipment, at least one slave
Equipment sends synchronous package;Receive the equipment state packet that any slave devices are sent, any slave devices sending device state packet
Time by any slave devices according to the receiving time of the synchronous package, from all online equipments of host equipment
The time of queue number determination or any slave devices sending device state packet is by any slave devices according to the synchronization
Receiving time, the online slave quantity of host equipment of packet determine;It is interacted with any slave devices according to the equipment state packet;
Enable the slave devices being connect with host equipment to send respective equipment state packet according to synchronous package timesharing, efficiently solves
The multi computer communication demand that cannot be satisfied current every field in the related technology has achieved the effect that realize multi computer communication.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of schematic diagram of implementation environment shown in an exemplary embodiment of the invention;
Fig. 2 is the method flow diagram of the means of communication provided by one embodiment of the present invention;
Fig. 3 is the method flow diagram for the means of communication that another embodiment of the present invention provides;
Fig. 4 is that the slave devices that another embodiment of the present invention provides determine the next equipment of itself according to synchronous package
State packet etc. duration to be sent flow chart;
Fig. 5 is the method flow diagram for the means of communication that further embodiment of the present invention provides.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1 is a kind of schematic diagram of implementation environment shown in an exemplary embodiment of the invention, which includes:It is main
Machine equipment 110 and at least one slave devices 120.
Host equipment 110 is connected by the first connector with each slave devices 120 at least one slave devices 120
It connecing, host equipment 110 is also connected by the second connector with each slave devices 120 at least one slave devices 120,
First connector is connected with the second connector.
Wherein, host equipment 110 receives slave devices using the first connector transmission data using the second connector
120 or itself send data;Any slave devices 120 utilize the first connector using the second connector transmission data
Receiving host equipment 110 or other slave devices 120 or the data itself sent.
Optionally, the first connector, the second connector can be data line, can also be conduction in actual implementation certainly
End, host equipment 110 are connect by conducting end with slave devices 120, for example, when the two contacts, then the two electrical connection.
Referring to FIG. 2, it illustrates the method flow diagram of the means of communication provided by one embodiment of the present invention, the present embodiment
It is illustrated for host equipment 110 in implementation environment shown in FIG. 1 with the means of communication.As shown in Fig. 2, the means of communication
May include:
Step 210, if not receiving data in the sending cycle for reaching synchronous package, at least one slave devices
Send synchronous package.
Wherein, the sending cycle of synchronous package is usually set by system developer, such as the sending cycle of synchronous package can be with
It is 100 milliseconds;The synchronous package that host equipment is sent includes the online equipment queue table of host equipment, the online equipment queue table packet
Include device identification, device type and the queue number of each online slave devices of the host equipment.
Optionally, host equipment utilizes UART receptions, transmission data.If the UART in the sending cycle for reaching synchronous package
Data are not received, then send synchronous package at least one slave devices, otherwise parsing connects after UART receives data
Whether the data packet received is equipment state packet, executes step 230.
The realization of this step can be:Host equipment sends synchronous package using the first connector, makes to be connected with host equipment
The slave devices connect can receive the synchronous package.So that slave devices according to the receiving time of the synchronous package, from master
Queue number in all online equipments of machine equipment determines the sending time of itself next equipment state packet, or according to this
The receiving time of synchronous package, the online slave quantity of host equipment determine the sending time of itself next equipment state packet, root
According to such duration to be sent itself next equipment state packet is sent to host equipment.Specific implementation can be found in step 320 or step
Rapid 330, details are not described herein again.
Wherein, in the equipment state packet of slave devices the slave devices device type, device identification and status information.
Come using slave devices as LED light for example, the status information of LED light includes the pattern of current LED light, color etc.;With from
Machine equipment comes for wireless charging module for example, the status information of wireless charging module includes charged state;With slave devices
Come for bluetooth module for example, the status information of bluetooth module includes play mode, broadcast sound volume etc. information.
Step 220, the equipment state packet that any slave devices are sent, any slave devices sending device state packet are received
Time by any slave devices according to the receiving time of the synchronous package, from all online equipments of host equipment
The time of queue number determination or any slave devices sending device state packet is by any slave devices according to the synchronization
Receiving time, the online slave quantity of host equipment of packet determine.
The realization of this step can be:The data packet that any slave devices are sent is received, parses whether the data packet is to set
Standby state packet;If the data packet is equipment state packet, step 230 is executed, otherwise according to the data packet (for example, broadcast packet, control
System inquiry packet) execute corresponding operating.
Step 230, it is interacted with any slave devices according to the equipment state packet.
For example, after the reception for completing the equipment state packet, sends broadcast packet to any slave devices or control is looked into
Ask packet.
For example, after completing the reception of the equipment state packet, the state of any slave devices is obtained from equipment state packet
Information generates control instruction according to status information;After all equipment state packets in line slave devices complete primary send, to
Any slave devices send the control inquiry packet comprising the control instruction.For example, in the equipment state for receiving LED light
Bao Hou obtains the electricity of LED light from equipment state packet;If the electricity of LED light is less than predetermined threshold value, a control is generated
Inquiry packet, control inquiry includes the control instruction for entering battery saving mode for triggering LED.
In addition, after executing step 220, step S1, step S2 can also carry out:
Step S1 obtains the device type of any slave devices from the equipment state packet.
Step S2, if online equipment queue table does not include the device type of any slave devices, for this it is any from
Machine equipment distribution queue is numbered, and the device type of any slave devices is added in the online equipment queue table, from the equipment
The device identification of any slave devices obtained in state packet and queue number.
If the online equipment queue table includes the device type of any slave devices, show all of the host equipment
Online slave devices include that the equipment of the device type (may be any slave devices, it is also possible to have the equipment class
Other slave devices of type), then it waits for UART to receive new data and waits next synchronous package to be sent.
The realization of this step can be:If the online equipment queue table does not include the equipment class of any slave devices
Type, shows that any slave devices are not online, then host equipment, which with any slave devices shake hands, makes any slave set
The standby online slave devices for becoming host equipment;Host equipment is also according to the maximum queue number of numerical value in online equipment queue table
The queue number of any slave devices is determined, for example, adding 1 to obtain using the maximum queue number of numerical value in online equipment queue table
To the queue number of any slave devices.
Optionally, which further includes host equipment.Optionally, host equipment is in online equipment queue table
Middle queue number is 0 or 1, and the queue number of host equipment is queue number minimum in the online equipment queue table always.
Using host equipment as pedestal socket, online slave devices include Baffle Box of Bluetooth, LED light, wireless charging come for example,
In online equipment queue table of the online slave devices all in the synchronous package that pedestal socket is sent;The queue number of pedestal insert row is
0, the queue number of LED light is 1, the queue number of Baffle Box of Bluetooth is 2, the queue number of wireless charging is 3.Then in one cycle
The sequence of these equipment sending device state packets is:Pedestal insert row, LED light, Baffle Box of Bluetooth, wireless charging.That is, pedestal is inserted
It comes after sending a synchronous package, before send out next synchronous package in this period of time, all online slave devices, which are sent, to be set
The sequence of standby state packet is:LED light, Baffle Box of Bluetooth, wireless charging.
It should be noted that:In the application with the queue number of slave devices and the slave devices in all slave devices
Sequence of shaking hands with host equipment is proportionate to illustrate.In actual implementation, the queue number of slave devices is set with the slave
It is standby negatively correlated with the sequence of shaking hands of host equipment in all slave devices;Host equipment is the first slave devices shaken hands point
The queue number matched can be the quantity for all slave devices types that host equipment is supported, successively decrease successively later, wherein host
The queue number of equipment is 0;Alternatively, the queue number that host equipment is the first slave devices distribution shaken hands can be that host is set
The quantity of the standby all slave devices types supported adds 1, and the queue number of host is 1.Certainly, above-mentioned only with two neighboring slave
The queue number difference of equipment is come for 1 for example, optionally, in actual implementation, may also differ by any step-length, for example,
When difference step-length is 5, if then the queue number of host equipment is 0, host equipment is the team of the first slave devices distribution shaken hands
Column number can be 5, and the queue number for second slave devices shaken hands distribution is 10, and so on, it shakes hands for n-th
The queue number of slave devices distribution is 5*n.
In conclusion method provided in an embodiment of the present invention, by host equipment in the sending cycle for reaching synchronous package
If not receiving data, synchronous package is sent at least one slave devices;Receive the equipment shape that any slave devices are sent
State packet, time of any slave devices sending device state packet by any slave devices according to the reception of the synchronous package when
Between, from all online equipments of host equipment queue number determine or any slave devices sending device shape
The time of state packet is determined by any slave devices according to the receiving time of the synchronous package, the online slave quantity of host equipment;
It is interacted with any slave devices according to the equipment state packet;Enable the slave devices connected with host equipment according to synchronous
Packet timesharing sends respective equipment state packet, efficiently solves the multi computer communication that cannot be satisfied current every field in the related technology
Demand has achieved the effect that realize multi computer communication.
Referring to FIG. 3, the method flow diagram of the means of communication provided it illustrates another embodiment of the present invention, this implementation
Example is illustrated with the means of communication for slave devices 120 in implementation environment shown in FIG. 1.As shown in figure 3, the communication side
Method may include:
Step 310, the synchronous package that receiving host equipment is sent.
Optionally, which includes the online equipment queue table of host equipment, which includes each
Device identification, device type and the queue number of online slave devices.
After executing step 310, step 320 or step 330 are executed.
Step 320, next equipment is determined according to from the queue number in all online equipments of the host equipment
State packet etc. duration to be sent.
Wherein, in the equipment state packet of slave devices the slave devices device type, device identification and status information.
Optionally, online slave devices often receive a synchronous package, and next equipment state packet is sent according only to the synchronous package.
This step can be realized by several steps as shown in Figure 4:
Step 410, online equipment queue table is obtained from the synchronous package.
After executing step 410, step 420 and/or step 430 can perform.
Step 420, if the online equipment queue table includes the device type of itself, in the online equipment queue table
In the case of including the device identification of itself, according to from online equipment list queue number, host equipment is online
The durations to be sent such as the queue number determination in list of devices.
For example, calculated using a formula the next equipment state packet of itself etc. duration to be sent, the formula be:
T1=(Q2-a)×T0;
Wherein, T1For next equipment state packet etc. duration to be sent, Q2It is the slave devices in online equipment list
Queue number, T0For delay time parameter, a is queue number of the host equipment in online equipment list.For example, host is set
The standby queue number in online equipment list is 0, then the value of a is 0;For another example machine equipment is in online equipment list
Queue number is 1, then the value of a is 1.Delay time parameter can be the parameter of systemic presupposition, or customized ginseng
Number.For example, T0For preset 5ms.
For example, include Baffle Box of Bluetooth, LED light, wireless charging by pedestal socket, online slave devices of host equipment
For example, in their the online equipment queue tables in the synchronous package that pedestal socket is sent;The queue number of pedestal insert row is
0, the queue number of LED light is 1, the queue number of Baffle Box of Bluetooth is 2, the queue number of wireless charging is 3.Then LED light is receiving
A delay time parameter is waited for retransmit its equipment state packet to when synchronous package.
It should be noted that above-mentioned formula only by queue number and is shaken hands for sequence correlation, optionally,
For negative correlativing relation when, above-mentioned formula can be T with mutation1=(a-Q2)×T0;
Step 430, if the online equipment queue table includes the device type of itself, in the online equipment queue table packet
In the case of the device identification for including itself, in the equipment state packet for receiving other slave devices, set according to other slaves
Standby and certainly in the online equipment list queue number determines such duration to be sent.
In line slave devices after receiving synchronous package, these online slave devices are according to from online equipment list
Queue number priority sending device state packet.Implementing to be:Any slave devices are receiving other slave devices
Equipment state packet when, it is true according to the queue number of other slave devices and the slave devices in the online equipment list
Fixed such duration to be sent.
For example, calculated using the first formula the next equipment state packet of itself etc. duration to be sent, the first formula be:
T1=(Q2-Q1-a)×T0;
Wherein, T1For next equipment state packet etc. duration to be sent, Q2For the queue certainly in online equipment list
Number, Q1For the queue number of other slave devices in online equipment list, T0For delay time parameter, a is host equipment
Queue number in online equipment list.
For example, include Baffle Box of Bluetooth, LED light, wireless charging by pedestal socket, online slave devices of host equipment
For example, in their the online equipment queue tables in the synchronous package that pedestal socket is sent;The queue number of pedestal insert row is
0, the queue number of LED light is 1, the queue number of Baffle Box of Bluetooth is 2, the queue number of wireless charging is 3.
Using slave devices as bluetooth equipment for example, bluetooth equipment knows the queue of oneself after receiving synchronous package
Number is 2, current when itself receiving the equipment state packet of LED light, calculate next equipment state packet of bluetooth equipment etc.
Time to be sent is (2-0-1) * T0, then bluetooth equipment wait for a time parameter T0The equipment state packet of itself is retransmited afterwards.
Step 330, according to the online slave quantity of the host equipment determine next equipment state packet etc. it is to be sent when
It is long.
The realization of this step can be:Online equipment queue table is obtained from the synchronous package;If the online equipment queue table
Do not include the device type of itself, then determines the total quantity of online slave and host equipment according to the online equipment list;Root
Any of priority and total quantity determination etc. are corresponded to according to the corresponding number of equipment of itself type, equipment of itself type
Duration to be sent.
Wherein, determine that the realization of the total quantity of online slave and host equipment can be according to the online equipment list:
In the case where the queue number of host equipment is 1, obtains the maximum queue number of numerical value in the online equipment list and obtain
The total quantity of line slave and host equipment;In the case where the queue number of host equipment is 0, obtain in the online equipment list
The maximum queue number of numerical value adds 1 to obtain the total quantity of online slave and host equipment.
Wherein, determine etc. that the realization of duration to be sent can be with according to the total quantity, the corresponding number of device type of itself
For:The summed result for calculating total quantity number corresponding with the device type of itself, when being multiplied by delay using the summed result
Between parameter the duration to be sent such as obtain.Wherein, delay time parameter is usually set by system developer.Not online slave is set to set
It is standby to be retransmited after line slave devices sending device state packet all, and all not online slave devices according to its own
The ascending sequence of the corresponding number of device type is successively sent.
It should be noted that all devices type of support is numbered in advance by system developer.Each equipment
Device type number simultaneously as agreement transmit address and return information source identification.
In addition, if the online equipment queue table includes the device type of itself but do not include the device identification of itself,
Continue waiting for receive data and/or wait for one send waiting time (be slave devices initialization when obtain, usually by system
The initial latency market of developer's setting) sending device state packet.As it can be seen that in multiple slave devices of identical device type,
The equipment state packet of equipment of itself can be sent according to synchronous package by only becoming the online slave devices of host equipment at first, other
The slave devices of the device type were periodically attempted to send the equipment state packet of itself according to the waiting time itself initialized.
Step 340, the next equipment state packet of itself is sent to host equipment according to such duration to be sent.
This step can be realized by following two modes:
The first, when according to the reception of predefined type data packet (the equipment state packet of synchronous package or other slave devices)
Between, etc. duration to be sent determine the sending time of next equipment state packet, send itself to host equipment in the sending time
Equipment state packet.
For example, using synchronous package receiving time plus etc. duration to be sent (according to the receiving time of the synchronous package calculate
Go out) sending time of next equipment state packet is obtained, the equipment state of itself is sent to host equipment in the sending time
Packet.
For example, using other slave devices equipment state packet receiving time plus etc. duration to be sent (set according to this
Standby state packet is calculated) sending time of next equipment state packet is obtained, it is sent certainly to host equipment in the sending time
The equipment state packet of body.
Second, reach completing predefined type data packet (the equipment state packet of synchronous package or other slave devices) reception
When corresponding transmission waiting time, the equipment state packet of itself is sent to host equipment.
For example, starting timing when completing the reception of synchronous package, it is (same according to this duration to be sent such as to reach in timing duration
The receiving time for walking packet is calculated) when, the equipment state packet of itself is sent to host equipment.
For another example starting timing when completing the reception of an equipment state packet of other slave devices, in timing duration
When duration to be sent (calculated according to the equipment state packet) such as reaching, the equipment state packet of itself is sent to host equipment.
Optionally, it if UART does not receive data when waiting waiting to be achieved to send duration, is sent to host equipment
Otherwise the next equipment state packet of itself parses whether the data packet received is synchronous after UART receives data
Packet or equipment state packet for other slave devices, execute step 310 or step 320 or step 330.
In conclusion method provided in an embodiment of the present invention, the synchronous package sent by receiving host equipment;According to itself
Queue number in all online equipments of the host equipment determine next equipment state packet etc. duration to be sent;Or
Person, according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;According to the waiting
It sends duration and sends the next equipment state packet of itself to host equipment;Enable the slave devices being connect with host equipment
Respective equipment state packet is sent according to synchronous package timesharing, efficiently solves and cannot be satisfied current every field in the related technology
Multi computer communication demand has achieved the effect that realize multi computer communication.
In one example, host equipment and/or it is any in line slave devices after receiving synchronous package, broadcast can be calculated
Packet or control inquiry packet etc. duration to be sent, specific implementation can be:Online slave is determined according to online equipment list
The total quantity of equipment and host equipment;Using the second formula calculate send broadcast packet or control inquiry packet etc. it is to be sent when
Long, the second formula is:
T2=(Q2+A+M)×T0;
Wherein, T2For broadcast packet or control inquiry packet etc. duration to be sent, Q2For from the online equipment list
Queue number, A be online slave devices and host equipment total quantity, M is preset offset value, T0For delay time parameter.
Optionally, if host equipment send synchronous package after etc. broadcast packet to be achieved etc. duration to be sent when do not receive
Data then send broadcast packet to all online slave devices.
Optionally, if host equipment send synchronous package after etc. it is to be achieved control inquiry packet etc. duration to be sent when do not connect
Data are received, then send control inquiry packet to all online slave devices.
Optionally, if any slave devices receive synchronous package after etc. broadcast packet to be achieved etc. duration to be sent when do not connect
Data are received, then send broadcast packet to host equipment and other online slave devices.
Optionally, if any slave devices receive synchronous package after etc. it is to be achieved control inquiry packet etc. duration to be sent when
Data are not received, then send control inquiry packet to host equipment and other online slave devices.
In addition, by the second formula it is found that after host equipment often sends a synchronous package, until all online slave devices are complete
Broadcast packet or control inquiry packet are just sent after the transmission of forming apparatus state packet;Any online slave devices often receive primary same
After step packet, broadcast packet or control inquiry packet are just sent after the transmission that line slave devices complete equipment state packet all.
Optionally, calculate broadcast packet etc. duration to be sent when default bias amount be the first offset, calculate control
Inquiry packet etc. duration to be sent when default bias amount be the second offset, the second offset differs with the first offset.Example
Such as, the second offset is 2, and the first offset is 1.
Referring to FIG. 5, the method flow diagram of the means of communication provided it illustrates further embodiment of the present invention, this implementation
In communication system of the example with the means of communication for being made of at least one slave devices, a host equipment.As shown in figure 5,
The means of communication may include:
Step 510, if host equipment does not receive data in the sending cycle for reaching synchronous package, at least one
Slave devices send synchronous package.
The realization of this step is referring to the realization of step 210, and details are not described herein again.
Step 520, any slave devices are according to true from the queue number in all online equipments of the host equipment
Fixed next equipment state packet etc. duration to be sent.
Step 530, which determines next equipment state according to the online slave quantity of the host equipment
Packet etc. duration to be sent.
Step 540, which sends the next of itself to host equipment according to such duration to be sent and sets
Standby state packet.
Step 550, host equipment is interacted according to the equipment state packet with any slave devices.
The realization of step 520, step 530, step 540 and step 550 is respectively referring to step 320, step 330, step
340 and step 230 realization, no longer repeat one by one herein.
In conclusion method provided in an embodiment of the present invention, by host equipment in the sending cycle for reaching synchronous package
If not receiving data, synchronous package is sent at least one slave devices;Any slave devices are according to from the host
Queue number in all online equipments of equipment determine next equipment state packet etc. duration to be sent;Alternatively, this is any
Slave devices according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;According to this
The next equipment state packet of itself is sent to host equipment etc. duration to be sent;So that the slave devices being connect with host equipment
Respective equipment state packet can be sent according to synchronous package timesharing, efficiently solve and cannot be satisfied current each neck in the related technology
The multi computer communication demand in domain has achieved the effect that realize multi computer communication.
A kind of computer readable storage medium that one embodiment of the invention also provides, in the computer readable storage medium
It is stored with one or more instruction, when one or more than one instruction is executed by the processor in host equipment
Realize the means of communication involved by Fig. 2.
A kind of computer readable storage medium that one embodiment of the invention also provides, in the computer readable storage medium
It is stored with one or more instruction, when one or more than one instruction is executed by the processor in host equipment
Realize the means of communication involved by Fig. 3.
One embodiment of the invention also provides a kind of communication device, and the communication device includes:Memory and processor;Institute
It states and is stored at least one program instruction in memory;The processor is referred to by loading and executing at least one program
It enables to realize the means of communication involved by Fig. 3.
One embodiment of the invention also provides a kind of communication device, and the communication device includes:Memory and processor;Institute
It states and is stored at least one program instruction in memory;The processor is referred to by loading and executing at least one program
It enables to realize the means of communication involved by Fig. 2.
Term " first ", " second " are used for description purposes only, and are not understood to indicate or imply relative importance or hidden
Quantity containing indicated technical characteristic.The feature of " first ", " second " that limit as a result, can express or implicitly include one
A or more this feature.In the description of the present invention, unless otherwise indicated, the meaning of " plurality " is two or two with
On.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.
Claims (12)
1. a kind of means of communication, which is characterized in that the method includes:
If not receiving data in the sending cycle for reaching synchronous package, synchronous package is sent at least one slave devices;
Receive the equipment state packet that any slave devices are sent;
It is interacted with any slave devices according to the equipment state packet;
Wherein, any slave devices send time of the equipment state packet by any slave devices according to described same
It walks the receiving time of packet, determined from the queue number in all online equipments of the host equipment;Alternatively, by described
One slave devices are determined according to receiving time, the online slave quantity of the host equipment of the synchronous package.
2. according to the method described in claim 1, it is characterized in that, the synchronous package includes the online equipment of the host equipment
Queue table, the online equipment queue table include device identification, device type and the queue number of each online slave devices,
After the equipment state packet for receiving any slave devices transmission, the method further includes:
The device type of any slave devices is obtained from the equipment state packet;
If the online equipment queue table does not include the device type of any slave devices, set for any slave
Back-up matches queue number, and the device type of any slave devices is added in the online equipment queue table, is set from described
The device identification of any slave devices obtained in standby state packet and queue number.
3. method according to claim 1 or 2, which is characterized in that
If receiving data in the sending cycle for reaching synchronous package, the data received are parsed after receiving data
Whether include equipment state packet.
4. a kind of means of communication, which is characterized in that the method includes:
The synchronous package that receiving host equipment is sent;
According to the queue number in all online equipments of the host equipment determine next equipment state packet etc. it is pending
Send duration;Alternatively, according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;
The equipment state packet of the slave devices is sent to the host equipment according to the duration to be sent such as described.
5. according to the method described in claim 4, it is characterized in that, the synchronous package includes the online equipment of the host equipment
Queue table, the online equipment queue table includes the device type and queue number of each online slave devices, described according to institute
State host equipment online slave quantity determine next equipment state packet etc. duration to be sent, including:
It is true according to the online equipment list when the online equipment queue table does not include the device type of the slave devices
Make the total quantity of online slave and the host equipment;
It is corresponded in priority according to the corresponding number of the device type of the slave devices, the device type of the slave devices
Any one and the total quantity determine the duration to be sent such as described.
6. according to the method described in claim 4, it is characterized in that, the synchronous package includes the online equipment of the host equipment
Queue table, the online equipment queue table include device identification, device type and the queue number of each online slave devices, institute
It states and next equipment state is determined according to queue number of the slave devices in all online equipments of the host equipment
Packet etc. duration to be sent, including:
If the online equipment queue table includes the device type of the slave devices, in the online equipment queue table packet
In the case of the device identification for including the slave devices, in the equipment state packet for receiving other slave devices, according to described
The equipment state packet of other slave devices obtains the queue number of other slave devices in the online equipment list;
Institute is determined according to the queue number of other described slave devices and the slave devices in the online equipment list
The duration to be sent such as state;And/or queue number, the host according to the slave devices in the online equipment list
Queue number of the equipment in the online equipment list determines the duration to be sent such as described.
7. according to the method described in claim 6, it is characterized in that, other slave devices and the slave described in the basis
Queue number of the equipment in the online equipment list determines the duration to be sent such as described, including:
Calculating duration to be sent, first formula such as described using the first formula is:
T1=(Q2-Q1-a)×T0;
Wherein, T1For next equipment state packet etc. duration to be sent, Q2It is the slave devices in the online equipment
Queue number in list, Q1For queue number of other the described slave devices in the online equipment list, T0When to be delayed
Between parameter, a be queue number of the host equipment in the online equipment list.
8. according to the method described in claim 4, it is characterized in that, described set according to the duration to be sent such as described to the host
Preparation send the equipment state packet of the slave devices, including:
If when waiting one to be achieved duration to be sent such as described, asynchronous receiving-transmitting transmitter UART does not receive data, to institute
Next equipment state packet that host equipment sends the slave devices is stated, otherwise, data is received in the UART and finishes
Parse afterwards the data packet that receives whether be synchronous package or be other slave devices equipment state packet.
9. according to the method described in claim 4, it is characterized in that, the synchronous package includes the online equipment of the host equipment
Queue table, the online equipment queue table include the queue number of each online slave devices, and the receiving host equipment is sent
Synchronous package after, the method further includes:
The total quantity of online slave devices and host equipment is determined according to the online equipment list;
Using the second formula calculate the slave devices send broadcast packet or control inquiry packet etc. duration to be sent, described the
Two formula are:
T2=(Q2+A+M)×T0;
Wherein, T2For the broadcast packet or control inquiry packet etc. duration to be sent, Q2It is the slave devices described online
Queue number in list of devices, A are the total quantity, and M is preset offset value, T0For delay time parameter.
10. a kind of communication device, which is characterized in that described device includes:
Memory and processor;
At least one program instruction is stored in the memory;
The processor, it is any described in claims 1 to 3 to realize by loading and executing at least one program instruction
The means of communication.
11. a kind of communication device, which is characterized in that described device includes:
Memory and processor;
At least one program instruction is stored in the memory;
The processor, it is any described in claim 4 to 9 to realize by loading and executing at least one program instruction
The means of communication.
12. a kind of communication system, which is characterized in that the communication system includes host equipment and at least one slave devices,
In:
If the host equipment does not receive data in the sending cycle for reaching synchronous package, at least one slave devices
Send synchronous package;
In at least one slave devices any slave devices according to any slave devices the host equipment institute
Have the queue number in online equipment determine next equipment state packet etc. duration to be sent;Alternatively, any slave is set
It is standby according to the online slave quantity of the host equipment determine next equipment state packet etc. duration to be sent;
Any slave devices are sent to the host equipment described in the slave devices according to the duration to be sent such as described
Equipment state packet;
The host equipment is interacted according to the equipment state packet with any slave devices.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810294345.0A CN108650296A (en) | 2018-03-30 | 2018-03-30 | The means of communication, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810294345.0A CN108650296A (en) | 2018-03-30 | 2018-03-30 | The means of communication, device and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108650296A true CN108650296A (en) | 2018-10-12 |
Family
ID=63745223
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810294345.0A Pending CN108650296A (en) | 2018-03-30 | 2018-03-30 | The means of communication, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108650296A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111342945A (en) * | 2020-02-19 | 2020-06-26 | 广东乐心医疗电子股份有限公司 | Master-slave communication method and device |
CN111818632A (en) * | 2020-09-02 | 2020-10-23 | 上海擎朗智能科技有限公司 | Method, device, equipment and storage medium for equipment synchronization |
CN111935680A (en) * | 2020-10-16 | 2020-11-13 | 上海擎朗智能科技有限公司 | Equipment synchronization device and equipment synchronization system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1533519A (en) * | 2001-05-30 | 2004-09-29 | Lg������ʽ���� | Network control system for home appliances |
US20060140166A1 (en) * | 2004-12-27 | 2006-06-29 | Microsoft Corporation | Reducing power consumption of a wireless device |
CN101917455A (en) * | 2010-06-23 | 2010-12-15 | 福州星网视易信息系统有限公司 | Method for synchronously ordering songs by a plurality of song-ordering machines in same box |
CN103826252A (en) * | 2014-01-16 | 2014-05-28 | 京信通信系统(中国)有限公司 | Method of acquiring and sending sequence numbers among main and slave devices and system |
CN106453383A (en) * | 2016-11-07 | 2017-02-22 | 深圳拓邦股份有限公司 | UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method |
CN107181659A (en) * | 2016-03-10 | 2017-09-19 | 深圳市祈飞科技有限公司 | Intelligent cabinet communication means and system based on RS485 buses |
-
2018
- 2018-03-30 CN CN201810294345.0A patent/CN108650296A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1533519A (en) * | 2001-05-30 | 2004-09-29 | Lg������ʽ���� | Network control system for home appliances |
US20060140166A1 (en) * | 2004-12-27 | 2006-06-29 | Microsoft Corporation | Reducing power consumption of a wireless device |
CN101917455A (en) * | 2010-06-23 | 2010-12-15 | 福州星网视易信息系统有限公司 | Method for synchronously ordering songs by a plurality of song-ordering machines in same box |
CN103826252A (en) * | 2014-01-16 | 2014-05-28 | 京信通信系统(中国)有限公司 | Method of acquiring and sending sequence numbers among main and slave devices and system |
CN107181659A (en) * | 2016-03-10 | 2017-09-19 | 深圳市祈飞科技有限公司 | Intelligent cabinet communication means and system based on RS485 buses |
CN106453383A (en) * | 2016-11-07 | 2017-02-22 | 深圳拓邦股份有限公司 | UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111342945A (en) * | 2020-02-19 | 2020-06-26 | 广东乐心医疗电子股份有限公司 | Master-slave communication method and device |
CN111342945B (en) * | 2020-02-19 | 2022-09-27 | 广东乐心医疗电子股份有限公司 | Master-slave communication method and device |
CN111818632A (en) * | 2020-09-02 | 2020-10-23 | 上海擎朗智能科技有限公司 | Method, device, equipment and storage medium for equipment synchronization |
CN111818632B (en) * | 2020-09-02 | 2022-08-30 | 上海擎朗智能科技有限公司 | Method, device, equipment and storage medium for equipment synchronization |
US11477003B2 (en) | 2020-09-02 | 2022-10-18 | Keenon Robotics Co., Ltd. | Device synchronization method and apparatus, device, and storage medium |
CN111935680A (en) * | 2020-10-16 | 2020-11-13 | 上海擎朗智能科技有限公司 | Equipment synchronization device and equipment synchronization system |
CN111935680B (en) * | 2020-10-16 | 2021-01-15 | 上海擎朗智能科技有限公司 | Equipment synchronization device and equipment synchronization system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10904832B2 (en) | Wireless system, wireless device, non-transitory computer-readable storage medium having stored therein communication program, and communication method | |
US10397868B2 (en) | Wireless system, wireless device, non-transitory computer-readable storage medium having stored therein communication program, and communication method | |
KR100643323B1 (en) | Data transmission and reception method in zigbee system and coodinator and device thereof | |
CN108650296A (en) | The means of communication, device and system | |
JP5607784B2 (en) | CAN open network configuration method, slave device operation method, PLC device control method, and PLC device control system | |
CN106506725B (en) | Subordinate communication system, host, slave and slave ID distribution method | |
CN106685735B (en) | EPA on-chip system, EPA communication system and communication method | |
US10331610B2 (en) | UART with automated protocols | |
TW522688B (en) | Efficient time-division multiplexed addressing protocol | |
CN108541079B (en) | Low power Bluetooth connection method for multiple devices | |
CN100527661C (en) | Method and system for realizing multi-clock synchronization | |
JP2006295871A (en) | Communication terminal device | |
CN109818710A (en) | A kind of data transmission method and corresponding intrument | |
CN112269749B (en) | I2C communication system | |
WO2014012259A1 (en) | Method, base station and system for achieving time division duplex configuration of auxiliary cell | |
CN106052045B (en) | Air conditioner multi-split method based on power line carrier communication network | |
US8645584B2 (en) | Method and system for partial USB enumeration and edge initiation | |
CN106982156B (en) | Priority setting method, device, communication system, equipment and readable storage medium storing program for executing | |
Klobedanz et al. | Distributed coordination of task migration for fault-tolerant FlexRay networks | |
CN110493764A (en) | Bluetooth devices method, apparatus, bluetooth equipment and storage medium | |
CN106507468B (en) | A kind of wireless sensor network time synchronization method and system | |
TWI406580B (en) | Transmission method and related apparatus for reducing radio resource overhead | |
US8554139B2 (en) | Transmission method and related apparatus for reducing radio resource overhead | |
CN106412657B (en) | A kind of method and system of set-top box programming sequence code | |
US11601792B1 (en) | BLE system with multiple topologies and slave to slave communication |
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 |
Application publication date: 20181012 |
|
RJ01 | Rejection of invention patent application after publication |