A method, apparatus and system for controlling the state of a GPIO interface of a multi-node

CN119921798BActive Publication Date: 2026-08-18NEWCOSEMI BEIJING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510081217.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2026-08-18
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

[0003]现有技术中,各节点在每轮仅传输和处理一条信息,这限制了系统并行处理的能力,导致整体效率低下

Benefits of technology

所述外部设备通过所述从节点的GPIO接口上报状态信息,经由所述主节点的GPIO接口至所述主控制器;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119921798B_ABST
    Figure CN119921798B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and system for controlling GPIO interface states of multiple nodes. The input and output modes of the GPIO interfaces of the nodes are configured, and the correspondence relationship with the virtual IO interfaces is configured, so that the flexibility and adaptability of the system are enhanced, and effective resource utilization and dynamic adjustment are realized. According to the input state of the GPIO interface of the master node, configuration information and the values of the virtual IO interfaces, the values of the virtual IO interfaces are modified to obtain state data. The state data is transmitted node by node downwards until the end and then upwards, the state data is updated by each node and the output is responded, the master node obtains the state data again after a preset time and transmits the state data downwards, the GPIO states of each node are identified and processed in each period, the real-time response and efficient processing of the system to the GPIO states are ensured, and the system scalability and multi-node processing capacity are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic circuit technology, and in particular to a method, apparatus and system for controlling the state of GPIO interfaces of multiple nodes. Background Technology

[0002] In multi-node communication networks such as audio and video, each node uses the General-purpose input / output (GPIO) interface to efficiently transmit control commands and status information. For example, the processor connected to the master node controls the status of the speakers connected to the slave node through the master node's GPIO, and the speakers connected to the slave node feed back the speaker fault status to the processor connected to the master node through the slave node's GPIO.

[0003] In existing technologies, each node transmits and processes only one message per round, which limits the system's parallel processing capabilities and leads to overall inefficiency. Furthermore, the prioritization of message transmission and processing can result in uncontrollable transmission delays for lower-priority messages, potentially leading to severe delays or even data loss due to prolonged waiting times. Therefore, controlling GPIO to achieve efficient and timely multi-node message transmission has become a pressing issue that needs to be addressed. Summary of the Invention

[0004] To address the aforementioned issues, this application provides a method, apparatus, and system for controlling the GPIO interface status of multiple nodes, thereby enabling efficient and timely multi-node information transmission through GPIO control.

[0005] This application discloses a method for controlling the GPIO interface state of multiple nodes, the method comprising: Based on the GPIO interface input status and configuration information of the master node, as well as the values ​​of each virtual IO interface, the values ​​of each virtual IO interface are modified to obtain status data; the GPIO interface input status refers to the status of the GPIO interface of type input interface; the configuration information of the master node includes whether the GPIO interface of the master node is of type input interface or output interface, and the correspondence between the GPIO interface of the master node and each virtual IO interface; The status data is transmitted to the first node. If the GPIO interface of the first node is enabled, the values ​​of each virtual IO interface are modified and the status data is updated according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node. The first node is the node that is arranged one position after the master node in a multi-node system. The status data is transmitted downwards, passing through each node in the multi-node system, and the operation of updating the status data is performed in each node where the GPIO interface is enabled, until it is transmitted to the end node. If the GPIO interface of the end node is enabled, then a response output is generated based on the current status data and the configuration information of the end node; The current status data is transmitted to the second node. If the GPIO interface of the second node is enabled, the values ​​of each virtual IO interface are modified according to the current status data and the configuration information of the second node, the status data is updated, and a response output is generated. The second node is the node that is arranged one position before the end node in the multi-node system. The status data is transmitted upwards, passing through each node in the multi-node system, and the status data is updated in each node with the GPIO interface enabled, and a response is output, until it is transmitted to the master node. After a preset time has elapsed, the master node acquires the status data again and transmits it downwards.

[0006] Optionally, before modifying the values ​​of each virtual I / O interface based on the GPIO interface input status and configuration information of the master node, and the values ​​of each virtual I / O interface, the method further includes: Based on the GPIO data transmission requirements, enable the GPIO interfaces required by each node, and preset virtual IO interfaces according to the number of processing relationships between the GPIO interfaces of each node. Configure the GPIO interface of each node as either an input interface or an output interface; Configure the mapping between the GPIO interface of each node and the virtual IO interface to obtain the configuration information of each node.

[0007] Optionally, the step of transmitting the state data downwards through each node in the multi-node system and performing the operation of updating the state data in each node where the GPIO interface is enabled includes: The status data is transmitted to node a, which is located one position after the first node in the multi-node system; When the GPIO interface of node a is not enabled, the status data is not processed and the status data continues to be transmitted downwards. When the GPIO interface of node a is enabled, the operation of updating the status data is performed.

