Communication method, system, master node, slave node and computer storage medium
By synchronizing information between master and slave nodes and adopting a non-destructive bit arbitration bus structure, the high configuration cost problem caused by the complexity of LIN bus hardware logic is solved, and simplified inter-node communication and reduced network configuration costs are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HAINING ESWIN IC DESIGN CO LTD
- Filing Date
- 2023-07-31
- Publication Date
- 2026-07-21
AI Technical Summary
The complex hardware logic of the LIN bus results in high configuration costs, and existing technologies struggle to simplify the hardware logic configuration for inter-node communication.
Synchronization is achieved through synchronization information between the master and slave nodes. The slave nodes respond according to the synchronization information on the bus, reducing the dependence on the synchronization clock. A non-destructive bit arbitration bus structure mechanism is adopted to simplify the bus configuration process.
It achieves communication synchronization between master and slave nodes, reduces the hardware logic cost required to configure the synchronization clock, and lowers network configuration costs.
Smart Images

Figure CN116846705B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method, system, master node, slave node, and computer storage medium. Background Technology
[0002] Local Interconnect Network (LIN) is a serial communication protocol, typically consisting of one master node and multiple slave nodes. Because it lacks a clock line, dedicated hardware logic is usually required to configure how each node sends and responds to messages, enabling normal communication between nodes. Therefore, LIN hardware logic is complex and configuration costs are high. Summary of the Invention
[0003] This application provides a communication method, system, master node, slave node, and computer storage medium.
[0004] The technical solution of this application is implemented as follows:
[0005] This application provides a communication method, including:
[0006] In response to the bus identifier acquisition command, it acquires its own slave node identifier;
[0007] Based on the bus synchronization information, it sends its own slave node identifier to the bus; the synchronization information is used to indicate when multiple slave nodes in the network should send the slave node identifier.
[0008] This application provides a communication method, including:
[0009] Send an identifier acquisition command to the bus so that multiple slave nodes in the network can acquire their own slave node identifiers;
[0010] Send identification acquisition information to the bus; the identification acquisition information includes synchronization information; the synchronization information is used to indicate when multiple slave nodes in the network should send their own slave node identification to the master node;
[0011] Information is obtained based on the identifier, and the slave node identifier of each slave node in the network is received.
[0012] This application provides a communication system, including:
[0013] Multiple slave nodes and one master node; the master node and the slave nodes are connected via a bus.
[0014] This application provides a slave node, including:
[0015] The first memory is used to store computer programs;
[0016] A first processor is configured to execute the aforementioned communication method on the node side during the execution of the computer program.
[0017] This application provides a master node, including:
[0018] The second memory is used to store computer programs;
[0019] The second processor is used to execute the communication method on the master node side when the computer program is running.
[0020] This application provides a computer storage medium storing executable instructions, which, when executed by a first processor, implement the aforementioned communication method on the slave node side; or, when executed by a second processor, implement the aforementioned communication method on the master node side.
[0021] The communication method, system, master node, slave node, and computer storage medium provided in this application embodiment respond to the slave node in the network based on the synchronization information on the bus, which comes from the master node. Thus, the network does not need to set a synchronization clock to synchronize the time when the slave node sends feedback information. This enables communication between the master node and the slave node while reducing the hardware logic cost required to configure the synchronization clock, thereby reducing the network configuration cost. Attached Figure Description
[0022] Figure 1 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0023] Figure 2 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0024] Figure 3 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0025] Figure 4 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0026] Figure 5 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0027] Figure 6 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0028] Figure 7 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0029] Figure 8A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0030] Figure 9 A flowchart illustrating an optional communication method provided in an embodiment of this application;
[0031] Figure 10 An optional data transmission diagram provided for an embodiment of this application;
[0032] Figure 11 A schematic diagram of an optional communication system provided in an embodiment of this application;
[0033] Figure 12 A schematic diagram of an optional slave node structure provided for an embodiment of this application;
[0034] Figure 13 This is a schematic diagram of an optional master node provided in an embodiment of this application;
[0035] Figure 14 A schematic diagram of an optional slave node structure provided for an embodiment of this application;
[0036] Figure 15 This is a schematic diagram of an optional master node provided in an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0039] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0041] To facilitate understanding of this solution, the application background of the embodiments of this application will be explained before describing the embodiments of this application.
[0042] A Universal Asynchronous Receiver-Transmitter (UART) is an asynchronous full-duplex serial communication protocol widely used for data exchange between microcomputers and peripherals; that is, UART is typically used in one-to-one communication. For any two devices to communicate using UART, they usually need two data lines—a transmit line and a receive line—but they do not use a common reference clock. Therefore, configuration parameters such as serial port baud rate, data bit width, parity bit, and stop bits need to be agreed upon before communication can occur.
[0043] Controller Area Network (CAN) is a serial communication protocol bus used in real-time applications to support distributed control systems. The CAN bus employs a multi-master contention bus architecture, featuring multi-master node operation, distributed arbitration, and broadcast communication. Any node on the bus can actively send information to other nodes at any time without prioritization. The CAN bus requires and uses dedicated hardware logic to determine the priority of data blocks transmitted on the bus, minimizing the waiting time of the highest-priority node when data block transmissions conflict. Therefore, the CAN bus requires a clock to implement complex transmission control and synchronization mechanisms, resulting in complex dedicated hardware logic and high hardware and software costs.
[0044] LIN bus is a serial communication protocol defined for automotive distributed electronic systems, complementing CAN bus. It connects devices such as switches, displays, and sensors to realize a distributed electronic system. LIN bus typically involves a master node sending information and slave nodes responding. Because LIN bus does not require a synchronization mechanism, it reduces hardware logic complexity and configuration costs compared to CAN bus. However, since LIN bus requires configuring the functions and identifiers of each node, the hardware logic is still not simple enough, leading to higher configuration costs.
[0045] This application provides a communication method, system, master node, slave node, and computer storage medium. By implementing communication between master and slave nodes in a bus, the complexity of hardware logic can be reduced, thereby reducing configuration costs. The following describes exemplary applications of the master and slave nodes provided in this application. The master and slave nodes provided in this application can be implemented as various types of user terminals such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), or as switches, displays, sensors, and simple controllers in an automotive distributed electronic system.
[0046] See Figure 1 , Figure 1 This is an optional communication method provided in the embodiments of this application, applied to a slave node, and the method will be described in conjunction with S101-S102.
[0047] S101. In response to the bus identifier acquisition command, acquire its own slave node identifier.
[0048] In this embodiment, the communication network includes a master node and multiple slave nodes connected via a bus. Slave nodes can receive an identifier retrieval command from the master node via the bus. In response to the identifier retrieval command, the slave node needs to retrieve its own slave node identifier. Each slave node has a unique slave node identifier that distinguishes it from other slave nodes. In some embodiments, the slave node identifier may represent the communication address of the slave node in the communication network. The master node can communicate with a designated slave node based on the slave node identifier.
[0049] In some embodiments, the slave node identifier may consist of at least one unit of information, which may be a byte or a bit, and can be set as needed.
[0050] For example, the communication network includes two slave nodes, and the slave node identifier can be a unit of information, which is a bit. One slave node is identified as "0" and the other slave node is identified as "1".
[0051] In this embodiment, the identifier acquisition instruction may include at least one data packet, each data packet being a preset protocol format. After receiving the data packet from the node, the data packet can be parsed to obtain the identifier acquisition instruction. The preset protocol format can be set as needed, and this embodiment does not impose any limitations.
[0052] In some embodiments, the preset protocol format is as follows: the data packet header sets start information, and the data packet trailer sets end information. Identification and acquisition instruction information is included between the start and end information. In some embodiments, verification information may also be included between the start and end information.
[0053] In some embodiments, a master node and multiple slave nodes in a communication network can communicate based on a Serial Communication Interface (SCI).
[0054] In some embodiments, a master node and multiple slave nodes in a communication network can communicate based on an asynchronous transceiver transmitter (UART).
[0055] In this embodiment, the baud rate, start bit, stop bit, data bits, parity bit, and asynchronous handshake signal used for communication between the master node and multiple slave nodes are predefined. The master node and slave nodes use the same baud rate for communication.
[0056] S102. Based on bus synchronization information, send its own slave node identifier to the bus; the synchronization information is used to indicate when multiple slave nodes in the communication network send their slave node identifiers.
[0057] In this embodiment, the master node and slave node do not send information to the bus simultaneously. The slave node can send information to the bus during the idle time when the master node is not sending information, i.e., during the time the master node receives information from the bus; thus, the master node can obtain the information sent by the slave node through the bus. In response to an identifier acquisition command, the slave node can detect the bus information and determine whether the master node is idle based on the detection result. If the detection result indicates that the master node is idle, the slave node responds to the identifier acquisition command and sends its own slave node identifier back to the bus. Here, the bus information refers to information on the bus, which can be information sent to the bus by the master node or information sent to the bus by the slave node.
[0058] In this embodiment of the application, after receiving the identifier acquisition instruction, the slave node can determine the idle time of the master node in receiving information based on the synchronization information, and send the slave node identifier to the bus during the idle time; that is, the master node can instruct the slave node to send its own slave node identifier through the synchronization information.
[0059] In this embodiment, the slave node can send its own slave node identifier to the bus after detecting synchronization information; alternatively, the slave node can send at least one unit of its own slave node identifier to the bus for each detected synchronization information until all unit information of its own slave node identifier has been sent; or the slave node can send its own slave node identifier by sending data packets to the bus according to a preset protocol. These settings can be configured as needed, and this embodiment does not impose any limitations.
[0060] For example, a data packet may include 8 bits of unit information, 1 bit of start information, 1 bit of end information, and 1 bit of check information; a slave node can return the 8 bits of unit information in the slave node identifier through a data packet.
[0061] In some embodiments, the slave node identifier includes multiple unit information, and the slave node can send each unit information sequentially according to the order in which the multiple unit information is arranged.
[0062] In this embodiment, the synchronization information can be the rising edge of the signal level, the falling edge of the signal level, or a preset code such as "00" or "001". This can be set according to actual needs, and this embodiment does not impose any restrictions.
[0063] It should be noted that when multiple slave nodes simultaneously send information to the bus based on synchronization information, they need to compete for the bus. A node considers its transmission successful only if the bus information matches its own transmitted information. Multiple slave nodes send their slave identifiers to the bus, and each time one successfully competes for the bus, the transmission is considered successful. If a slave node fails to send a message on the first attempt, it needs to retry until it succeeds.
[0064] In this embodiment, multiple slave nodes simultaneously send information to the bus, and the information on the bus is determined by the information sent by the multiple slave nodes; here, the slave nodes preempt the bus based on the priority of the information they send.
[0065] In this embodiment, the unit information sent by a slave node to the bus is either first information or second information. If the slave node sends the first information, the bus unit information is the first information; if the slave node sends the second information, and all other slave nodes send the second information, the bus unit information is the second information; if the slave node sends the second information, but at least one of the other slave nodes sends the first information, the bus unit information is the first information. In other words, when multiple slave nodes compete for the bus, the first information takes precedence. Thus, using a unique slave node identifier and a non-destructive bit arbitration bus structure mechanism to determine the priority of data blocks simplifies the bus configuration process. Furthermore, since the non-destructive bit arbitration bus structure mechanism has low complexity and the configuration cost in the communication network is small, it can significantly improve the transmission speed during the configuration phase.
[0066] In some embodiments, the first information is a low level "1" and the second information is a high level "0". Either the master node or the slave node can pull the bus level to a low level "1". When all nodes are idle and do not operate on the bus level, the bus level is a low level "0".
[0067] In some embodiments, the first information is a low level "0" and the second information is a high level "1". Either the master node or the slave node can pull the bus level low to "0", leaving all nodes idle and not operating on the bus level, in which case the bus level is high level "1". Here, the levels of the master and slave nodes can be implemented using an open-drain output method.
[0068] Understandably, since the slave nodes in the network respond based on the synchronization information on the bus, which comes from the master node, the network does not need to set a synchronization clock to synchronize the timing of the slave nodes sending feedback information. This reduces the hardware logic cost required to configure a synchronization clock while enabling communication between the master and slave nodes, thereby reducing the network configuration cost.
[0069] In some embodiments of this application, the slave node identifier includes at least one byte identifier; the implementation of sending its own slave node identifier to the bus based on bus synchronization information in S102 may include:
[0070] 1021. In response to each of the at least one synchronization messages, send at least one byte identifier corresponding to the byte identifier in the at least one byte identifier to the bus until all byte identifiers included in the slave node identifier have been sent.
[0071] In this embodiment, a single byte identifier is defined as one byte. When the slave node identifier includes a single byte identifier, the slave node can send a single byte identifier to the bus upon detecting synchronization information, thus completing the transmission of its own slave node identifier to the bus. When the slave node identifier includes multiple bytes, the slave node can send a single byte identifier to the bus each time it detects synchronization information on the bus, until all multiple bytes of the slave node identifier have been transmitted.
[0072] In this embodiment, the slave node can send multiple byte identifiers sequentially from the least significant bit to the most significant bit; it can also send multiple byte identifiers sequentially from the most significant bit to the least significant bit; or it can send multiple byte identifiers sequentially in other preset orders. These can be set as needed, and this embodiment does not impose any restrictions.
[0073] In some embodiments, the slave node can send a byte identifier, compare the byte identifier with the byte information on the bus, and if the comparison result indicates that the byte identifier was successfully sent, it can continue to respond to the next synchronization information and continue to send the next byte identifier to the bus.
[0074] In some embodiments, after all the byte identifiers in the slave node identifier have been sent, the slave node can determine whether the slave node identifier has been sent successfully based on the comparison results of multiple byte identifiers with the byte information of the bus. If the transmission is successful, the slave node will no longer send its own slave node identifier to the bus; if the transmission fails, the slave node identifier will continue to be sent to the bus.
[0075] Understandably, a synchronization message used to instruct a slave node to send a byte identifier can increase the synchronization frequency of slave nodes and improve the synchronization effect of network communication.
[0076] In some embodiments of this application, 1021 is implemented by sending at least one byte identifier corresponding to at least one byte identifier to the bus in response to each of the at least one synchronization information, such as... Figure 2 As shown, it may include: S201-S203.
[0077] S201. In response to the synchronization information, send a corresponding one-byte identifier to the bus.
[0078] S202. Determine the transmission result of the byte identifier based on the byte information on the bus.
[0079] In this embodiment, the slave node identifier includes multiple byte identifiers. Multiple synchronization messages need to be responded to, and multiple byte identifiers need to be sent, with one synchronization message corresponding to one byte identifier. After the slave node responds to a synchronization message and sends a byte identifier to the bus, it can detect the byte information on the bus and determine whether the byte information on the bus is the same as the byte identifier sent by the slave node. If the byte information and the byte identifier are the same, the transmission result of the byte identifier is determined to be successful; if the byte information and the byte identifier are different, the transmission result of the byte identifier is determined to be a failure. Here, the byte information on the bus is one byte of information.
[0080] It should be noted that any single byte in the node identifier indicating a transmission failure can represent a transmission failure by the node.
[0081] S203. If the result of sending the byte identifier indicates that the byte identifier was successfully sent, and the byte identifier is not the last one in the slave node identifier, in response to the next synchronization information, continue to send the next byte identifier to the bus until all multiple byte identifiers have been sent.
[0082] In this embodiment of the application, the slave node can determine whether the byte identifier is the last one in the slave node identifiers if the byte identifier is successfully sent, and obtain a first determination result; based on the first determination result, determine the subsequent processing method.
[0083] In some embodiments of this application, if the first judgment result indicates that the byte identifier is not the last one in the slave node identifier, the slave node may determine that the slave node identifier has not been sent completely and needs to respond to the next synchronization information to continue sending the next byte identifier to the bus until all multiple byte identifiers have been sent completely and the slave node identifier has been sent completely.
[0084] In some embodiments of this application, the slave node can determine that the slave node identifier transmission is complete if the first determination result indicates that the byte identifier is the last in the slave node identifier. The slave node stops responding to indicate that it has acquired the instruction, and even if synchronization information is subsequently detected, it will not respond at all and will not send the slave node identifier to the bus.
[0085] Understandably, the slave node can determine the transmission result of each byte identifier it sends, and only send the next byte identifier if the previous one was successfully transmitted. This timely determination of the byte identifier transmission result allows the slave node to promptly stop sending information to the bus, reducing its resource consumption.
[0086] In some embodiments of this application, the implementation after determining the transmission result of the byte identifier based on the byte information on the bus in S202 may further include: if the byte identifier transmission fails, stopping the response to the next synchronization information until a new identifier transmission opportunity arrives, and retransmitting the slave node identifier.
[0087] In this embodiment, the slave node can determine that its identifier transmission has failed if the transmission result of any single byte identifier indicates that the byte identifier transmission has failed. In this case, the slave node will no longer respond to synchronization information until a new opportunity to transmit identifier arises, at which point it will respond to synchronization information again and send the corresponding single byte identifier to the bus.
[0088] It should be noted that once any slave node successfully sends its own slave node identifier, it indicates that a new identifier transmission opportunity has arrived. After receiving the identifier retrieval instruction, new identifier transmission opportunities continue to arrive until all slave nodes in the communication network have successfully sent their identifiers.
[0089] For example, the slave node identifier includes a 3-byte identifier. Each time the slave node detects a synchronization message, it sends one byte of the identifier to the bus. These three synchronization messages can be used to send one slave node identifier. After receiving the identifier acquisition instruction, the slave node responds to the first synchronization message by sending the first byte of the identifier. If the first byte is successfully sent, it continues to respond to the second synchronization message by sending the second byte of the identifier. If the second byte fails to send, it stops responding to the third synchronization message. Each set of three synchronization messages corresponds to one transmission of the slave node identifier. If the first transmission of the slave node's own identifier fails, it indicates that another slave node in the communication network has successfully sent its own identifier, and a new opportunity for identification transmission has arrived. The slave node can then begin sending its own identifier a second time. The slave node can respond to the fourth synchronization message by retransmitting the first byte of the identifier to the bus, and the subsequent processing method is determined based on the result of the first byte's transmission.
[0090] Understandably, each new flag transmission opportunity signifies that one more slave node has completed sending its own flag, and that slave node can then stop responding to flag acquisition commands. Thus, when a new flag transmission opportunity arrives, one less slave node will preempt the bus, increasing the success rate of subsequent slave nodes preempting the bus.
[0091] In some embodiments of this application, the implementation of sending a corresponding one-byte identifier to the bus in response to synchronization information in step S201 may include:
[0092] S2011. In response to the synchronization information, send multiple bit identifiers from the byte identifier to the bus in sequence until the last bit identifier among the multiple bit identifiers is sent.
[0093] In this embodiment, a bit identifier is one bit, and a byte identifier includes multiple bit identifiers. A slave node can sequentially send multiple bit identifiers to the bus to complete sending a byte identifier to the bus.
[0094] In this embodiment, the slave node can send multiple bit identifiers sequentially from the least significant bit to the most significant bit; it can also send multiple bit identifiers sequentially from the most significant bit to the least significant bit; or it can send multiple bit identifiers sequentially in other preset orders. These can be set as needed, and this embodiment does not impose any restrictions.
[0095] For example, a byte identifier includes an 8-bit identifier "00110101", and the slave node can send the 8 bits sequentially in the order of "10101100" starting from the least significant bit "1".
[0096] In some embodiments, the slave node can send a bit identifier and compare it with the bit information on the bus. If the comparison result indicates that the bit identifier was successfully sent, the slave node can continue to send the next bit identifier to the bus.
[0097] In some embodiments, after all the bit identifiers in the byte identifier have been sent, the slave node can determine whether the byte identifier has been sent successfully based on the comparison results of multiple bit identifiers with the bit information of the bus. If the transmission is successful, it will no longer send its own slave node identifier to the bus; if the transmission fails, it will continue to send the slave node identifier to the bus.
[0098] In some embodiments of this application, in S2011, in response to synchronization information, multiple bit identifiers in the byte identifier are sequentially sent to the bus, such as... Figure 3 As shown, it may include: S301-S303.
[0099] S301. After sending a bit identifier from the byte identifier to the bus, determine the result of sending the bit identifier.
[0100] S302. Determine the transmission result of the bit identifier based on the bit information on the bus.
[0101] In this embodiment, the byte identifier includes multiple bit identifiers. A slave node responds to a synchronization message by sending multiple bit identifiers. After sending a bit identifier, the slave node can detect the bit information on the bus and determine whether the bit information on the bus is the same as the bit identifier sent by the slave node. If the bit information and the bit identifier are the same, the sending result of the bit identifier is determined to be successful; if the bit information and the bit identifier are different, the sending result of the bit identifier is determined to be a failure. Here, the bit information on the bus refers to a single bit.
[0102] It should be noted that if any bit in the byte identifier indicates that the transmission of the byte has failed, it can be interpreted as the byte identifier indicating that the transmission has failed.
[0103] S303. If the result of sending the bit identifier is that the bit identifier was successfully sent, and the bit identifier is not the last one in the byte identifier, continue to send the next bit identifier to the bus until all multiple bit identifiers have been sent.
[0104] In this embodiment of the application, the slave node can determine whether the bit identifier is the last one in the byte identifier if the bit identifier is successfully sent, and obtain a second determination result; based on the second determination result, determine the subsequent processing method.
[0105] In some embodiments of this application, if the second judgment result indicates that the bit identifier is not the last one in the byte identifier, the slave node can determine that the byte identifier has not been completely sent and needs to continue sending the next bit identifier to the bus until all multiple bit identifiers have been sent and the byte identifier has been sent.
[0106] In some embodiments of this application, the slave node can determine that the byte identifier has been sent if the second judgment result indicates that the bit identifier is the last one in the byte identifier.
[0107] Understandably, the slave node can determine the transmission result of each bit identifier sent, and only send the next bit identifier if the previous one was successfully sent. This timely determination of the bit identifier transmission result allows the slave node to promptly stop sending the next bit to the bus, reducing its resource consumption.
[0108] In some embodiments of this application, the implementation after determining the transmission result of the bit identifier based on the bit information on the bus in S302 may include: if the transmission result of the bit identifier is that the bit identifier transmission failed, stopping the transmission of the next bit identifier until the new identifier transmission opportunity arrives, and retransmitting the slave node identifier.
[0109] In this embodiment, the slave node can determine that the byte identifier transmission has failed if the transmission result of any bit identifier indicates that the bit identifier transmission has failed. The slave node can then stop sending the next bit identifier to the bus. Simultaneously, the slave node can also determine that the corresponding byte transmission has failed, meaning that the current transmission of the slave node identifier has failed. The slave node needs to wait for a new identifier transmission opportunity to arrive before responding to the synchronization information again and sequentially sending multiple bits of the corresponding byte identifier to the bus.
[0110] Understandably, the failure to send any bit in the byte identifier indicates a failure to send the slave node identifier. In this way, the slave node can promptly determine that its own identifier has failed to be sent, stop sending its own slave node identifier, and reduce the slave node's resource consumption.
[0111] In some embodiments of this application, S102 is implemented after sending its own slave node identifier to the bus based on the bus synchronization information, such as... Figure 4 As shown, it may also include: S401-S402.
[0112] S401: In response to the information command on the bus, compare the target identifier carried in the information command with its own slave node identifier to obtain the comparison result.
[0113] In this embodiment, after a slave node successfully sends its own slave node identifier to the bus, and all slave nodes have successfully sent their own slave node identifiers, the communication network configuration is complete, and the system can enter the working phase. At this time, the slave node can receive information commands, which contain the slave node identifier of the target slave node, i.e., the target identifier. The slave node can compare the target identifier with its own slave node identifier to obtain the comparison result. The target identifier represents the target slave node receiving the information command.
[0114] S402. If the comparison result indicates that the target identifier is the same as its own slave node identifier, respond to the information command and send the response information of the information command to the bus.
[0115] In this embodiment, when a slave node receives a comparison result, and the comparison result indicates that the identifier of the target slave node's slave node is the same as its own slave node identifier, it responds to the information command by sending a response message to the bus. If the comparison result indicates that the identifier of the target slave node's slave node is different from its own slave node identifier, it does not respond to the information command.
[0116] It is understandable that during the operation of a communication network, after receiving an information instruction from a node, it can determine whether to respond to the information instruction based on the target identifier carried in the information instruction; thus, using a question-and-answer method for communication can simplify the communication control method.
[0117] In some embodiments of this application, the identifier acquisition instruction includes at least one data packet; each data packet contains start information, content information, and end information; the content information is the information between the start information and the end information.
[0118] Understandably, a slave node can determine a data packet based on start and end information, and then retrieve the content information within that data packet. This improves the accuracy of the slave node's retrieval of content information from the master node.
[0119] In some embodiments of this application, the content information also includes verification information; the verification information is used by the node to verify the correctness of the transmission of the data information.
[0120] Based on the above communication method, this application provides a schematic flowchart of a communication method, as shown below. Figure 5 As shown, this method, applied to slave nodes, may include:
[0121] S10. Determine whether an identifier acquisition instruction has been received; if yes, execute S11; otherwise, continue executing S10.
[0122] S11. Response to the identifier acquisition command, obtain the slave node identifier.
[0123] In this embodiment of the application, the slave node identifier includes 6 bytes; each byte includes 8 bits.
[0124] S12. In the current round, determine whether the synchronization information has arrived. If yes, execute S13; otherwise, continue executing S12.
[0125] In this embodiment of the application, one round is used to send a slave node identifier.
[0126] S13, Send 1 bit of information to the bus;
[0127] S14. Determine whether the 1-bit information sent is the same as the bus information; if so, execute S15; otherwise, execute S55.
[0128] In this embodiment of the application, each time a slave node sends 1 bit, it can check whether the 1 bit on the bus is the 1 bit it sent; if it is, it means that the 1 bit was sent successfully, otherwise it means that the 1 bit was sent unsuccessfully, and the 1 byte to which the 1 bit belongs was also sent unsuccessfully.
[0129] S15. Determine whether 1 byte of information has been sent. If yes, execute S16; otherwise, execute S12.
[0130] In this embodiment of the application, after the slave node successfully sends 1 bit, it needs to determine whether the byte to which the 1 bit belongs has been sent. If so, it means that the byte has been sent successfully; otherwise, it needs to continue sending the next bit.
[0131] S16. Determine whether the slave node identifier has been sent. If yes, proceed to S17; otherwise, execute S12.
[0132] In this embodiment of the application, after the slave node successfully sends a byte, it needs to determine whether the byte is the last byte represented by the slave node. If it is, it indicates that the slave node has completed sending; otherwise, the slave node needs to continue to send the next round of bytes.
[0133] S17. Confirm that the node identifier was successfully sent.
[0134] S18. Stop sending slave node identifiers to the bus until the next round begins.
[0135] In this embodiment, the slave node can begin network configuration upon receiving an identifier acquisition instruction. After multiple rounds, multiple slave node identifiers are sent to the bus. Each slave node identifier comprises m bytes, with each byte consisting of 8 bits. Each time a slave node sends one bit, it needs to determine whether the bit was sent successfully. If any bit fails to be sent, it indicates that the slave node identifier transmission failed, and the slave node must stop sending information until entering the next round to retransmit the slave node identifier. Thus, during network configuration, it is not necessary to configure the functions of each node or the synchronization clock, greatly reducing hardware logic configuration and thereby reducing network configuration costs.
[0136] See Figure 6 , Figure 6 This is an optional communication method provided in the embodiments of this application, applied to the master node, and the method will be described in conjunction with S501-S503.
[0137] S501: Send an identifier acquisition command to the bus so that multiple slave nodes in the network can acquire their own slave node identifiers.
[0138] In this embodiment, the communication network includes a master node and multiple slave nodes. The master node and the multiple slave nodes transmit information at the same baud rate and are connected via a bus. After sending an identifier retrieval command to the bus, the master node can retrieve the slave node identifiers of the multiple slave nodes from the bus. Each slave node has a unique slave node identifier that distinguishes it from other slave nodes. In some embodiments, the slave node identifier can represent the communication address of the slave node in the communication network. The master node can communicate with a specified slave node based on the slave node identifier.
[0139] In some embodiments, a master node and multiple slave nodes in a communication network can communicate based on an asynchronous transceiver.
[0140] In some embodiments, the slave node identifier may consist of at least one unit of information, which may be a byte or a bit, and can be set as needed.
[0141] In this embodiment, the master node can send an identifier acquisition command to the bus when the configuration time arrives, and acquire the slave node identifier through the identifier acquisition command to complete the communication network configuration. The configuration time may include: master node power-on, the appearance of a new slave node in the network, and master node or slave node upgrades, etc. These can be set as needed, and this embodiment does not impose any restrictions.
[0142] In this embodiment, the identifier acquisition instruction may include at least one data packet, each data packet being a preset protocol format. The preset protocol format can be set as needed, and this embodiment does not impose any limitations. In some embodiments, the preset protocol format is: a data packet header sets start information, and a data packet tail sets end information. Identifier acquisition instruction information is included between the start information and the end information. In some embodiments, verification information may also be included between the start information and the end information.
[0143] S502, Send identification acquisition information to the bus; the identification acquisition information includes synchronization information; the synchronization information is used to indicate when multiple slave nodes in the network should send their own slave node identification to the master node.
[0144] S503. Obtain information based on identifiers, and receive the slave node identifier of each slave node in the network.
[0145] In this embodiment of the application, after the master node sends an identifier acquisition command to the bus, in order to obtain the slave node identifier from the bus, it needs to send identifier acquisition information to the bus and obtain the slave node identifier through the identifier acquisition information.
[0146] In this embodiment of the application, the identification acquisition information may include synchronization information and idle information; the master node can use the synchronization information to indicate when the slave node sends its own slave node identification to the bus, and can use the idle information to indicate the idle time of the master node, that is, the time when it receives information from the bus.
[0147] For example, the slave node identifier is 6 bits and the synchronization information is 1 bit; the identifier acquisition information can start with 1 bit of synchronization information, followed by 6 bits of idle information; the 6 bits of idle information indicate the idle time that can receive 6 bits of slave node identifier.
[0148] In this embodiment, the synchronization information can be the rising edge of the signal level, the falling edge of the signal level, or a preset code such as "00" or "001". This can be set according to actual needs, and this embodiment does not impose any restrictions.
[0149] In some embodiments of this application, the master node can obtain the slave node identifier of each slave node through an identifier acquisition information. This identifier acquisition information may include a synchronization information, through which the master node receives its own slave node identifier sent by multiple slave nodes; alternatively, the identifier acquisition information may include multiple synchronization information, through which the master node receives a portion of its own slave node identifier sent by the slave node in installments via each of the multiple synchronization information.
[0150] In some embodiments of this application, the master node can obtain a corresponding slave node identifier through an identifier acquisition information; thus, the master node can obtain the slave node identifier of each of multiple slave nodes through multiple identifier acquisition information. Specifically, an identifier acquisition information may include a synchronization information, through which a slave node identifier is received; or an identifier acquisition information may include multiple synchronization information, through which a portion of its own slave node identifier, sent in installments by the slave node, is received from each of the multiple synchronization information. This can be configured as needed, and the embodiments of this application do not impose limitations.
[0151] Understandably, since the master node in a communication network can send synchronization information to the bus to instruct multiple slave nodes to send information at the same time, thus enabling multiple slave nodes to synchronize, the communication network can achieve communication between the master node and slave nodes without setting a synchronization clock, thereby reducing the hardware logic cost required to configure a synchronization clock, and thus reducing the network configuration cost.
[0152] In some embodiments of this application, the identifier acquisition information includes multiple first identifier acquisition information; the implementation of receiving the slave node identifier of each slave node in the network based on the identifier acquisition information in S503 may include:
[0153] S5031. Based on the first identifier, obtain information, receive a slave node identifier corresponding to the first identifier, and obtain the slave node identifier of each slave node.
[0154] In this embodiment of the application, the identifier acquisition information includes multiple first identifier acquisition information. The master node can acquire a slave node identifier through each first identifier acquisition information; thus, the slave node identifier of each slave node can be acquired through multiple first identifier acquisition information.
[0155] In some embodiments, each first identifier acquisition information includes a synchronization information and a first idle information. The synchronization information is used to instruct the slave node to send a slave node identifier, and the first idle information is used to receive a slave node identifier sent by the slave node.
[0156] In some embodiments, each first identifier acquisition information may also include multiple synchronization information and corresponding multiple first idle information. Each synchronization information is used to instruct the slave node to send a part of a slave node identifier, and each first idle information is used to receive a part of the slave node identifier, thereby receiving the complete slave node identifier.
[0157] In some embodiments of this application, the master node can continuously send first identifier acquisition information to the bus until the first identifier is acquired. If the received information is blank and does not contain slave node identifiers, the master node can determine that no slave node responded to the identifier acquisition instruction, meaning the master node has acquired the identifiers of each slave node, and thus determines that the configuration of the communication network is complete. This improves the intelligence of the master node in autonomously determining the completion of network configuration.
[0158] In some embodiments of this application, the master node can determine the amount of information to be obtained by the first identifier based on the number of slave nodes in the communication network; in this way, the probability of receiving blank information can be reduced, thereby reducing the configuration time of the communication network and improving the configuration efficiency of the communication network.
[0159] Understandably, the master node can send multiple first identifiers to the bus to obtain information, and obtain a slave node identifier through each first identifier. In this way, the master node can determine that it has received a slave node identifier by obtaining information through the first identifier, thereby improving the master node's ability to identify and distinguish different slave node identifiers.
[0160] In some embodiments of this application, the slave node identifier includes multiple byte identifiers; the first identifier acquisition information includes multiple second identifier acquisition information; the implementation of receiving a slave node identifier corresponding to each first identifier acquisition information in S5031 may include: receiving a byte identifier corresponding to each second identifier acquisition information based on each second identifier acquisition information in the first identifier acquisition information to obtain the slave node identifier.
[0161] In this embodiment, the first identifier acquisition information includes multiple second identifier acquisition information; the slave node identifier includes multiple byte identifiers; the master node can acquire a corresponding byte identifier through each second identifier acquisition information. Here, one byte identifier is a one-byte identifier.
[0162] In some embodiments, each second identifier acquisition information may include a first synchronization information and a corresponding second idle information. The first synchronization information is used to indicate the timing when each of the plurality of slave nodes sends a byte identifier of a slave node identifier to the bus, and each second idle information is used to receive a byte identifier.
[0163] In some embodiments, each second identifier acquisition information may include multiple first synchronization information and corresponding multiple second idle information. The first synchronization information is used to indicate the timing when the slave node sends a portion of a byte identifier, and the multiple portions constitute a byte identifier. Each second idle information is used to receive a portion of a byte identifier, thereby receiving a complete byte identifier.
[0164] Understandably, the master node can send multiple second identifiers to the bus to obtain information, and obtain a corresponding byte identifier through each second identifier. In this way, the master node can obtain information through the second identifiers to determine that it has received a byte identifier of a slave node, thereby improving the master node's ability to identify and distinguish different byte identifiers.
[0165] In some embodiments of this application, the implementation of S503, which obtains information based on the identifier and receives the slave node identifier of each slave node in the network, is as follows: Figure 7 As shown, it may include: S601-S602.
[0166] S601, Sends a message command to the bus; the message command carries a target identifier.
[0167] S602, Receive response information from the bus response information instruction; the response information is sent to the bus by the target slave node, the target slave node is a slave node in the network, and the identifier of the target slave node is the same as the target identifier.
[0168] In this embodiment, when a master node sends an information command to a target slave node among multiple slave nodes, the information command must carry the target slave node's slave node identifier, i.e., the target identifier. Upon receiving the information command, the multiple slave nodes can determine whether they are the target slave node based on the target slave node's identifier; if so, they will respond to the information command. At this time, the master node can receive the response information from the target slave node via the bus in response to the information command.
[0169] For example, this application provides a schematic diagram of an interaction method between a master node and a slave node, as shown in the following embodiment. Figure 8 As shown, the method may include:
[0170] S71, The master node sends an information command to the bus; the information command carries the target identifier;
[0171] S72. The slave node responds to the information command and determines whether the target identifier is consistent with its own slave node identifier; if so, execute S73; otherwise, continue to execute S72.
[0172] In this embodiment of the application, if a slave node determines that the target slave node identifier in the information instruction is different from its own slave node identifier, it may choose not to respond to the information instruction and continue to wait for the next information instruction.
[0173] S73, Send response information to the bus;
[0174] S74, The master node receives the response information.
[0175] In this embodiment of the application, after the network configuration is completed and the working phase begins, the master node can send the identifier of the target slave node in the information command to the bus, thereby realizing communication between the master node and the target slave node and improving the accuracy of communication between the master node and the target slave node.
[0176] In some embodiments of this application, after the network configuration is completed, the feedback of information from the slave node to the master node can be achieved through push-pull bus contention, thereby improving the information transmission speed.
[0177] In some embodiments of this application, after the network configuration is completed, the feedback of information from the slave node to the master node can be achieved by using the same open-drain method as the configuration process to realize bus contention, which can reduce the structural complexity of the hardware circuit and reduce the network construction cost.
[0178] Understandably, the master node can include the target slave node's identifier in the message command, thus receiving the target slave node's response to the message command. This improves the accuracy of network communication.
[0179] Based on the above communication method, this application provides a flowchart illustrating the communication method, as shown below. Figure 9 As shown, this method, applied to the master node, can include:
[0180] S20, Power on.
[0181] S21. Send an identifier acquisition command to the bus.
[0182] S22. Send the first identifier acquisition information of the current round to the bus; the first identifier acquisition information includes multiple synchronization information, each synchronization information is used to instruct the slave node to send one byte of the slave node identifier to the bus.
[0183] In this embodiment, the master node receives x bytes over x rounds. Each byte consists of 8 bits.
[0184] S23. When the first identifier acquisition information ends, determine whether a slave node identifier has been received; if yes, execute S24; otherwise, execute S44.
[0185] In this embodiment, after the master node finishes sending the waiting information in each round, that is, when the round duration ends, it needs to determine whether it has received a slave node identifier in that round. If it has, it means that the master node can continue to receive information in the next round and needs to continue to send the waiting information for the next round to the bus. If it has not, it means that no slave node has responded to the master node's identifier acquisition instruction in the current round, and the master node has acquired all slave node identifiers.
[0186] S24. Determine whether all slave node identifiers have been received; if yes, execute S44; otherwise, execute S22.
[0187] S25, Acquisition of identifier ends.
[0188] In this embodiment, the master node can send an identifier acquisition command to the bus to acquire the slave node identifiers of all slave nodes, thereby completing the network configuration. The master node can send identifier acquisition information to the bus in multiple rounds, with each acquisition message used to receive one slave node identifier, thus receiving multiple slave node identifiers. The identifier acquisition information includes multiple synchronization messages, one of which instructs a slave node to send one byte. Therefore, during communication network configuration, it is unnecessary to configure the functions of each node and the synchronization clock. The master node can instruct the slave nodes to synchronously send each byte using the synchronization information in the identifier acquisition information, thereby significantly reducing hardware logic configuration and thus reducing network configuration costs.
[0189] For example, Figure 10 A schematic diagram of data transmission is shown. For example... Figure 10 As shown, communication between the master and slave nodes is based on an asynchronous transceiver transmitter (UART), transmitting information in data packets. Each data packet consists of 11 bits, of which 8 bits are the actual information, and the remaining 3 bits are the start bit, check bit P, and stop bit. The master node sends a data packet as an identifier acquisition command to the bus, and then continues to send first identifier acquisition information to the bus. This first identifier acquisition information includes 1 bit "0" for synchronization information and 11 bits of idle information for the data packet. All 11 bits of idle information in this data packet are "1", indicating that the master node can receive bus information. The falling edge of the 1 bit "0" represents the synchronization information. In response to the falling edge, slave node 0 sends a data packet "100101XXXXX" to the bus, slave node 1 sends a data packet "10010010011", slave node 2 sends a data packet "101XXXXXXXX", and slave node 3 sends a data packet "11XXXXXXXXX". The data on the bus is "10010010011". As can be seen, when node 0 sends the 6th bit of the data packet, it differs from the 6th bit of the bus, and subsequent information transmission stops. The data packet sent by node 1 is identical to the data on the bus, indicating successful transmission. When node 2 sends the 3rd bit of the data packet, it differs from the 3rd bit of the bus, and subsequent information transmission stops. Similarly, when node 3 sends the 2nd bit of the data packet, it differs from the 2nd bit of the bus, and subsequent information transmission stops. Thus, a slave node can use a falling edge as a synchronization signal to send a corresponding data packet, thereby completing the feedback of its slave node identification through multiple data packets.
[0190] Based on the communication methods described in the above embodiments, this application also provides a communication system, such as... Figure 11 As shown, the system includes a master node 90 and multiple slave nodes 91 (slave nodes 91-0, 91-1, 91-2, and 91-3 are shown as examples in the figure). The master node 90 and slave nodes 91 are connected via a T / R bus and communicate based on an asynchronous transceiver transmitter (UART). Both the master node 90 and slave nodes 91 are connected to the power supply line VCC and the ground line GND. The master node 90 is used to execute the communication method described above on the master node side, and the slave nodes 91 are used to execute the communication method described above on the slave node side.
[0191] It should be noted that the configuration phase does not require high transmission speeds from the communication network, such as... Figure 3 and Figure 4 The configuration method shown can be implemented using general-purpose input / output (GPIO) combined with software, which is simple and reduces configuration costs; alternatively, it can be implemented using application-specific integrated circuits (ASICs), thereby reducing hardware logic costs. During the operational phase, the master node and slave nodes communicate using a UART serial transmission controller.
[0192] Based on the above embodiments, this application also provides a slave node, such as... Figure 12 As shown, node 100 includes:
[0193] The acquisition module 1001 is used to acquire its own slave node identifier in response to the identifier acquisition command of the bus;
[0194] The sending module 1002 is used to send its own slave node identifier to the bus based on bus synchronization information; the synchronization information is used to indicate the timing when multiple slave nodes in the network send the slave node identifier.
[0195] In some embodiments, the sending module 1002 is further configured to send a byte identifier corresponding to the at least one byte identifier to the bus in response to each of the at least one synchronization information, until all byte identifiers included in the slave node identifier have been sent.
[0196] In some embodiments, the transmitting module 1002 is further configured to, in response to the synchronization information, send a corresponding byte identifier to the bus; determine the transmission result of the byte identifier based on the byte information on the bus; and, if the transmission result of the byte identifier indicates that the byte identifier was successfully transmitted and the byte identifier is not the last one among the slave node identifiers, continue to send the next byte identifier to the bus in response to the next synchronization information until all the multiple byte identifiers have been transmitted.
[0197] In some embodiments, the transmitting module 1002 is further configured to determine the transmission result of the byte identifier based on the byte information on the bus, and if the transmission result of the byte identifier indicates that the byte identifier was successfully transmitted and the byte identifier is the last one among the slave node identifiers, then determine that the transmission of the slave node identifier is complete and stop responding to the identifier acquisition instruction.
[0198] In some embodiments, the slave transmitting module 1002 is further configured to, after determining the transmission result of the byte identifier based on the byte information on the bus, stop responding to the next synchronization information if the byte identifier transmission fails, until a new identifier transmission opportunity arrives, and then retransmit the slave node identifier. In some embodiments, the slave transmitting module 1002 is further configured to, in response to the synchronization information, sequentially transmit multiple bit identifiers in the byte identifier to the bus until the last bit identifier among the multiple bit identifiers is transmitted.
[0199] In some embodiments, the transmitting module 1002 is further configured to, after transmitting one bit identifier of the byte identifier to the bus, determine the transmission result of the bit identifier; determine the transmission result of the bit identifier based on the bit information on the bus; and, if the transmission result of the bit identifier is that the bit identifier was successfully transmitted and the bit identifier is not the last one in the byte identifier, continue to transmit the next bit identifier to the bus until all the multiple bit identifiers have been transmitted.
[0200] In some embodiments, the transmitting module 1002 is further configured to determine the transmission result of the bit identifier based on the bit information on the bus, and then determine that the transmission of the byte identifier is complete if the transmission result of the bit identifier is that the bit identifier was successfully transmitted and the bit identifier is the last one in the byte identifier.
[0201] In some embodiments, the slave transmitting module 1002 is further configured to, after determining the transmission result of the bit identifier based on the bit information on the bus, stop transmitting the next bit identifier if the transmission result of the bit identifier is that the bit identifier transmission failed, until a new identifier transmission opportunity arrives, and then retransmit the slave node identifier.
[0202] In some embodiments, the communication method is implemented based on a universal asynchronous transceiver.
[0203] In some embodiments, the sending module 1002 is further configured to, after sending its own slave node identifier to the bus based on the bus synchronization information, compare the target identifier carried in the information instruction with its own slave node identifier in response to the information instruction of the bus, and obtain a comparison result; if the comparison result indicates that the target identifier is the same as its own slave node identifier, respond to the information instruction by sending the response information of the information instruction to the bus.
[0204] Based on the above embodiments, this application also provides a master node, such as... Figure 13 As shown, master node 110 includes:
[0205] The main transmitting module 1101 is used to send an identifier acquisition instruction to the bus so that multiple slave nodes in the network can acquire their own slave node identifiers; send identifier acquisition information to the bus; the identifier acquisition information includes synchronization information; the synchronization information is used to indicate when multiple slave nodes in the network send their own slave node identifiers to the main node.
[0206] The main receiving module 1102 is used to obtain information based on the identifier and receive the slave node identifier of each slave node in the network.
[0207] In some embodiments, the identifier acquisition information includes multiple first identifier acquisition information; the main receiving module 1102 is further configured to receive a slave node identifier corresponding to each first identifier acquisition information based on each first identifier acquisition information, thereby obtaining the slave node identifier of each slave node.
[0208] In some embodiments, the slave node identifier includes multiple byte identifiers; the first identifier acquisition information includes multiple second identifier acquisition information; the main receiving module 1102 is further configured to receive a byte identifier corresponding to each second identifier acquisition information in the first identifier acquisition information to obtain the slave node identifier.
[0209] In some embodiments, each of the second identifier acquisition information includes a first synchronization information; the first synchronization information is used to indicate the timing when multiple slave nodes in the network send the byte identifier to the master node.
[0210] In some embodiments, the communication method is implemented based on an asynchronous transceiver.
[0211] In some embodiments, the main sending module 1101 is further configured to obtain information based on the identifier, and after receiving the slave node identifier of each slave node in the network, send an information instruction to the bus; the information instruction carries a target identifier; the main receiving module 1102 is further configured to receive response information from the bus in response to the information instruction; the response information is sent to the bus by a target slave node, the target slave node is a slave node in the network, and the identifier of the target slave node is the same as the target identifier.
[0212] Figure 14 This is a schematic diagram of an optional slave node structure provided in an embodiment of this application. The slave node 1200 includes: a first memory 1207, a first processor 1208, and a computer program stored in the first memory 1207 and executable on the first processor 1208; wherein, when the first processor 1208 runs the computer program, it executes the communication method on the slave node side as described in the foregoing embodiments.
[0213] It is understood that the slave node 1200 also includes a first bus system 1209; the various components in the slave node 1200 are coupled together through the first bus system 1209. It is understood that the first bus system 1209 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1209 also includes a first power bus, a first control bus, and a first status signal bus.
[0214] Figure 15 This is a schematic diagram of an optional master node provided in an embodiment of this application. The master node 1300 includes: a first memory 1307, a first processor 1308, and a computer program stored in the first memory 1307 and executable on the first processor 1308; wherein, when the first processor 1308 runs the computer program, it executes the communication method on the slave node side as described in the foregoing embodiments.
[0215] It is understood that the master node 1300 also includes a second bus system 1309; the various components in the master node 1300 are coupled together through the second bus system 1309. It is understood that the second bus system 1309 is used to implement communication between these components. In addition to a data bus, the second bus system 1309 also includes a second power bus, a second control bus, and a second status signal bus.
[0216] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM). Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM). The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memory.
[0217] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. A processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the aforementioned methods.
[0218] This application provides a computer-readable storage medium storing a computer program thereon. When executed by a first processor, the computer program implements the steps in the communication method on the slave node side described above. When executed by a second processor, the computer program implements the steps in the communication method on the master node side described above.
[0219] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.
[0220] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A communication method, characterized in that, include: In response to the bus's identifier retrieval command, it retrieves its own slave node identifier; In response to bus synchronization information, determine when the master node is in an idle period where it can receive messages; Based on the synchronization information of the bus, multiple slave nodes simultaneously send their own slave node identifiers to the bus during the idle time; The slave node preempts the bus by prioritizing the information in its own slave node identifier; The synchronization information is used to indicate when multiple slave nodes in the communication network should send the slave node identifier; A slave node identifier includes at least one byte of identifier; The bus-based synchronization information, wherein the plurality of slave nodes simultaneously send their own slave node identifiers to the bus during the idle time, includes: in response to each of the at least one synchronization information, sending a byte identifier corresponding to the at least one byte identifier to the bus, until all byte identifiers included in the slave node identifier have been sent; Wherein, the step of sending a corresponding byte identifier from the at least one byte identifier to the bus in response to each of the at least one synchronization information includes: In response to the synchronization information, the corresponding one-byte identifier is sent to the bus; Based on the byte information on the bus, determine the transmission result of the byte identifier; If the result of sending the byte identifier indicates that the byte identifier was successfully sent, and the byte identifier is not the last one among the slave node identifiers, in response to the next synchronization information, the next byte identifier is sent to the bus until all at least one byte identifier has been sent.
2. The method according to claim 1, characterized in that, After determining the transmission result of the byte identifier based on the byte information on the bus, the method includes: If the sending result of the byte identifier indicates that the byte identifier was successfully sent, and the byte identifier is the last one in the slave node identifiers, then it is determined that the slave node identifier has been sent successfully, and the response to the identifier acquisition instruction is stopped.
3. The method according to claim 1, characterized in that, After determining the transmission result of the byte identifier based on the byte information on the bus, the method further includes: If the byte identifier fails to be sent, stop responding to the next synchronization message until a new identifier is sent, then resend the slave node identifier.
4. The method according to claim 1, characterized in that, The step of sending a corresponding one-byte identifier to the bus in response to the synchronization information includes: In response to the synchronization information, multiple bit identifiers in the byte identifier are sent to the bus sequentially until the last bit identifier among the multiple bit identifiers is sent.
5. The method according to claim 4, characterized in that, The step of sequentially sending multiple bit identifiers from the byte identifier to the bus includes: After sending a bit identifier from the byte identifier to the bus, the result of sending the bit identifier is determined; Based on the bit information on the bus, determine the transmission result of the bit identifier; If the result of sending the bit identifier is that the bit identifier was successfully sent, and the bit identifier is not the last one in the byte identifier, the next bit identifier is sent to the bus until all the multiple bit identifiers have been sent.
6. The method according to claim 5, characterized in that, After determining the transmission result of the bit identifier based on the bit information on the bus, the method further includes: If the result of sending the bit identifier is that the bit identifier was sent successfully, and the bit identifier is the last one in the byte identifier, then it is determined that the byte identifier has been sent successfully.
7. The method according to claim 5, characterized in that, After determining the transmission result of the bit identifier based on the bit information on the bus, the method further includes: If the transmission of the bit identifier fails, the transmission of the next bit identifier is stopped until a new opportunity to transmit the identifier arises, at which point the slave node identifier is retransmitted.
8. The method according to any one of claims 1-7, characterized in that, The communication method is implemented based on a universal asynchronous transceiver.
9. The method according to any one of claims 1-7, characterized in that, After sending its slave node identifier to the bus for the bus-based synchronization information, the method further includes: In response to the information command of the bus, the target identifier carried in the information command is compared with its own slave node identifier to obtain the comparison result; If the comparison result indicates that the target identifier is the same as its own slave node identifier, the system responds to the information command by sending a response message to the bus.
10. A communication method, characterized in that, include: Send an identifier acquisition command to the bus so that multiple slave nodes in the communication network can acquire their own slave node identifiers; Send an identifier to the bus to obtain information; The identification information includes synchronization information and idle information; The synchronization information is used to indicate when multiple slave nodes in the communication network send their own slave node identifiers to the master node; the idle information indicates that the master node is in an idle period where it can receive messages; Based on the identification information, the slave node identifier of each slave node in the network is received; wherein, multiple slave nodes in each slave node simultaneously send their own slave node identifiers to the bus based on the identification information; the slave node identifiers of each slave node are received based on the priority of the information in the slave node identifiers when preempting the bus; the identification information includes multiple first identification information; the first identification information includes multiple second identification information; a slave node identifier includes multiple bytes of identifier; The step of receiving the slave node identifier of each slave node in the network based on the identifier acquisition information includes: receiving a one-byte identifier corresponding to the second identifier acquisition information during the idle time based on each second identifier acquisition information in the first identifier acquisition information to obtain the slave node identifier; and receiving the one slave node identifier corresponding to the first identifier acquisition information during the idle time based on each first identifier acquisition information to obtain the slave node identifier of each slave node. Specifically, based on each second identifier acquisition information in the first identifier acquisition information, a one-byte identifier corresponding to the second identifier acquisition information is received during the idle time to obtain the slave node identifier, including: Based on each of the second identifiers, information is obtained, and during the idle time, the one-byte identifier corresponding to the second identifier information is received; Based on the information obtained from each of the second identifiers, the one-byte identifier of the received slave node identifier is determined.
11. The method according to claim 10, characterized in that, Each of the second identifier acquisition information includes a first synchronization information; the first synchronization information is used to indicate the timing when multiple slave nodes in the communication network send the byte identifier to the master node.
12. The method according to any one of claims 10-11, characterized in that, The communication method is implemented based on an asynchronous transceiver.
13. The method according to any one of claims 10-11, characterized in that, After obtaining the information based on the identifier and receiving the slave node identifier of each slave node in the network, the method further includes: Send an information command to the bus; the information command carries a target identifier; The system receives a response message from the bus in response to the information instruction; the response message is sent to the bus by a target slave node, which is a slave node in the network and whose identifier is the same as the target identifier.
14. A bus system, characterized in that, include: A plurality of slave nodes as described in any one of claims 1-9 and a master node as described in any one of claims 10-13; The master node and the plurality of slave nodes are connected via a bus.
15. A slave node, characterized in that, include: The first memory is used to store computer programs; A first processor is configured to execute the communication method as described in any one of claims 1-9 when the computer program is running.
16. A master node, characterized in that, include: The second memory is used to store computer programs; A second processor is configured to execute the communication method as described in any one of claims 10-13 when the computer program is running.
17. A computer storage medium, characterized in that, It stores executable instructions that, when executed by a first processor, implement the communication method as described in any one of claims 1-9; or, when executed by a second processor, implement the communication method as described in any one of claims 10-13.