Communication method of equipment and target controller

By identifying and adjusting the voltage of external devices during the initialization process of the target controller of the Hub device, the communication abnormality caused by the inability to adaptively configure the voltage of the Hub device is solved, and dynamic identification and compatibility improvement of the device type are achieved.

CN120353750AActive Publication Date: 2025-07-22INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510859706.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-22
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

Existing Hub devices cannot adaptively configure the voltage of external devices, resulting in abnormal communication or damage to external devices, especially when hybrid access to different types of devices.

Method used

By sending a probe signal to each slave port during the initialization of the target controller, identifying the device type, and adjusting the voltage to the target voltage according to the type, ensuring that the device communicates at the optimal operating voltage.

Benefits of technology

Improves system compatibility and reliability, avoids equipment damage and communication abnormalities, and enhances system flexibility and energy efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353750A_ABST
    Figure CN120353750A_ABST
Patent Text Reader

Abstract

The invention discloses a device communication method and a target controller, and relates to the technical field of computers, and the method comprises the steps: in the initialization process of a target controller, after a detection signal is sent to an external device connected to each slave port, traversing the external device connected to each slave port, and according to the response condition of the external device to the detection signal, determining the target controller according to the response condition of the external device to the detection signal; and determining the device type of the external device connected to each slave port, adjusting the voltage of the external device to the target voltage according to the device type of the external device, and communicating with the external device under the target voltage. The technical problem that communication of the external equipment is abnormal due to the fact that the voltage of the external equipment cannot be adaptively configured in the related technology is solved, and the technical effect of improving system compatibility is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a communication method for devices and a target controller. Background Art

[0002] A Hub (hub) is a central device responsible for managing and coordinating multiple external devices, such as a USB Hub (Universal Serial Bus Hub), etc. It can expand the connection ability of a single network port so that it can connect multiple external devices. Through the Hub, multiple devices can communicate in the same network.

[0003] In the actual use of the Hub, it is quite common for different types of external devices to be mixed and connected to the Hub. However, the current Hub mainly adopts a static configuration method, usually by designing two different voltage domains, and only the same voltage can be fixedly applied within each voltage domain. It is impossible to configure a suitable voltage for the external device according to the actual situation of the external device. Once an external device is connected to a mismatched voltage domain, the device may be damaged or communication anomalies may occur.

[0004] In response to the above problems, there is currently no effective solution. Summary of the Invention

[0005] This application provides a communication method for devices and a target controller to at least solve the problem in the related art that the voltage of an external device cannot be adaptively configured, resulting in communication anomalies of the external device.

[0006] This application provides a communication method for devices, which is applied to a target controller. The target controller is connected to the main port of a hub, and multiple slave ports of the hub are used to connect external devices. The method includes: during the initialization process of the target controller, sending a detection signal to the external device connected to each slave port through each slave port, where the detection signal is used to request an external device of a target type to respond to the detection signal; determining the device type of the external device connected to each slave port according to the response situation of the external device connected to each slave port to the detection signal; adjusting the current voltage of the external device connected to each slave port to a target voltage corresponding to the device type, and communicating with the external device under the target voltage.

[0007] The present application also provides a target controller. The target controller is connected to the main port of a hub, and multiple slave ports of the hub are used to connect external devices, including: a sending module, configured to send a detection signal to an external device connected to each slave port during the initialization process of the target controller, where the detection signal is used to request the external device of a target type to respond to the detection signal; a determining module, configured to determine the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal; an adjusting module, configured to adjust the current voltage of the external device connected to each slave port to a target voltage corresponding to the device type, and communicate with the external device under the target voltage.

[0008] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of the communication method of any one of the above devices when executing the computer program.

[0009] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the communication method of any one of the above devices are implemented.

[0010] The present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the communication method of any one of the above devices are implemented.