[0008] Optionally, setting the correspondence between the GPIO interface of each node and the virtual IO interface includes: When multiple nodes have GPIO interfaces of type input that correspond to the same first virtual IO interface, the value of the first virtual IO interface is a logical AND or logical OR of the GPIO interfaces of type input in the multiple nodes. When multiple virtual I / O interfaces correspond to an output interface in the GPIO interface of the same b node, the output interface in the GPIO interface of the b node outputs the values ​​of the multiple virtual I / O interfaces using a logical AND or logical OR operation.

[0009] Optionally, the preset time is greater than the time it takes for the status data to be transmitted downlink from the master node to the end node, and then uplink from the end node to the master node.

[0010] Optionally, when the bandwidth of the status data is greater than or equal to the preset bandwidth, the status data is transmitted in one go; when the bandwidth is less than the preset bandwidth, the status data is transmitted multiple times using time-division multiplexing.

[0011] Optionally, the register addresses of all nodes can be the same.

[0012] Optionally, the multi-node system is a daisy-chain topology.

[0013] Based on the above-mentioned method for controlling the GPIO interface state of multiple nodes, this application also discloses an apparatus for controlling the GPIO interface state of multiple nodes, including: a master node unit, a down-transmission unit, a end node unit, an up-transmission unit, and a repeat unit. The master node unit is used to modify the values ​​of each virtual IO interface according to the GPIO interface input status, configuration information, and values ​​of each virtual IO interface to obtain status data; the GPIO interface input status refers to the status of the GPIO interface of type input interface; the configuration information of the master node includes whether the GPIO interface of the master node is of type input interface or output interface, and the correspondence between the GPIO interface of the master node and each virtual IO interface; The down-transmission unit is used to transmit the status data to the first node. If the GPIO interface of the first node is enabled, the value of each virtual IO interface is modified and the status data is updated according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node. The first node is the node arranged one position after the master node in a multi-node system. The downward transmission unit is used to transmit the status data downward through each node in the multi-node system, and to perform the operation of updating the status data in each node with the GPIO interface enabled, until it is transmitted to the end node. The end node unit is used to respond and output according to the current status data and the configuration information of the end node if the GPIO interface of the end node is enabled. The up-transmission unit is used to transmit the current status data to the second node. If the GPIO interface of the second node is enabled, it modifies the values ​​of each virtual IO interface according to the current status data and the configuration information of the second node, updates the status data, and outputs a response. The second node is the node that is arranged one position before the end node in the multi-node system. The upward transmission unit is used to transmit the status data upward through each node in the multi-node system, and perform the operation of updating the status data in each node with the GPIO interface enabled, and respond with output, until it is transmitted to the master node. The repeating unit is used by the master node to acquire status data again and transmit it downwards after a preset time.

[0014] Optionally, the device further includes: The enable unit is used to enable the GPIO interfaces required by each node according to the GPIO data transmission requirements, and to preset virtual IO interfaces according to the number of processing relationships between the GPIO interfaces of each node. The configuration unit is used to set the type of the GPIO interface of each node as either an input interface or an output interface; The configuration unit is used to set the correspondence between the GPIO interface of each node and the virtual IO interface, thereby obtaining the configuration information of each node.

[0015] Optionally, the down-transmission unit includes: A downward transmission subunit is used to transmit the status data to node a, which is located one position after the first node in the multi-node system. The skip sub-unit is used to not process the status data and continue to transmit the status data downwards when the GPIO interface of node a is not enabled; The update subunit is used to perform the operation of updating state data when the GPIO interface of node a is enabled.

[0016] Optionally, the setting unit includes: The first subunit is used to set the value of the first virtual IO interface to be a logical AND or logical OR of the input interface type among the GPIO interfaces of the multiple nodes when the interfaces of the input interface type in the GPIO interfaces of the multiple nodes correspond to the same first virtual IO interface. The second subunit is used to perform a logical AND or logical OR operation on the output of the values ​​of the multiple virtual I / O interfaces when multiple virtual I / O interfaces correspond to the output interface of the same b-node's GPIO interface.

[0017] Optionally, the preset time is greater than the time it takes for the status data to be transmitted downlink from the master node to the end node, and then uplink from the end node to the master node.

[0018] Optionally, when the bandwidth of the status data is greater than or equal to the preset bandwidth, the status data is transmitted in one go; when the bandwidth is less than the preset bandwidth, the status data is transmitted multiple times using time-division multiplexing.

[0019] Optionally, the register addresses of all nodes can be the same.

[0020] Optionally, the multi-node system is a daisy-chain topology.

[0021] Based on the above-mentioned method for controlling the GPIO interface state of multiple nodes, this application also discloses a system for controlling the GPIO interface state of multiple nodes to implement the above method, including: a master controller, an external device, a master node, and a slave node; The main controller is connected to the GPIO interface of the master node, and the external device is connected to the GPIO interface of the slave node; The main controller transmits control information through the GPIO interface of the master node, and then transmits it to the external device via the GPIO interface of the slave node. The control information is used to control the output of the GPIO interface of the slave node; The external device reports status information through the GPIO interface of the slave node and then to the master controller via the GPIO interface of the master node; The status information is used to control the output of the GPIO interface of the master node.

