Communication method of device and target controller

By identifying the external device type and adjusting the voltage during the initialization process, the communication abnormality caused by the Hub device's inability to adaptively configure the voltage is solved, and the system's high compatibility and reliability are achieved.

CN120353750BActive Publication Date: 2025-08-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510859706.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-08-26
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 between external devices.

Method used

The target controller sends a detection signal to each slave port during initialization, identify the external device type, and adjusts the voltage to the target voltage according to the type for communication.

Benefits of technology

It avoids damage and communication abnormalities caused by voltage mismatch of external devices, and improves system compatibility and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353750B_ABST
    Figure CN120353750B_ABST
Patent Text Reader

Abstract

The present application discloses a device communication method and a target controller, which relate to the field of computer technology. The method includes sending a detection signal to each external device connected to a slave port during the target controller initialization process, traversing each external device connected to the slave port, determining the device type of each external device connected to the slave port according to the response of the external device to the detection signal, and then adjusting the voltage of the external device to a target voltage according to the device type of the external device, and communicating with the external device at the target voltage. The method solves 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, and achieves the technical effect of improving system compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a communication method and a target controller of a device. Background Art

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

[0003] In the actual use of the Hub, it is common to connect different types of external devices to the Hub. However, the current Hub mainly adopts a static configuration method, usually designing two different voltage domains. Only the same voltage can be applied to each voltage domain. It is impossible to configure the appropriate voltage for the external device according to the actual situation of the external device. Once an external device is connected to an incompatible voltage domain, it may damage the device or cause communication abnormalities.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

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

[0006] The present application provides a communication method for a device, which is applied to a target controller, wherein the target controller is connected to a master port of a hub, and multiple slave ports of the hub are used to connect to external devices, including: 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, wherein the detection signal is used to request the external device of the target type to respond to the detection signal; determining the device type of the external device connected to each slave port based on the response 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 at the target voltage.

[0007] The present application also provides a target controller, which is connected to the master port of the hub, and the multiple slave ports of the hub are used to connect external devices, including: a sending module, which is used to send a detection signal to the external device connected to each slave port through each slave port during the initialization process of the target controller, wherein the detection signal is used to request the external device of the target type to respond to the detection signal; a determination module, which is used to determine the device type of the external device connected to each slave port based on the response of the external device connected to each slave port to the detection signal; and an adjustment module, which is used 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 at the target voltage.

[0008] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned communication methods 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 of the above-mentioned devices are implemented.

[0010] The present application also provides a computer program product, including a computer program, which implements the steps of the communication method of any of the above devices when the computer program is executed by a processor.

[0011] Through this application, during the target controller initialization process, after sending a detection signal to each external device connected to the slave port, the external device connected to each slave port is traversed, and the device type of each external device connected to the slave port is determined based on the external device's response to the detection signal. Then, the voltage of the external device is adjusted to the target voltage based on the device type of the external device, and communication is performed with the external device at the target voltage. Since the device type of the external device is dynamically identified by 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 problem of external device damage and communication anomalies caused by voltage mismatch when the hub is mixed with different types of external devices is avoided. Therefore, the technical problem of the inability to adaptively configure the voltage of the external device, which leads to communication anomalies of the external device, can be solved in the related art, thereby achieving the technical effect of improving the compatibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

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

[0014] Figure 2 A flow chart of a communication method for a device provided in an embodiment of the present application;

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

[0016] Figure 4 A flow chart of a target controller dynamically managing a hub provided in an embodiment of the present application;

[0017] Figure 5 This is a structural block diagram of the target controller provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

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

[0020] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0021] In conjunction 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 is described here.

[0022] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure diagram of a mobile terminal for a communication method of a device provided in an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. The mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[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 embodiment 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, implementing the above-mentioned 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 memory. In some instances, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0024] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0025] An embodiment of the present application provides a communication method for a device, and the method is described in detail in conjunction with the execution flow of the communication method for the device.

[0026] The following are explanations of the professional terms in the embodiments of this application:

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

[0028] The embodiment of the present application provides a communication method of a device, Figure 2 A flow chart of a communication method for a device provided in an embodiment of the present application, such as Figure 2 As shown, the method is applied to a target controller, wherein the target controller is connected to a master port of a hub, and multiple slave ports of the hub are used to connect to external devices. The specific process includes the following steps:

[0029] Step S202, during the target controller initialization process, sending a detection signal to an external device connected to each slave port through each slave port, wherein the detection signal is used to request the target type external device to respond to the detection signal;