[0011] Through the present application, during the initialization process of the target controller, after sending a detection signal to the external devices connected to each slave port, the external devices connected to each slave port are traversed. According to the response of the external devices to the detection signal, the device type of the external device connected to each slave port is determined. Furthermore, according to the device type of the external device, the voltage of the external device is adjusted to the target voltage, and communication is performed with the external device under the target voltage. Since the device type of the external device is dynamically identified through the detection signal, and the voltage and communication method of the external device are adaptively adjusted based on the device type of the external device, the problems of damage to the external device and abnormal communication caused by voltage mismatch when different types of external devices are mixedly connected to the hub are avoided. Therefore, the technical problem in the related art that the voltage of the external device cannot be adaptively configured, resulting in abnormal communication of the external device, can be solved, and the technical effect of improving the compatibility of the system can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0013] Figure 1 Hardware block diagram of a mobile terminal for a communication method of a device provided in an embodiment of the present application;

[0014] Figure 2 Flowchart of a communication method of a device provided in an embodiment of the present application;

[0015] Figure 3 Schematic diagram of the hub connection relationship provided in an embodiment of the present application;

[0016] Figure 4 Flowchart of the target controller dynamically managing the hub provided in an embodiment of the present application;

[0017] Figure 5 Block diagram of the target controller provided in an embodiment of the present application. Detailed implementation manners

[0018] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0019] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0020] In order to enable those skilled in the art in the technical field of the present application to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0021] In combination with the specific application environment architecture or specific hardware architecture on which the execution of the communication method of the device depends, the specific application environment architecture or specific hardware architecture will be described herein.

[0022] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 Hardware block diagram of a mobile terminal for a communication method of a device provided in an embodiment of the present application. As Figure 1 shown, the mobile terminal may include one or more (Figure 1 Only one processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data are shown. Among them, the above mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only schematic and does not limit the structure of the above mobile terminal. For example, the mobile terminal may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.

[0023] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the communication method of the device in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely provided with respect to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by the communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] Embodiments of the present application provide a communication method for a device. In combination with the execution process of the communication method of the device, the method is described in detail.

[0026] The following explains the professional terms in the embodiments of the present application:

[0027] BMC: Baseboard Management Controller, the baseboard management controller, responsible for the out-of-band management of the server.

[0028] An embodiment of the present application provides a communication method for a device. Figure 2 It is a flowchart of the communication method for the device provided by the embodiment of the present application. As Figure 2 shown, this method is applied to a target controller. The target controller is connected to the main port of a hub, and multiple slave ports of the hub are used to connect external devices. The specific process includes the following steps:

[0029] Step S202, during the initialization of the target controller, send a detection signal to the external device connected to each slave port through each slave port, where the detection signal is used to request the external device of the target type to respond to the detection signal.

[0030] In the embodiment of the present application, the target controller can be a central device responsible for managing and coordinating multiple external devices, including communicating with multiple external devices of the same or different types through a hub, such as sending commands, data, or requests to the external devices and receiving their responses, etc. For example, the target controller can be a microcontroller (MCU) or a baseboard management controller (BMC), etc.

[0031] In the embodiment of the present application, a hub can be a network device or an interface device. Its main function is to connect multiple devices so that the connected multiple devices can communicate with each other. The hub itself usually does not process or change signals, but simply transmits signals to the connected devices. For example, the hub can be a USB Hub (Universal Serial Bus Hub). The USB Hub includes a main port for connecting to the target controller and multiple slave ports for connecting to multiple external devices. Each slave port can support external devices of different types (i.e., using different communication protocols). The external devices currently connected to each slave port must be of the same type (i.e., using the same communication protocol). For example, if the external device connected to slave port 1 of hub A is another hub B (specifically, connecting to the main port of hub B), at this time, it is only necessary to ensure that the external devices connected to the slave ports of hub B are of the same type, and the specific device type of the external device connected to slave port 1 of hub A is not restricted (i.e., the specific device type of the external devices connected to the slave ports of hub B is not restricted). The USB Hub transmits signals to each connected device through these ports.

[0032] In the embodiment of the present application, the external device can be any hardware device that needs to communicate with the target controller, used to expand the functions of the target controller or provide additional services, such as sensors, actuators, storage devices, etc.

[0033] In the embodiments of the present application, the detection signal may be a signal used to identify, test, or configure the presence, type, and status of an external device, so as to ensure that the target controller can correctly interact with each device. Among them, the detection signal is sent to the external device connected to each slave port through each slave port. For example, the detection signal may be a broadcast signal sent by the BMC through a broadcast address (such as 0x7E).

