First controller, second controller, address conflict processing system and method
By adjusting the communication address of the first controller, the address conflict between the first controller and the target device is solved by using the address scanning operation of the second controller, and the communication reliability and stability of the computer system are improved.
Patent Information
- Application Number
- CN202510743809.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-06-05
AI Technical Summary
The address conflict between the first controller and the target device in the computer system results in a reduced system stability.
By adjusting the communication address of the first controller, the second controller performs an address scanning operation to obtain the target device address, and adjust the initial controller address when an address conflict is detected to obtain the target controller address, ensuring that it is different from the target device address.
It solves the problem of address conflict and improves the communication reliability and stability of computer systems.
Smart Images

Figure CN120256360B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technology, and in particular to a first controller, a second controller, and an address conflict processing system and method for processing address conflicts. Background Art
[0002] With the advancement of computer technology, computer systems (e.g., servers) are playing an increasingly important role. For example, a computer system may include a first controller and a second controller. The computer system may also deploy a target device. The second controller may communicate with the first controller and the target device based on a communication protocol to provide various functions. For example, the first controller may be a programmable device (PD). The second controller may include a baseboard management controller (BMC). The target device may be a non-programmable device.
[0003] Since there is an address conflict between the first controller and the target device, system stability is reduced. Summary of the Invention
[0004] In view of the above problems, embodiments of the present application provide a first controller, a second controller, and an address conflict processing system and method for processing address conflicts to resolve address conflicts between a first controller and a target device.
[0005] According to a first aspect of an embodiment of the present application, a first controller for handling address conflicts is provided. The first controller may include: an address acquisition circuit configured to, in response to detecting that a second controller performs a first address scan operation for at least one target device, obtain a target device address for each of the at least one target devices based on first response information of each of the at least one target device to the first address scan operation, while a communication function is disabled. An address conflict handling circuit configured to, in response to the presence of a target device address in at least one of the target device addresses that matches an initial controller address of the first controller, adjust the initial controller address to obtain a target controller address for the first controller. The target controller address is different from the target device address.
[0006] A second aspect of an embodiment of the present application provides a second controller for handling address conflicts, the second controller may include: an address scanning module configured to perform a first address scanning operation for at least one target device, so that the first controller, in response to detecting the first address scanning operation, obtains a target device address of each of the at least one target device based on first response information of each of the at least one target device to the first address scanning operation when a communication function is disabled, and in response to a target device address in at least one of the target device addresses matching an initial controller address of the first controller, adjusts the initial controller address to obtain a target controller address of the first controller. The target controller address is different from the target device address.
[0007] A third aspect of an embodiment of the present application provides an address conflict processing system, which may include: a first controller, the first controller may include an address acquisition circuit and an address conflict processing circuit, the address acquisition circuit being configured to, in response to detecting a first address scanning operation, obtain a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation when a communication function is disabled. The address conflict processing circuit is configured to, in response to the presence of a target device address in at least one of the target device addresses that matches an initial controller address of the first controller, adjust the initial controller address to obtain a target controller address of the first controller, where the target controller address is different from the target device address.
[0008] A fourth aspect of an embodiment of the present application provides a method for handling address conflicts. The method can be applied to a first controller. In response to detecting that a second controller performs a first address scanning operation for at least one target device, when the communication function is disabled, the method obtains a target device address of each of the at least one target devices based on first response information of each of the at least one target device to the first address scanning operation. In response to the presence of a target device address in at least one of the target device addresses that matches the initial controller address of the first controller, the method adjusts the initial controller address to obtain a target controller address of the first controller. The target controller address is different from the target device address.
[0009] A fifth aspect of an embodiment of the present application provides a method for handling address conflicts, which can be applied to a second controller, performing a first address scanning operation for at least one target device, so that the first controller, in response to detecting the first address scanning operation, obtains a target device address of each of the at least one target device based on first response information of each of the at least one target device to the first address scanning operation when the communication function is disabled, and in response to the presence of a target device address in at least one of the target device addresses that matches the initial controller address of the first controller, adjusts the initial controller address to obtain a target controller address of the first controller. The target controller address is different from the target device address. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0011] Figure 1 A schematic diagram showing the architecture of a computer system according to the related art is shown;
[0012] Figure 2 A schematic diagram showing the principle of a method for handling address conflicts according to an embodiment of the present application is shown;
[0013] Figure 3 A diagram showing an application scenario of a method for handling address conflicts according to an embodiment of the present application is shown;
[0014] Figure 4 A flowchart of a method for handling an address conflict applied to a first controller according to an embodiment of the present application is shown;
[0015] Figure 5 A flowchart of a method for handling an address conflict applied to a second controller according to an embodiment of the present application is shown;
[0016] Figure 6A A schematic diagram showing address scanning information of an integrated circuit bus according to an embodiment of the present application is shown;
[0017] Figure 6B A timing diagram showing a first response message indicating that an available address received from a second controller does not match a pre-configured device address of a target device according to an embodiment of the present application is shown;
[0018] Figure 6C A timing diagram showing a first response message indicating that an available address received from a second controller matches a pre-configured device address of a target device according to an embodiment of the present application is shown;
[0019] Figure 7A block diagram of a first controller for handling address conflicts according to an embodiment of the present application is shown;
[0020] Figure 8 A block diagram of a second controller for handling address conflicts according to an embodiment of the present application is shown;
[0021] Figure 9 A block diagram of a system for handling address conflicts according to an embodiment of the present application is shown;
[0022] Figure 10 A block diagram of an electronic device suitable for implementing a method for handling address conflicts according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit this application. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0026] When using expressions such as "at least one of A, B or C", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] In order to clearly describe the technical solutions of the embodiments of the present application, some terms involved in the embodiments of the present application are explained below.
[0028] The first controller may be an integrated circuit whose logic functions are configured through programming. This allows users to configure the inputs, outputs, and internal logic of the first controller based on business needs without having to redesign the hardware. For example, the first controller may be a programmable device. The programmable device may include at least one of the following: a programmable logic device, a complex programmable logic device, a field programmable gate array, a programmable logic array, programmable array logic, or general purpose array logic.
[0029] The second controller can be used to communicate with the first controller and the target device to provide multiple functions. For example, the second controller can include at least one of the following: a baseboard management controller, a microcontroller, or a central processing unit.
[0030] The baseboard management controller can be a component in the server management system defined by the Intelligent Platform Management Interface (IPMI) protocol, and can be used for at least one of device information management, server status detection, server status management, remote control management of the server, or maintenance management of the server.
[0031] The target device may be an integrated circuit with fixed logic functions that are difficult to modify through programming. For example, if the communication address used for communicating with the second controller has already been configured, it is difficult to modify the communication address through programming. The target device may also be a non-programmable device. For example, a non-programmable device may include at least one of the following: an analog sensor, a digital sensor, an application-specific integrated circuit, or a memory.
[0032] A server may include a motherboard and a backplane. The motherboard is the server's core circuit board, integrating at least one of the following: a baseboard management controller (BMC), processor, memory, chipset, or expansion slots. It connects and coordinates hardware components. The BMC can accommodate non-programmable devices. The backplane connects the motherboard to storage devices and serves as a data transmission channel for the motherboard. It can accommodate at least one of the following: memory, programmable devices, or non-programmable devices.
[0033] A communication protocol may refer to a protocol that has address conflicts. For example, a communication protocol may include a two-wire (i.e., 2-Wire) protocol. A two-wire protocol may include a serial data line (SDA) for transmitting data and a serial clock line (SCL) for transmitting a clock signal. Two-wire protocols may include at least one of the following: Inter-Integrated Circuit (I2C), Improved Inter-Integrated Circuit (I3C), System Management Bus (SMBus), Power Management Bus (PMBus), or Modbus (i.e., Modicon Bus). An integrated circuit bus may also be referred to as an inter-integrated circuit bus or an inter-integrated circuit. An improved integrated circuit bus may also be referred to as an enhanced integrated circuit bus. A first controller and a target device that communicate with a second controller via an integrated circuit bus may both be referred to as integrated circuit bus devices.
[0034] The target device address may refer to the address of the target device. The initial controller address may refer to the initial address of the first controller. The target controller address may refer to the target address of the first controller. The preconfigured device address of the target device may refer to the preconfigured address of the target device. The available address may be an address within an available address range. The available address range may be an address range that can be used for communication between the first controller, the second controller, and the target device. The available address range may be determined based on a communication protocol used for communication between the first controller, the second controller, and the target device.
[0035] The inventive concept of the embodiments of the present application is described below with reference to the accompanying drawings.
[0036] Figure 1 A schematic diagram of the architecture of a computer system according to the related art is shown.
[0037] like Figure 1 As shown, the computer system may include a first controller and a second controller. The computer system may also deploy at least one target device. The second controller may communicate with the first controller and the target device based on a communication protocol to provide various functions. For example, the communication protocol may include a two-wire protocol. The two-wire protocol may include a serial data line and a serial clock line.
[0038] Since the communication address of the first controller is "0x10" and the communication address of a target device is also "0x10", there is an address conflict between the first controller and the target device, thereby affecting the normal operation of the computer system.
[0039] In order to solve the address conflict problem between the first controller and the target device, in the process of realizing the inventive concept of the embodiment of the present application, it was found that since the first controller can be a programmable device and the target device is a non-programmable device, the communication address of the non-programmable device is fixed and the communication address of the programmable device is adjustable. Therefore, in the case of an address conflict between the first controller and the target device, that is, in the case of an address conflict between the programmable device and the non-programmable device, the address conflict between the first controller and the target device can be resolved by adjusting the communication address of the first controller (that is, the programmable device).
[0040] To this end, the embodiment of the present application provides a method for resolving the address conflict between the first controller and the target device. Figure 2 This method will be described.
[0041] Figure 2 A schematic diagram showing the principles of a method for handling address conflicts according to an embodiment of the present application is shown.
[0042] like Figure 2 As shown, the first controller may have an initial controller address. The initial controller address may be intended to be used for communication between the first controller and the second controller. In the event that there is no address conflict between the first controller and the target device, the initial controller address may serve as the target controller address of the first controller. The target controller address may actually be used for communication between the first controller and the second controller. In the event that there is an address conflict between the first controller and the target device, the initial controller address cannot be used as the target controller address. In this case, the target controller address needs to be determined so that the target controller address is different from the target device address of each of the at least one target devices. The target device address may actually be used for communication between the target device and the second controller.
[0043] In order to determine whether there is an address conflict between the first controller and the target device, it is necessary to obtain the target device address of the target device.
[0044] To this end, the second controller may perform a first address scan operation on at least one target device, and the target device may generate first response information in response to the first address scan operation. During the second controller's execution of the first address scan operation, the communication function of the first controller is disabled so that the first controller does not perform a response operation to the first address scan operation, and a detection function of the first controller is activated. The detection function may be used to obtain first response information of each of the at least one target device in response to detecting the first address scan operation, and obtain a target device address of the at least one target device based on the first response information of each of the at least one target device.
[0045] When determining that at least one target device address conflicts with the initial controller address of the first controller, the first controller may determine a target controller address that is different from the at least one target device address, for example, by adjusting the initial controller address to obtain the target controller address. Because the target device address is different from the at least one target device, there is no address conflict between the target controller address and any of the at least one target device addresses. This resolves the address conflict between the first controller and the target device, ensures address uniqueness during the hardware initialization phase, and improves communication reliability and system stability.
[0046] In addition, when obtaining the target controller address actually used for communication between the first controller and the second controller, the second controller is also required to obtain the target controller address so that the first controller and the second controller can communicate based on the target controller address.
[0047] To this end, an embodiment of the present application proposes that when the first controller determines the target controller address, the communication function of the first controller can be started so that the second controller can obtain the target controller address. The second controller performs a second address scanning operation for at least one target device and the first controller. Since the communication function of the first controller is enabled, the first controller will perform a response operation for the second address scanning operation. Thus, the second controller can obtain a second address set based on the second response information of at least one target device for the second address scanning operation and the third response information of the first controller for the second address scanning operation. The second address set may include at least one target device address and a target controller address.
[0048] As described above, the first address scan operation is directed to at least one target device. Since the communication function of the first controller is disabled, the first controller does not execute response information for the first address scan operation. Therefore, the second controller can obtain a first address set based on the first response information of the at least one target device for the first address scan operation. The first address set may include at least one target device address.
[0049] Since the first address set does not include the target controller address of the first controller and may include the target device address of at least one target device, and the second address set may include the target controller address of the first controller and the target device address of at least one target device, it can be determined that there is no matching address between the second address set and the first address set, and the unmatched address is used as the target controller address of the first controller. In this way, the second controller can obtain the target controller address of the first controller.
[0050] The above describes the inventive concept of the embodiment of the present application. The following describes in detail the first controller, the second controller, the address conflict processing method, and the address conflict processing system provided by the embodiment of the present application with reference to the accompanying drawings.
[0051] First, combine Figure 3 , taking the computer system as the server and the communication protocol as the two-wire protocol as an example, the application scenario applicable to the method of handling address conflicts is explained. Figure 3 As an example, combining the application scenario shown in Figure 4 、 Figure 5 、 Figure 6A 、 Figure 6B and 6C , the method for handling address conflicts provided in the embodiment of the present application is specifically described. Figure 4 A method for handling address conflicts applied to the first controller is described. Figure 5 A method for handling address conflicts applied to the second controller is described below. Figure 6A 、 Figure 6B and Figure 6C Taking the communication protocol as an integrated circuit bus as an example, the second controller performs the first address scanning operation. Then, combined with Figure 7 The first controller for handling address conflicts provided in the embodiment of the present application is described in detail. Figure 8 The second controller for handling address conflicts provided in the embodiment of the present application is described in detail. Figure 9 The address conflict processing system provided in the embodiment of the present application is described in detail.
[0052] It should be noted that the embodiments of the present application can be implemented independently or in combination with each other, and the same or similar concepts or processes will not be described in detail in some embodiments.
[0053] Figure 3 The following diagram shows an application scenario of a method for handling address conflicts according to an embodiment of the present application.
[0054] like Figure 3 As shown, the server may include a mainboard and a backplane. The mainboard may include a baseboard management controller (BMC). The mainboard may also host at least one target device. The backplane may include a programmable device. The programmable device may include static random access memory (SRAM) and flash memory. The flash memory may include at least one of user flash memory and configuration flash memory. Optionally, the backplane may also host at least one target device. The BMC may communicate with the target device and the programmable device using a two-wire protocol. The two-wire protocol may include a serial data line and a serial clock line.
[0055] The baseboard management controller and the programmable device can execute the address conflict processing method described in the embodiment of the present application.
[0056] It should be understood that Figure 3 This is merely an illustrative description and does not constitute a limitation on the scope of protection of this application.
[0057] The following will be based on Figure 3 The application scenario described, combined with Figure 4 、 Figure 5 、 Figure 6A 、 Figure 6B and Figure 6C The method for handling address conflicts in the embodiment of the present application is described in detail.
[0058] Figure 4 A flow chart of a method for handling address conflicts applied to a first controller according to an embodiment of the present application is shown.
[0059] like Figure 4 As shown, the method includes operations S410 to S420.
[0060] In operation S410, in response to detecting that the second controller performs a first address scan operation for at least one target device, a target device address of the at least one target device is obtained based on first response information of the at least one target device to the first address scan operation with a communication function disabled.
[0061] In operation S420 , in response to a target device address matching the initial controller address of the first controller existing in the at least one target device address, the initial controller address is adjusted to obtain a target controller address of the first controller.
[0062] According to an embodiment of the present application, the first controller may include an address obtaining circuit and an address conflict handling circuit. The address obtaining circuit may be configured to perform operation S410. The address conflict handling circuit may be configured to perform operation S420.
[0063] According to an embodiment of the present application, a first address scan operation may refer to the second controller performing an address scan operation for at least one target device. The first address scan operation may be used to obtain a target device address of each of the at least one target device. The target device address may be actually used for communication between the target device and the second controller, i.e., the target device address may be an address actually used for communication between the target device and the second controller. The first address scan operation may be triggered by the second controller during power-on. The initial controller address may be stored in a communication address register, i.e., the first controller may obtain the initial controller address from the communication address register.
[0064] According to an embodiment of the present application, the first response information may be the response information of the target device for the first address scanning operation. The first response information may be used to indicate whether the available address received from the second controller matches the pre-configured device address of the target device. The communication function disabling may be understood as the communication function being temporarily disabled, the communication function being shielded, or the communication function not being enabled. The first controller may start the detection function when the communication function is disabled. The detection function may be used by the first controller to obtain the first response information of each of the at least one target device for the first address scanning operation in response to detecting that the second controller performs the first address scanning operation for at least one target device, and obtain at least one target device address based on the first response information of each of the at least one target device. The first controller may have an initial controller address. The initial controller address may be intended to be used for communication between the first controller and the second controller, that is, the initial controller address may be an address intended to be used for communication between the first controller and the second controller.
[0065] The following describes how the first controller obtains at least one target device address.
[0066] As an implementation, the address obtaining module of the second controller may perform a first address scanning operation for at least one target device based on an address traversal strategy, which may include a fully available address traversal strategy or a partially available address traversal strategy.
[0067] The following describes how the first controller obtains at least one target device address based on the full address traversal strategy.
[0068] The address obtaining module of the second controller may determine an available address range according to a communication protocol used for communication between the target device, the second controller, and the first controller. The available address range may include at least one available address.
[0069] The second controller may send an available address to at least one target device for any available address among the at least one available address. For any target device among the at least one target device, the target device may respond to receiving the available address from the second controller. The target device may generate first response information of the target device when determining that the available address received from the second controller matches the pre-configured device address of the target device. The first response information of the target device indicates that the available address received from the second controller matches the pre-configured device address of the target device. The first response information of the target device is sent to the second controller.
[0070] The target device may generate first response information of the target device when determining that the available address received from the second controller does not match the pre-configured device address of the target device. The first response information of the target device indicates that the available address received from the second controller does not match the pre-configured device address of the target device. The first response information of the target device is sent to the second controller.
[0071] The first controller may obtain, when the communication function is disabled, first response information of the target device for the first address scan operation. The first controller may determine that the available address is the target device address of the target device if it is determined that the first response information of the target device indicates that the available address received by the target device from the second controller matches the pre-configured device address of the target device. The first controller may determine that the available address is not the target device address of the target device if it is determined that the first response information of the target device indicates that the available address received by the target device from the second controller does not match the pre-configured device address of the target device.
[0072] Based on the above manner, the first controller can obtain at least one target device address.
[0073] Because the at least one available address is determined based on the communication protocol used between the target device, the second controller, and the first controller, the at least one available address is a relatively complete available address. This ensures that the first address scan operation is a relatively comprehensive address scan operation, reducing the probability of missing a target device address. Because the target controller address is determined only when the at least one target device address conflicts with the initial controller address, the accuracy of the target controller address is improved, thereby enhancing communication reliability and system stability.
[0074] The following describes how the first controller obtains at least one target device address based on the partial address traversal strategy.
[0075] The second controller may obtain at least one second target available address. The at least one second target available address may be determined from a plurality of available addresses. The number of the second available addresses may be less than the number of available addresses.
[0076] Regarding how to enable the first controller to obtain at least one target device address based on a partial address traversal strategy, the above description of "enabled the first controller to obtain at least one target device address based on a full address traversal strategy" can be replaced with "second target available address" for understanding, and no further details will be given here.
[0077] Because the at least one second target available address is determined from a plurality of available addresses, and the available addresses are determined based on a communication protocol used between the target device, the second controller, and the first controller, and the number of the second target available addresses is smaller than the number of available addresses, the efficiency of the first address scanning operation based on the at least one second target available address is higher, thereby improving the efficiency of determining the target controller address.
[0078] When obtaining the at least one target device address, the first controller may determine whether the at least one target device address conflicts with the initial controller address of the first controller.
[0079] If the address of at least one target device of the first controller conflicts with the initial controller address of the first controller, it may indicate that an address conflict exists between the first controller and the at least one target device, and the initial controller address cannot be used as an address actually used for communication between the first controller and the second controller. The first controller may adjust the initial controller address to obtain a target controller address, thereby making the target controller address different from the at least one target device address, thereby eliminating the address conflict between the first controller and the at least one target device. The target controller address can be actually used for communication between the first controller and the second controller without causing an address conflict with the at least one target device.
[0080] When the address of at least one target device of the first controller does not conflict with the initial controller address of the first controller, it can be indicated that there is no address conflict between the first controller and the at least one target device, thereby determining that the initial controller address can be actually used for communication between the first controller and the second controller.
[0081] Regarding how the first controller adjusts the initial controller address to obtain the target controller address when determining that at least one target device address conflicts with the initial controller address, this can be achieved in the following manner.
[0082] As an implementation manner, the first controller may adjust the initial controller address based on an address increment strategy to obtain the target controller address.
[0083] As another implementation, the first controller may determine the target controller address from a plurality of first target available addresses. For example, the target controller address may be determined from the plurality of first target available addresses based on the probability of an address conflict for each of the plurality of first target available addresses. For example, the target controller address may be the first target available address with the lowest probability of an address conflict among the plurality of first target available addresses. The first target available address may be determined from the plurality of available addresses. The available address may be within a range of available addresses used for communication between the first controller, the second controller, and the target device. The available address may be determined based on a communication protocol used between the first and second controllers. For example, the communication protocol may include at least one of the following: an integrated circuit bus, an improved integrated circuit bus, a system management bus, a power management bus, or Modbus. If the communication protocol is an integrated circuit bus, if the integrated circuit bus uses a 7-bit address mode, the available address may be an address within the available address range of "0x00-0x7F." If the integrated circuit bus uses a 10-bit address mode, the available address may be an address within the available address range of "0x000-0x3FF."
[0084] Because the target controller address is determined from a plurality of first target available addresses, which are determined from a plurality of available addresses, and the available addresses are addresses within a range of available addresses determined according to a communication protocol used between the first controller, the second controller, and the target device, the addressing range is narrowed, thereby improving the efficiency of determining the target controller address. Furthermore, for example, the target controller address can be the first target available address with the lowest probability of an address conflict, determined from the plurality of first target available addresses based on the probability of an address conflict occurring in each of the plurality of first target available addresses. This reduces the probability of an address conflict between the target controller address and other addresses.
[0085] As another implementation method, if multiple target device addresses conflict with multiple first target available addresses, that is, multiple target device addresses include multiple first target available addresses, that is, there are target device addresses in the multiple target device addresses that match each of the multiple first target available addresses, then it can be said that for any first target available address among the multiple first target available addresses, a target device address that matches the first target available address can be determined from multiple target controller addresses, and thus an address conflict occurs between the first target available address and the matching target device address. In this case, the target controller address cannot be determined from the multiple first target available addresses. The existence of a target device address in multiple target devices that matches each of the multiple first target available addresses can be understood as, for any first target available address among the multiple first target available addresses, there is a target device address that matches the first target available address among the multiple target device addresses. Thus, each first target available address has a target device address that matches the first target available address.
[0086] In response to the above situation, the first controller can adjust the initial controller address based on the address increment strategy to obtain the target controller address when multiple target device addresses conflict with multiple first target available addresses, that is, when the target controller address cannot be determined from multiple first target available addresses.
[0087] Since the target controller address is obtained by adjusting the initial controller address based on the address increment strategy when multiple target device addresses conflict with multiple first target available addresses, the addressing complexity is reduced while improving the efficiency of determining the target controller address.
[0088] According to an embodiment of the present application, a first controller has an initial controller address intended for communication with a second controller. When a communication function is disabled, in response to detecting first response information from at least one target device to a first address scanning operation, a target device address of the at least one target device is obtained, and the target device address is actually used for communication between the target device and the second controller. Thus, in the event that the at least one target device address conflicts with the initial controller address, the initial controller address is adjusted to obtain a target controller address such that the target controller address is different from the at least one target device address. Since the target controller address is different from the at least one target device address, the address conflict problem between the first controller and the at least one target device is resolved, the probability of communication anomalies between the first controller and the second controller is reduced, and communication reliability and system stability are improved.
[0089] The following further explains the method of "adjusting the initial controller address to obtain the target controller address" described above.
[0090] Regarding how to adjust the initial controller address based on the address increment strategy to obtain the target controller address, this can be achieved in the following manner.
[0091] The address increment strategy can be used to gradually increase the address offset based on the initial controller address. The address offset can be configured based on actual business needs and is not limited here. For example, the address offset can be configured to 1.
[0092] Thus, the first controller can adjust the initial controller address based on the address increment strategy until a target controller address different from at least one target device address is obtained.
[0093] Since the target device address is obtained by adjusting the initial controller address based on the address increment strategy, the addressing complexity is reduced.
[0094] Regarding how to determine multiple first target available addresses from multiple available addresses, it can be achieved in the following manner.
[0095] As an implementation method, the usage status information can be used to indicate at least one of the usage information or conflict information of the available address in the first predetermined period, that is, the usage status information may include the usage information of the available address in the first predetermined period. Optionally, the usage status information may include the conflict information of the available address in the first predetermined period. Optionally, the usage status information may include the usage information of the available address in the first predetermined period and the conflict information of the available address in the first predetermined period. The first predetermined period can be used to indicate the time period between the first moment and the second moment. The second moment is earlier than the first moment. For example, the first moment can be used to indicate the moment when the second controller performs the first address scanning operation. The second moment can be used to indicate the moment when the last address conflict occurred. Optionally, the second moment can be used to indicate the moment that is a predetermined length of time away from the first moment. The predetermined length of time can be configured according to actual business needs and is not limited here.
[0096] As an implementation manner, the usage information may include at least one of the following: the number of uses or the usage period. Optionally, the conflict information may include at least one of the following: the number of conflicts or the conflict period.
[0097] In this case, a plurality of first target available addresses may be determined from a plurality of available addresses based on the usage status information of each of the plurality of first communication addresses.
[0098] As an implementation, when the usage status information includes conflict information of available addresses in a first predetermined time period, the multiple available addresses can be classified according to their respective conflict information to obtain first-category available addresses and second-category available addresses. The probability of a conflict occurring in the first-category available addresses can be lower than the probability of a conflict occurring in the second-category available addresses. Multiple first target available addresses are determined from the first-category available addresses.
[0099] For example, conflict information for each of the multiple available addresses can be input into a classification model to obtain the address categories of each of the multiple available addresses. Based on the address categories of each of the multiple available addresses, a first-category available address or a second-category available address can be obtained. The classification model can be trained using sample conflict information for each of the multiple sample addresses. The sample conflict information can include at least one of the number of conflicts or the duration of the conflicts for the sample addresses. For example, the artificial intelligence model can include at least one of the following: logistic regression, decision tree, random forest, gradient boosting tree, support vector machine, multilayer perceptron, or transformer.
[0100] Because conflict information can reflect conflicts among available addresses, the first and second categories of available addresses are obtained by classifying multiple available addresses based on their respective conflict information. This improves the accuracy of the first and second categories of available addresses. Furthermore, because multiple first target available addresses are determined from the first category of available addresses, the probability of conflicts among the first category of available addresses is lower than that among the second category of available addresses. This reduces the probability of conflicts between the first target available address and other addresses. Because the target controller address is determined from the multiple first available addresses, the probability of conflicts between the target controller address and other addresses is reduced, thereby improving communication reliability and system stability.
[0101] As another implementation method, when the usage status information includes at least one of the conflict information or usage information of the available address in the first predetermined time period, the conflict evaluation results of each of the multiple available addresses can be determined based on the usage status information of each of the multiple available addresses. The conflict evaluation result can be used to indicate the probability of a conflict occurring in the available addresses. Then, based on the conflict evaluation results of each of the multiple available addresses, an available address with a probability of a conflict occurring that is less than or equal to a first predetermined threshold is determined from the multiple available addresses as the first target available address. The first predetermined threshold can be determined based on the historical usage status information of the historical address in the second predetermined time period. The historical address can be determined based on the communication protocol used between the first object and the second object. The first object can be a programmable device. The second object can be a non-programmable device. The second predetermined time period can be configured according to actual business needs and is not limited here. For example, the second predetermined time period can be used to indicate that the number of address conflicts occurring is greater than or equal to the second predetermined threshold.
[0102] Optionally, the multiple available addresses may be sorted according to their respective conflict evaluation results to obtain a sorting result. Based on the sorting result, multiple available addresses with higher sorting levels among the multiple available addresses may be determined as the first target available addresses, or based on the sorting result, multiple available addresses with lower sorting levels among the multiple available addresses may be determined as the first target available addresses.
[0103] Because the conflict assessment result can be determined based on the usage status information of the available addresses, the usage status information can be used to indicate at least one of the usage status or conflict status of the available addresses, and the conflict assessment result can be used to indicate the probability of conflicts among the available addresses, the accuracy of the conflict assessment result is improved. Furthermore, because the multiple first target available addresses are determined from the multiple available addresses based on their respective conflict assessment results, the accuracy of the target controller address is improved, the probability of conflicts between the target controller address and other addresses is reduced, and thus communication reliability and system stability are improved.
[0104] As an implementation, when the plurality of first target available addresses are sorted in a predetermined order, the address offset between two adjacent first target available addresses may be greater than or equal to a third predetermined threshold value. The third predetermined threshold value may be determined based on usage status information of each of the plurality of available addresses.
[0105] Since, when at least one target device address is sorted in a predetermined order, the address offset between two adjacent target device addresses is small, and the address offset between two adjacent first target available addresses is greater than or equal to a third predetermined threshold, the probability of a conflict between the first target available address and the target device address is reduced, and the target controller address is determined from multiple first target available addresses, thereby improving the efficiency of determining the target controller address.
[0106] The following describes the conditions under which the first controller disables the communication function.
[0107] The function configuration circuit of the first controller may disable the communication function, temporarily disable the communication function, or shield the communication function if it fails to obtain a valid address within the third predetermined period, for example, if the initial controller address of the first controller is not obtained from the first memory within the third predetermined period.
[0108] When the first controller is powered on, it can retrieve an address for communicating with the second controller from the first memory. This address for communicating with the second controller can be referred to as a valid address. Since the first memory does not store a valid address when the first controller is first started, the first controller can block, disable, or temporarily disable the communication function if it fails to retrieve a valid address from the first memory within a third predetermined period. For example, the first memory can include non-volatile memory. The non-volatile memory can include flash memory. The flash memory can include user flash memory.
[0109] By disabling the communication function of the first controller, temporarily disabling the communication function of the first controller, or shielding the communication function of the first controller when the first controller fails to obtain a valid address within a third predetermined time period, the first controller is unable to perform a response operation to the first address scanning operation, thereby causing the addresses obtained to be all target device addresses and not including the initial controller address of the first controller. If the first controller enables the communication function, the first controller may perform a response operation to the first address scanning operation, thereby causing the addresses obtained to include the target device address of at least one target device and the initial controller address of the first controller. In this case, since the obtained address includes the initial controller address of the first controller, an operation to determine the target controller address needs to be performed. However, this is not actually caused by an address conflict between the initial controller address and the target device address of the target device, but rather by the first controller responding to the first address scanning operation. The embodiment of the present application needs to resolve the address conflict between the first controller and the target device. Therefore, by disabling the communication function of the first controller, the false positive rate can be reduced.
[0110] In addition, the detection function can be started when the communication function is shielded, disabled, temporarily disabled, or not enabled, so that the first controller can obtain at least one target device address based on the first response information of at least one target device for the first address scanning operation in response to detecting that the second controller performs a first address scanning operation.
[0111] As an implementation, when the first controller determines the target controller address, the target controller address can be stored, for example, in a first memory, so that the function configuration circuit of the first controller, in response to a reload or restart, can enable the communication function of the first controller upon obtaining the target controller address, for example, upon obtaining the target controller address from the first memory. Thus, the second controller can obtain the target controller address when performing a second address operation, so that the second controller can communicate with the first controller using the target controller address without having to perform an address scan operation.
[0112] As an implementation, when the first controller determines the target controller address, the communication function of the first controller may be enabled, so that when the second controller performs a second address scanning operation on the first controller, the first controller may generate third response information in response to the second scanning operation, and the third response information may indicate that the available address received from the second controller matches the target controller address of the first controller. Thus, the second controller may determine that the target controller address is the address actually used for communication with the first controller.
[0113] The above describes the method for handling address conflicts applied to the first controller provided in the embodiments of the present application.
[0114] Figure 5 A flow chart of a method for handling an address conflict applied to a second controller according to an embodiment of the present application is shown.
[0115] like Figure 5 As shown, the method includes operation S510.
[0116] In operation S510, a first address scanning operation is performed for at least one target device, so that the first controller obtains a target device address of the at least one target device in response to detecting the first address scanning operation based on first response information of the at least one target device for the first address scanning operation, and adjusts the initial controller address in response to the presence of a target device address in the at least one target device address that matches the initial controller address of the first controller to obtain the target controller address of the first controller.
[0117] According to an embodiment of the present application, the second controller may include an address scanning module. The address scanning module may be configured to perform operation S510. The target device address may be different from the at least one target device address.
[0118] The following describes how the second controller performs a first address scanning operation on at least one target device.
[0119] As an implementation manner, the second controller may determine at least one available address included in the available address range according to a communication protocol used for communication between the target device, the second controller, and the first controller.
[0120] For any available address among at least one available address, the second controller can send the available address to at least one target device, so that for any target device among the at least one target device, the target device can generate first response information for the first address scanning operation based on the pre-configured device address of the target device and the available address received from the second controller.
[0121] Because the at least one available address is determined based on the communication protocol between the target device, the second controller, and the first controller, the at least one available address is a relatively complete available address. This ensures that the first address scanning operation is a relatively comprehensive address scanning operation, reducing the probability of missing the target device address.
[0122] As an implementation method, the communication protocol used for communication between the target device, the second controller and the first controller may be an integrated circuit bus. The integrated circuit bus may include SDA and SCL. The first address scanning operation may be implemented based on the address scanning information of the integrated circuit bus. For example, for any available address among at least one available address, the second controller may send address scanning information including the available address to at least one target device, and obtain the target device address of the target device based on the first response information of the target device to the available address. Figure 6A 、 Figure 6B and Figure 6C Provide explanation.
[0123] Figure 6A A schematic diagram showing address scanning information of an integrated circuit bus according to an embodiment of the present application is shown.
[0124] like Figure 6AAs shown in the figure, the address scan information can include a start condition S, an available address, a read / write bit R / W, an acknowledge bit ACK (Acknowledge) / NACK (Not Acknowledge), and a stop condition P. A start condition can mean that SDA switches from a high level to a low level before SCL switches from a high level to a low level. A stop condition can mean that SDA switches from a low level to a high level after SCL switches from a low level to a high level. The available address can include 7 bits.
[0125] When the read / write bit is low, the device is in write mode. The second controller can send address scan information including the available address to the target device. If the target device determines that the available address received from the second controller matches the pre-configured device address of the target device, it can set SDA to a low level during the ninth clock signal (i.e., SCLK) as the first response information. If the target device determines that the available address received from the second controller does not match the pre-configured device address of the target device, it can maintain SDA at a high level during the ninth clock signal as the first response information.
[0126] Figure 6B A timing diagram is shown in which the first response information indicates that the available address received from the second controller does not match the pre-configured device address of the target device according to an embodiment of the present application.
[0127] like Figure 6B As shown, when the target device determines that the available address received from the second controller does not match the pre-configured device address of the target device, it maintains SDA at a high level as the first response information at the 9th clock signal.
[0128] Figure 6C A timing diagram is shown in which the first response information indicates that the available address received from the second controller matches the pre-configured device address of the target device according to an embodiment of the present application.
[0129] like Figure 6C As shown, when the target device determines that the available address received from the second controller matches the pre-configured device address of the target device, it sets SDA to a low level at the ninth clock signal as the first response information.
[0130] It should be noted that, for other descriptions on how the target device generates the first response information for the first address scanning operation, please refer to the corresponding part above, which will not be repeated here.
[0131] The following describes how the second controller determines that the target controller address is the address actually used for communication with the first controller.
[0132] As an implementation method, the address acquisition module of the second controller can obtain a first address set based on the first response information of at least one target device for the first address scanning operation. The first address set may include the target device address of at least one target device. The address scanning module of the second controller may perform a second address scanning operation for at least one target device and the first controller. The address acquisition module may obtain a second address set based on the second response information of at least one target device for the second address scanning operation and the third response information of the first controller for the second address scanning operation. The second address set may include the target device address of at least one target device and the target controller address of the first controller. The address comparison module may use the unmatched addresses between the second address set and the first address set as the target controller address.
[0133] How the second controller obtains the first address set can be achieved in the following manner.
[0134] As an implementation method, for any target device among at least one target device, the second controller can determine that the available address is the target device address of the target device when the first response information of the target device indicates that the available address received from the second controller matches the pre-configured device address of the target device.
[0135] The second controller may determine that the available address cannot be used as the target device address of the target device if the first response information of the target device indicates that the available address received from the second controller does not match the pre-configured device address of the target device.
[0136] In the case where the first address scanning operation is implemented based on address scanning information of the integrated circuit bus, the first address set may include 0x40, 0x41, 0x42, 0x4c, 0x70, and 0x71.
[0137] Because the at least one available address is determined based on the communication protocol between the target device, the second controller, and the first controller, the at least one available address is a relatively complete available address. This ensures that the first address scanning operation is a relatively comprehensive address scanning operation, reducing the probability of missing the target device address.
[0138] The second controller may perform the second address scanning operation on at least one target device and the first controller under certain circumstances, which may be achieved in the following manner.
[0139] As an implementation, the third address set may include a pre-configured device address for each of at least one target device. The pre-configured device address may be intended for communication between the target device and the second controller. The pre-configured device address may be stored in a second memory. The second memory may include a non-volatile memory. The non-volatile memory may include an electrically erasable programmable read-only memory.
[0140] The second controller can perform a second address scanning operation for at least one target device and the first controller in response to the first address set and the second address set being consistent. For example, the second controller can determine whether there is a target device address that matches the pre-configured device address in the first address set for any pre-configured device address in at least one pre-configured device address. When it is determined that there is a target device address that matches the pre-configured device address in the first address set, it can be determined that there is a matching target device address for the pre-configured device address. When it is determined that there is a matching target device address for each of at least one pre-configured device addresses, a second address scanning operation can be performed for at least one target device and the first controller. When it is determined that there is at least one pre-configured device address that does not have a matching target device address, an error message can be generated. The error message can be used to indicate an address configuration anomaly.
[0141] How the second controller performs the second address scanning operation on at least one target device and the first controller can be implemented in the following manner.
[0142] As an implementation, for any available address among the at least one second communication address, the second controller may send the available address to the at least one target device and the first controller, so that for any target device among the at least one target device, the target device may generate second response information for the second address scanning operation based on the preconfigured device address of the target device and the available address received from the second controller. The first controller may generate third response information for the second address scanning operation based on the target controller address of the first controller and the available address received from the second controller.
[0143] The target device may respond to receiving the available address from the second controller. The target device may generate second response information of the target device when determining that the available address received from the second controller matches the pre-configured device address of the target device. The second response information of the target device indicates that the available address received from the second controller matches the pre-configured device address of the target device. The second response information of the target device is sent to the second controller.
[0144] The target device may generate second response information of the target device when determining that the available address received from the second controller does not match the pre-configured device address of the target device. The second response information of the target device indicates that the available address received from the second controller does not match the pre-configured device address of the target device. The second response information of the target device is sent to the second controller.
[0145] The first controller may respond to receiving the available address from the second controller. The first controller may generate third response information of the first controller if it determines that the available address received from the second controller matches the target controller address of the first controller. The third response information of the first controller indicates that the available address received from the second controller by the first controller matches the pre-configured device address of the first controller. The third response information of the first controller is sent to the second controller.
[0146] The first controller may generate third response information of the first controller if it is determined that the available address received from the second controller does not match the pre-configured device address of the first controller. The third response information of the first controller indicates that the available address received from the second controller by the first controller does not match the pre-configured device address of the first controller. The third response information of the first controller is sent to the second controller.
[0147] Since the execution of the second address scanning operation for at least one target device and the first controller is triggered when it is determined that a matching target device address exists for each of the at least one pre-configured device addresses, the pre-configured device addresses are expected to be used for communication between the target device and the second controller, and the target device addresses are obtained by the second controller based on the first response information for the first address scanning operation, and the presence of a matching target device address for each of the at least one pre-configured device addresses indicates that the actual address of the target device used for communication with the second controller is accurate, thereby improving the accuracy of the target controller address, thereby improving communication reliability and system stability.
[0148] How the second controller obtains the second address set can be achieved in the following manner.
[0149] As an implementation method, for any target device among at least one target device, the second controller determines that the available address is the target device address of the target device when it determines that the second response information of the target device indicates that the available address received from the second controller matches the pre-configured device address of the target device.
[0150] When the second controller determines that the third response information of the first controller indicates that the available address received from the second controller matches the target controller address of the first controller, the second controller determines the available address as the target controller address of the first controller.
[0151] In the case where the second address scanning operation is implemented based on the address scanning information of the integrated circuit bus, the second address set may include 0x11, 0x40, 0x41, 0x42, 0x4c, 0x70, and 0x71.
[0152] Because the at least one available address is determined based on the communication protocol used between the target device, the second controller, and the first controller, the at least one available address is a relatively complete available address. This ensures that the second address scan operation is a relatively comprehensive address scan operation, reducing the probability of missing addresses in the second address set. Because the target controller address is an unmatched address between the second address set and the first address set, the accuracy of the target controller address is improved, thereby enhancing communication reliability and system stability.
[0153] Regarding how to determine the target controller address based on the first address set and the second address set, it can be achieved in the following manner.
[0154] As an implementation method, since the first address set is obtained by performing a first address scanning operation on at least one target device, and the second address set is obtained by performing a second address scanning operation on at least one target device and the first controller, it is possible to determine that there is an unmatched address between the second address set and the first address set, and use the unmatched address as the target controller address.
[0155] For any address in the second address set, the second controller can determine whether there is an address in the first address set that matches the address. If it is determined that there is an address in the first address set that matches the address, the second controller determines that the address is not the target controller address. If it is determined that there is no address in the first address set that matches the address, the second controller determines that the address is the target controller address. Thus, the unmatched address between the second address set and the first address set can be used as the target controller address.
[0156] For example, the first address set may include 0x40, 0x41, 0x42, 0x4c, 0x70, and 0x71. The second address set may include 0x11, 0x40, 0x41, 0x42, 0x4c, 0x70, and 0x71. By comparing the first address set and the second address set, it is found that "0x11" is an unmatched address between the second address set and the first address set. Therefore, "0x11" is used as the target controller address.
[0157] Because the at least one available address is determined based on the communication protocol used between the target device, the second controller, and the first controller, the at least one available address is a relatively complete available address. This ensures that the first and second address scanning operations are relatively comprehensive, reducing the probability of missing addresses in the first and second address sets. Because the target controller address is an unmatched address between the second and first address sets, the accuracy of the target device address is improved, thereby enhancing communication reliability and system stability.
[0158] When the second controller obtains the target device address, in response to a reset, reload, or restart of the second controller, the second controller may communicate with the first controller using the target device address without performing an address scan operation.
[0159] The above describes the method for handling address conflicts applied to the second controller provided in the embodiments of the present application.
[0160] Based on the above content, the following generally describes a method for handling address conflicts between a first controller and a second controller provided in an embodiment of the present application.
[0161] The first controller can communicate with the second controller using a dynamic address allocation strategy. Upon power-up, the first controller can retrieve an address from the first memory for communicating with the second controller. The address used for communicating with the second controller can be referred to as a valid address. Since the first memory does not store a valid address when the first controller is first started, if the first controller does not retrieve a valid address from the first memory within a third predetermined period, the first controller can block, disable, or temporarily disable the communication function and initiate a detection function.
[0162] When the detection function is activated, the first controller, in response to detecting that the second controller performs a first address scanning operation, obtains the target device address of at least one target device based on the first response information of at least one target device to the first address scanning operation. When it is determined that the at least one target device address conflicts with the initial controller address of the first controller, the initial controller address is adjusted to obtain a target controller address that is different from the at least one target device address. In addition, when the second controller obtains the target controller address, the communication function can be enabled. Thus, when the second controller performs the second address scanning operation, it can obtain the target controller address. In addition, the target controller address can be stored in the first memory so that the first controller can obtain the target controller address from the first memory in response to reloading or restarting, thereby improving the stability of system communication.
[0163] The first controller uses address conflict detection and conflict resolution to convert the fixed initial controller address into an adaptively variable target controller address, resolving address conflicts between the first controller and the target device. Furthermore, this ensures address uniqueness during hardware initialization and subsequent communication reliability.
[0164] For the second controller, the second controller improves hardware reliability and obtains the target controller address of the first controller by performing a first address scanning operation and a second address scanning operation. The second controller can obtain a first address set including the target device address of at least one target device based on the first response information of at least one first target device for the first address scanning operation. Comparing the first address set with the third address set including the pre-configured device address of at least one target device, when it is determined that there is a matching target device address for each of the at least one pre-configured device addresses, a second address scanning operation can be performed for the at least one target device and the first controller. When it is determined that there is at least one pre-configured device address that does not have a matching target device address, an error message can be generated. The error message can be used to indicate an address configuration abnormality.
[0165] The second controller obtains a second address set based on the second response information of the at least one target device to the second address scan operation and the third response information of the first controller to the second address scan operation, wherein the second address set may include at least one target device address and a target controller address. Unmatched addresses in the second address set and the first address set are used as the target controller address of the first controller. When the second controller obtains the target controller address, in response to a reset, reload, or restart of the second controller, the second controller may communicate with the first controller using the target controller address without further performing the address scan operation.
[0166] The second controller improves hardware reliability by adopting the above-mentioned method, realizes stable communication after supporting system reset, and is dynamically bound to the second actual address of the first controller.
[0167] Based on the address conflict processing method provided in the embodiment of the present application, it is possible to solve the address conflict problem between the first controller (i.e., programmable device) and the target device (i.e., non-programmable device) by modifying the code of the first controller and the second controller while maintaining the hardware architecture between the first controller, the second controller and the target device unchanged, thereby reducing the probability of communication anomalies and improving system stability.
[0168] The above are merely exemplary embodiments, but are not limited thereto. Other methods for handling address conflicts known in the art may also be included, as long as they can resolve the address conflict.
[0169] Based on the same inventive concept as the aforementioned embodiment of the method for handling address conflicts applied to a first controller, the present embodiment further provides a first controller for handling address conflicts, implementing the method for handling address conflicts applied to the first controller provided in the embodiment of the present invention. The first controller includes circuitry for implementing various operations of the method for handling address conflicts.
[0170] Figure 7 A block diagram of a first controller for handling address conflicts according to an embodiment of the present application is shown.
[0171] like Figure 7 As shown, the first controller 700 may include an address obtaining circuit 710 and an address conflict handling circuit 720 .
[0172] The address obtaining circuit 710 is configured to perform operation S410 .
[0173] The address conflict handling circuit 720 is configured to perform operation S420 .
[0174] According to an embodiment of the present application, the first controller 700 may further include a function configuration circuit. The function configuration circuit may be configured to disable the communication function if a valid address, for example, an initial controller address, is not obtained within a predetermined period of time.
[0175] According to an embodiment of the present application, the function configuration circuit may also be configured to, in response to reloading or restarting, enable the communication function of the first controller when the target controller address is obtained, so that the second controller obtains the target controller address.
[0176] Based on the same inventive concept as the aforementioned embodiment of the method for handling address conflicts applied to a second controller, the present embodiment further provides a second controller for handling address conflicts, implementing the method for handling address conflicts applied to the second controller provided in the embodiment of the present invention. The second controller includes modules or units for implementing the various operations of the method for handling address conflicts.
[0177] Figure 8 A block diagram of a second controller for handling address conflicts according to an embodiment of the present application is shown.
[0178] like Figure 8 As shown, the second controller 800 may include an address scanning module 810 .
[0179] The address scanning module 810 is configured to perform operation S510.
[0180] Figure 9 A block diagram of an address conflict processing system according to an embodiment of the present application is shown.
[0181] like Figure 9 As shown, the address conflict processing system 900 may include a first controller 700 and a second controller 800 .
[0182] The first controller 700 may include an address obtaining circuit and an address conflict handling circuit. The first controller 700 may be configured to execute the address conflict handling method applied to the first controller 700 according to the embodiment of the present application.
[0183] The second controller 800 may include an address scanning module. The second controller 800 may be configured to execute the method for handling address conflicts applied to the second controller 800 according to the embodiment of the present application.
[0184] Figure 10 A block diagram of an electronic device suitable for implementing a method for handling address conflicts according to an embodiment of the present application is shown.
[0185] like Figure 10 As shown, the electronic device 1000 according to an embodiment of the present application includes a first controller 700, a second controller 800, and one or more memories 1030. The memories 1030 store a computer program (sometimes also referred to as code or instructions). The computer program can be executed on the first controller 700, so that the electronic device 1000 performs the method applied to the first controller 700 in the above embodiment. Optionally, the computer program can be executed on the second controller 800, so that the electronic device 1000 performs the method applied to the second controller 800 in the above embodiment. The memory 1030 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
[0186] The present application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the present application.
[0187] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM and / or RAM described above and / or one or more memories other than ROM and RAM.
[0188] The embodiments of the present application also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided in the embodiments of the present application.
[0189] When the computer program is executed by the first controller 700 and the second controller 800, the above functions defined in the system / device of the embodiment of the present application are performed. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0190] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal over a network medium. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0191] In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion, and / or installed from a removable medium. When the computer program is executed by the first controller 700 and the second controller 800, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0192] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0193] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0194] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.
[0195] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present application, those skilled in the art may make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present application.
Claims
1. A first controller for handling address conflicts, characterized in that: include: an address obtaining circuit configured to, in response to detecting that the second controller performs a first address scanning operation for at least one target device, start a detection function when a communication function is disabled, the detection function being configured to obtain a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation; as well as an address conflict handling circuit configured to, in response to a target device address in at least one of the target device addresses including a target device address that matches an initial controller address of the first controller, adjust the initial controller address to obtain a target controller address of the first controller, wherein the target controller address is different from the target device address; Wherein, the first controller is further configured as: In a case where the target controller address is obtained, enabling a communication function of the first controller so that the second controller is configured to perform a second address scanning operation for the at least one target device and the first controller in response to consistency between the first address set and the third address set, obtaining a second address set based on second response information of each of the at least one target device to the second address scanning operation and third response information of the first controller to the second address scanning operation, and using unmatched addresses between the second address set and the first address set as the target controller address, wherein the first address set is obtained by the second controller based on the first response information of each of the at least one target device to the first address scanning operation, the second address set includes the target device address of each of the at least one target device and the target controller address of the first controller, and the third address set includes the pre-configured device address of each of the at least one target device; The address conflict handling circuit is further configured to: The target controller address is determined from a plurality of first target available addresses stored in a first memory, where the first target available address is an address within a range of available addresses for communication between the first controller, the second controller, and the target device.
2. The first controller according to claim 1, characterized in that The address conflict handling circuit is further configured to: The initial controller address is adjusted based on an address increment strategy to obtain the target controller address.
3. The first controller according to claim 1, characterized in that The available address range includes a plurality of available addresses; Wherein, the address conflict processing circuit is further configured to: The plurality of first target available addresses are determined from the plurality of available addresses according to respective usage status information of the plurality of available addresses, wherein the usage status information is used to indicate at least one of usage information or conflict information of the available addresses.
4. The first controller according to claim 3, characterized in that: The usage information includes at least one of the following: the number of uses or the usage period; the conflict information includes at least one of the following: the number of conflicts or the conflict period; Wherein, the address conflict processing circuit is further configured to: Determining, based on the usage status information of each of the plurality of available addresses, a conflict evaluation result of each of the plurality of available addresses, wherein the conflict evaluation result is used to indicate a probability of a conflict occurring among the available addresses; and The plurality of first target available addresses are determined from the plurality of available addresses according to conflict evaluation results of the respective plurality of available addresses.
5. The first controller according to claim 3, characterized in that: The usage status information includes the conflict information; Wherein, the address conflict processing circuit is further configured to: Classifying the multiple available addresses according to their respective conflict information to obtain a first category of available addresses and a second category of available addresses, wherein a probability of a conflict occurring in the first category of available addresses is less than a probability of a conflict occurring in the second category of available addresses; and The plurality of first target available addresses are determined from the first type of available addresses.
6. The first controller according to claim 1, characterized in that: The address conflict handling circuit is further configured to: In response to the presence of a target device address in the plurality of target device addresses that matches each of the plurality of first target available addresses, the initial controller address is adjusted based on an address increment strategy to obtain the target controller address.
7. The first controller according to any one of claims 1 to 6, characterized in that: Also includes: The function configuration circuit is configured to disable the communication function in response to failure to obtain a valid address of the first controller within a predetermined period of time.
8. The first controller according to any one of claims 1 to 6, characterized in that: Also includes: The function configuration circuit is configured to, in response to reloading or restarting, enable the communication function of the first controller when the target controller address is obtained, so that the second controller obtains the target controller address.
9. The first controller according to any one of claims 1 to 6, characterized in that: The address acquisition circuit is further configured to: For any target device among the at least one target device, when the first response information indicates that the available address received from the second controller matches the pre-configured device address of the target device, determining that the available address is the target device address, wherein the available address is an address within a range of available addresses used for communication between the target device, the second controller and the first controller.
10. The first controller according to claim 9, characterized in that: The address acquisition circuit is further configured to: When the first response information indicates that a second target available address received from the second controller matches a pre-configured device address of the target device, the second target available address is determined to be the target device address, wherein the second target available address is determined from the plurality of available addresses.
11. A second controller for handling address conflicts, characterized in that: include: an address scanning module configured to perform a first address scanning operation for at least one target device, so that an address obtaining circuit of the first controller is configured to, in response to detecting the first address scanning operation, start a detection function when a communication function is disabled, the detection function being configured to obtain a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation, and an address conflict handling circuit of the first controller is configured to, in response to a target device address in at least one of the target device addresses matching an initial controller address of the first controller, adjust the initial controller address to obtain a target controller address of the first controller; Wherein, the target controller address is different from the target device address; The second controller is further configured to, when a communication function of the first controller is enabled, obtain a first address set based on the first response information, the first address set including the target device address of each of the at least one target device; in response to the first address set and the third address set being consistent, obtain a second address set based on second response information of each of the at least one target device to a second address scan operation and third response information of the first controller to the second address scan operation, and use unmatched addresses between the second address set and the first address set as the target controller address, the second address set including the target device address of each of the at least one target device and the target controller address of the first controller, and the third address set including the pre-configured device address of each of the at least one target device, and the communication function of the first controller is configured by the first controller to be enabled when the target controller address is obtained; The address conflict handling circuit of the first controller is further configured to determine the target controller address from a plurality of first target available addresses stored in the first memory, wherein the first target available address is an address within a range of available addresses for communication between the first controller, the second controller and the target device.
12. The second controller according to claim 11, characterized in that: The address scanning module is further configured to: For any available address of at least one available address, the available address is sent to the at least one target device, so that for any target device of the at least one target device, the target device generates first response information for the first address scan operation based on the available address and a pre-configured device address of the target device, wherein the available address is an address within a range of available addresses used for communication between the target device, the second controller and the first controller.
13. The second controller according to claim 12, characterized in that: The address acquisition module is further configured to: For any target device among the at least one target device, if the first response information indicates that the available address received from the second controller matches the pre-configured device address of the target device, determining the available address as the target device address.
14. The second controller according to claim 11, characterized in that: The address acquisition module is further configured to: For any target device among the at least one target device, if the second response information indicates that the available address received from the second controller matches the pre-configured device address of the target device, determining the available address as the target device address; And if the third response information indicates that the available address received from the second controller matches the target controller address of the first controller, determining the available address as the target controller address.
15. A system for handling address conflicts, characterized in that: include: A first controller includes an address obtaining circuit and an address conflict handling circuit; The address acquisition circuit is configured to, in response to detecting a first address scanning operation, activate a detection function when a communication function is disabled, wherein the detection function is used to obtain a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation; the address conflict handling circuit being configured to, in response to at least one of the target device addresses having a target device address that matches the initial controller address of the first controller, adjust the initial controller address to obtain a target controller address of the first controller, wherein the target controller address is different from the target device address; and a second controller comprising an address scanning module configured to perform a first address scanning operation for the at least one target device; The first controller is further configured to enable a communication function of the first controller when the target controller address is obtained; the first controller is further configured to determine the target controller address from a plurality of first target available addresses stored in the first memory, the first target available address being an address within a range of available addresses for communication between the first controller, the second controller, and the target device; The second controller is also configured to, when the communication function of the first controller is enabled, perform a second address scanning operation for the at least one target device and the first controller in response to the consistency of the first address set and the third address set, obtain a second address set based on the second response information of the at least one target device for the second address scanning operation and the third response information of the first controller for the second address scanning operation, and use the unmatched address between the second address set and the first address set as the target controller address. The first address set is obtained by the second controller based on the first response information of the at least one target device for the first address scanning operation, the second address set includes the target device address of the at least one target device and the target controller address of the first controller, and the third address set includes the pre-configured device address of the at least one target device.
16. A method for handling address conflicts, characterized in that: Applied to the first controller, comprising: In response to detecting that the second controller performs a first address scanning operation for at least one target device, when the communication function is disabled, starting a detection function for obtaining a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation; and In response to at least one of the target device addresses having a target device address that matches the initial controller address of the first controller, adjusting the initial controller address to obtain a target controller address of the first controller, wherein the target controller address is different from the target device address; The method further comprises: In a case where the target controller address is obtained, enabling a communication function of the first controller so that the second controller is configured to perform a second address scanning operation for the at least one target device and the first controller in response to consistency between the first address set and the third address set, obtaining a second address set based on second response information of each of the at least one target device to the second address scanning operation and third response information of the first controller to the second address scanning operation, and using unmatched addresses between the second address set and the first address set as the target controller address, wherein the first address set is obtained by the second controller based on the first response information of each of the at least one target device to the first address scanning operation, the second address set includes the target device address of each of the at least one target device and the target controller address of the first controller, and the third address set includes the pre-configured device address of each of the at least one target device; The adjusting the initial controller address to obtain the target controller address of the first controller includes: The target controller address is determined from a plurality of first target available addresses stored in a first memory, where the first target available address is an address within a range of available addresses for communication between the first controller, the second controller, and the target device.
17. A method for handling address conflicts, characterized in that: Applicable to the second controller, including: performing a first address scanning operation for at least one target device, so that the first controller, in response to detecting the first address scanning operation, starts a detection function with a communication function disabled, the detection function being configured to obtain a target device address of each of the at least one target devices based on first response information of each of the at least one target devices to the first address scanning operation, and the first controller is configured to adjust the initial controller address to obtain a target controller address of the first controller in response to a target device address matching the initial controller address of the first controller among at least one of the target device addresses; Wherein, the target controller address is different from the target device address; The method further comprises: When the communication function of the first controller is enabled, in response to the first address set and the third address set being consistent, a second address scan operation is performed for the at least one target device and the first controller, a second address set is obtained based on second response information of each of the at least one target device to the second address scan operation and third response information of the first controller to the second address scan operation, and an unmatched address between the second address set and the first address set is used as the target controller address, the first address set is obtained by the second controller based on the first response information of each of the at least one target device to the first address scan operation, the second address set includes the target device address of each of the at least one target device and the target controller address of the first controller, and the third address set includes the pre-configured device address of each of the at least one target device, and the communication function of the first controller is enabled by the first controller when the target controller address is obtained; The first controller is further configured to determine the target controller address from a plurality of first target available addresses stored in the first memory, where the first target available address is an address within an available address range for communication between the first controller, the second controller, and the target device.
Citation Information
Patent Citations
Equipment address changing method and device, electronic equipment and storage medium
CN119011526A
Address allocation method and device, electronic equipment and computer readable storage medium
CN119946020A