[0022] This application discloses a method, apparatus, and system for controlling the GPIO interface status of multiple nodes. Based on the GPIO interface input status and configuration information of the master node, as well as the values ​​of each virtual IO interface, the values ​​of each virtual IO interface are modified to obtain status data. The required number of virtual IO interfaces is flexibly determined according to the number of GPIO interface processing relationships of each node, defining the necessary virtual IO interfaces to achieve effective resource utilization and dynamic adjustment. The input / output modes of each node's GPIO interface and their correspondence with virtual IO interfaces are configured, enhancing the system's flexibility and adaptability. The system can modify the values ​​of virtual IO interfaces and update the status data based on the status data, the node's GPIO interface input status, and the node's configuration information. The status data is transmitted downwards to the end nodes, updating the status containing the values ​​of each virtual interface through transmission and updating between nodes. The status data is then transmitted upwards and a response output is provided. After a preset time, the master node retrieves the status data again and transmits it downwards. The system can identify and process the GPIO status of each node in each cycle, ensuring the system's real-time response and processing capability to GPIO status changes. Effective management of the GPIO status of multiple nodes improves the system's scalability and multi-node processing capabilities. It can significantly improve the processing efficiency and response speed of the entire system, optimize overall performance, and achieve efficient and timely transmission and processing of GPIO status of multiple nodes. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0024] Figure 1a This is a flowchart illustrating a method for controlling the GPIO interface state of multiple nodes as disclosed in an embodiment of this application. Figure 1b This is a schematic diagram of the multi-node configuration disclosed in an embodiment of this application; Figure 2 This is a flowchart illustrating another method for controlling the GPIO interface state of multiple nodes disclosed in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a device for controlling the GPIO interface state of multiple nodes, as disclosed in an embodiment of this application. Figure 4 This is a schematic diagram of the structure of a system for controlling the GPIO interface status of multiple nodes, as disclosed in an embodiment of this application. Detailed Implementation

[0025] 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 only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] Example 1: This application discloses a method for controlling the GPIO interface state of multiple nodes.

[0027] For details, please refer to Figure 1a The method for controlling the GPIO interface state of multiple nodes disclosed in this embodiment includes the following steps: Step 101: Based on the GPIO interface input status and configuration information of the master node, as well as the values ​​of each virtual IO interface, modify the values ​​of each virtual IO interface to obtain status data.

[0028] In the method described in this embodiment, as an optional approach, the multi-node system adopts a daisy-chain topology, with the master node and each slave node connected sequentially. First, based on the GPIO data transmission requirements, the necessary GPIO interfaces of each node are enabled, and virtual IO interfaces are preset according to the number of processing relationships between the GPIO interfaces of each node. For example, if there are four processing relationships between the GPIOs of each node, then four virtual IO interfaces are preset and enabled.

[0029] In the method described in this embodiment, the type of the GPIO interface of each node is set to an input interface or an output interface, and the correspondence between the GPIO interface of each node and the virtual IO interface is set to obtain the configuration information of each node.

[0030] The GPIO interface input status refers to the status of the GPIO interfaces of type input. The master node's configuration information includes whether the master node's GPIO interfaces are of type input or output, and the correspondence between the master node's GPIO interfaces and each of the virtual IO interfaces. The register addresses of all nodes are consistent.

[0031] In the method described in this embodiment, as an optional approach, when setting the correspondence, if multiple nodes' GPIO interfaces of type input interface correspond to the same first virtual IO interface, the value of the first virtual IO interface is a logical AND, OR, or logical OR of the values ​​of the multiple nodes' GPIO interfaces of type input interface. Conversely, if multiple virtual IO interfaces correspond to the same node's GPIO interface of type output interface, the node's GPIO interface of type output interface outputs a logical AND, OR, or logical OR of the values ​​of the multiple virtual IO interfaces.

[0032] In the method described in this embodiment, each node is essentially a chip integrating multiple GPIO interfaces, the functions of which can be flexibly configured according to actual needs. It is worth noting that even if a specific GPIO interface is not enabled (i.e., not activated), since each GPIO interface has a pre-defined correspondence with various virtual IO interfaces, it is necessary to check whether the GPIO interface has been enabled when discussing these correspondences later. If it is not enabled, the correspondence is considered invalid in actual operation.