[0034] During the initialization process of the target controller (that is, during the initialization process of the target controller controlling the hub), the target controller will send a detection signal to the external device connected to each slave port through each slave port. For example, the target controller will send a broadcast signal to the external device connected to each slave port through a broadcast address (such as 0x7E).

[0035] Step S204, determine the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal;

[0036] In the embodiments of the present application, the response to the detection signal may be the feedback made by the external device based on the detection signal.

[0037] Optionally, determining the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal includes: when the external device returns a target response to the detection signal, determining that the external device is a first device of the target type, where the first device communicates with the target controller using a first communication protocol, and the detection signal is a signal sent based on the first communication protocol; when the external device does not return a target response to the detection signal, determining that the external device is a second device of other types, where the other type is a device type other than the target type, and the second device communicates with the target controller using a second communication protocol, and the second device cannot operate normally under the current voltage.

[0038] In the embodiments of the present application, the first device may be a device of the target type, such as an I3C device, that is, a device that communicates using the I3C communication protocol (that is, the first communication protocol); the second device may be a device of other types, such as an I2C device, that is, a device that communicates using the I2C communication protocol (that is, the second communication protocol).

[0039] For example, when the BMC sends a broadcast signal through a broadcast address (such as 0x7E), if the external device can recognize the broadcast address 0x7E, the external device will make a corresponding response to the detection signal, including returning an acknowledgement signal (such as returning an ACK response), etc.; if the external device cannot recognize the broadcast address 0x7E, the external device will ignore the message with the broadcast address 0x7E and will not give any feedback (that is, return a NACK response, indicating that there is no I3C device present). At this time, the target controller will not receive any signal from this slave port. Thus, the BMC can determine the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal, and further take corresponding management measures, such as adjusting the voltage domain, enabling functions such as a proxy, etc. It should be noted that if no external device is connected to the slave port, no feedback will be given to the detection signal sent by the target controller either.

[0040] Through the above content, based on the target response of the external device returned for the detection signal, the target controller can automatically distinguish between the first device and the second device (such as I3C and I2C devices), without manual configuration or user intervention, improving the intelligence level and user experience of the system. At the same time, by automatically identifying devices with different communication protocols, it is ensured that the system can be compatible with multiple device types, enabling the system to adapt to the ever-changing peripheral ecosystem, support more device access, and enhancing the reliability and flexibility of the system.

[0041] Step S206: Adjust the current voltage of the external device connected to each slave port to the target voltage corresponding to the device type, and communicate with the external device at the target voltage.

[0042] In the application embodiment, the current voltage can be the initial voltage of the external device, and this current voltage can be the voltage that the target controller defaults to load for the external device at the beginning of initialization; the target voltage can be the operating voltage when the external device operates normally, and different types of external devices have different voltage requirements. For example, for an I2C device, the target voltage is 3.3V, and for an I3C device, the target voltage is 1.8V, etc.

[0043] In the embodiment of the present application, the voltage of the external device on each slave port is adjusted according to the device type of the external device on each slave port, and the current voltage is adjusted to the target voltage, so as to communicate with the external device at the target voltage, ensuring that each external device operates normally at its optimal operating voltage and can communicate effectively.

[0044] Optionally, the execution entity of the above steps may be a background processor, or other devices with similar processing capabilities, or may also be a machine integrating at least an image acquisition device and a data processing device. Among them, the image acquisition device may include a graphic acquisition module such as a camera, and the data processing device may include terminals such as a computer and a mobile phone, but is not limited thereto.

[0045] Through the above steps, during the initialization of the target controller, after sending a detection signal to the external devices connected to each slave port, traverse the external devices connected to each slave port, and determine the device type of the external devices connected to each slave port according to the response of the external devices to the detection signal. Then, adjust the voltage of the external devices to the target voltage according to the device type of the external devices, and communicate with the external devices at the target voltage. Since the device type of the external devices is dynamically identified through the detection signal, and the voltage and communication method of the external devices are adaptively adjusted based on the device type of the external devices, it avoids the problems of damage to the external devices and communication anomalies caused by voltage mismatch or communication protocol differences when different types of external devices are mixedly connected to the hub. It solves the technical problem in the related art that the voltage of the external devices cannot be adaptively configured, resulting in communication anomalies of the external devices, and improves the compatibility of the system.