[0030] In an embodiment of the present application, the target controller may 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 external devices and receiving their responses, etc. For example, the target controller may be a microcontroller (MCU) or a baseboard management controller (BMC), etc.

[0031] In the embodiment of the present application, a hub may be a network device or an interface device whose main function is to connect multiple devices so that the connected 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), which includes a master port for connecting to a target controller and multiple slave ports for connecting to multiple external devices, wherein each slave port can support external devices of different types (i.e., using different communication protocols), and the external device currently connected to each slave port must be an external device of the same type (i.e., using the same communication protocol). For example, the external device connected to slave port 1 of hub A is another hub B (specifically, the master port connected to hub B). At this time, it is only necessary to ensure that the external device connected to the slave port of hub B is an external device 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 device connected to the slave port of hub B is not restricted). The USB Hub transmits signals to each connected device through these ports.

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

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

[0034] During the target controller initialization process (that is, the target controller controls the hub initialization process), 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, determining the device type of the external device connected to each slave port based on the response of the external device connected to each slave port to the detection signal;

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

[0037] Optionally, the device type of the external device connected to each slave port is determined based on the response of the external device connected to each slave port to the detection signal, including: 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, wherein 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 type, wherein 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 normally under the current voltage.

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

[0039] For example, when the BMC sends a broadcast signal using a broadcast address (such as 0x7E), if the external device can recognize the broadcast address 0x7E, the external device will respond to the detection signal accordingly, including returning an acknowledgment signal (such as an ACK response). If the external device cannot recognize the broadcast address 0x7E, it will ignore the message with the broadcast address 0x7E and not provide any feedback (i.e., return a NACK response, indicating that no I3C device is present). At this time, the target controller will not receive any signal from the slave port. Therefore, the BMC can determine the device type of each external device connected to the slave port based on the external device's response to the detection signal and further take appropriate management measures, such as adjusting the voltage domain and enabling proxy functions. It should be noted that if no external device is connected to the slave port, no feedback will be provided in response to the detection signal sent by the target controller.

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

[0041] Step S206 , 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 at the target voltage.

[0042] In the application embodiment, the current voltage may be the initial voltage of the external device, which may be the voltage that the target controller loads to the external device by default at the beginning of initialization; the target voltage may be the operating voltage when the external device is working normally. Different types of external devices have different voltage requirements. For example, for I2C devices, the target voltage is 3.3V, and for I3C devices, the target voltage is 1.8V, etc.

[0043] In an 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 can be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone and other terminals, but is not limited to this.

[0045] Through the above steps, during the target controller initialization process, after sending a detection signal to each external device connected to the slave port, the external device connected to each slave port is traversed, and the device type of each external device connected to the slave port is determined based on the external device's response to the detection signal. Then, the voltage of the external device is adjusted to the target voltage based on the device type of the external device, and communication is performed with the external device at 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 problem of external device damage and communication anomalies due to voltage mismatch or communication protocol differences when the hub is mixed with different types of external devices is avoided. The technical problem of the inability to adaptively configure the voltage of the external device, which leads to communication anomalies of the external device, is solved in the related art, thereby improving the compatibility of the system.

[0046] As an optional embodiment, before sending a detection signal to the external device connected to each slave port through each slave port, the above method also includes: applying a first voltage to the external device connected to each slave port, wherein the first voltage is a voltage to ensure the normal operation of the first device, and the current voltage includes the first voltage; adjusting the current voltage of the external device connected to each slave port to a target voltage corresponding to the device type, including: when the external device is a second device, adjusting the first voltage applied to the second device to a second voltage, wherein the second voltage is a voltage to ensure the normal operation of the second device, and the target voltage includes the second voltage.

[0047] In an embodiment of the present application, the first voltage may be the voltage that the target controller loads to the external device by default at the beginning of initialization. The first voltage may be a 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 a 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] For example, taking the case where the first device is an I3C device and the second device is an I2C device, to prioritize the power supply requirements of the I3C device, during the power-on initialization phase (i.e., the BMC initialization phase), the system (i.e., the BMC) will forcibly load a 1.8V VIOS voltage (a first voltage) on the external device connected to each slave port. After sending a detection signal, if the detection signal detects that the external device is an I3C device, no adjustment is required to the current voltage of the I3C device. If the detection signal detects that the external device is an I2C device, the system will immediately activate the 3.3V VDDIN power supply module and adjust the current voltage of the I2C device (i.e., the first voltage) to the second voltage (i.e., the target voltage), thereby providing a suitable operating voltage for the I2C device.