[0033] As an optional method, the GPIO interface information can be defined by setting the first information to indicate that the GPIO interface of each node is high, the second information to indicate that the GPIO interface of each node is low, the third information to indicate that the GPIO interface of each node is an input interface, and the fourth information to indicate that the GPIO interface of each node is an output interface. For example, the first information 0xFF indicates that the GPIO interface of each node is high, the second information 0x00 indicates that the GPIO interface of each node is low, the third information 0 indicates that the GPIO interface of each node is an input interface, and the fourth information 1 indicates that the GPIO interface of each node is an output interface.

[0034] Step 102: Transmit the status data to the first node. If the GPIO interface of the first node is enabled, modify the value of each virtual IO interface and update the status data according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node.

[0035] In the method described in this embodiment, when the bandwidth of the state data is greater than or equal to the preset bandwidth, the entire state data set is transmitted in one go without any intervals. When the bandwidth is less than the preset bandwidth, in order to ensure the integrity of the data and the reliability of the transmission, the state data can be transmitted multiple times by time-division multiplexing.

[0036] In the method described in this embodiment, the first node is the node arranged after the master node in a multi-node system. During downlink transmission, if each node enables its GPIO interface, it will identify the input status of each node's GPIO interface and modify the value of each virtual IO interface based on the current value of each virtual IO interface and the configuration information of each node. As an optional method, if the GPIO interface of the first node is enabled, the first node can obtain the current value of each virtual IO interface by parsing the transmitted status data. The first node modifies the value of each virtual IO interface according to the current value of each virtual IO interface, the input status of the first node's GPIO interface, and the first node's configuration information.

[0037] If a node does not enable its GPIO interface during downlink transmission, that node will not operate on the status data, but will continue to transmit it downlink.

[0038] Step 103: Transmit the status data downwards, through each node in the multi-node system, and perform the operation of updating the status data in each node where the GPIO interface is enabled, until it is transmitted to the end node.

[0039] In the method described in this embodiment, the status data is transmitted to node a, which is located one node after the first node in the multi-node system. When the GPIO interface of node a is not enabled, the status data is not processed, and the status data continues to be transmitted downwards. When the GPIO interface of node a is enabled, the operation of updating the status data is performed.

[0040] Step 104: If the GPIO interface of the end node is enabled, then respond and output according to the current status data and the configuration information of the end node.

[0041] Step 105: Transmit the current status data to the second node. If the GPIO interface of the second node is enabled, modify the values ​​of each virtual IO interface according to the current status data and the configuration information of the second node, update the status data, and output the response.

[0042] In the method described in this embodiment, the second node is the node preceding the end node in a multi-node system. If the GPIO interface of the second node is enabled, after receiving the transmitted current status data, the second node parses the status data to obtain the current values ​​of each virtual IO interface, and modifies the values ​​of each virtual IO interface according to the current values ​​of each virtual IO interface and the configuration information of the second node, and responds with output. During uplink transmission, the input status of each node's GPIO interface is not identified; the values ​​of each virtual IO interface are modified and the response is based solely on the current values ​​of each virtual IO interface and the configuration information of each node.

[0043] Step 106: Transmit the status data upwards, through each node in the multi-node system, and perform the operation of updating the status data in each node with the GPIO interface enabled, and output the response until it is transmitted to the master node.

[0044] Step 107: After a preset time, the master node acquires the status data again and transmits it downwards.

[0045] In the method described in this embodiment, the preset time is greater than the time required for status data to be transmitted downlink from the master node to the end node, and then uplink from the end node to the master node. For example, if it takes 20 μs for status data to be transmitted downlink from the master node to the end node and 20 μs for status data to be transmitted uplink from the end node to the master node, then the preset time should be greater than 40 μs.

[0046] In the method described in this embodiment, as an optional method, such as Figure 1b As shown, assume a multi-node system has one master node and four slave nodes, each with two GPIO interfaces. The master node's GPIO interfaces are GPIO0_0 and GPIO0_1, slave node 1's are GPIO1_0 and GPIO1_1, slave node 2's are GPIO2_0 and GPIO2_1, slave node 3's are GPIO3_0 and GPIO3_1, and slave node 4's are GPIO4_0 and GPIO4_1. Further assume 0xFF represents a high level for each node's GPIO interface, 0x00 represents a low level, 0 represents an input interface, and 1 represents an output interface. The GPIO interface configuration table for each node is as follows: Table 1 GPIO Interface Configuration Table

[0047] Assume there are two processing relationships between the GPIO interfaces of the master node and the four slave nodes: processing relationship 0 and processing relationship 1. Therefore, define two virtual IO interfaces, VIO_0 and VIO_1. Processing relationship 0 involves the master node's GPIO0_0 interface transmitting control information to the slave node's GPIO2_1 interface, where the output of slave node 2's GPIO2_1 interface equals the input of the master node's GPIO_0 interface. Processing relationship 1 involves both slave node 3's GPIO3_0 interface and slave node 4's GPIO4_0 interface reporting status information to the master node's GPIO0_1 interface, where the output of the master node's GPIO0_1 interface equals the logical OR of the inputs of slave node 3's GPIO3_0 interface and slave node 4's GPIO4_0 interface. The corresponding relationship table is as follows:

[0048] In the assumptions of the method described in this embodiment, GPIO1_0 of slave node 1 corresponds to VIO_0 by default, GPIO1_1 of slave node 1 corresponds to VIO_1 by default, GPIO2_0 of slave node 2 corresponds to VIO_0 by default, GPIO3_1 of slave node 3 corresponds to VIO_1 by default, and GPIO4_1 of slave node 4 corresponds to VIO_1 by default. However, since these GPIO interfaces are not enabled, the correspondence is invalid.

[0049] In the method described in this embodiment, it is assumed that initially, the GPIO interface states of each node are all low, that is, the values ​​of GPIO0_0, GPIO0_1, GPIO1_0, GPIO1_1, GPIO2_0, GPIO2_1, GPIO3_0, GPIO3_1, GPIO4_0, and GPIO4_1 are all 0x00, and the values ​​of VIO_0 and VIO_1 are also 0x00. The GPIO0_0 (input) interface and GPIO0_1 (output) interface of the master node are enabled, and GPIO0_0 corresponds to VIO_0, and GPIO0_1 corresponds to VIO_1.

[0050] When the GPIO0_0 (input) interface of the master node goes high (i.e., the value of GPIO0_0 becomes 0xFF), the value of VIO_0 also becomes 0xFF, while the value of VIO_1 remains 0x00, and status data is transmitted downlink to slave node 1. If both GPIO1_0 and GPIO1_1 interfaces of slave node 1 are disabled, slave node 1 does nothing; the value of VIO_0 is 0xFF, the value of VIO_1 is 0x00, and status data is transmitted downlink to slave node 2.

[0051] On node 2, GPIO2_0 (input) is disabled, while GPIO2_1 (output) is enabled, and GPIO2_1 corresponds to VIO_0. Since GPIO2_0 is used as an input interface on node 2 and is disabled, the values ​​of VIO_0 and VIO_1 remain unchanged; VIO_0 remains 0xFF, and VIO_1 remains 0x00. Downlink status data is transmitted to node 3. On node 3, GPIO3_0 (input) is enabled, while GPIO3_1 (output) is disabled, and GPIO3_0 corresponds to VIO_1. If the state of GPIO3_0 (input) on node 3 is still low (i.e., its value is still 0x00), then VIO_0 will be 0xFF, and VIO_1 will be 0x00. Downlink status data is transmitted to node 4.

[0052] If GPIO4_0 (input) is enabled on node 4, while GPIO4_1 (output) is disabled, and GPIO4_0 corresponds to VIO_1, and the state of GPIO4_0 (input) on node 4 goes high (i.e., the value of GPIO4_0 becomes 0xFF), then the value of VIO_0 and the value of VIO_1 also become 0xFF. At this point, node 4 is the end node, and its GPIO4_1 interface, acting as an output interface, is disabled and has no output response. Status data is then transmitted upstream to node 3.

[0053] On node 3, GPIO3_0 (input) is enabled, while GPIO3_1 (output) is disabled, and GPIO3_0 corresponds to VIO_1. GPIO3_1 on node 3 is used as an output interface but is disabled, resulting in no output response. During uplink transmission, the input state of GPIO3_0 on node 3 is not recognized; therefore, the value of VIO_0 and VIO_1 remains 0xFF. Uplink status data is transmitted to node 2. On node 2, GPIO2_0 (input) is disabled, while GPIO2_1 (output) is enabled, and GPIO2_1 corresponds to VIO_0. Therefore, the value of GPIO2_1 on node 2 changes to 0xFF, and the interface state of GPIO2_1 becomes high. GPIO2_0 on node 2 is used as an input interface but is disabled; the value of VIO_0 and VIO_1 remains 0xFF. Uplink status data is transmitted to node 1.

[0054] If both GPIO1_0 and GPIO1_1 interfaces on slave node 1 are disabled, slave node 1 performs no processing; the value of VIO_0 remains 0xFF, and the value of VIO_1 remains 0xFF. Uplink status data is transmitted to the master node. On the master node, GPIO0_0 (input) and GPIO0_1 (output) interfaces are enabled, with GPIO0_0 corresponding to VIO_0 and GPIO0_1 corresponding to VIO_1. During uplink transmission, the input state of the master node's GPIO0_0 interface is not recognized; the value of VIO_0 remains 0xFF, and the value of VIO_1 remains 0xFF. Therefore, the value of GPIO0_1 on the master node changes to 0xFF, and the interface state of GPIO0_1 becomes high.