[0046] As an optional implementation manner, before sending a detection signal to the external devices connected to each slave port through each slave port, the above method further includes: applying a first voltage to the external devices connected to each slave port, where the first voltage is the voltage that ensures the normal operation of the first device, and the current voltage includes the first voltage; adjusting the current voltage of the external devices connected to each slave port to the target voltage corresponding to the device type, including: in the case where the external device is a second device, adjusting the first voltage applied to the second device to a second voltage, where the second voltage is the voltage that ensures the normal operation of the second device, and the target voltage includes the second voltage.

[0047] In the embodiment of the present application, the first voltage may be the voltage that the target controller defaults to load to the external device at the beginning of initialization, and this first voltage may be the voltage that ensures the normal operation of the first device. For example, if the first device is an I3C device, the first voltage may be 1.8V; the second voltage may be the voltage that ensures the normal operation of the second device. For example, if the second device is an I2C device, the second voltage may be 3.3V.

[0048] Exemplarily, taking the first device and the second device as an I3C device and an I2C device respectively, in order to preferentially meet the power supply requirements of the I3C device, during the power-on initialization stage (i.e., the BMC initialization stage), the system (i.e., the BMC) will forcibly load a 1.8V VIOS voltage (the first voltage) on the external devices on each slave port; after sending the detection signal, if the external device is detected as an I3C device through the detection signal, there is no need to make any adjustment to the current voltage of the I3C device. If the external device is detected as an I2C device through the detection signal, the system will immediately activate the 3.3V VDDIN power supply module and adjust the current voltage (i.e., the first voltage) of the I2C device to the second voltage (i.e., the target voltage), so as to provide a suitable working voltage for the I2C device.

[0049] Through the above content, by adopting the method of switching the voltage domain on demand, it avoids the voltage domain conflict problem caused by the difference between the pre-determined voltage domain of the slave port and the voltage required by the actually connected external device in the static configuration mode, and ensures that all types of devices can operate efficiently and stably under the most suitable conditions. At the same time, dynamically adjusting the power supply according to the actual connection situation of the external device effectively reduces the static power consumption of the system and improves the energy utilization efficiency.

[0050] As an optional implementation manner, communicating with the external device at the target voltage includes: determining the device type of the target device that will receive the target instruction sent by the target controller, where the target instruction is used to request the target information required by the target controller from the target device, and the external device includes the target device; sending the target instruction to the target device at the target voltage according to the device type of the target device.

[0051] In the embodiment of the present application, the target device can be a device that will receive the instruction sent by the target controller, and this device can be an external device of any device type, such as an I2C device, an I3C device, etc.

[0052] In the embodiment of the present application, the target instruction can be an instruction for communicating with the external device (i.e., the target device) at the target voltage, and the purpose of the target instruction can be to request the target information required by the target controller from the target device. Among them, the specific content and format of the target instruction usually depend on the device type of the target device and the communication protocol supported by the target device.

[0053] Exemplarily, before the BMC is ready to send the target instruction to the target device, first determine the device type of the target device that will receive the target instruction, and then send the target instruction to the target device based on the device type of the target device.

[0054] Through the above, it is possible to ensure that the instructions sent are instructions that the target device can understand and process, reducing errors and data loss in communication, reducing the possibility of sending incorrect instructions, thereby reducing the risk of communication anomalies, increasing the reliability of communication, and improving the overall communication efficiency of the system. At the same time, it can ensure that the system supports different types of external devices to communicate with the target controller, enhancing the compatibility and flexibility of the system, enabling the system to adapt to various device configurations.

[0055] As an optional implementation, according to the device type of the target device, sending a target instruction to the target device under the target voltage includes at least one of the following: in the case where the target device is a first device of the target type, determining the first address of the target device; sending the target instruction to the target device according to the first address; in the case where the target device is a second device of other types except the target type, determining the target proxy of the target device; sending the target instruction to the target device through the target proxy.