[0049] Through the above-mentioned on-demand voltage domain switching, the system avoids voltage domain conflicts caused by differences between the predetermined slave port voltage domain and the voltage required by the connected external device in static configuration mode. This ensures that all types of devices can operate efficiently and stably under optimal conditions. Furthermore, by dynamically adjusting the power supply based on the actual connection status of external devices, the system's static power consumption is effectively reduced, improving energy efficiency.

[0050] As an optional embodiment, communicating with an external device at a target voltage includes: determining 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 device includes the target device; and 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 may be a device that will receive instructions sent by the target controller, and the device may be an external device of any device type, such as an I2C device, an I3C device, etc.

[0052] In an embodiment of the present application, a target instruction may be an instruction for communicating with an external device (i.e., a target device) operating at a target voltage. The purpose of the target instruction may be to request the target device to obtain target information required by a target controller. The specific content and format of the target instruction generally depend on the device type of the target device and the communication protocol supported by the target device.

[0053] For example, before the BMC prepares to send a target instruction to a target device, it first determines the device type of the target device that is to receive the target instruction, and then sends the target instruction to the target device based on the device type of the target device.

[0054] The above content ensures that the sent commands are commands that the target device can understand and process, reducing communication errors and data loss, and reducing the possibility of sending erroneous commands, thereby reducing the risk of communication anomalies, increasing communication reliability, and improving the overall communication efficiency of the system. At the same time, it can ensure that the system supports communication between different types of external devices and the target controller, enhancing the system's compatibility and flexibility, making the system adaptable to a variety of device configurations.

[0055] As an optional embodiment, sending a target instruction to a target device at a target voltage according to the device type of the target device includes at least one of the following: determining a first address of the target device when the target device is a first device of the target type; sending a target instruction to the target device according to the first address; determining a target agent of the target device when the target device is a second device of a type other than the target type; and sending the target instruction to the target device through the target agent.

[0056] In an embodiment of the present application, the first address may be a unique identification address of the first device in the network, and the first address is mainly used to locate the first device and communicate with the first device; the target agent may be a communication intermediary between the target controller and the second device, such as an SMBus agent (SMBus Agent), etc., and the target agent is mainly used to forward the target instructions sent by the target controller to the second device, so that the second device can recognize the target instructions 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, as an example, 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, to achieve efficient communication between the I2C devices, when the target device is an I3C device (the first device), a transparent mode is adopted, that is, the I3C MCTP protocol is adopted to enable the BMC to communicate directly 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 a target instruction to the target device according to the first address; when the target device is an I3C device (the first device), an indirect access mode is adopted, that is, the MCTP protocol is used to communicate indirectly with the I2C device through the SMBUS, including determining a target agent associated with the second device (i.e., the target device) and sending a target instruction to the second device through the target agent, thereby performing communication protocol conversion and forwarding the target instruction through the target agent to achieve communication with the I2C device.

[0058] Through the above, direct communication is adopted for the first device, fully leveraging the high-speed transmission characteristics of the first communication protocol to achieve fast and stable data transmission. Indirect access is adopted for the second device, using the target proxy as a communication intermediary to effectively manage and coordinate command transmission between the target controller and the second device, preventing command loss or mistransmission and improving system reliability and stability. The use of different communication strategies for different device types ensures that different types of devices can communicate efficiently and stably within the same system, ensuring efficient communication between devices and improving system compatibility and stability.

[0059] Optionally, sending a target instruction to a target device through a target agent includes: encapsulating a first instruction to obtain a target instruction, wherein the first instruction is an instruction recognizable by a 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 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.

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

[0061] For example, when 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 agent through the I3C communication protocol (i.e., the first communication protocol), so that the target agent parses the target instruction, obtains 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, thereby completing the communication between the target controller and the second device.

[0062] As an optional implementation, for an I2C device (i.e., the second device), when multiple I2C devices share the same bus, multiple I2C devices may have the same address, resulting in an address conflict and communication failure. In this case, the SMBus Agent (i.e., the target agent) can be used to manage I2C device address conflicts. Specifically, 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 device's actual I2C address. After receiving a command from the BMC, the SMBus Agent forwards the command to the correct I2C device based on an internally preset target mapping table. The target mapping table includes a mapping between I2C devices and corresponding virtual addresses, thereby distinguishing between them through virtual addresses and avoiding address conflicts.

