Communication method, communication device, slave and multi-split system
By preempting communication data, the problem of excessive response time caused by master-slave polling in multiple online systems is solved, and efficient communication and data accuracy of the system are achieved.
Patent Information
- Application Number
- CN202510815873.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-08-26
AI Technical Summary
The master-slave polling method in multiple online systems causes the system to respond too long, affecting communication efficiency.
The method of preempting communication data is adopted to define priority by preempting frame data, detect the data status on the communication bus, send preempting frame data and make priority judgments, ensuring that the preempting frame data with the highest priority is transmitted.
Improve the response efficiency of multi-online systems, avoid data errors, and ensure data accuracy and timeliness.
Smart Images

Figure CN120547019A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a communication method, a communication device, a slave device and a multi-connection system. Background Art
[0002] Multi-split systems typically use a master-slave architecture, employing standard industrial bus protocols such as RS485, CAN, and MDV-Link. This architecture primarily employs a master-slave polling method. For example, in a multi-split air conditioning system, when an outdoor unit communicates with multiple indoor units, the outdoor unit acts as the master and the indoor units as the slaves. The installation process involves the on-site installer first assigning addresses to the multi-split system's indoor units. For example, if 10 indoor units are connected, the indoor units' addresses are assigned to 1, 2, ..., and 10. The outdoor unit then sends a signal, which all ten indoor units receive. The indoor units then respond sequentially to the outdoor unit's message based on their respective addresses, establishing communication between the indoor and outdoor units. In practice, multiple rounds of polling are often required to ensure reliability. Furthermore, multi-split systems are typically very large, so a master-slave polling method can result in very slow system response times, significantly impacting system response time. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a communication method, a communication device, a slave device, and a multi-connection system.
[0004] A communication method provided in an embodiment of the present invention is used for a slave device in a multi-connected system. The multi-connected system includes a master device and at least two slave devices. The slave devices include a main control chip and are connected to the master device via a communication bus. The communication method includes:
[0005] In response to the preemption communication data sent by the main control chip, detecting the data of the communication bus, the preemption communication data includes preemption frame data and reply data, the preemption frame data defines the priority of the preemption communication data, the preemption frame data includes a plurality of preemption bytes, each preemption byte represents a data bit, and each preemption byte is composed of a plurality of current signals;
[0006] sending the preemption frame data to the communication bus according to the data state on the communication bus, so that the communication bus performs priority determination according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority;
[0007] Detecting preemption frame data on the communication bus;
[0008] Comparing the preemption frame data on the communication bus with the preemption frame data in the preemption communication data; and
[0009] In a case where the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data, the reply data is sent to the communication bus.
[0010] In some embodiments, the communication method further comprises:
[0011] When the preemption frame data on the communication bus is different from the preemption frame data in the preemption communication data, the sending of data to the communication bus is stopped and the state is switched to a receiving state.
[0012] In some embodiments, sending preemption frame data to the communication bus according to the data state on the communication bus, so that the communication bus performs priority determination according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority, includes:
[0013] In a case where the communication bus includes communication data, sending the preemption frame data to the communication bus after a preset period of time after the communication data is sent; or
[0014] In a case where the communication bus does not include the communication data, the preemption frame data is sent to the communication bus.
[0015] In some embodiments, the communication device includes an indicator pin, and the communication method further includes:
[0016] When receiving the preemption frame data, controlling the indication pin to display a first level signal so that the main control chip stops sending the preemption communication data; and
[0017] In a case where the preemption frame data is sent to the communication bus, the indication pin is controlled to display a second level signal.
[0018] In some embodiments, when the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data, sending the reply data to the communication bus includes:
[0019] The reply data is sent to the communication bus at intervals.
[0020] In some embodiments, when there is a current signal of 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 0; when there is no current signal of 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 1.
[0021] In some embodiments, the communication bus performs priority determination based on the current signal in the preemption frame data and displays the preemption frame data with the highest priority, including:
[0022] All received preemption frame data are combined and processed to generate one preemption frame data, so as to obtain the preemption frame data with the highest priority.
[0023] The communication device of the embodiment of the present application is used as a slave of a multi-connected system. The multi-connected system includes a master and at least two slaves. The slave includes a main control chip and is connected to the master via a communication bus. The communication device includes:
[0024] a detection module, configured to detect data on the communication bus in response to preemption communication data sent by the main control chip, wherein the preemption communication data includes preemption frame data and reply data, the preemption frame data includes a plurality of preemption bytes, each preemption byte represents a data bit, and each preemption byte is composed of a plurality of current signals;
[0025] A sending module, configured to send the preemption frame data to the communication bus according to the data status on the communication bus;
[0026] The detection module is also used to detect the preemption frame data on the communication bus;
[0027] a comparison module, configured to compare the preemption frame data on the communication bus with the preemption frame data in the preemption communication data; and
[0028] The sending module is further configured to send the reply data to the communication bus when the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data.
[0029] The slave device of the embodiment of the present application is used in a multi-connected system, and the slave device includes a main control chip and the communication device.
[0030] The multi-split system according to the embodiment of the present application includes a host and at least two indoor units, wherein the host is connected to the slave units via a communication bus.
[0031] In the communication method, communication device, indoor unit and multi-split system of the embodiments of the present application, after receiving the preempted communication data sent by the main control chip, the data on the communication bus is detected, and the preempted frame data is sent to the communication bus according to the data status on the communication bus, thereby avoiding the preempted frame data from affecting the data on the communication bus, and also avoiding the preempted frame data from being affected by the data on the communication bus. Since the preempted frame data defines the priority of the preempted communication data, if the communication bus receives the preempted frame data sent by multiple slaves, it will make a judgment and only display the preempted frame data with high priority. Therefore, by detecting the preempted frame data on the communication bus and comparing the preempted frame data in the preempted communication data to see whether they are the same, if they are the same, it indicates that the current preempted communication data has the highest priority, and reply data is sent to the communication bus. In this way, timely response to system command information is achieved, and the response efficiency of the multi-connected system is improved. In addition, since the preemption frame data includes multiple preemption bytes, and each preemption byte represents a data bit, each preemption byte is composed of multiple current signals, which lengthens the time length of each data bit. This solves the problem of data errors on the communication bus caused by misaligned commands when multiple slaves send preemption frame data at the same time, thereby ensuring data accuracy.
[0032] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0034] Figure 1 is a flow chart of a communication method according to certain embodiments of the present invention;
[0035] Figure 2 is a schematic diagram of a module of a communication device according to some embodiments of the present invention;
[0036] Figure 3 is a schematic diagram of a module of a multi-connected system according to certain embodiments of the present invention;
[0037] Figure 4 1 is a waveform diagram of preemptive frame data "01010..." according to some embodiments of the present invention;
[0038] Figure 5 1 is a waveform diagram of a preempted byte "0" according to some embodiments of the present invention;
[0039] Figure 6 1 is a waveform diagram of a preempted byte "1" according to some embodiments of the present invention;
[0040] Figure 71 is a waveform diagram of preemptive frame data on a communication bus in certain embodiments of the present invention;
[0041] Figure 8 is a schematic diagram of a scenario of a communication method in certain embodiments of the present invention;
[0042] Figure 9-11 is a flow chart of a communication method according to certain embodiments of the present invention;
[0043] Figure 12 1 is a waveform diagram of preempting communication data in certain embodiments of the present invention. DETAILED DESCRIPTION
[0044] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "example", "specific example" or "some examples" is intended to mean that the specific features, structures, materials or characteristics described in combination with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are mutually contradictory. At the same time, the description with reference to the terms "first", "second" and the like is intended to distinguish the same or similar operations. In some embodiments, there is a logical relationship between "first" and "second", but in some embodiments, there is not necessarily a logical or front-to-back relationship. It needs to be determined based on the actual embodiment and should not be determined only by the literal meaning.
[0045] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.
[0046] Multi-split systems typically use a master-slave architecture, employing standard industrial buses like RS485, CAN, and MDV-Link. For example, in a multi-split system, the outdoor unit acts as the master and the indoor units as the slaves. The installation process involves first assigning addresses to the system's indoor units. For example, if 10 indoor units are connected, the indoor units' addresses are assigned to 1, 2, and so on. The outdoor unit then sends a signal, which all ten indoor units receive. The indoor units then respond sequentially to the outdoor unit's message based on their respective addresses, establishing communication between the two units. In practice, multiple rounds of polling are often required to ensure reliable communication control. Furthermore, multi-split systems are very large; a single outdoor unit can connect to 64 indoor units, along with other devices like remote controllers and mobile stations, potentially reaching over 100 communication nodes. Based on the above analysis, a master-slave polling approach can result in very slow system response times, significantly impacting system response time.
[0047] In view of this, please see Figure 1 The present application provides a communication method for a slave unit of a multi-split system. The multi-split system includes a master unit and at least two slave units. The indoor unit also includes a main control chip. The slave unit is connected to the master unit via a communication bus. The communication method includes:
[0048] 01, in response to the preemption communication data sent by the main control chip, detect the data of the communication bus, the preemption communication data includes preemption frame data and reply data, the preemption frame data defines the priority of the preemption communication data, the preemption frame data includes multiple preemption bytes, each preemption byte represents a data bit, and each preemption byte consists of multiple current signals;
[0049] 02, sending preemption frame data to the communication bus according to the data status on the communication bus, so that the communication bus makes a priority decision according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority;
[0050] 03, detect the preemption frame data on the communication bus;
[0051] 04, compare the preemption frame data on the communication bus with the preemption frame data in the preemption communication data; and
[0052] 05. When the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data, the reply data is sent to the communication bus.
[0053] See also Figure 2The present application provides a communication device 10. The communication device 10 includes a detection module 11, a sending module 12, and a comparison module 13. Steps 01 and 03 can be implemented by the detection module 11, steps 02 and 05 can be implemented by the sending module 12, and step 04 can be implemented by the comparison module 13.
[0054] In other words, the detection module 11 can be used to respond to the preempted communication data sent by the main control chip and detect the data on the communication bus. The preempted communication data includes preempted frame data and reply data. The preempted frame data defines the priority of the preempted communication data. The preempted frame data includes multiple preempted bytes, each preempted byte represents a data bit, and each preempted byte is composed of multiple current signals; the sending module 12 can be used to send preempted frame data to the communication bus according to the data status on the communication bus, so that the communication bus makes a priority decision based on the current signal in the preempted frame data and displays the preempted frame data with the highest priority; the detection module 11 can also be used to detect the preempted frame data on the communication bus; the comparison module 13 can be used to compare the preempted frame data on the communication bus with the preempted frame data in the preempted communication data; the sending module 12 can also be used to send reply data to the communication bus when the preempted frame data on the communication bus is the same as the preempted frame data in the preempted communication data.
[0055] See also Figure 3 The embodiment of the present application further provides a multi-connected system 1000, which includes a host 200 and at least two slaves 100. The host 200 communicates with each slave 100 via a communication bus. The slave 100 can implement the above-mentioned communication method, that is, the slave 100 can be used to respond to the preempted communication data sent by the master chip 20 and detect the data on the communication bus. The preempted communication data includes preempted frame data and reply data. The preempted frame data defines the priority of the preempted communication data. The preempted frame data includes multiple preempted bytes, each preempted byte represents a data bit, and each preempted byte is composed of multiple current signals; and the preempted frame data is sent to the communication bus according to the data status on the communication bus, so that the communication bus makes a priority decision based on the current signal in the preempted frame data and displays the preempted frame data with the highest priority; and detects the preempted frame data on the communication bus; the slave 100 can also be used to compare the preempted frame data on the communication bus with the preempted frame data in the preempted communication data; and when the preempted frame data on the communication bus is the same as the preempted frame data in the preempted communication data, the reply data is sent to the communication bus.
[0056] In the communication method, communication device 10 and multi-connected system 1000 of the embodiment of the present application, after receiving the preempted communication data sent by the main control chip 20, the data on the communication bus is detected, and the preempted frame data is sent to the communication bus according to the data status on the communication bus, thereby avoiding the preempted frame data from affecting the data on the communication bus, and also avoiding the preempted frame from being affected by the data on the communication bus. Since the preempted frame data defines the priority of the preempted communication data, if the communication bus receives the preempted frame data sent by multiple slaves 100, it will make a judgment and only display the preempted frame data with high priority. Therefore, by detecting the preempted frame data on the communication bus and comparing the preempted frame data in the preempted communication data to see whether they are the same, if they are the same, it indicates that the current preempted communication data has the highest priority, and reply data is sent to the communication bus. In this way, timely response of the command information of the multi-connected system 1000 is achieved, and the response efficiency of the multi-connected system 1000 is improved. In addition, since the preemption frame data includes multiple preemption bytes, and each preemption byte represents a data bit, each preemption byte is composed of multiple current signals, which lengthens the time length of each data bit. This solves the problem of data errors in the communication bus caused by misaligned commands when multiple slaves send preemption frame data at the same time, thereby ensuring data accuracy.
[0057] It should be noted that the communication method of the present application is implemented based on MDV-Link communication technology. That is, the master 200 and slave 100 in the multi-connected system 1000 communicate based on MDV-Link communication technology. Those skilled in the art will understand that the principle of MDV-Link communication technology is that the master 200 transmits data using wide-band voltage modulation, and the slave 100 responds using current signals. When a 0 is transmitted, there is a current signal, and when a 1 is transmitted, there is no current. The master 200 analyzes the 0 and 1 signals in the slave 100's response by detecting the current signal. In this way, when different communication nodes simultaneously transmit 1 and 0, the communication node can detect the data 0, which is the dominant level.
[0058] The multi-split system 1000 in this embodiment will be described using an air conditioning system as an example. It should be understood that the multi-split system 1000 is not limited to air conditioning systems. The master unit 200 may be an outdoor unit, and the slave units 100 may be indoor units. The outdoor unit and multiple indoor units are connected via a communication bus. This means that the aforementioned communication method can be applied to air conditioning systems, thereby improving the response rate and communication efficiency of air conditioning systems.
[0059] In the multi-connected system 1000, a master-slave communication architecture can be employed. There can be one master 200 and multiple slaves 100, including two, three, four, five, ten, fifteen, twenty, fifty, or even more slaves 100. In other words, the specific number of indoor units is not limited. Each slave 100 can include a communication device 10 and a master control chip 20. The communication device 10 is electrically connected to the master control chip 20 and a communication bus. The communication device 10 can receive commands sent by the master 200 via the communication bus and transmit them to the master control chip 20. The communication device 10 can also transmit data sent by the master control chip 20 to the communication bus, thereby enabling communication between the slave 100 and the master 200. The master control chip 20 can generate preemptive communication data based on commands from the master 200 and transmit it to the communication device 10. The communication device 10 then transmits the preemptive communication data sent by the master control chip 20 to the communication bus.
[0060] It should be noted that the preempted communication data can generate reply data according to the command of the host 200. The preempted communication data can include preempted frame data and reply data, wherein the preempted frame data defines the preempted communication data priority, and the preempted frame data is used to determine when the reply data can be sent to the communication bus. For the preempted communication in multiple slaves 100, the sending priority of the reply data in each slave 100 can be determined according to the priority of each preempted communication data. The higher the priority of the preempted communication data, the higher the priority of the corresponding reply data is sent to the communication bus for transmission to the host 200. It can be understood that since the host 200 communicates with multiple slaves 100 through the communication bus, in order to ensure the communication effect, the communication bus can only transmit the data of one of the slaves 100 at a time. Therefore, the data transmission order of the slaves 100 can be determined according to the priority of the preempted communication data of each slave 100.
[0061] like Figure 4 As shown, each preemption frame data includes multiple preemption bytes, each preemption byte represents a data bit, that is, each preemption byte is used to represent 0 or 1, and each preemption byte is composed of multiple current signals. The current signals can be sent in the form of pulses, and the number of current signals can be 8, 9, 10, 11, 12, 15, or even more. For example, in some examples, each preemption byte may include 11 current signals, and the current signals can be 1 or 0, wherein when the current signal is 0, it indicates the presence of the current signal, and when the current signal is 1, it indicates the absence of the current signal.
[0062] When the current signal is 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 0. When the current signal is not 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 1. For example, the encoding of the preempted byte representing "0" can be 00111110001 (such as Figure 5 As shown), 00111110111 or 0011000001, the encoding of the preemptive byte "1" can be "11111111111" (as shown Figure 6 shown).
[0063] The priority of preempted communication data can be cut by the communication bus based on the preempted frame data, while the preempted frame data with the highest priority is retained on the communication bus. For example, in some examples, the multi-connected system 1000 includes a host 200 and slaves 1, 2, and 3, wherein the priority of preempted communication data from slave 1 is higher than the priority of preempted communication data from slave 2, and the priority of preempted communication data from slave 2 is higher than the priority of preempted communication data from slave 1003. Then, after slaves 1, 2, and 1003 all send preempted frame data simultaneously, the communication bus cuts all preempted frame data and retains the preempted frame data from slave 1 with the highest priority.
[0064] More specifically, when the communication bus receives preemption frame data sent by different slaves 100 at the same time, it merges all received preemption frame data to generate a preemption frame data to obtain the preemption frame data with the highest priority. That is, each preemption byte in each preemption frame data is merged with each preemption byte in other preemption frame data. It should also be noted that if the preemption byte of one of the preemption frame data represents "0" and the preemption byte of the other preemption frame data represents 1, then the merged preemption byte is "0"; if the preemption byte of one of the preemption frame data represents "0" and the preemption byte of the other preemption frame data represents 0, then the merged preemption byte is "0"; if the preemption byte of one of the preemption frame data represents "1" and the preemption byte of the other preemption frame data represents 1, then the merged preemption byte is "1". For example, in some examples, the multi-connected system 1000 includes slave 1 (device 1) and slave 2 (device 2), the communication device 10 of slave 1 sends preemption frame data "010...", and the communication device 10 of slave 2 sends preemption data "011...". After receiving the preemption frame data from slave 1 and slave 2, the communication bus merges them to generate one preemption frame data, obtaining the preemption frame data "010..." with the highest priority.
[0065] Understandably, see Figure 7When two slaves 100 that are far apart compete for the communication bus, the data commands sent by the two slaves 100 may not be fully aligned due to signal transmission delays and the influence of parasitic capacitance and inductance on the communication bus. However, in this embodiment, since each preemption is directly composed of multiple data bits, even if two or more slaves 100 send preemption frame data simultaneously and the preemption frame data is not aligned, the communication bus will not be affected in detecting the preemption frame data. This avoids the situation where misaligned preemption frame data causes communication bus data errors, thereby improving communication quality.
[0066] After the communication device 10 of the slave machine 100 receives the preemptive communication data sent by the main control chip 20, it can detect the data on the communication bus and decide whether to send the preemptive frame data to the communication bus again based on the data status, thereby avoiding the preemptive frame data from affecting the data on the communication bus, and also avoiding the preemptive frame from being affected by the data on the communication bus.
[0067] When the communication device 10 of the slave 100 sends preemption frame data to the communication bus, it can detect the preemption frame data on the communication bus and compare the preemption frame data on the communication bus with the preemption frame data it has sent, thereby determining whether its transmission priority is the highest compared to other slaves 100. If they are the same, it indicates that its data currently has the highest priority, and the slave can then send reply data to the communication bus, which is then transmitted to the master 200.
[0068] If the preemption frame data of the communication bus is different from the preemption frame data sent by the slave 100, it indicates that the current priority is not optimal. At this time, when reply data is sent to the communication bus by other slaves 100, the slave 100 stops sending reply data to the communication bus and switches to the receiving state to detect the data status of the communication bus. Then, based on the data status of the communication bus, the slave 100 decides whether to send the preemption frame data to the communication bus again until the reply data is sent. In this way, by setting different priorities according to the urgency of the command, the communication device 10 of the slave 100 sends the preemption frame data while detecting the preemption frame data of the communication bus during preemption, so that the command with higher priority can be sent to the bus first, thereby achieving timely response of the multi-connected system 1000 command information.
[0069] See also Figure 8In one example, multi-connected system 1000 includes slave 1 (device 1) and slave 2 (device 2). Slave 1's communication device 10 sends preemption frame data "01010...", and slave 2's communication device 10 sends preemption data "01000...". After receiving the preemption frame data from both slaves 1 and 2, the communication bus displays "01000...", indicating that slave 2 has a higher priority than slave 1. Upon detecting that the preemption frame data on the communication bus matches the preemption frame data it sent, slave 2 sends its reply data to the communication bus, which then sends it to master 200. Simultaneously, slave 1 stops sending data to the communication bus and switches to a receiving state to detect data on the communication bus. If the data of slave 2 is sent, that is, slave 1 detects that the data on the communication bus has been sent, then slave 1 sends the preemption frame data "01010..." to the communication bus again. If slave 1 detects that the preemption frame data on the communication bus is "01010..." at this time, it sends the reply data to the communication bus.
[0070] In addition, it should be noted that when the communication device 10 of the slave 100 sends the preemption frame data to the communication bus, each preemption byte of the preemption frame data is sent to the communication bus at a predetermined time interval. For example, if the preemption frame data in the preemption communication data is "11011100", the preemption bytes are sent in the order of "1", "1", "0", ... "0" until all the preemption bytes in the preemption data are sent. The specific length of the predetermined time interval is not limited, for example, it can be 800 microseconds.
[0071] It can be understood that when comparing the preemption frame data of the communication bus with the preemption frame data sent by the user, the comparison is to determine whether the data bits represented by each preemption byte in the preemption frame data of the communication bus are the same as the data bits represented by each preemption byte in the preemption frame data sent by the user. For example, if the preemption frame data of the communication bus is "11011100", if the preemption frame data in the preemption communication data is "110...", then the preemption frame data of the communication bus is determined to be the same as the preemption frame data sent by the user. If the preemption frame data in the preemption communication data is "100...", then the preemption frame data of the communication bus is determined to be different from the preemption frame data sent by the user.
[0072] Furthermore, after each preemption byte is sent to the communication bus, the preemption byte on the communication bus can be detected to determine whether they are the same. If they are not the same, it is determined that the preemption frame data of the communication bus is different from the preemption frame data sent by itself, then the sending is stopped and the state is switched to the receiving state. The next time the bus is idle, the preemption frame data is sent again. If they are the same, the next preemption byte is sent. For example, if the preemption frame data in the preempted communication data is "110...", if the first preemption byte on the communication bus is detected to be "1", the second preemption byte "1" is continued to be sent. If the second preemption byte on the communication bus is detected to be "0", it is determined that the preemption frame data of the communication bus is different from the preemption frame data sent by itself, then the sending is stopped and the state is switched to the receiving state. The next time the bus is idle, the preemption frame data is sent again.
[0073] See also Figure 9 In some embodiments, step 02 includes:
[0074] 021, in the case where the communication bus includes communication data, sending preemption frame data to the communication bus after a preset period of time after the communication data is sent; or
[0075] 022, when the communication bus does not include communication data, sending preemption frame data to the communication bus.
[0076] Please further combine Figure 2 In some embodiments, sub-steps 021-022 may be implemented by the sending module 12. That is, the sending module 12 may be configured to send preemption frame data to the communication bus after a preset period of time after the communication data is sent, when the communication bus includes communication data; or to send preemption frame data to the communication bus, when the communication bus does not include communication data.
[0077] It should be noted that the communication data can be preempted communication data sent by other slaves 100, or preempted communication data previously sent by the communication device 10. Furthermore, the communication data can be preempted frame data or reply data. That is, when the communication device 10 detects that the communication bus includes preempted frame data or reply data, it does not send the preempted frame data to the communication bus. When it detects that the preempted frame data or reply data in the communication bus has been sent, it sends the preempted frame data to the communication bus after a preset period of time. If the communication device 10 does not detect that the communication bus includes preempted frame data or reply data, it directly sends the preempted frame data to the communication bus.
[0078] In this way, the impact of the preemption frame data on the data of the communication bus can be avoided. At the same time, the preemption frame is prevented from being affected by the data on the communication bus, thereby ensuring the accuracy of the preemption frame data.
[0079] In some examples, when the slave machine 100 sends data with a relatively low priority command, if the data on the communication bus at this time has always been data with a relatively high command priority, the data of the communication device 10 will not be sent out and will be cached in the storage area. The main control chip 20 is unaware of this situation and continues to send data to the communication device 10, which can easily cause data overflow problems in the communication device 10.
[0080] In view of this, please see Figure 10 In some embodiments, the communication method further comprises:
[0081] 06. When receiving the preemption frame data, the control indication pin displays a first level signal, so that the main control chip stops sending the preemption communication data; and
[0082] 07. When the preemption frame data is sent to the communication bus, the control indication pin displays a second level signal.
[0083] Please combine Figure 2 In some embodiments, the communication device 10 further includes a control module 14, wherein steps 06 and 07 can be implemented by the control module 14. That is, the control module 14 can be configured to control the indicator pin to display a first level signal when receiving preemption frame data, so as to cause the main control chip to stop sending preemption communication data; and to control the indicator pin to display a second level signal when sending preemption frame data to the communication bus.
[0084] The first level signal and the second level signal can be two electrically opposite level signals. For example, the first level signal is a high level signal, and the second level signal is a low level signal. The indicator pin is used to indicate the status of the communication device 10. When the indicator pin displays a first level signal, it indicates that the communication device 10 has received the preemption frame data sent by the main control chip 20 and has entered the preemption mode. When the indicator pin displays a second level signal, it indicates that the communication device 10 has not entered the preemption mode.
[0085] Before sending reply data to the communication device 10, the main control chip 20 can detect the level signal status of the indicator pin. When it is detected that the indicator pin displays a first level signal, the main control chip 20 stops sending chips to the communication device 10. When it is detected that the indicator pin displays a first level signal, the main control chip 20 stops sending reply data to the communication device 10. When it is detected that the indicator pin displays a second level signal, the main control chip 20 sends the next frame of reply data to the communication device 10.
[0086] In this way, by setting the indicator pin to display the level signal, the problem of data overflow of the communication device 10 caused by the main control chip 20 sending reply data to the communication device 10 is solved, ensuring that the host 200 can receive complete reply data, thereby improving the communication quality of the multi-connected system 1000.
[0087] Please combine Figure 11 In some embodiments, step 05 includes:
[0088] 051, send reply data to the communication bus at intervals.
[0089] Please combine Figure 2 In some embodiments, step 051 can be implemented by the sending module 12, or in other words, the sending module 12 can be used to send reply data to the communication bus at intervals.
[0090] It is understandable that when the host 200 of the multi-connected system 1000 continuously receives multiple preemption commands, the host 200 will continuously parse the data, which can easily result in a small time interval between two frames of data, causing the two frames of data to be processed as one frame of data, resulting in communication data errors in the multi-connected system 1000. Therefore, to avoid this problem, when the communication device 10 sends reply data to the communication bus, the reply data is sent to the communication bus at intervals, so that the time interval between two adjacent frames of data sent to the host 200 is increased, thereby reserving time for the host 200 to interrupt the frame interval. In this way, the host 200 can avoid processing two frames of data as one frame of data, which can cause communication data errors in the multi-connected system 1000.
[0091] Specifically, when the communication device 10 sends the reply data to the communication bus, it can interrupt the sending of the reply data at a fixed time interval, thereby reserving time for the host 200 to use for the frame interruption time interval. Figure 12 As shown, the data format replied by the communication device 10 is to send the preempted bytes first and then the normal bytes, and insert an idle period every 4-7 bytes when sending the normal bytes, so as to achieve the purpose of reducing the data speed on the communication bus.
[0092] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A communication method for a slave device in a multi-connection system, characterized in that: The multi-connected system includes a host and at least two slaves, wherein the slaves include a main control chip and are connected to the host via a communication bus. The communication method includes: In response to the preemption communication data sent by the main control chip, detecting the data of the communication bus, the preemption communication data includes preemption frame data and reply data, the preemption frame data defines the priority of the preemption communication data, the preemption frame data includes a plurality of preemption bytes, each preemption byte represents a data bit, and each preemption byte is composed of a plurality of current signals; sending the preemption frame data to the communication bus according to the data state on the communication bus, so that the communication bus performs priority determination according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority; Detecting preemption frame data on the communication bus; Comparing the preemption frame data on the communication bus with the preemption frame data in the preemption communication data; and In a case where the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data, the reply data is sent to the communication bus.
2. The communication method according to claim 1, wherein: The communication method further includes: When the preemption frame data on the communication bus is different from the preemption frame data in the preemption communication data, the sending of data to the communication bus is stopped and the state is switched to a receiving state.
3. The communication method according to claim 1, wherein: Sending preemption frame data to the communication bus according to the data state on the communication bus, so that the communication bus performs priority determination according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority, comprising: In a case where the communication bus includes communication data, sending the preemption frame data to the communication bus after a preset period of time after the communication data is sent; or In a case where the communication bus does not include the communication data, the preemption frame data is sent to the communication bus.
4. The communication method according to claim 1, wherein: The slave device includes an indication pin, and the communication method further includes: When receiving the preemption frame data, controlling the indication pin to display a first level signal so that the main control chip stops sending the preemption communication data; and In a case where the preemption frame data is sent to the communication bus, the indication pin is controlled to display a second level signal.
5. The communication method according to claim 1, wherein: When the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data, sending the reply data to the communication bus comprises: The reply data is sent to the communication bus at intervals. The communication method according to claim 1 , wherein: When the current signal is 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 0; when the current signal is not 0 in the preempted byte, the data bit represented by the preempted byte is determined to be 1.
7. The communication method according to claim 6, wherein: The communication bus performs priority determination according to the current signal in the preempted frame data and displays the preempted frame data with the highest priority, including: All received preemption frame data are combined and processed to generate one preemption frame data, so as to obtain the preemption frame data with the highest priority.
8. A communication device for a slave device of a multi-connection system, characterized in that: The multi-connection system includes a host and at least two slaves, wherein the slave includes a main control chip and is connected to the host via a communication bus. The communication device includes: a detection module, configured to detect data on the communication bus in response to preemption communication data sent by the master control chip, wherein the preemption communication data includes preemption frame data and reply data, the preemption frame data defines a priority of the preemption communication data, the preemption frame data includes a plurality of preemption bytes, each preemption byte represents a data bit, and each preemption byte is composed of a plurality of current signals; a sending module, configured to send the preemption frame data to the communication bus according to the data state on the communication bus, so that the communication bus performs priority determination according to the current signal in the preemption frame data and displays the preemption frame data with the highest priority; The detection module is also used to detect the preemption frame data on the communication bus; a comparison module, configured to compare the preemption frame data on the communication bus with the preemption frame data in the preemption communication data; and The sending module is further configured to send the reply data to the communication bus when the preemption frame data on the communication bus is identical to the preemption frame data in the preemption communication data.
9. A slave device for a multi-connection system, characterized in that: The slave device includes a master control chip and the communication device according to claim 7.
10. A multi-connection system, characterized in that: The system comprises a host and at least two slaves according to claim 9, wherein the host is connected to the slaves via a communication bus.
Citation Information
Cited By
Master-slave communication method, electronic equipment and storage medium
CN121125392A