[0056] In the embodiments of the present application, the first address may be the unique identification address that the first device has in the network, which is mainly used to locate the first device and communicate with the first device; the target proxy may be a communication intermediary between the target controller and the second device, such as an SMBus Agent, etc., which is mainly used to forward the target instruction sent by the target controller to the second device, so that the second device can recognize the target instruction sent by the target controller and ensure normal communication with the second device.

[0057] For example, taking the first device and the second device as an I3C device and an I2C device respectively, since the I3C device uses the I3C protocol (i.e., the first communication protocol) for communication and the I2C device uses the I2C protocol (i.e., the second communication protocol) for communication, therefore, in order to achieve efficient communication between the I2C device and the I3C device, in the case where the target device is an I3C device (the first device), the transparent mode is adopted, that is, the I3C MCTP protocol is used to enable the BMC to directly communicate with the I3C device, including determining the physical address (i.e., the first address) of the first device (i.e., the target device) in the network and directly sending the target instruction to the target device according to the first address; in the case where the target device is an I2C device (the first device), the indirect access mode is adopted, that is, the MCTP protocol through SMBUS is used to communicate indirectly with the I2C device, including determining the target proxy related to the second device (i.e., the target device) and sending the target instruction to the second device through the target proxy, so as to perform communication protocol conversion and target instruction forwarding through the target proxy to achieve communication with the I2C device.

[0058] Through the above, the first device uses the direct communication method, making full use of the high-speed transmission characteristics of the first communication protocol to achieve fast and stable data transmission; while for the second device, the indirect access method is adopted, and the target proxy is used as the communication intermediary to effectively manage and coordinate the instruction transmission between the target controller and the second device, prevent instruction loss or mistransmission, and improve the reliability and stability of the system. Different communication strategies are adopted for different device types to ensure that different types of devices can communicate efficiently and stably in the same system, guarantee efficient communication between devices, and improve the compatibility and stability of the system.

[0059] Optionally, sending a target instruction to a target device through a target proxy includes: encapsulating a first instruction to obtain a target instruction, where the first instruction is an instruction recognizable by the second device, and the target instruction includes the first instruction and a second address of the target device; sending the target instruction to the target proxy to instruct the target proxy to parse the target instruction and send the first instruction to the target device according to the second address.

[0060] In the embodiment of the present application, the second address may be a unique identification address of the second device in the network, which is mainly used to locate the second device and communicate with the second device; the first instruction may be an instruction obtained by encapsulating the target instruction, where the first instruction includes the second address and the target instruction.

[0061] Exemplarily, in the case where the target controller needs to send a target instruction to the second device, the target controller (such as BMC) encapsulates the SMBus instruction (i.e., the first instruction) through the I3C command to obtain the target instruction, and sends the target instruction to the target proxy through the I3C communication protocol (i.e., the first communication protocol), so that the target proxy parses the target instruction to obtain the SMBus command and the second address of the second device (i.e., the target device), and based on the second communication protocol (including the SMBus protocol), sends the first instruction to the target device according to the second address to complete the communication between the target controller and the second device.

[0062] As an optional implementation, for I2C devices (i.e., the second devices), when multiple I2C devices share the same bus, it is possible that the addresses of multiple I2C devices are the same, resulting in address conflicts and communication failures. At this time, the address conflicts of I2C devices can be managed through the SMBus Agent (i.e., the target agent). Specifically, it includes: the target agent assigns a unique virtual address to each I2C device. When the BMC (i.e., the target controller) needs to communicate with an I2C device, the SMBus Agent uses the assigned virtual address instead of the actual I2C address of the device for communication. After the SMBus Agent receives an instruction from the BMC, it forwards the instruction to the correct I2C device according to the internally preset target mapping relationship table, where the target mapping relationship table includes the mapping relationship between the I2C device and the corresponding virtual address, thereby avoiding address conflicts through virtual address differentiation.