[0055] The above is an example of the method described in this embodiment. The complete data transmission process involves changing the GPIO0_0 interface (input) of the master node to a high level, which in turn controls the GPIO2_1 interface (output) of slave node 2 to a high level. Similarly, when the GPIO3_0 interface (input) of slave node 3 or the GPIO4_0 interface (input) of slave node 4 is high, the GPIO0_1 interface (output) of the master node will also become high. This process identifies and processes the GPIO states of each node, achieving efficient and timely transmission and processing of the GPIO states of multiple nodes.

[0056] The method described in this embodiment achieves efficient GPIO state management by defining virtual I / O interfaces and flexibly configuring them according to the GPIO interface processing relationships of each node. It supports periodic state updates; at preset intervals, the master node automatically modifies the value of the virtual I / O interface based on the current state, ensuring that the GPIO states of all nodes are updated in a timely manner. It can identify and process the GPIO states of each node within each cycle, guaranteeing the timeliness of data transmission and processing. Furthermore, it possesses flexible configuration and scalability; according to the actual needs of each node, the virtual I / O interfaces and the input / output relationships of the GPIO interfaces can be flexibly defined and configured, easily expanding to adapt to node networks of different sizes. In addition, it achieves integrated control and distributed processing of multi-node GPIO states through a unified method, improving the overall efficiency and reliability of the system. It also enhances the system's scalability and multi-node processing capabilities.

[0057] Example 2: This application discloses another method for controlling the GPIO interface state of multiple nodes. Please refer to [link / reference]. Figure 2 This embodiment describes the method for transmitting data at various points.

[0058] Step 201: Based on the GPIO data transmission requirements, enable the GPIO interfaces required by each node, and preset virtual IO interfaces according to the number of processing relationships between the GPIO interfaces of each node.

[0059] In the method described in this embodiment, all GPIO interfaces of all nodes are enabled by default. In actual operation, nodes whose GPIO interfaces are not enabled do not operate on the status data, but directly pass the data to the next node.

[0060] Step 202: Set the type of the GPIO interface of each node to an input interface or an output interface, set the correspondence between the GPIO interface and the virtual IO interface of each node, and obtain the configuration information of each node.

[0061] Step 203: Based on the GPIO interface input status and configuration information of the master node, as well as the values ​​of each virtual IO interface, modify the values ​​of each virtual IO interface to obtain status data. Then transmit the status data to the next node.

[0062] In the method described in this embodiment, the next node is a node in the downlink transmission direction of a multi-node system.

[0063] Step 204: Determine if the receiving node is an end node. If yes, proceed to step 206. If no, proceed to step 205.

[0064] Step 205: Receive status data. Based on the current node's GPIO interface input status, configuration information, and the values ​​of each virtual IO interface, modify the values ​​of each virtual IO interface and update the status data. Then transmit the status data to the next node. Return to step 204.

[0065] Step 206: The end node modifies the values ​​of each virtual I / O interface based on the GPIO interface input status of the end node, the configuration information of the end node, and the values ​​of each virtual I / O interface, updates the status data, and responds with output.

[0066] Step 207: Transmit the status data to the previous node.

[0067] In the method described in this embodiment, the previous node is the node in the uplink transmission direction of the multi-node system.

[0068] Step 208: Modify the values ​​of each virtual I / O interface according to the configuration information of the receiving node and the values ​​of each virtual I / O interface, update the status data, and output the response.

[0069] Step 209: Determine if the receiving node is the master node. If yes, proceed to step 210. If no, proceed to step 207.

[0070] Step 209: After waiting for the preset time, return to step 203.

[0071] Based on the method for controlling the GPIO interface state of multiple nodes disclosed in the above embodiments, this embodiment correspondingly discloses an apparatus for controlling the GPIO interface state of multiple nodes. Please refer to... Figure 3 The device for controlling the GPIO interface state of multiple nodes includes: a master node unit 301, a down transmission unit 302, a last node unit 303, an up transmission unit 304, and a repeat unit 305. The master node unit 301 is used to modify the values ​​of each virtual IO interface according to the GPIO interface input status, configuration information, and values ​​of each virtual IO interface of the master node to obtain status data; the GPIO interface input status refers to the status of the GPIO interface of type input interface; the configuration information of the master node includes whether the GPIO interface of the master node is of type input interface or output interface, and the correspondence between the GPIO interface of the master node and each virtual IO interface; The down-transmission unit 302 is used to transmit the status data to the first node. If the GPIO interface of the first node is enabled, the value of each virtual IO interface is modified and the status data is updated according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node. The first node is the node arranged one position after the master node in the multi-node system. The downward transmission unit 302 is used to transmit the status data downward through each node in the multi-node system, and to perform the operation of updating the status data in each node with the GPIO interface enabled, until it is transmitted to the end node. The end node unit 303 is used to respond and output according to the current status data and the configuration information of the end node if the GPIO interface of the end node is enabled. The upward transmission unit 304 is used to transmit the current status data to the second node. If the GPIO interface of the second node is enabled, the values ​​of each virtual IO interface are modified according to the current status data and the configuration information of the second node to update the status data and respond with an output. The second node is the node that is arranged one position before the end node in the multi-node system. The upward transmission unit 304 is used to transmit the status data upward through each node in the multi-node system, and perform the operation of updating the status data in each node with the GPIO interface enabled, and respond and output, until it is transmitted to the master node. The repeating unit 305 is used by the master node to acquire status data again and transmit it downward after a preset time.