[0063] For an I3C device (i.e., the first device), multiple I3C devices may have the same address. In this case, address conflicts between I3C devices can be avoided by controlling the target register (such as REG81) in the hub network topology. Specifically, this includes controlling the hub's network connection through the REG81 register to ensure that each I3C device has a unique address space in its corresponding hub network, effectively avoiding address conflicts between I3C devices and achieving address isolation.

[0064] The above effectively resolves the address conflict issue that may arise when I2C and I3C devices share a bus. Furthermore, by setting the REG18 register, the system ensures continuous detection and management of all slave ports, enabling efficient and dynamic control of multiple device types. This ensures reliable inter-device communication and overall system stability in a complex system that mixes 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 sending a first instruction to the target device according to the second address, the above method also includes: receiving a first message sent by the target agent, wherein the first message is used to indicate that there is target information to be returned in the target agent; and obtaining the target information from the target agent according to the first message.

[0066] In an embodiment of the present application, the above-mentioned first message may be a message for indicating whether the first instruction has completed transmission, and the first message may include information required to determine whether the target controller exists in the second device (ie, the target device).

[0067] For example, after the target agent sends a first command to the second device, the second device responds to the first command and returns the response data to the target agent. At this point, the target agent does not immediately transmit the data directly to the target controller. Instead, it sends an interrupt signal (i.e., the first message) to the target controller via the IBI mechanism. This interrupt signal notifies the target controller that data is waiting to be read. Upon receiving the IBI interrupt signal, the target controller recognizes that the target agent has returned data and proactively requests data from the target agent via the I3C bus. Upon receiving the data request from the target controller, the target agent forwards the data previously received from the second device to the target controller in I3C protocol format, enabling the target controller to read and process the response data from the second device.

[0068] Through the above, the target controller is notified via an interrupt signal, allowing it to selectively request data at the appropriate time. This reduces unnecessary data transmission and avoids unnecessary polling or waiting, thereby optimizing resource utilization and improving overall system efficiency. Furthermore, data can be transmitted using a unified communication protocol (i.e., the first communication protocol), improving the reliability and consistency of data transmission, reducing the chance of errors, and simplifying the complexity of system expansion.

[0069] As an optional implementation, Figure 3 The schematic diagram of the hub connection relationship provided in the embodiment of the present application is as follows: Figure 3 As shown, the BMC (i.e., the target controller) is connected to the master port of the hub (including hub 1, hub 2, etc.), and the slave ports of the hub are connected to different external devices. Each slave port has a corresponding SMBus Agent for its corresponding external device. The hub and the BMC communicate through the I3C protocol (i.e., the first communication protocol), and the hub and the external device communicate using different communication protocols. For example, if 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; if 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 optional implementation, Figure 4 The flowchart of the target controller dynamically managing the hub provided in the embodiment of the present application is as follows: Figure 4 As shown, the specific process is as follows:

[0071] S401 , during the initialization of the BMC (i.e., target controller), uniformly forcibly load the voltage of the external device on each slave port of the Hub (i.e., hub) to a VIOS voltage of 1.8V (i.e., a first voltage);

[0072] S402, sending a detection signal to the external devices on all slave ports via the I3C broadcast address 0x7E;

[0073] S403, scanning and traversing the external devices on each slave port, and determining the response of each external device on the slave port to the detection signal;

[0074] At step S404, if the BMC receives an ACK response (i.e., the external device returns a target response to the detection signal), it determines that the external device is an I3C device (i.e., the first device), and continues to execute the following steps. If the BMC receives a NACK response (i.e., the external device does not return a target response to the detection signal), it determines that the external device is an I2C device (i.e., the second device) or that the external device is not connected, and jumps to step S406.

[0075] S405, entering transparent mode, not adjusting the current voltage (i.e., the first voltage), and directly communicating with the I3C device using the I3C communication protocol (i.e., the first communication protocol), and using 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 agent through the I3C protocol, indirectly communicate with the I2C device through the target agent using the SMBus communication protocol (i.e., the second communication protocol). At the same time, address isolation between different external devices is achieved through the target mapping relationship table preset in the target agent.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and 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-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the target controller described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0079] Figure 5The structural block diagram of the target controller provided in the embodiment of the present application is as follows: Figure 5 As shown, the target controller is connected to the master port of the hub, and the multiple slave ports of the hub are used to connect external devices, including: a sending module 502, which is used to send a detection signal to the external device connected to each slave port through each slave port during the initialization process of the target controller, wherein the detection signal is used to request the external device of the target type to respond to the detection signal; a determination module 504, which is used to determine the device type of the external device connected to each slave port based on the response of the external device connected to each slave port to the detection signal; an adjustment module 506, which is used to 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.