[0063] For I3C devices (i.e., the first devices), it is also possible that the addresses of multiple I3C devices are the same. At this time, the address conflicts of I3C devices can be avoided by controlling the target register (such as REG81) of the network topology structure (Hub Network) of the hub. Specifically, it includes: controlling the network connection of the Hub (i.e., the hub) through the REG81 register, so as to ensure that each I3C device has a unique address space in its corresponding Hub network, thereby effectively avoiding address conflicts between I3C devices and achieving address isolation.

[0064] Through the above content, the address conflict problems that may be encountered by I2C and I3C devices when sharing a bus are effectively solved. At the same time, by setting the REG18 register, the continuous detection and management capabilities of the system for all slave ports are ensured, realizing the efficient and dynamic control of multiple types of devices, and ensuring the communication reliability between devices and the overall stability of the system in a complex system mixed with I2C and I3C devices.

[0065] As an optional implementation, after sending a target instruction to the target agent to instruct the target agent to parse the target instruction and send a first instruction to the target device according to the second address, the above method further includes: receiving a first message sent by the target agent, where the first message is used to indicate that there is target information to be returned in the target agent; obtaining the target information from the target agent according to the first message.

[0066] In the embodiments of the present application, the above first message may be a message used to indicate whether the first instruction has been successfully transmitted, and the first message may include whether there is information required by the target controller in the second device (i.e., the target device).

[0067] Exemplarily, after the target agent sends the first instruction to the second device, the second device responds to the first instruction and returns the response data to the target agent. At this time, the target agent does not immediately directly transfer the data to the target controller, but sends an interrupt signal (i.e., the first message) to the target controller through the IBI mechanism. This interrupt signal will tell the target controller that there is data waiting to be read. After receiving the IBI interrupt signal, the target controller will know that the target agent has data to return, and then the target controller will actively request data from the target agent through the I3C bus. After receiving the data acquisition request from the target controller, the target agent forwards the data obtained from the second device in the format of the I3C protocol to the target controller, realizing that the target controller reads and processes the response data of the second device.

[0068] Through the above content, the target controller is notified through the interrupt signal, enabling the target controller to selectively request data at an appropriate time, reducing unnecessary data transmission, and avoiding unnecessary polling or waiting, thereby optimizing resource utilization and improving the overall efficiency of the system. At the same time, a unified communication protocol (i.e., the first communication protocol) can be used to transmit data, improving the reliability and consistency of data transmission, reducing the chance of errors occurring, and simplifying the complexity of system expansion.

[0069] As an alternative implementation Figure 3 The following is a schematic diagram of the hub connection relationship provided by the embodiment of the present application. As Figure 3 shown, the BMC (i.e., the target controller) is connected to the main port of the hub (including Hub 1, Hub 2, etc.). The slave ports of the hub are respectively connected to different external devices. There is a corresponding SMBus Agent (agent) between each slave port and its corresponding external device. Among them, the hub communicates with the BMC through the I3C protocol (i.e., the first communication protocol), and different communication protocols are used between the hub and the external devices. For example, when the external device is an I3C device (i.e., the first device), the hub directly forwards the data (i.e., the target instruction) sent by the BMC to the I3C device through the I3C protocol; when the external device is an I2C device (i.e., the second device), the hub forwards the data sent by the BMC to the agent corresponding to the I2C device through the I3C protocol, and the data is forwarded to the I2C device through the corresponding agent.

[0070] As an alternative implementation Figure 4 The following is a flowchart of the target controller dynamically managing the hub provided by the embodiment of the present application. As Figure 4 shown, the specific process is as follows:

[0071] S401. During the initialization of the BMC (i.e., the target controller), uniformly force the voltage of the external devices on each slave port of the Hub (i.e., the hub) to the VIOS voltage of 1.8V (i.e., the first voltage).

[0072] S402. Send a detection signal to the external devices on all slave ports through the I3C broadcast address 0x7E.

[0073] S403. Scan and traverse the external devices on each slave port, and judge the response of each external device to the detection signal.

[0074] S404. If the BMC receives an ACK response (i.e., the external device returns the target response to the detection signal), determine that the external device is an I3C device (i.e., the first device), and continue to execute the following steps. If the BMC receives a NACK response (i.e., the external device does not return the target response to the detection signal), determine that the external device is an I2C device (i.e., the second device) or no external device is connected, and jump to S406.

