Bus communication method and bus communication system
Patent Information
- Application Number
- CN202610729064.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-05-26
AI Technical Summary
[0004]但是,相关技术中,主机端的基于超时机制来尝试重发,容易出现请求发送效率低的问题,而且,容易出现请求的无效发送
[0016]本申请的有益效果是:本申请实施例提供一种总线通信方法,包括:通过总线向第二通信节点发送请求;若未接收到第二通信节点针对请求的回复,则通过目标通信链路向第二通信节点发送第一通知信息,以使第二通信节点在未接收到请求时,根据第一通知信息执行恢复操作,并通过目标通信链路向第一通信节点发送第二通知信息;根据第二通知信息,通过总线再次向第二通信节点发送请求。第一通信节点和第二通信节点之间还通过目标通信链路通信连接,在第一通信节点和第二通信节点之间的总线通信存在异常时,第一通信节点可以通过目标通信链路通知第二通信节点及时进行恢复操作,恢复完成后第二通信节点可以通过目标通信链路及时通知第一通信节点尝试重发,提升了请求发送效率,减少了请求的无效发送。
Smart Images

Figure CN122316829B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a bus communication method and a bus communication system. Background Technology
[0002] With the rapid advancement of technology, the application and demand for various products such as desktop computers, laptops, and servers are becoming increasingly widespread across different fields, leading to higher requirements for product stability. These products generally utilize buses for power management and external event management. Communication problems can often have serious consequences, making the assurance of stable communication crucial.
[0003] In related technologies, the host sends a request to the slave. If the host does not receive a response from the slave, it will attempt to resend the request based on a timeout mechanism. That is, if no response is received within a preset time, the request will be resent.
[0004] However, in related technologies, the host-side timeout-based retransmission mechanism is prone to low request sending efficiency and invalid request transmission. Summary of the Invention
[0005] The purpose of this application is to provide a bus communication method and a bus communication system to address the shortcomings of the prior art and solve the aforementioned technical problems in the related art.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a bus communication method applied to a first communication node in a communication system, the communication system further including a second communication node, the first communication node and the second communication node being connected via a bus communication connection, and the first communication node and the second communication node also being connected via a target communication link, the method comprising: A request is sent to the second communication node via the bus; If no response is received from the second communication node in response to the request, a first notification message is sent to the second communication node through the target communication link, so that the second communication node performs a recovery operation based on the first notification message when it does not receive the request, and sends a second notification message to the first communication node through the target communication link. Based on the second notification information, the request is sent again to the second communication node via the bus.
[0007] Optionally, after sending the request again to the second communication node via the bus based on the second notification information, the method further includes: If no response is received from the second communication node in response to the request, it is determined that the recovery of the second communication node is invalid. Perform the first recovery operation and send the request again to the second communication node via the bus; If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
[0008] Optionally, the method further includes: If the target information sent by the second communication node through the bus is not received, but the third notification information sent by the second communication node through the target communication link is received, then the first recovery operation is performed, and the request is sent to the second communication node again through the bus. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
[0009] Optionally, performing the first recovery operation includes: reducing the clock frequency; The second recovery operation includes resetting the bus.
[0010] Optionally, after performing a second recovery operation and resending the request to the second communication node via the bus if no response is received from the second communication node for the request, the method further includes: If a predetermined number of requests are sent to the second communication node via the bus and no response is received from the second communication node for each request, then the bus communication is confirmed to be abnormal. A fourth notification message is sent to the second communication node through the target communication link, so that the second communication node can issue an alarm based on the fourth notification message and perform a third recovery operation after a preset time.
[0011] Secondly, embodiments of this application also provide a bus communication method applied to a second communication node in a communication system, wherein the communication system further includes a first communication node, the first communication node and the second communication node are connected via bus communication, and the first communication node and the second communication node are also connected via a target communication link, the method comprising: If a first notification message is received from the first communication node via the target communication link, and no request is received from the first communication node via the bus, then a recovery operation is performed. The first communication node sends a second notification message to the first communication node via the target communication link, so that the first communication node sends the request to the second communication node again via the bus based on the second notification message.
[0012] Optionally, the method further includes: The target information is sent to the first communication node via the bus, and a third notification information is sent to the first communication node via the target communication link. This causes the first communication node to perform a first recovery operation based on the third notification information if it does not receive the target information, and then send the request to the second communication node again via the bus. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus, until a response is received from the second communication node in response to the request.
[0013] Optionally, sending target information to the first communication node via the bus includes: If a request is received from the first communication node via the bus, a response to the request is sent to the first communication node via the bus. Alternatively, a needle update data request may be sent to the first communication node via the bus; The target information is either a response to the request or a request to update data.
[0014] Optionally, the method further includes: Receive a fourth notification message sent by the first communication node through the target communication link; wherein the fourth notification message is sent after the first communication node confirms the bus communication abnormality; An alarm is triggered based on the fourth notification information, and a third recovery operation is performed after a preset time.
[0015] Thirdly, embodiments of this application also provide a bus communication system, including: a first communication node and a second communication node, wherein the first communication node and the second communication node are connected via a bus communication connection, and the first communication node and the second communication node are also connected via a target communication link, wherein the first communication node is used to execute the bus communication method described in any of the first aspects, and the second communication node is used to execute the bus communication method described in any of the second aspects.
[0016] The beneficial effects of this application are as follows: This application provides a bus communication method, including: sending a request to a second communication node via a bus; if no response is received from the second communication node in response to the request, sending a first notification message to the second communication node via a target communication link, so that the second communication node performs a recovery operation based on the first notification message when no request is received, and sends a second notification message to the first communication node via the target communication link; and sending the request again to the second communication node via the bus based on the second notification message. The first and second communication nodes are also connected via a target communication link. When there is an anomaly in the bus communication between the first and second communication nodes, the first communication node can notify the second communication node to perform a recovery operation in a timely manner via the target communication link. After recovery, the second communication node can promptly notify the first communication node to attempt retransmission via the target communication link, improving request transmission efficiency and reducing invalid request transmissions. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the structure of a bus communication system provided in an embodiment of this application; Figure 2 This application provides a schematic diagram of the overall structure of an embodiment of the machine. Figure 3 A schematic diagram of the structure of a management module provided in an embodiment of this application; Figure 4 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 1 ; Figure 5 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 2 ; Figure 6 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 3 ; Figure 7 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 4 ; Figure 8 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 5 ; Figure 9A flowchart illustrating a bus communication method provided in this application embodiment. Figure 6 ; Figure 10 A complete flowchart of a bus communication method provided in this application embodiment. Figure 1 ; Figure 11 A complete flowchart of a bus communication method provided in this application embodiment. Figure 2 ; Figure 12 This is a schematic diagram of the structure of a bus communication device provided in an embodiment of this application; Figure 13 This is a schematic diagram of the structure of a communication node provided in an embodiment of this application. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.
[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in, it is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0022] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0024] Figure 1 This is a schematic diagram of a bus communication system provided in an embodiment of this application, as shown below. Figure 1 As shown, the bus communication system includes: a first communication node and a second communication node.
[0025] The first communication node and the second communication node are connected via a bus communication connection, and are also connected via a target communication link.
[0026] In this embodiment of the application, the first communication node and the second communication node are connected via a bus. There is no specific restriction on the type of bus. For example, the bus can be an LPC (Low Pin Count) bus.
[0027] In addition, the first and second communication nodes are also connected via a target communication link. Specifically, the first and second communication nodes communicate via a bus, for example, a GPIO (General-Purpose Input / Output) bus or an SMBus (System Management Bus). Of course, the target communication link can also be other types of communication links, as long as it can provide a backup communication mechanism for the first and second communication nodes.
[0028] In practical applications, the first communication node and the second communication node can be two complete machines, two modules, or two devices. This application embodiment does not impose specific restrictions on the form of the first communication node and the second communication node.
[0029] Figure 2 This application provides a schematic diagram of the overall structure of an embodiment of the machine, as shown below. Figure 2 As shown, the complete machine may include: a central processing unit, a management module, a storage module, and other modules.
[0030] The central processing unit (CPU) is connected to the management module, storage module, and other modules.
[0031] In some implementations, the central processing unit can be the master and the management module can be the slave; or, the central processing unit can be the slave and the management module can be the master.
[0032] Figure 3 This application provides a schematic diagram of the structure of a management module, as shown in the embodiment. Figure 3 As shown, the management module includes a control unit and an exception handling unit, which are directly connected in communication.
[0033] It should be noted that the control unit can be an EC (Embedded Controller), an FPGA (Field-Programmable Gate Array), or a MCU (Microcontroller Unit). The exception handling unit can be an alarm module or a recovery module.
[0034] certainly, Figure 3 This is merely one example of a management module, and the embodiments of this application do not impose specific limitations on the internal structure of the management module.
[0035] It is worth noting that the first communication node and the second communication node are used to execute a bus communication method provided in the embodiments of this application.
[0036] This application provides a bus communication method applied to a first communication node in a bus communication system, wherein the first communication node may also be referred to as a host. The following explains the bus communication method provided by this application.
[0037] Figure 4 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 1 ,like Figure 4 As shown, the method may include: S101, Send a request to the second communication node via the bus.
[0038] In this embodiment, the first communication node sends a request to the second communication node via the bus. The type of request is not specifically limited in this application; for example, the request can be an LPC request.
[0039] S102. If no response is received from the second communication node in response to the request, a first notification message is sent through the target communication link so that the second communication node performs a recovery operation based on the first notification message when no request is received, and sends a second notification message to the first communication node through the target communication link.
[0040] It is worth noting that after receiving the request, the second communication node will send a reply to the first communication node in response to the request; if there is an anomaly on the bus, the second communication node will not be able to receive the request, and therefore will also be unable to send a reply to the first communication node in response to the request.
[0041] In some implementations, if the first communication node does not receive a response from the second communication node to the request, the first communication node sends a first notification message to the second communication node via the target communication link. Correspondingly, if the second communication node does not receive the request, it receives the first notification message and performs a self-recovery operation based on it. The second communication node then sends a second notification message to the first communication node via the target communication link. The second notification message instructs the first communication node to re-establish communication.
[0042] In this embodiment, the first communication node sends a first notification message to the second communication node through the target communication link, which may include: the first communication node sending an interrupt to the second communication node through a first GPIO pin; or the first communication node sending first data to the second communication node through a target GPIO pin, wherein the first data indicates a notification response from the other end.
[0043] For example, the first GPIO pin can be the GPIO0 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0044] S103. Based on the second notification information, send the request to the second communication node again via the bus.
[0045] In this process, the first communication node receives the second notification information sent by the second communication node. Based on the second notification information, the first communication node can determine that the second communication node has performed a self-recovery operation. The first communication node then sends a request to the second communication node again via the bus.
[0046] It should be noted that after the second communication node performs a self-recovery operation, if the bus returns to normal, the second communication node can receive the request and send a reply to the first communication node in response to the request.
[0047] In summary, this application provides a bus communication method, comprising: sending a request to a second communication node via a bus; if no response is received from the second communication node in response to the request, sending a first notification message to the second communication node via a target communication link, so that the second communication node performs a recovery operation based on the first notification message when no request is received, and sends a second notification message to the first communication node via the target communication link; and sending the request again to the second communication node via the bus based on the second notification message. The first and second communication nodes are also connected via a target communication link. When there is an anomaly in the bus communication between the first and second communication nodes, the first communication node can notify the second communication node to perform a recovery operation in a timely manner via the target communication link. After recovery, the second communication node can promptly notify the first communication node to attempt retransmission via the target communication link, thereby improving request sending efficiency and reducing invalid request transmissions.
[0048] Optionally, Figure 5 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 2 ,like Figure 5 As shown, after the process in S103 above of sending a request to the second communication node again via the bus based on the second notification information, the method may further include: S201. If no response is received from the second communication node in response to the request, it is determined that the recovery of the second communication node is invalid.
[0049] If the first communication node sends a request to the second communication node again via the bus but still does not receive a response from the second communication node, the first communication node can determine that the recovery of the second communication node is invalid. In order to restore bus communication between the first communication node and the second communication node as soon as possible, the first communication node continues to execute the following processes S202 to S203.
[0050] S202, Perform the first recovery operation and send the request to the second communication node again via the bus.
[0051] It should be noted that the first communication node performs the first recovery operation and then resumes communication, sending a request to the second communication node again via the bus to attempt to resend the request. If a response is received from the second communication node in response to the request, it indicates that bus communication between the first and second communication nodes has returned to normal.
[0052] S203. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
[0053] In this embodiment, if no response to the request is received from the second communication node, it indicates that the bus communication between the first and second communication nodes is still abnormal. The first communication node then performs a second recovery operation and continues to communicate by sending the request to the second communication node again via the bus. The first communication node attempts to resend the request until it receives a response to the request, indicating that the bus communication between the first and second communication nodes has returned to normal.
[0054] Optionally, Figure 6 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 3 ,like Figure 6 As shown, the method may further include: S301. If the target information sent by the second communication node through the bus is not received, but the third notification information sent by the second communication node through the target communication link is received, then the first recovery operation is performed, and the request is sent to the second communication node again through the bus.
[0055] Specifically, the first communication node sends target information to the second communication node via the bus and sends third notification information to the second communication node via the target communication link. If the first communication node does not receive the target information sent by the second communication node via the bus, but receives the third notification information sent by the second communication node via the target communication link, it indicates that the first communication node is malfunctioning.
[0056] In this embodiment, the first communication node performs a first recovery operation and then continues communication by sending a request to the second communication node again via the bus, attempting to resend the request. If a response is received from the second communication node in response to the request, it indicates that bus communication between the first and second communication nodes has returned to normal.
[0057] S302. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
[0058] It should be noted that the process of S203 is similar to that of S302, and will not be described again here.
[0059] Optionally, the process of performing the first recovery operation in S202 above may include: reducing the clock frequency. The process of performing the second recovery operation in S203 above may include: resetting the bus.
[0060] It should be noted that by reducing the clock frequency and resetting the bus, the bus communication between the first and second communication nodes can be fully and reliably restored.
[0061] Optionally, Figure 7 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 4 ,like Figure 7 As shown, after the process in S302 above, where if no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus, the method may further include: S401. If a preset number of requests are sent to the second communication node via the bus and no response is received from the second communication node for each request, then the bus communication is confirmed to be abnormal.
[0062] If a preset number of requests are sent to the second communication node via the bus without a response, it indicates that the bus cannot be restored after the preset number of attempts, confirming a complete communication failure in the communication route.
[0063] It is worth noting that the preset number of times can be set according to actual needs. For example, the preset number of times can be 2 times. In this embodiment of the application, there is no specific limit on the preset number of times.
[0064] S402. Send a fourth notification message to the second communication node through the target communication link so that the second communication node can issue an alarm based on the fourth notification message and perform a third recovery operation after a preset time.
[0065] In this application embodiment, for the above-described implementations of S201 to S203, after confirming a bus communication anomaly, the first communication node sending a fourth notification message to the second communication node through the target communication link may include: the first communication node sending an interrupt to the second communication node through a second GPIO pin; or the first communication node sending second data to the second communication node through a target GPIO pin, the second data indicating an anomaly in the second communication node.
[0066] For example, the second GPIO pin can be the GPIO1 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the second data can be represented as: 10.
[0067] In this process, the first communication node sends a fourth notification message to the second communication node through the target communication link; the second communication node can receive the fourth notification message, the second communication node determines that the second communication node is faulty, and the second communication node recovers itself. The first communication node also performs multiple recovery operations, all of which are ineffective. The second communication node issues an alarm based on the fourth notification message and restarts the device after a preset time.
[0068] In the above-described embodiments of S301 to S302, after confirming a bus communication anomaly, the first communication node sending a fourth notification message to the second communication node through the target communication link may include: the first communication node sending an interrupt to the second communication node through a third GPIO pin; or the first communication node sending third data to the second communication node through a target GPIO pin, the third data indicating an anomaly in the first communication node.
[0069] For example, the third GPIO pin can be the GPIO2 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the third data can be represented as: 11.
[0070] In this process, the first communication node sends a fourth notification message to the second communication node through the target communication link; the second communication node can receive the fourth notification message, and the second communication node determines that the first communication node is faulty, and the first communication node has also performed multiple bus recovery operations, all of which are ineffective. The second communication node issues an alarm based on the fourth notification message and restarts the device after a preset time.
[0071] It should be noted that the second communication node can issue fault code alarms, buzzer alarms, and LED (Light Emitting Diode) alarms.
[0072] This application provides a bus communication method applied to a second communication node in a bus communication system, wherein the second communication node may also be referred to as a slave device. The following is an explanation of the bus communication method provided by this application.
[0073] Optionally, Figure 8 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 5 ,like Figure 8 As shown, the method includes: S501. If a first notification message is received from the first communication node via the target communication link, but no request is received from the first communication node via the bus, then a recovery operation is performed.
[0074] In this process, the first communication node sends a request to the second communication node via the bus. If there is an anomaly on the bus, the second communication node will not be able to receive the request and will therefore be unable to send a reply to the first communication node in response to the request.
[0075] In some implementations, if the first communication node does not receive a response from the second communication node to the request, it sends a first notification message to the second communication node through the target communication link. The second communication node receives the first notification message and determines that the first communication node has sent a request to the second communication node based on the first notification message. The second communication node performs a self-check and finds that the request is lost, that is, the second communication node determines that it has not received the request sent by the first communication node through the bus. Then the second communication node performs a self-recovery operation.
[0076] S502, Send a second notification message to the first communication node through the target communication link, so that the first communication node sends a request to the second communication node again through the bus according to the second notification message.
[0077] In this embodiment of the application, the second communication node sends a second notification message to the first communication node through the target communication link, including: the second communication node sending an interrupt to the second GPIO pin of the first communication node; or, the second communication node sending first data to the target GPIO pin of the first target communication node, the first data being used to indicate the other end's response.
[0078] For example, the second GPIO pin can be the GPIO1 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0079] Accordingly, the first communication node can determine from the second notification information that the second communication node has performed a self-recovery operation, and the first communication node sends a request to the second communication node again through the bus.
[0080] In summary, the bus communication method provided in this application includes: if a first notification message is received from a first communication node via a target communication link, but no request is received from the first communication node via the bus, then a recovery operation is performed; a second notification message is sent to the first communication node via the target communication link, so that the first communication node, based on the second notification message, resends a request to the second communication node via the bus. The first and second communication nodes are also connected via the target communication link. When an anomaly occurs in the bus communication between the first and second communication nodes, the first communication node can notify the second communication node via the target communication link to perform a timely recovery operation. After recovery, the second communication node can promptly notify the first communication node via the target communication link to attempt a retransmission, thereby improving request transmission efficiency and reducing invalid request transmissions.
[0081] Optionally, the method may further include: The target information is sent to the first communication node via the bus, and a third notification information is sent to the first communication node via the target communication link. If the first communication node does not receive the target information, it performs a first recovery operation based on the third notification information and sends a request to the second communication node again via the bus. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and a request is sent to the second communication node again via the bus, until a response is received from the second communication node in response to the request.
[0082] In some implementations, the second communication node sends a third notification message to the first communication node via the target communication link, which may include: the second communication node sending an interrupt to a first GPIO pin of the first communication node, or the second communication node sending first data to a target GPIO pin of the first communication node, the first data indicating a response from the other end.
[0083] For example, the first GPIO pin can be the GPIO0 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0084] It should be noted that if the first communication node does not receive the target information but receives the third notification information, it indicates that there is an anomaly in the first communication node. The first communication node performs the first recovery operation and sends the request to the second communication node again through the bus. If no response is received from the second communication node in response to the request, it indicates that there is still an anomaly. The first communication node then performs the second recovery operation and sends the request to the second communication node again through the bus until a response is received from the second communication node in response to the request.
[0085] If the first communication node sends requests to the second communication node via the bus a preset number of times and does not receive a response from the second communication node for each request, then the bus communication is confirmed to be abnormal.
[0086] Optionally, Figure 9 A flowchart illustrating a bus communication method provided in this application embodiment. Figure 6 ,like Figure 9 As shown, the method may further include: S601, Receive the fourth notification information sent by the first communication node through the target communication link.
[0087] The fourth notification message is sent after the first communication node confirms the bus communication abnormality.
[0088] In this embodiment of the application, after the first communication node confirms that the bus communication is abnormal, it sends a fourth notification message to the second communication node through the target communication link; the second communication node can receive the fourth notification message.
[0089] S602. Issue an alarm based on the fourth notification information, and perform the third recovery operation after a preset time.
[0090] In some implementations, receiving the fourth notification information sent by the first communication node through the target communication link includes: the second communication node receiving an interrupt sent by the first communication node through a third GPIO pin, or receiving second data sent by the first communication node through a target GPIO pin, the second data indicating an anomaly in the second communication node. The second GPIO pin can be GPIO1 on the first communication node, the target GPIO pin can be GPIO01 on the first communication node, and the second data can be represented as 10. Based on this fourth notification information, the second communication node determines that it is faulty, and that it has self-recovered. The first communication node has also performed multiple recovery operations without success, thus issuing a corresponding first alarm and restarting the device after a preset time.
[0091] In other embodiments, receiving the fourth notification information sent by the first communication node through the target communication link includes: receiving an interrupt sent by the first communication node through a third GPIO pin; or receiving third data sent by the first communication node through a target GPIO pin, the third data indicating an anomaly in the first communication node. The third GPIO pin can be GPIO2 on the first communication node, the target GPIO pin can be GPIO01 on the first communication node, and the third data can be represented as 11. Based on this fourth notification information, the second communication node determines that the first communication node is faulty, and that the first communication node has performed multiple bus recovery operations without success, thus issuing a corresponding second alarm and restarting the device after a preset time.
[0092] It should be noted that the first alarm and the second alarm can be different alarms. The first alarm and the second alarm can be any of the following: fault code alarm, buzzer alarm, and LED alarm. If the second communication node is connected to an LED light, digital tube, or buzzer, it can execute the alarm. Otherwise, the second communication node can send an alarm notification to the externally connected fault handling unit so that the fault handling unit can execute the corresponding alarm based on the alarm notification.
[0093] Optionally, the process of sending target information to the first communication node via the bus may include: If a request is received from the first communication node via the bus, a response to the request is sent to the first communication node via the bus; or, a request to update data is sent to the first communication node via the bus. The target information is either a response to the request or a request to update data.
[0094] In this embodiment, the same interrupt can be transmitted through different GPIO pins of the first communication node to represent notification information under different conditions. Conversely, different data can be transmitted through the same GPIO pin of the first communication node to represent notification information under different conditions. Thus, either the first or second communication node can determine its corresponding state based on the transmitted GPIO pin or the transmitted data.
[0095] It should be noted that when transmitting different notification information, a convention register, a specific ECRAM (embedded controller memory), or a GPIO state machine can also be used for transmission. When transmitting different data through the same GPIO pin of the first communication node, GPIO01 is used as the state machine for the interaction and response between the first and second communication nodes. When the transmitted data is the first data (01), it indicates that the other end has responded; when the transmitted data is the second data (10), it indicates that the second communication node is abnormal; when the transmitted data is the third data (11), it indicates that the first communication node is abnormal. Additionally, when the transmitted data is 00, it indicates that there is no event.
[0096] Figure 10 A complete flowchart of a bus communication method provided in this application embodiment. Figure 1 ,like Figure 10 As shown, the method may include: S701, the first communication node sends a request to the second communication node via the bus.
[0097] S702. If the first communication node does not receive a response from the second communication node to the request, it sends a first notification message to the second communication node through the target communication link.
[0098] In this scenario, the first communication node sends an interrupt to the second communication node via a first GPIO pin; or the first communication node sends first data to the second communication node via a target GPIO pin, the first data indicating a notification to the other end to respond.
[0099] For example, the first GPIO pin can be the GPIO0 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0100] S703. If the second communication node receives the first notification information but does not receive the request sent by the first communication node through the bus, then a recovery operation is performed.
[0101] S704, The second communication node sends a second notification message to the first communication node through the target communication link.
[0102] In this scenario, the second communication node sends an interrupt to the second GPIO pin of the first communication node; or, the second communication node sends first data to the target GPIO pin of the first target communication node, the first data being used to indicate a response from the other end.
[0103] For example, the second GPIO pin can be the GPIO1 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0104] S705. Based on the second notification information, the first communication node sends a request to the second communication node again via the bus.
[0105] S706. If the first communication node does not receive a response from the second communication node to the request, it determines that the second communication node's recovery is invalid.
[0106] S707, The first communication node performs the first recovery operation and sends a request to the second communication node again via the bus.
[0107] S708. If the first communication node does not receive a response from the second communication node in response to the request, it performs a second recovery operation and sends the request to the second communication node again via the bus until it receives a response from the second communication node in response to the request.
[0108] S709. If the first communication node sends requests to the second communication node via the bus a preset number of times consecutively, and does not receive a response from the second communication node for each request, then the bus communication is confirmed to be abnormal.
[0109] S710, the first communication node sends the fourth notification information to the second communication node through the target communication link.
[0110] In this scenario, the first communication node sends an interrupt to the second communication node via the second GPIO pin; or the first communication node sends second data to the second communication node via the target GPIO pin, the second data indicating an abnormality in the second communication node.
[0111] For example, the second GPIO pin can be the GPIO1 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the second data can be represented as: 10.
[0112] S711, the second communication node issues an alarm based on the fourth notification information, and performs the third recovery operation after a preset time.
[0113] The second communication node receives the fourth notification information, determines that the second communication node is faulty, and recovers itself. The first communication node also performs multiple recovery operations, all of which are ineffective. The second communication node issues an alarm based on the fourth notification information and restarts the device after a preset time.
[0114] Figure 11 A complete flowchart of a bus communication method provided in this application embodiment. Figure 2 ,like Figure 11 As shown, the method includes: S801, the second communication node sends target information to the first communication node through the bus, and sends third notification information to the first communication node through the target communication link.
[0115] The target information is either a response to the request or a request to update data.
[0116] It should be noted that the second communication node sends an interrupt to the first GPIO pin of the first communication node, or the second communication node sends first data to the target GPIO pin of the first communication node, which indicates the other end's acknowledgment.
[0117] For example, the first GPIO pin can be the GPIO0 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the first data can be represented as: 01.
[0118] S802. If the first communication node does not receive the target information sent by the second communication node through the bus, but receives the third notification information sent by the second communication node through the target communication link, then the first recovery operation is performed, and the request is sent to the second communication node again through the bus.
[0119] S803. If the first communication node does not receive a reply from the second communication node in response to the request, then the second recovery operation is performed, and the request is sent to the second communication node again via the bus until a reply from the second communication node in response to the request is received. S804. If the first communication node sends requests to the second communication node via the bus a preset number of times consecutively, and does not receive a response from the second communication node for each request, then the bus communication is confirmed to be abnormal. S805, the first communication node sends the fourth notification information to the second communication node through the target communication link.
[0120] In this scenario, the first communication node sends an interrupt to the second communication node via a third GPIO pin; or the first communication node sends third data to the second communication node via a target GPIO pin, which indicates an abnormality in the first communication node.
[0121] For example, the third GPIO pin can be the GPIO2 pin on the first communication node, the target GPIO pin can be the GPIO01 pin on the first communication node, and the third data can be represented as: 11.
[0122] S806, the second communication node issues an alarm based on the fourth notification information, and performs the third recovery operation after a preset time.
[0123] The second communication node can receive the fourth notification information. The second communication node determines that the first communication node is faulty and that the first communication node has also performed multiple bus recovery operations, all of which have been ineffective. The second communication node issues an alarm based on the fourth notification information and restarts the device after a preset time.
[0124] The following describes the bus communication device, communication node, and storage medium used to execute the bus communication method provided in this application. For the specific implementation process and technical effects, please refer to the relevant content of the above method, which will not be repeated below.
[0125] This application provides a bus communication device applied to a first communication node in a communication system. The communication system further includes a second communication node. The first communication node and the second communication node are connected via a bus communication connection, and are also connected via a target communication link. The device includes: A first sending module is configured to send a request to a second communication node via the bus; if no response is received from the second communication node in response to the request, a first notification message is sent to the second communication node via the target communication link, so that the second communication node performs a recovery operation based on the first notification message when it does not receive the request, and sends a second notification message to the first communication node via the target communication link; based on the second notification message, the request is sent to the second communication node again via the bus.
[0126] Optionally, the device includes: The determination module is used to determine that the recovery of the second communication node is invalid if no response is received from the second communication node in response to the request. The second sending module is used to perform the first recovery operation and send the request to the second communication node again through the bus; if no response is received from the second communication node for the request, the second recovery operation is performed and the request is sent to the second communication node again through the bus until a response is received from the second communication node for the request.
[0127] Optionally, the device further includes: The third sending module is configured to, if it does not receive the target information sent by the second communication node through the bus, but receives the third notification information sent by the second communication node through the target communication link, perform a first recovery operation and send the request to the second communication node again through the bus; if it does not receive a response from the second communication node to the request, perform a second recovery operation and send the request to the second communication node again through the bus, until a response from the second communication node to the request is received.
[0128] Optionally, performing the first recovery operation includes: reducing the clock frequency; performing the second recovery operation includes: resetting the bus.
[0129] Optionally, it also includes: The confirmation module is used to confirm that the bus communication is abnormal if a preset number of requests are sent to the second communication node through the bus and no response is received from the second communication node for the requests. The fourth sending module is used to send a fourth notification message to the second communication node through the target communication link, so that the second communication node can issue an alarm based on the fourth notification message and perform a third recovery operation after a preset time.
[0130] Figure 12 This is a schematic diagram of a bus communication device provided in an embodiment of this application. The device is applied to a second communication node in a communication system. The communication system also includes a first communication node. The first communication node and the second communication node are connected via a bus communication connection, and the first communication node and the second communication node are also connected via a target communication link. Figure 12 As shown, the device includes: The recovery module 101 is configured to perform a recovery operation if it receives a first notification message sent by the first communication node through the target communication link, but does not receive a request sent by the first communication node through the bus. The first sending module 102 is used to send a second notification message to the first communication node through the target communication link, so that the first communication node sends the request to the second communication node again through the bus according to the second notification message.
[0131] Optionally, the device further includes: The second sending module is configured to send target information to the first communication node via the bus and send third notification information to the first communication node via the target communication link, so that if the first communication node does not receive the target information, it performs a first recovery operation according to the third notification information and sends the request to the second communication node again via the bus; if it does not receive a response from the second communication node to the request, it performs a second recovery operation and sends the request to the second communication node again via the bus, until it receives a response from the second communication node to the request.
[0132] Optionally, the second sending module is specifically configured to, if it receives a request sent by the first communication node through the bus, send a reply to the first communication node in response to the request; or send a data update request to the first communication node through the bus; wherein the target information is either a reply to the request or the data update request.
[0133] Optionally, the device further includes: A receiving module is configured to receive a fourth notification message sent by the first communication node through the target communication link; wherein the fourth notification message is sent after the first communication node confirms the bus communication abnormality; The execution module is used to issue an alarm based on the fourth notification information and, after a preset time, perform a third recovery operation.
[0134] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0135] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0136] Figure 13 This is a schematic diagram of the structure of a communication node provided in an embodiment of this application, such as... Figure 13 As shown, the communication node includes: processor 201 and memory 202.
[0137] The memory 202 is used to store programs, and the processor 201 calls the programs stored in the memory 202 to execute the above method embodiments. The specific implementation and technical effects are similar, and will not be described in detail here.
[0138] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0140] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0141] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0142] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A bus communication method, characterized in that, A first communication node is applied in a communication system, the communication system further including a second communication node, the first communication node and the second communication node are connected via a bus communication connection, and the first communication node and the second communication node are also connected via a target communication link, the method comprising: A request is sent to the second communication node via the bus; If no response is received from the second communication node in response to the request, a first notification message is sent to the second communication node through the target communication link, so that the second communication node performs a recovery operation based on the first notification message when it does not receive the request, and sends a second notification message to the first communication node through the target communication link. Based on the second notification information, the request is sent again to the second communication node via the bus; After sending the request to the second communication node again via the bus based on the second notification information, the method further includes: If no response is received from the second communication node in response to the request, it is determined that the recovery of the second communication node is invalid. Perform the first recovery operation and send the request again to the second communication node via the bus; If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
2. The method according to claim 1, characterized in that, The method further includes: If the target information sent by the second communication node through the bus is not received, but the third notification information sent by the second communication node through the target communication link is received, then the first recovery operation is performed, and the request is sent to the second communication node again through the bus. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus until a response is received from the second communication node in response to the request.
3. The method according to claim 1 or 2, characterized in that, The execution of the first recovery operation includes: reducing the clock frequency; The second recovery operation includes resetting the bus.
4. The method according to claim 1 or 2, characterized in that, If no response is received from the second communication node for the request, a second recovery operation is performed, and the request is resent to the second communication node via the bus. The process further includes: If a predetermined number of requests are sent to the second communication node via the bus and no response is received from the second communication node for each request, then the bus communication is confirmed to be abnormal. A fourth notification message is sent to the second communication node through the target communication link, so that the second communication node can issue an alarm based on the fourth notification message and perform a third recovery operation after a preset time.
5. A bus communication method, characterized in that, A second communication node is applied in a communication system, which further includes a first communication node. The first and second communication nodes are connected via a bus communication connection and are also connected via a target communication link. The method includes: If a first notification message is received from the first communication node via the target communication link, and no request is received from the first communication node via the bus, then a recovery operation is performed. The first communication node sends a second notification message to the first communication node through the target communication link, so that the first communication node sends the request to the second communication node again through the bus according to the second notification message; The method further includes: Receive a fourth notification message sent by the first communication node through the target communication link; wherein the fourth notification message is sent after the first communication node confirms the bus communication abnormality; An alarm is triggered based on the fourth notification information, and a third recovery operation is performed after a preset time.
6. The method according to claim 5, characterized in that, The method further includes: The target information is sent to the first communication node via the bus, and a third notification information is sent to the first communication node via the target communication link. This causes the first communication node to perform a first recovery operation based on the third notification information if it does not receive the target information, and then send the request to the second communication node again via the bus. If no response is received from the second communication node in response to the request, a second recovery operation is performed, and the request is sent to the second communication node again via the bus, until a response is received from the second communication node in response to the request.
7. The method according to claim 6, characterized in that, Sending target information to the first communication node via the bus includes: If a request is received from the first communication node via the bus, a response to the request is sent to the first communication node via the bus. Alternatively, a needle update data request may be sent to the first communication node via the bus; The target information is either a response to the request or a request to update data.
8. A bus communication system, characterized in that, include: A first communication node and a second communication node are connected via a bus communication link and are also connected via a target communication link. The first communication node is used to execute the bus communication method according to any one of claims 1-4, and the second communication node is used to execute the bus communication method according to any one of claims 5-7.
Citation Information
Patent Citations
Communication fault recovery method and system, and related components
CN110413435A