[0072] Optionally, the device further includes: The enable unit is used to enable the GPIO interfaces required by each node according to the GPIO data transmission requirements, and to preset virtual IO interfaces according to the number of processing relationships between the GPIO interfaces of each node. The configuration unit is used to set the type of the GPIO interface of each node as either an input interface or an output interface; The configuration unit is used to set the correspondence between the GPIO interface of each node and the virtual IO interface, thereby obtaining the configuration information of each node.

[0073] Optionally, the down-transmission unit includes: A downward transmission subunit is used to transmit the status data to node a, which is located one position after the first node in the multi-node system. The skip sub-unit is used to not process the status data and continue to transmit the status data downwards when the GPIO interface of node a is not enabled; The update subunit is used to perform the operation of updating state data when the GPIO interface of node a is enabled.

[0074] Optionally, the setting unit includes: The first subunit is used to set the value of the first virtual IO interface to be a logical AND or logical OR of the input interface type among the GPIO interfaces of the multiple nodes when the interfaces of the input interface type in the GPIO interfaces of the multiple nodes correspond to the same first virtual IO interface. The second subunit is used to perform a logical AND or logical OR operation on the output of the values ​​of the multiple virtual I / O interfaces when multiple virtual I / O interfaces correspond to the output interface of the same b-node's GPIO interface.

[0075] Optionally, the preset time is greater than the time it takes for the status data to be transmitted downlink from the master node to the end node, and then uplink from the end node to the master node.

[0076] Optionally, when the bandwidth of the status data is greater than or equal to the preset bandwidth, the status data is transmitted in one go; when the bandwidth is less than the preset bandwidth, the status data is transmitted multiple times using time-division multiplexing.

[0077] Optionally, the register addresses of all nodes can be the same.

[0078] Optionally, the multi-node system is a daisy-chain topology.

[0079] Based on the method for controlling the GPIO interface state of multiple nodes disclosed in the above embodiments, this embodiment discloses a system for controlling the GPIO interface state of multiple nodes to implement the above method. Please refer to... Figure 4 The system includes: a main controller, external devices, a master node, and slave nodes; The main controller is connected to the GPIO interface of the master node, and the external device is connected to the GPIO interface of the slave node; The main controller transmits control information through the GPIO interface of the master node, and then transmits it to the external device via the GPIO interface of the slave node. The control information is used to control the output of the GPIO interface of the slave node; The external device reports status information through the GPIO interface of the slave node and then to the master controller via the GPIO interface of the master node; The status information is used to control the output of the GPIO interface of the master node.

[0080] The embodiments in this specification are described in a progressive manner. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant details can be found in the method section.

[0081] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0082] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0083] The features described in the embodiments of this specification can be substituted for or combined with each other, so that those skilled in the art can implement or use this application.

[0084] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for controlling the GPIO interface state of multiple nodes, characterized in that, include: The virtual I / O interface is preset according to the number of processing relationships between the GPIO interfaces of each node; Configure the mapping between the GPIO interface of each node and the virtual IO interface to obtain the configuration information of each node; Based on the GPIO interface input status and configuration information of the master node, as well as the values ​​of each virtual IO interface, the values ​​of each virtual IO interface are modified to obtain status data; the GPIO interface input status refers to the status of the GPIO interface of type input interface; the configuration information of the master node includes whether the GPIO interface of the master node is of type input interface or output interface, and the correspondence between the GPIO interface of the master node and each virtual IO interface; The status data is transmitted to the first node. If the GPIO interface of the first node is enabled, the values ​​of each virtual IO interface are modified and the status data is updated according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node. The first node is the node arranged one position after the master node in the multi-node system. The multi-node system is a daisy-chain topology. The status data is transmitted downwards through each node in the multi-node system, and the status data update operation is performed in each node where the GPIO interface is enabled, until it is transmitted to the end node; when the GPIO interface of a node is not enabled, the status data is not processed, and the status data continues to be transmitted downwards. If the GPIO interface of the end node is enabled, then a response output is generated based on the current status data and the configuration information of the end node; The current status data is transmitted to the second node. If the GPIO interface of the second node is enabled, the values ​​of each virtual IO interface are modified according to the current status data and the configuration information of the second node, the status data is updated, and a response output is generated. The second node is the node that is arranged one position before the end node in the multi-node system. The status data is transmitted upwards, passing through each node in the multi-node system, and the status data is updated in each node with the GPIO interface enabled, and a response is output, until it is transmitted to the master node. After a preset time has elapsed, the master node acquires the status data again and transmits it downwards.

