CN111431668B - Baud rate switching method based on multi-node UART communication, air conditioning system and processor - Google Patents

Baud rate switching method based on multi-node UART communication, air conditioning system and processor Download PDF

Info

Publication number
CN111431668B
CN111431668B CN202010322982.1A CN202010322982A CN111431668B CN 111431668 B CN111431668 B CN 111431668B CN 202010322982 A CN202010322982 A CN 202010322982A CN 111431668 B CN111431668 B CN 111431668B
Authority
CN
China
Prior art keywords
baud rate
communication
baud
slave
switching method
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010322982.1A
Other languages
Chinese (zh)
Other versions
CN111431668A (en
Inventor
刘文斌
王星
贺小林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010322982.1A priority Critical patent/CN111431668B/en
Publication of CN111431668A publication Critical patent/CN111431668A/en
Application granted granted Critical
Publication of CN111431668B publication Critical patent/CN111431668B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F24HEATING; RANGES; VENTILATING
    • F24FAIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
    • F24F11/00Control or safety arrangements
    • F24F11/50Control or safety arrangements characterised by user interfaces or communication
    • F24F11/56Remote control
    • F24F11/58Remote control using Internet communication
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F24HEATING; RANGES; VENTILATING
    • F24FAIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
    • F24F11/00Control or safety arrangements
    • F24F11/88Electrical aspects, e.g. circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0015Systems modifying transmission characteristics according to link quality, e.g. power backoff characterised by the adaptation strategy

Abstract

The invention discloses a baud rate switching method based on multi-node UART communication, an air conditioning system and a processor. The switching method comprises the steps that the host and the plurality of slave machines are switched once every T1 time, the host carries out roll calling on the baud rates of all the slave machines, judgment is carried out according to the baud rates replied by all the slave machines, and the shared baud rate is selected for communication. Setting baud rate priority in a communication protocol of a master machine and a slave machine, and if the common baud rate replied by all slave machines is unique, using the common baud rate to carry out communication; if the common baud rate replied by all the slave machines is not unique, the host machine arbitrates the baud rates of all the slave machines and selects the highest priority in the common baud rates for communication. The invention effectively solves the communication problem caused by asynchronous switching baud rate in multi-node UART communication.

Description

Baud rate switching method based on multi-node UART communication, air conditioning system and processor
Technical Field
The invention relates to the technical field of communication, in particular to a baud rate switching method based on multi-node UART communication, an air conditioning system and a processor.
Background
The multi-node Universal Asynchronous Receiver Transmitter (UART) technology has the advantages of low cost, high reliability and large number of accommodated communication nodes, so that the UART technology has wide application in the air conditioning industry, and particularly aims at a multi-connected unit with large number of communication nodes.
With the updating and upgrading of the technology, the baud rate of the multi-node UART communication is correspondingly adjusted, and the baud rates of the communication which is more common in the industry are 1200, 2400, 4800, 9600 and 19200. The conventional baud rate replacement can cause communication failure of different versions of mainboards of each node in the same communication network, and the problem of UART communication and baud rate switching of multiple nodes cannot be coordinately solved. For example, an after-sale multi-connected unit has 1 master and 8 slaves, and if 1 slave is damaged, the baud rate of the master board of the new slave replaced is different from that of the old master board, so that the problem of communication failure occurs.
Therefore, how to design a baud rate switching method based on multi-node UART communication so that slaves with different baud rates can be compatible with a motherboard is an urgent technical problem to be solved in the industry.
Disclosure of Invention
In order to solve the problem of communication failure caused by different baud rates of a multi-connected unit in the prior art, the invention provides a baud rate switching method based on multi-node UART communication.
The invention provides a baud rate switching method based on multi-node UART communication, which comprises a host and a plurality of slave machines, wherein the baud rate switching method comprises the following steps: the host switches the baud rate of the host once every T1 seconds, the host carries out roll call on the baud rates of all the slave machines, the host judges according to the baud rates fed back by all the slave machines and selects the shared baud rate for communication.
In the method provided by the invention, the baud rate priority is set in the communication protocol, if the common baud rate of all the slave answers is unique, the common baud rate is used for communication; if the common baud rate replied by all the slave machines is not unique, the master machine arbitrates the baud rates of all the slave machines and selects the highest priority level in the common baud rates for communication.
Preferably, when there are more than 3 slaves, the switching step size of all slaves is equal.
Preferably, the switching step A1 of the master baud rate is greater than the switching step A2 of the slave baud rate, and A1/A2 = N, 1 < N < 2, and A2 < (A1-A2) < 3 times of the single frame communication period.
Preferably, the switching step size a2 of the baud rate of the host is greater than 10 times of the single frame communication period.
Preferably, all the slaves reply the wave characteristic rate information to the master according to the communication address sequence.
Preferably, the baud rate switching of the master and the slave is asynchronous.
In an embodiment, the baud rate switching method provided by the present invention includes the following steps:
s21, the host performs roll calling on all slave machines according to the baud rate;
s22, all the slave machines reply wave characteristic rate information to the host machine according to the communication address sequence;
s23, the master machine collects wave characteristic rate information of all slave machines;
s24, the host judges whether the number of the shared baud rates is larger than 1, and if not, the only baud rate is used for communication; if yes, go to step S25;
and S25, using the highest priority of all the shared baud rates to carry out communication.
The invention also provides a multi-split air conditioning system which uses the baud rate switching method based on the multi-node UART communication to carry out communication.
The invention also provides a processor for running a computer program, and the computer program executes the baud rate switching method based on the multi-node UART communication during running.
Compared with the prior art, the invention has the following beneficial effects:
1. the method provided by the invention is applied to the subsequent updating and updating of the multi-split air conditioner, can freely combine various baud rates, enables the host machine and the slave machine to be completely compatible, and solves the problem of communication failure caused by asynchronous baud rate switching in multi-node UART communication.
2. The method provided by the invention has high reliability and simple implementation, and does not need to increase extra cost.
Drawings
The invention is described in detail below with reference to examples and figures, in which:
FIG. 1 is a schematic diagram of a multi-node UART communication circuit;
FIG. 2 is a timing diagram illustrating baud rate switching for a multi-node UART communication;
FIG. 3 is a protocol diagram of multi-node UART communication baud rate switching;
FIG. 4 is a flow chart of multi-node UART communication baud rate selection.
Detailed Description
The embodiments of the present invention will be described in detail below, and the embodiments described by referring to the drawings are illustrative only and are not intended to limit the present invention.
FIG. 1 shows a schematic diagram of a multi-node UART communication circuit. As shown in fig. 1, the master side has at least two stages of current amplification, and the master communication signal current is amplified and sent to a plurality of slave nodes, and communication is performed according to a specified baud rate. The multi-connected air conditioning unit comprises a main machine and N auxiliary machines, and the main machine and the auxiliary machines are communicated through UART. Wherein, the host computer includes: the system comprises a main control board, a sending end TX, a receiving end RX, a first-stage power amplifier 9012 and a second-stage power amplifier 9013. The slave machine comprises: drive plate, sending end TXS, receiving end RXS, the drive plate includes: the optical coupler comprises a mainboard, an optical coupler isolator connected with a transmitting end TSX and an optical coupler isolator connected with a receiving end RXS. The optical coupling isolation device is used for solving the problem of different electric potentials between plates. The host computer and the slave computer are communicated through a bus, a special chip is not needed, and only the communication interfaces are electrically interconnected in a parallel line mode.
Signals sent by a sending end TX of the host computer are amplified through a first-stage power amplifier 9012 and a second-stage power amplifier 9013, then sent out on a BUS TX _ BUS according to a specified baud rate, received by a receiving end RXS after passing through a drive board of the slave computer, and communicated with the slave computer. The multiple slave machines are respectively connected with the communication bus in a parallel mode, and a transmitting end TXS of each slave machine transmits a communication signal to a receiving end RX of the host machine for receiving through the driving board and the bus according to the specified baud rate.
FIG. 2 is a timing diagram illustrating baud rate switching for a multi-node UART communication. With the updating of multi-node UART communication, the situation that each node of a host and a slave can have a plurality of different baud rates occurs at present, and the situation can cause abnormal communication. In the figure, curve 1 shows the baud rate of the master and curve 2 shows the baud rate of the slave. When the baud rates of the master and the slave are different, communication failure is caused. Taking a multi-split unit with 1 host and 8 slaves as an example, when the multi-split unit leaves a factory, the communication is performed at a baud rate of 1, and after sale, when 1 of the slaves is damaged and the baud rate 2 of a new slave main board to be replaced is different from the baud rate 1 of an old main board, the baud rate switching under the condition can cause communication failure of the master and slave machines of different versions of each node in the same communication network, and the problems of UART communication and baud rate switching of multiple nodes cannot be coordinately solved.
In the method, the host switches the baud rate once every T1 time, roll names the baud rates of all the slave machines, judges according to the baud rates replied by all the slave machines, and selects the shared baud rate for communication.
In the method provided by the invention, the baud rate priority is set in the communication protocol of the master and slave machines, and if the common baud rate replied by all the slave machines is unique, the common baud rate is used for communication; if the common baud rate replied by all the slave machines is not unique, the host machine arbitrates the baud rates of all the slave machines and selects the highest priority in the common baud rates for communication.
In the method provided by the invention, wave rate information is added in a communication protocol between the host and the slave, and the wave rate information is added after the effective data is loaded and before the effective data is finished and verified. FIG. 3 is a protocol diagram of multi-node UART communication baud rate switching, wherein the host roll-call protocol comprises: protocol specific code, ID number of the clicked person, effective data bit, baud rate condition of the current mainboard, ending and checking; the slave reply protocol comprises: protocol specific code, roll call ID number, valid data bit, baud rate condition of current mainboard, end and check. After the power is on, the host computer realizes the operation with the slave computer through the protocol specific code, then roll over the ID number, send the valid data and the situation that the current mainboard contains the baud rate, and finally check and finish. Similarly, the slave reply host also realizes simplex communication through the protocol specific code, then is subjected to point ID number, effective data sending and baud rate containing situation of the current mainboard, verification and ending, and finally the host stores the baud rate containing situation of the current mainboard in the slave in a list.
Fig. 4 shows a flowchart of the baud rate switching method of the present invention, which includes the following steps:
s21, after power-on, the host machine performs roll calling on all slave machines according to the baud rate;
s22, all the slave machines reply wave characteristic rate information to the host machine according to the communication address sequence;
when the slave machine replies the host computer roll call, all the wave specific rate information contained in the current main board is replied;
s23, the master machine collects wave characteristic rate information of all slave machines;
s24, judging whether the number of the shared baud rates is larger than 1, and if not, using the currently available baud rates for communication; if not, go to step S25;
and S25, using the highest priority in the shared baud rate to carry out communication.
The multi-connected air conditioning unit comprises a main machine and N auxiliary machines, wherein the main machine can communicate with the Baud rate 1, the Baud rate 2 and the Baud rate 3. The slave 1 can communicate with the baud rate 1, the baud rate 2 and the baud rate 3; the slave 2 can communicate at a baud rate 2 and a baud rate 3; the slave 3 can communicate … … at baud rate 1 and baud rate 3; the slave N can communicate at a baud rate of 3. The priority setting order is that the baud rate 1 level is highest and is decreased in sequence.
Figure DEST_PATH_IMAGE001
For example, when 1-3 slaves are started, the master carries out roll calling on the slaves 1-3 according to the baud rate, and the slaves reply the result that a common baud rate 3 exists, and then the unit selects the baud rate 3 to carry out communication. When the slave is started for 1-2 machines, the host carries out roll calling on the slave 1-2 according to the baud rate, the slave replies that two common baud rates 2 and 3 exist, at the moment, the host needs to carry out arbitration according to the priority level preset in the communication protocol, and the baud rate 2 is higher than the baud rate 3, so that the unit selects the baud rate 2 for communication.
In the method provided by the invention, the switching step A1 of the baud rate of the host computer is larger than the switching step A2 of the slave computer, the ratio A1/A2 = N of the two, and the value of N is required to be larger than 1 and smaller than 2; meanwhile, A1-A2 satisfies that more than A2 is less than 3 times the period of single frame communication. When the above condition is not satisfied, baud rate switching may also be performed, but this does not solve occasional communication failures. Meanwhile, the switching time step length of the master machine is different from that of the slave machine, so that the circular switching is avoided. More generally, if a1-a2 is less than 3 times the single frame period of a2, it may happen that the communication data starts to switch before the communication data is finished, which may result in missing the communication time. As a general example, when the master 9600 baud rate continues until the 4 th second, the slave just switches from 4800 to 9600, and the master switches to 4800 for the 5 th second, leaving 1 second insufficient to establish communication, resulting in communication failure.
Preferably, a2 satisfies 10 times or more of the single frame period. When there are 3 or more nodes, the communication is carried out by adopting a mode that all slave machines are equal in switching step length and A2. To prevent possible frame loss and avoid failure to establish communication properly in poor communication signals, a2 must ensure that there is a sufficient number of frames, preferably 10 times the period of a single frame, for communication establishment.
In the method provided by the invention, the baud rate switching of the master machine and the slave machine is asynchronous. Fig. 2 is a timing diagram illustrating baud rate switching of multi-node UART communication, and fig. 2 shows switching of 2 baud rate cases: the host baud rate switching and the slave baud rate switching illustratively give curves for the particular host switching from the upper baud rate 1 to the lower baud rate 1. If the switching of the baud rates is synchronous, the host is switched from the upper baud rate 1 to the lower baud rate 1, and the slave is switched from the lower baud rate 2 to the upper baud rate 2 at the same time, so that the host and the slave can never establish communication.
In one embodiment, the host computer baud rate performs roll calling on the slave computer at 9600 baud rate in the initial power-on stage, and if the communication signal of the slave computer is not received, the baud rate is switched to 4800 after 5 s; in the process, the slave computer is powered on at 4800 early stage, the host computer signal is not received, the baud rate is switched to 9600 after 3s, a 2s time overlapping region exists between the baud rate and the 9600 baud rate of the host computer 5s, and the host computer and the slave computer can be ensured to establish communication in the overlapping region.
The host machine selects the common baud rate according to the received all slave machine wave rate information, and if the common baud rate is unique, the current baud rate is used for communication; if a plurality of baud rates are shared, the baud rates are selected according to the priority, and the priority can be determined by each manufacturer.
The baud rate switching method provided by the invention is applied to a multi-split air conditioning system, can effectively solve the baud rate switching problem of multi-node UART communication, and avoids communication failure caused by switching. In addition, the switching method provided by the invention can be stored in the processor as a computer program through software, and the computer program is called to solve the baud rate switching problem through the software when the processor runs, so that a hardware circuit or a component does not need to be replaced, and the after-sale maintenance cost of the equipment is further reduced.
Although the technical solution of the present invention has been described above with reference to the embodiments and the accompanying drawings, it should be understood that changes can be made to the embodiments by those skilled in the art without departing from the principle and concept of the invention, and such changes should be included in the scope of the appended claims.

Claims (8)

1. The baud rate switching method based on multi-node UART communication comprises a host and a plurality of slave machines, and is characterized in that the baud rate switching method comprises the steps that the host switches the baud rate once every T1 time, roll names are carried out on the baud rates of all the slave machines, judgment is carried out according to the baud rates replied by all the slave machines, and a common baud rate is selected for communication; which comprises the following steps:
s21, performing roll calling on all the slave machines according to the baud rate of the host machine;
s22, all the slave machines reply wave characteristic rate information to the host machine according to the communication address sequence;
s23, the master computer collects the wave characteristic rate information of all the slave computers;
s24, the host computer judges whether the number of the sharable baud rate is larger than one, if not, the only baud rate is used for communication, if yes, the step S25 is executed;
s25, communicating using the highest priority of all common baud rates.
2. The baud rate switching method of claim 1, wherein the baud rate priority is set in the communication protocol of the master and slave devices, if the common baud rate of all the slave devices replies is unique, the common baud rate is used for communication, and if the common baud rate of all the slave devices replies is not unique, the master device arbitrates the baud rates of all the slave devices, and selects the highest priority in the common baud rates for communication.
3. The baud rate switching method of claim 1, wherein the switching step size a2 from the baud rate is greater than 10 times the single frame communication period.
4. The baud rate switching method of claim 3, wherein when there are more than three slaves, the switching steps of all slaves are equal.
5. The baud rate switching method of claim 1, wherein all the slaves reply with baud rate information to the master in the order of communication addresses.
6. The baud rate switching method of claim 1, wherein the baud rate switching of the master and the slave is asynchronous.
7. A multi-split air conditioning system, wherein the air conditioning system communicates using the baud rate switching method based on multi-node UART communication of any one of claims 1 to 6.
8. A processor for executing a computer program, wherein the computer program is executed to perform the baud rate switching method based on multi-node UART communication according to any one of claims 1 to 6.
CN202010322982.1A 2020-04-22 2020-04-22 Baud rate switching method based on multi-node UART communication, air conditioning system and processor Active CN111431668B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010322982.1A CN111431668B (en) 2020-04-22 2020-04-22 Baud rate switching method based on multi-node UART communication, air conditioning system and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010322982.1A CN111431668B (en) 2020-04-22 2020-04-22 Baud rate switching method based on multi-node UART communication, air conditioning system and processor

Publications (2)

Publication Number Publication Date
CN111431668A CN111431668A (en) 2020-07-17
CN111431668B true CN111431668B (en) 2021-04-06

Family

ID=71558415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010322982.1A Active CN111431668B (en) 2020-04-22 2020-04-22 Baud rate switching method based on multi-node UART communication, air conditioning system and processor

Country Status (1)

Country Link
CN (1) CN111431668B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112968752B (en) * 2021-01-28 2023-01-24 歌尔科技有限公司 Baud rate switching method and device for UART communication and initiator terminal

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904688A (en) * 2012-10-12 2013-01-30 北京新雷能科技股份有限公司 Method and device for regulating baud rate
CN103916284A (en) * 2013-01-06 2014-07-09 上海开通数控有限公司 RS485 communication interface automatic baud rate and communication address detection method
CN104796222A (en) * 2014-11-21 2015-07-22 湖南先步信息股份有限公司 A CAN baud-rate automatic matching method
CN106532960A (en) * 2016-12-23 2017-03-22 烟台东方威思顿电气股份有限公司 Adaptive SCADA monitoring method applicable to power supply and power distribution field
CN106788907A (en) * 2017-03-24 2017-05-31 湖南浩奇通讯技术有限公司 Master-salve station communication baud rate Auto-matching
JP2017175309A (en) * 2016-03-23 2017-09-28 キヤノン株式会社 Communication system
CN108826588A (en) * 2018-05-11 2018-11-16 珠海格力电器股份有限公司 The air-conditioner set means of communication and device
CN108966251A (en) * 2018-07-12 2018-12-07 四川虹美智能科技有限公司 A kind of WiFi module baud rate collocation method, system and WiFi module

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101409716B (en) * 2008-11-25 2011-11-23 中国联合网络通信集团有限公司 Method for matching communication velocity of wireless communication module and external application module

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904688A (en) * 2012-10-12 2013-01-30 北京新雷能科技股份有限公司 Method and device for regulating baud rate
CN103916284A (en) * 2013-01-06 2014-07-09 上海开通数控有限公司 RS485 communication interface automatic baud rate and communication address detection method
CN104796222A (en) * 2014-11-21 2015-07-22 湖南先步信息股份有限公司 A CAN baud-rate automatic matching method
JP2017175309A (en) * 2016-03-23 2017-09-28 キヤノン株式会社 Communication system
CN106532960A (en) * 2016-12-23 2017-03-22 烟台东方威思顿电气股份有限公司 Adaptive SCADA monitoring method applicable to power supply and power distribution field
CN106788907A (en) * 2017-03-24 2017-05-31 湖南浩奇通讯技术有限公司 Master-salve station communication baud rate Auto-matching
CN108826588A (en) * 2018-05-11 2018-11-16 珠海格力电器股份有限公司 The air-conditioner set means of communication and device
CN108966251A (en) * 2018-07-12 2018-12-07 四川虹美智能科技有限公司 A kind of WiFi module baud rate collocation method, system and WiFi module

Also Published As

Publication number Publication date
CN111431668A (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN106959935B (en) Method compatible with I2C communication and IPMB communication
CN102081568B (en) Multi-motherboard server system
CN102185754B (en) Method for upgrading board card in switch system
RU2614569C2 (en) Rack with automatic recovery function and method of automatic recovery for this rack
CN111431668B (en) Baud rate switching method based on multi-node UART communication, air conditioning system and processor
WO2007054447A1 (en) Method for controlling mobile data connection through usb ethernet management
CN113434442A (en) Switch and data access method
CN115632900B (en) Computing equipment
CN112178881B (en) Self-checking method and device of RS485 network
JP6134720B2 (en) Connection method
CN113794713B (en) Communication processing method for bridging MIL-STD-1553 and UART by FC-AE-1553 protocol
US20080133955A1 (en) Apparatus, methods and computer program products supporting automatic network identification for power supplies
US7724646B2 (en) System and method for implementing service switching
CN113360191B (en) Driving device of network switching chip
US20100005197A1 (en) Network device and active control card detecting method
JP2010136038A (en) Transmitter, and method for switching system in redundant configuration
CN114338265B (en) Program downloading system and method based on TTP/C bus
KR20050100204A (en) Method for communicating with master module and slave module of plc network
CN111431780B (en) Communication method and device of 1553B bus system
CN113872818B (en) Method for detecting connection state of baseboard management control unit and server device thereof
CN112131167B (en) LPC protocol-based I2C forwarding module, system and use method thereof
US11876555B2 (en) Failure determination system and failure determination method
US20230315064A1 (en) Network system, communication method, and computer readable medium
CN112600679A (en) Intelligent network card
CN117857249A (en) Modbus protocol-based data transmission 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