[0075] S405. Enter the transparent mode, do not adjust the current voltage (i.e., the first voltage), and directly communicate with the I3C device using the I3C communication protocol (i.e., the first communication protocol), and use network connection control to achieve address isolation between different external devices.

[0076] S406. Enter the indirect access mode, pull up the current voltage (i.e., the first voltage) to VDDIN = 3.3V (i.e., the target voltage, including the second voltage), and after communicating with the target proxy through the I3C protocol, indirectly communicate with the I2C device through the target proxy using the SMBus communication protocol (i.e., the second communication protocol). At the same time, achieve address isolation between different external devices through the preset target mapping table in the target proxy.

[0077] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.

[0078] The embodiments of the present application also provide a target controller, which is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the target controller described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0079] Figure 5The structural block diagram of the target controller provided by the embodiment of the present application is as follows. Figure 5 As shown, the target controller is connected to the main port of the hub, and multiple slave ports of the hub are used to connect external devices, including: a sending module 502, configured to send a detection signal to an external device connected to each slave port through each slave port during the initialization process of the target controller, where the detection signal is used to request the external device of the target type to respond to the detection signal; a determination module 504, configured to determine the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal; an adjustment module 506, configured to adjust the current voltage of the external device connected to each slave port to a target voltage corresponding to the device type, and communicate with the external device under the target voltage.

[0080] As an optional implementation manner, the target controller is further configured to determine that the external device is a first device of the target type when the external device returns a target response to the detection signal, where the first device communicates with the target controller using a first communication protocol, and the detection signal is a signal sent based on the first communication protocol; determine that the external device is a second device of other types when the external device does not return a target response to the detection signal, where the other type is a device type other than the target type, the second device communicates with the target controller using a second communication protocol, and the second device cannot operate properly at the current voltage.

[0081] As an optional implementation manner, the target controller is further configured to apply a first voltage to the external device connected to each slave port, where the first voltage is a voltage that ensures the normal operation of the first device, and the current voltage includes the first voltage; when the external device is a second device, adjust the first voltage applied to the second device to a second voltage, where the second voltage is a voltage that ensures the normal operation of the second device, and the target voltage includes the second voltage.

[0082] As an optional implementation manner, the target controller is further configured to determine the device type of the target device that will receive the target instruction sent by the target controller, where the target instruction is used to request the target device to obtain the target information required by the target controller, and the external device includes the target device; send the target instruction to the target device under the target voltage according to the device type of the target device.

[0083] As an optional implementation manner, the target controller is further configured to determine the first address of the target device when the target device is a first device of the target type; send the target instruction to the target device according to the first address; when the target device is a second device of other types other than the target type, determine the target proxy of the target device; send the target instruction to the target device through the target proxy.

[0084] As an optional implementation manner, the target controller is further configured to encapsulate the first instruction to obtain a target instruction, where the first instruction is an instruction recognizable by the second device, and the target instruction includes the first instruction and the second address of the target device; send the target instruction to the target agent to instruct the target agent to parse the target instruction and send the first instruction to the target device according to the second address.

[0085] As an optional implementation manner, the target controller is further configured to receive a first message sent by the target agent, where the first message is used to indicate that there is target information to be returned in the target agent; obtain the target information from the target agent according to the first message.

[0086] For the description of the features in the embodiments corresponding to the target controller, reference may be made to the relevant descriptions in the embodiments corresponding to the communication method of the device, which will not be elaborated here one by one.

[0087] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above embodiments of the communication method of the device.

[0088] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above embodiments of the communication method of the device when running.

[0089] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs that can store computer programs.

[0090] An embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, and the computer program implements the steps in any one of the above embodiments of the communication method of the device when executed by a processor.

[0091] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and the computer program implements the steps in any one of the above embodiments of the communication method of the device when executed by a processor.