[0080] As an optional implementation, the target controller is also used 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, wherein the first device and the target controller communicate 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, determine that the external device is a second device of other type, wherein the other type is a device type other than the target type, the second device and the target controller communicate using a second communication protocol, and the second device cannot operate normally under the current voltage.

[0081] As an optional implementation, the target controller is also used to apply a first voltage to an external device connected to each slave port, wherein 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, the first voltage applied to the second device is adjusted 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.

[0082] As an optional implementation, the target controller is also used to 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 device includes the target device; according to the device type of the target device, the target instruction is sent to the target device under the target voltage.

[0083] As an optional implementation, the target controller is also used to determine the first address of the target device when the target device is a first device of the target type; send a target instruction to the target device according to the first address; determine the target agent of the target device when the target device is a second device of other types other than the target type; and send the target instruction to the target device through the target agent.

[0084] As an optional implementation, the target controller is also used to encapsulate the first instruction to obtain a target instruction, wherein the first instruction is an instruction that can be recognized 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, the target controller is further configured to receive a first message sent by the target agent, wherein the first message is used to indicate that the target agent has target information to be returned; and obtain the target information from the target agent according to the first message.

[0086] For the description of the features in the embodiment corresponding to the target controller, please refer to the relevant description of the embodiment corresponding to the communication method of the device, and will not be repeated here.

[0087] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned communication method embodiments of the device.

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

[0089] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0090] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned communication method embodiments of the device are implemented.

[0091] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the communication method embodiment of any of the above-mentioned devices are implemented.

[0092] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0093] The above is a detailed introduction to the communication method and target controller of a device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A communication method, characterized in that: Applied to a target controller, wherein the target controller is connected to a master port of a hub, and a plurality of slave ports of the hub are used to connect to external devices, the communication method of the device includes: During the target controller initialization process, a detection signal is sent to an external device connected to each slave port through each slave port, wherein the detection signal is used to request the target type external device to respond to the detection signal; determining the device type of the external device connected to each of the slave ports according to a response of the external device connected to each of the slave ports to the detection signal; adjusting the current voltage of the external device connected to each of the slave ports to a target voltage corresponding to the device type, and communicating with the external device at the target voltage; Wherein, communicating with the external device at the target voltage includes: Determining a device type of a target device that will receive a target instruction sent by the target controller, wherein the target instruction is used to request the target device to obtain target information required by the target controller, and the external device includes the target device; The target instruction is sent to the target device at the target voltage according to the device type of the target device.

2. The communication method according to claim 1, wherein: Determining the device type of the external device connected to each of the slave ports according to a response of the external device connected to each of the slave ports to the detection signal includes: In a case where the external device returns a target response to the detection signal, determining that the external device is a first device of the target type, wherein 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; In a case where the external device does not return a target response to the detection signal, it is determined that the external device is a second device of another type, wherein 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 normally under the current voltage.

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

4. The communication method according to claim 1, wherein: Sending the target instruction to the target device at the target voltage according to the device type of the target device includes at least one of the following: In a case where the target device is a first device of the target type, determining a first address of the target device; and sending the target instruction to the target device according to the first address; In a case where the target device is a second device of a type other than the target type, determining a target agent for the target device; The target instruction is sent to the target device through the target agent.

5. The communication method according to claim 4, wherein: Sending the target instruction to the target device through the target agent includes: encapsulating the first instruction to obtain the target instruction, wherein 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; The target instruction is sent 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. The communication method according to claim 5 , wherein: After sending 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, the method further includes: receiving a first message sent by the target agent, wherein the first message is used to indicate that the target agent has the target information to be returned; The target information is obtained from the target agent according to the first message.

7. A target controller, characterized in that: The target controller is connected to the master port of the hub, and the multiple slave ports of the hub are used to connect to external devices, including: a sending module, configured to send a detection signal to an external device connected to each of the slave ports through each of the slave ports during the initialization process of the target controller, wherein the detection signal is used to request the external device of the target type to respond to the detection signal; a determination module, configured to determine a device type of an external device connected to each of the slave ports according to a response of the external device connected to each of the slave ports to the detection signal; an adjustment module, configured to adjust a current voltage of an external device connected to each of the slave ports to a target voltage corresponding to the device type, and to communicate with the external device at the target voltage; The target controller is also used to 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 device includes the target device; according to the device type of the target device, the target instruction is sent to the target device under the target voltage.

8. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the communication method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the communication method according to any one of claims 1 to 6 when executed by a processor.

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