2. The method according to claim 1, characterized in that, Before modifying the values ​​of each virtual I / O interface based on the GPIO interface input status and configuration information of the master node, and the values ​​of each virtual I / O interface, the method further includes: Enable the required GPIO interfaces for each node according to the GPIO data transmission requirements; Configure the GPIO interface of each node as either an input interface or an output interface.

3. The method according to claim 1, characterized in that, The step of transmitting the state data downwards, through each node in the multi-node system, and performing the operation of updating the state data in each node where the GPIO interface is enabled, includes: The status data is transmitted to node a, which is located one position after the first node in the multi-node system; When the GPIO interface of node a is not enabled, the status data is not processed and the status data continues to be transmitted downwards. When the GPIO interface of node a is enabled, the operation of updating the status data is performed.

4. The method according to claim 1, characterized in that, The process of setting the correspondence between the GPIO interface and the virtual IO interface of each node includes: When multiple nodes have GPIO interfaces of type input that correspond to the same first virtual IO interface, the value of the first virtual IO interface is a logical AND or logical OR of the GPIO interfaces of type input in the multiple nodes. When multiple virtual I / O interfaces correspond to an output interface in the GPIO interface of the same b node, the output of the output interface in the GPIO interface of the b node is a logical AND or logical OR of the values ​​of the multiple virtual I / O interfaces.

5. The method according to claim 1, characterized in that, The preset time is greater than the time it takes for status data to be transmitted downlink from the master node to the end node, and then uplink from the end node to the master node.

6. The method according to any one of claims 1-5, characterized in that, When the bandwidth of the status data is greater than or equal to the preset bandwidth, the status data is transmitted in one go; when the bandwidth is less than the preset bandwidth, the status data is transmitted multiple times through time-division multiplexing.

7. The method according to any one of claims 1-5, characterized in that, The register addresses of all nodes are consistent.

8. A device for controlling the state of GPIO interfaces of multiple nodes, characterized in that, include: Enable unit, setting unit, master node unit, downward transmission unit, end node unit, upward transmission unit, and repeat unit; The enable unit is used to preset virtual I / O interfaces based on the number of processing relationships between the GPIO interfaces of each node; The configuration unit is used to set the correspondence between the GPIO interface of each node and the virtual IO interface, and to obtain the configuration information of each node; The master node unit is used to modify the values ​​of each virtual IO interface according to the GPIO interface input status, configuration information, and values ​​of each virtual IO interface to obtain status data; the GPIO interface input status refers to the status of the GPIO interface of type input interface; the configuration information of the master node includes whether the GPIO interface of the master node is of type input interface or output interface, and the correspondence between the GPIO interface of the master node and each virtual IO interface; The downlink unit is used to transmit the status data to the first node. If the GPIO interface of the first node is enabled, the value of each virtual IO interface is modified and the status data is updated according to the status data, the GPIO interface input status of the first node, and the configuration information of the first node. The first node is a node arranged one position after the master node in a multi-node system. The multi-node system is a daisy-chain topology. The downward transmission unit is used to transmit the status data downward through each node in the multi-node system, and to perform the operation of updating the status data in each node where the GPIO interface is enabled, until it is transmitted to the end node; when the GPIO interface of a node is not enabled, the status data is not processed, and the status data continues to be transmitted downward. The end node unit is used to respond and output according to the current status data and the configuration information of the end node if the GPIO interface of the end node is enabled. The up-transmission unit is used to transmit the current status data to the second node. If the GPIO interface of the second node is enabled, it modifies the values ​​of each virtual IO interface according to the current status data and the configuration information of the second node, updates the status data, and outputs a response. The second node is the node that is arranged one position before the end node in the multi-node system. The upward transmission unit is used to transmit the status data upward through each node in the multi-node system, and perform the operation of updating the status data in each node with the GPIO interface enabled, and respond with output, until it is transmitted to the master node. The repeating unit is used by the master node to acquire status data again and transmit it downwards after a preset time.

9. A system for controlling the GPIO interface state of multiple nodes, characterized in that, The method according to any one of claims 1-7 comprises: a main controller, an external device, a master node, and a slave node; The main controller is connected to the GPIO interface of the master node, and the external device is connected to the GPIO interface of the slave node; The main controller transmits control information through the GPIO interface of the master node, and then transmits it to the external device via the GPIO interface of the slave node. The control information is used to control the output of the GPIO interface of the slave node; The external device reports status information through the GPIO interface of the slave node and then to the master controller via the GPIO interface of the master node; The status information is used to control the output of the GPIO interface of the master node.

Citation Information

Patent Citations

  • Virtual general-purpose i / o controller

    CN106062714A

  • GPIO-TO-GPIO communication on a multi-node daisy-chained network

    CN107025200A