[0092] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0093] The communication method of a device and the target controller provided in this application have been introduced in detail above. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A communication method for a device, characterized in that, Applied to a target controller, wherein the target controller is connected to the main port of a hub, and multiple slave ports of the hub are used to connect external devices. The communication method of the devices includes: During the initialization process of the target controller, a detection signal is sent to the external devices connected to each of the slave ports through each of the slave ports, wherein the detection signal is used to request the external devices of a target type to respond to the detection signal; According to the response conditions of the external devices connected to each of the slave ports to the detection signal, determine the device types of the external devices connected to each of the slave ports; Adjust the current voltage of the external devices connected to each of the slave ports to a target voltage corresponding to the device type, and communicate with the external devices under the target voltage.

2. The communication method of the device according to claim 1, characterized in that, According to the response conditions of the external devices connected to each of the slave ports to the detection signal, determining the device types of the external devices connected to each of the slave ports includes: In the case where the external device returns a target response to the detection signal, determine that the external device is a first device of the target type, wherein a first communication protocol is used for communication between the first device and the target controller, and the detection signal is a signal sent based on the first communication protocol; In the case where the external device does not return a target response to the detection signal, determine that the external device is a second device of other types, wherein the other types are device types other than the target type, and a second communication protocol is used for communication between the second device and the target controller, and the second device cannot operate normally under the current voltage.

3. The communication method of the device according to claim 2, characterized in that, Before sending a detection signal to the external devices connected to each of the slave ports through each of the slave ports, the method further includes: Applying a first voltage to the external devices connected to each of the slave ports, wherein the first voltage is a voltage that ensures the normal operation of the first device, and the current voltage includes the first voltage; Adjusting the current voltage of the external devices connected to each of the slave ports to a target voltage corresponding to the device type includes: In the case where the external device is the second device, adjusting the first voltage applied to the second device to a second voltage, wherein the second voltage is a voltage that ensures the normal operation of the second device, and the target voltage includes the second voltage.

4. The communication method of the device according to claim 1, characterized in that Communicating with the external devices under the target voltage includes: Determine the device type of the target device that will receive the target instruction sent by the target controller, wherein the target instruction is used to request the target device to obtain the target information required by the target controller, and the external devices include the target device; Send the target instruction to the target device under the target voltage according to the device type of the target device.

5. The communication method of the device according to claim 4, characterized in that, Sending the target instruction to the target device under the target voltage according to the device type of the target device includes at least one of the following: In the case where the target device is a first device of the target type, determine a first address of the target device; send the target instruction to the target device according to the first address; In the case where the target device is a second device of a type other than the target type, determine a target proxy of the target device; Send the target instruction to the target device through the target proxy.

6. The communication method of the device according to claim 5, characterized in that, Sending the target instruction to the target device through the target proxy includes: Encapsulate a first instruction to obtain the target instruction, where the first instruction is an instruction recognizable by the second device, and the target instruction includes the first instruction and a second address of the target device; Send the target instruction to the target proxy to instruct the target proxy to parse the target instruction and send the first instruction to the target device according to the second address.

7. The communication method of the device according to claim 6, characterized in that, After sending the target instruction to the target proxy to instruct the target proxy to parse the target instruction and send the first instruction to the target device according to the second address, the method further includes: Receive a first message sent by the target proxy, where the first message is used to indicate that there is target information to be returned in the target proxy; Obtain the target information from the target proxy according to the first message.

8. A target controller, characterized in that, The target controller is connected to the main port of the hub, and multiple slave ports of the hub are used to connect external devices, including: A sending module, configured to, during the initialization process of the target controller, send a detection signal to an external device connected to each slave port through each slave port, where the detection signal is used to request an external device of the target type to respond to the detection signal; A determining module, configured to determine the device type of the external device connected to each slave port according to the response of the external device connected to each slave port to the detection signal; An adjusting module, configured to adjust the current voltage of the external device connected to each slave port to a target voltage corresponding to the device type, and communicate with the external device under the target voltage.

9. An electronic device, characterized in that, including: A memory, configured to store a computer program; A processor, configured to implement the steps of the communication method of the device according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program, when executed by a processor, implements the steps of the communication method of the device according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Adaptive voltage scaling using a serial interface

    CN103324266A

  • Method and device for adaptively driving serial port of equipment and serial port equipment

    CN114490454A

  • USB hub host detection

    US20170270067A1