Equipment address changing method and device, electronic equipment and storage medium
Through the server processor identifying and modifying the device address, the problem of device address conflicts in the server system is solved, and the device address is automatically adjusted, which reduces development and maintenance costs and improves efficiency.
Patent Information
- Application Number
- CN202411215357.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-22
AI Technical Summary
In a server system, device address conflicts are prone to occur when the equipment of multiple manufacturers are connected, resulting in functional abnormalities. The prior art is difficult to effectively solve this problem, especially when the hardware design is not changed.
The server processor recognizes the device addresses of all target devices currently connected, judges and modifys the device addresses of the first device, and directly modifys the address of the first device using the communication connection channel to avoid address conflicts. The address scanning unit, the conflict judgment unit and Combination solution for address modification units.
It realizes conflict detection and resolution of device address, avoids address conflicts, saves server development and maintenance costs, improves development and maintenance efficiency, and does not need to change the hardware design of the target device.
Smart Images

Figure CN119011526A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a method and device for changing a device address, an electronic device and a storage medium. Background Art
[0002] With the continuous development of big data and cloud computing technologies, users' demand for server system resources has also increased. Although the overall upgrade of server system resources has been achieved by improving the computing power of processors and upgrading multi-way processor platforms, the data processing capacity of the entire server system has been greatly improved. However, with the application of technologies such as big data and artificial intelligence, the amount of data has grown exponentially in recent years, resulting in the inability of traditional servers with only CPU (Central Processing Unit) as the data processing core to meet data processing needs. The only way to further improve the data processing capacity of the entire server system is to configure other devices for the server. During application, the server may connect to devices from multiple manufacturers to implement the entire server system. When configuring these devices, there are inconsistencies in the use of device addresses by various manufacturers. This leads to address conflicts when the server is connected to multiple external devices, which may cause server malfunctions in severe cases.
[0003] It can be seen that how to resolve the device address conflict that occurs in the server system is a problem that those skilled in the art need to solve. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method, an apparatus, an electronic device and a storage medium for changing a device address, which can solve the address conflict problem existing in devices connected to a server.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for changing a device address, which is applied to a processor of a server; the method for changing a device address includes:
[0006] Determine the device addresses of all target devices currently connected to the server; the target devices include a first device and a second device, the first device is a device that supports the server to modify the device address, and the second device is a device that does not support the server to modify the device address;
[0007] Determine whether there is a consistent device address between the device address of the first device and the device address of the second device;
[0008] If so, a communication connection channel for directly connecting the first device corresponding to the consistent device address is determined, and the device address of the first device corresponding to the consistent device address is modified based on the communication connection channel.
[0009] In some embodiments, the processor of the server is connected to the first device via an address line;
[0010] The method for changing the device address also includes:
[0011] Sending a configuration instruction to the corresponding first device through the address line to configure a device address for the first device;
[0012] The device address of the first device corresponding to the modified consistent device address includes:
[0013] Determine a configuration instruction of the first device corresponding to the consistent device address;
[0014] The configuration instruction is modified, and the modified configuration instruction is sent to the corresponding first device through the address line.
[0015] In some embodiments, it also includes:
[0016] When a configuration instruction of the first device is modified, recording the modified configuration instruction of the first device and the device address corresponding to the modification;
[0017] The access address of the first device is updated based on the modified device address, so that the first device can be accessed subsequently according to the updated access address.
[0018] In some embodiments, before determining the device addresses of all target devices currently connected to the server, the method further includes:
[0019] Identify the current hardware connection status of the server;
[0020] Determining whether there is a change in the hardware configuration of the server based on the hardware connection status; the hardware configuration includes the number and type of hardware devices connected to the server;
[0021] If yes, jump to the step of determining the device addresses of all target devices currently connected to the server.
[0022] In some embodiments, the communication port of the processor of the server establishes an original communication connection with all target devices currently connected to the server via a daisy chain topology;
[0023] Determining the device addresses of all target devices currently connected to the server includes:
[0024] Divide all target devices currently connected to the server into several device groups; the target devices in each device group are all first devices of the server or all external second devices;
[0025] Cutting off the original communication connection between the device groups;
[0026] Establishing independent communication connections between itself and each of the device groups respectively; the independent communication connections corresponding to each of the device groups are independent of each other, and the communication mode of the independent communication connection is consistent with that of the original communication connection;
[0027] For any device group, an address scanning instruction is issued through its corresponding independent communication connection;
[0028] receiving a response result of the device group to the address scanning instruction;
[0029] Determine the device address of each of the target devices in the device group based on the response result;
[0030] Recording the device address of each of the target devices;
[0031] The step of determining the communication connection channel of the first device corresponding to the device address that is directly connected to the same device address includes:
[0032] The device group to which the first device corresponding to the consistent device address belongs is determined, and the independent communication connection corresponding to the device group to which it belongs is determined as a communication connection channel directly connected to the first device corresponding to the consistent device address.
[0033] In some embodiments, the server further comprises a switching switch chip, the switching switch chip is arranged between two adjacent device groups, and there is a corresponding switching switch chip for any two adjacent device groups; the input end of the switching switch chip is connected to the communication output end of the first device group, the first output end is connected to the communication input end of the second device group, and the second output end is connected to the redundant communication port of the processor;
[0034] The cutting off of the original communication connection between the device groups includes:
[0035] Controlling the switching switch chip to cut off its own input end and the first output end;
[0036] The step of respectively establishing independent communication connections between itself and each of the device groups comprises:
[0037] The switching switch chip is controlled to connect its input terminal and the second output terminal.
[0038] In some embodiments, after recording the device address of each target device, the method further includes:
[0039] The switching switch chip is controlled to connect its own input end and the first output end, and to disconnect its own input end and the second output end, so that the target device can restore the original communication connection.
[0040] In order to solve the above technical problems, an embodiment of the present invention further provides a device for changing a device address, which is applied to a processor of a server; the device for changing a device address comprises:
[0041] An address scanning unit, used to determine the device addresses of all target devices currently connected to the server; the target devices include a first device of the server and an external second device;
[0042] a conflict determination unit, configured to determine whether a device address of the first device and a device address of the second device are consistent; if so, triggering an address modification unit;
[0043] The address modification unit is used to determine a communication connection channel for directly connecting a first device corresponding to a consistent device address, and modify a device address of the first device corresponding to the consistent device address based on the communication connection channel.
[0044] To solve the above technical problems, an embodiment of the present invention further provides an electronic device, including:
[0045] Memory for storing computer programs;
[0046] A processor is used to execute the computer program to implement the steps of the device address changing method as described above.
[0047] To solve the above technical problem, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for changing the device address as described above are implemented.
[0048] It can be seen from the above technical solution that by identifying the device addresses configured for all target devices currently connected to the server, when there is an address conflict between the first device and the second device connected to the server, the address conflict can be avoided by directly modifying the device address of the first device, so as to cope with the problem of address conflict when a general server is used with devices from different manufacturers; the beneficial effect of the present invention is that it effectively realizes the conflict detection of device addresses and resolves the address conflict situation, and the address modification process of the server for the first device can be directly implemented through its own control mechanism, and the device address can be automatically adjusted without changing the hardware design of the target device, which greatly saves the development cost and maintenance cost of the server and improves the development and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a flow chart of a method for changing a device address provided by an embodiment of the present invention;
[0051] Figure 2 A schematic diagram of device connection during normal application of a server provided by an embodiment of the present invention;
[0052] Figure 3 A schematic diagram of device connection during address conflict detection of a server provided by an embodiment of the present invention;
[0053] Figure 4 A schematic flow chart of another method for changing a device address provided in an embodiment of the present invention;
[0054] Figure 5 A schematic diagram of the structure of a device address changing apparatus provided by an embodiment of the present invention;
[0055] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0058] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0059] With the widespread application of technologies such as big data and artificial intelligence, traditional servers that only use CPU as the data processing core cannot meet the data processing needs. At this time, servers equipped with GPU (Graphics Processing Unit) came into being. Similarly, when using servers, they will be equipped with various types of network cards and GPUs to improve the data processing capabilities of the entire server system or meet more functional requirements of users. At this time, the BMC (Baseboard Management Controller) in the server will read various information such as alarms, voltages, temperatures, hard disk information, firmware version numbers, FW (Firmware) upgrades, etc. of each device through the i2c bus or other types of communication buses to control and manage each device. In general, general servers have diverse configurations and can adapt to many manufacturers' equipment, but there are inconsistencies in the use of device addresses by various manufacturers, which leads to frequent address conflicts. If there is an address conflict problem on the communication bus of the server, functional abnormalities may occur in severe cases; some address conflict problems are relatively hidden and difficult to find. Only when new functions are developed later can problems with the implementation of new functions be found, and the cost of solving the problem will also be greatly increased. Currently, the address configuration of devices in servers is done by connecting pins with pull-up and pull-down resistors. Once the device address is configured, it can only be changed by changing the hardware, which is time-consuming and labor-intensive, increases costs, and is difficult to control.
[0060] Next, a method for changing a device address provided by an embodiment of the present invention is described in detail, which is applied to a processor of a server. Figure 1 As shown, Figure 1 A schematic diagram of a flow chart of a method for changing a device address provided in an embodiment of the present invention; the method for changing a device address includes:
[0061] S11: Determine the device addresses of all target devices currently connected to the server; the target devices include a first device and a second device, the first device is a device that supports the server to modify the device address, and the second device is a device that does not support the server to modify the device address;
[0062] It is not difficult to understand that when the configuration of the server is completed, it is first necessary to detect whether there is an address conflict in the device currently connected to the server. At this time, the device currently connected to the server is scanned as a target device, and the device addresses of all target devices currently connected to the server are scanned to obtain the device addresses, so that the subsequent judgment on whether there is an address conflict among all the devices currently connected to the server can be based on all the obtained device addresses.
[0063] It should be noted that the devices connected to the server include the first device and the second device. The first device is a self-developed device developed by the same R&D party as the server. It is usually a device developed by the designer when designing the R&D server. The server can directly access these R&D devices and modify the configuration information such as the device address of the R&D device; the second device refers to some devices or components with unknown device addresses connected to the server. The addresses of these devices are not specified in the manufacturer's manual. The second device is a device purchased from other manufacturers or other R&D parties during the actual application of the server, and then installed in the server. The generation design of these devices is completed by other manufacturers or other R&D personnel. Its device address and other configuration information is fixed and cannot be modified by the server. The first device is generally set on the self-developed board of the server, and the server's processor clearly defines the device address information of the first device; the second device is usually directly set on the board during production and directly connected to the server through the board. Since the second device is usually designed by other manufacturers or R&D personnel, the server cannot directly clarify its device address and needs to issue instructions through the communication bus to execute the process of obtaining the device address, thereby completing the process of obtaining the device address and detecting address conflicts.
[0064] S12: Determine whether there is a consistent device address between the device address of the first device and the device address of the second device;
[0065] It can be understood that the present invention detects whether an address conflict occurs in the server by comparing the acquired device addresses. After the processor scans each target device connected to the server, it can obtain the device address corresponding to each target device and record each device address when it is acquired. Then, the processor can compare the device address of the first device with the device address of the second device based on the recorded device addresses. If there is a situation where the device address of a first device is the same as the device address of a second device, it means that an address conflict occurs.
[0066] It is not difficult to understand that there are multiple options for the specific process of comparing the device address of the first device and the device address of the second device, and the present application does not make any special restrictions here. As an optional embodiment, when recording the acquired device address, the processor can record the device address of the first device and the device address of the second device separately. When the processor acquires the device address of a target device, it first determines whether the target device is the first device or the second device. If it is the first device, it traverses the various device addresses of the second device that have been recorded. If it is the second device, it traverses the various device addresses of the first device that have been recorded, and determines whether there is a device address that is the same as it in the recorded data; if there is a same, it means that the server currently has an address conflict. The conflicting first device and the second device can be recorded first and then the subsequent device address acquisition process can be performed, or the step S13 can be directly jumped to solve the address conflict problem first and then the device address acquisition process can be performed again; if there is no same, the device address of the next target device can be acquired until the device address of the target device connected to the server is acquired. The above operation is performed each time the acquired device address is received, so as to detect whether there is an address conflict for all device addresses.
[0067] S13: If yes, determine a communication connection channel for directly connecting the first device corresponding to the consistent device address, and modify the device address of the first device corresponding to the consistent device address based on the communication connection channel.
[0068] It is understandable that when there is an address conflict on the server, considering that the configuration server of the device address of the second device cannot be directly modified, the server needs to modify the device address of the first device with the address conflict to avoid the address conflict. At this time, the processor can use the pre-established direct connection communication connection channel between itself and the first device to modify the device address of the first device. The communication connection channel of the first device corresponding to the device address of the direct connection is a communication connection that starts with the processor and ends with the first device and only connects the processor and the corresponding first device. The modification process of the device address of the first device by the server can be directly implemented through software control without changing the hardware design of the server or device. The specific implementation method of the server to modify the device address and the rules for changing the device address are not specifically limited here. The preset device address change rules can be pre-constructed; specifically, a reference device address that is different from all the device addresses recorded in step S11 can be determined first, and the reference device address can be configured to the first device that needs to modify the device address; it is also possible to pre-determine a number of reference device addresses that are different from the device addresses of all first devices before the server is applied. When the device address needs to be modified, a reference device address is directly selected from them and configured to the corresponding first device.
[0069] It should be noted that the specific types and implementation methods of the first device and the second device are not specifically limited in this application, and may be network cards, GPUs, etc. The specific types and implementation methods of the server are not specifically limited in this application, and may be AI (Artificial Intelligence) servers, etc., which are designed and adjusted according to the actual application needs of users. The specific types and implementation methods of the processor are not specifically limited in this application. For servers, processors generally include BMC and CPLD (Complex Programmable Logic Device), and BMC and CPLD cooperate to implement the detection and change process of address conflicts in the server. The device address change method provided in this application can be applied to other products that require communication, not just server products; the communication method between the server and the target device can be implemented through the i2c bus (Inter-Integrated Circuit, two-wire serial bus), or it can be implemented through other types of communication buses. Taking the i2c bus as an example, the solution can also be used in other products that use the i2c bus for communication.
[0070] It should be further explained that the present application does not make any special limitation on the specific connection method between the target device and the server, especially the specific connection method between the second device and the server, which may be a PCIe Slot slot, etc. For example, the process of configuring the second device for the server can be realized by inserting PCIe cards from different manufacturers. In this case, the address on the PCIe card may be consistent with the address on the self-developed board, and the problem of address conflict arises.
[0071] As a specific embodiment, the server communicates with the target device through the i2c bus. The address conflict detection process is implemented by the BMC and CPLD. All target devices connected to the i2c bus are divided into several groups according to actual needs. The self-developed board part with clear i2c address in the server system and the board with unknown parts of other manufacturers are isolated from each other. After the server system changes the hardware configuration, the BMC needs to scan all target devices, and the CPLD screens and compares the addresses of all target devices to see if there is an address conflict. The device addresses of the i2c slave devices inside the self-developed board are all configured by the CPLD. When it is found that the i2c slave device on the self-developed board has an address conflict with the i2c slave device on other unknown boards, the CPLD changes the device address of the device on the corresponding self-developed board, and informs the BMC of the address change of a certain device according to the pre-agreed device address change rules. The BMC will record the address change of the current device, and use the changed new address to access the device during subsequent normal operation, thereby achieving the purpose of solving the address conflict problem.
[0072] The present invention can realize device address conflict detection by designing a process for address conflict detection and a method and server system for automatically adjusting the device address of the server after the address conflict occurs. If an address conflict occurs, the server can change the device address of the first device of the controllable part through its own mechanism, automatically adjust the device address without changing the hardware design, solve the problem of address conflict, greatly save the development cost and maintenance cost of the server, improve the development and maintenance efficiency, effectively solve the address conflict problem that occurs when the device components of different manufacturers are matched during the actual application of the server, and solve the address conflict problem without changing the hardware. In particular, in order to adapt to the needs of different scenarios, the current AI server needs to match various types of network cards, GPUs and other different components. The device addresses inside these components are different, and it is easy to conflict with the device address of the i2c device on the self-developed board. The server can compare the actual device address. If the address is consistent, the device address of the self-developed device of the self-developed board will be changed, thereby solving the address conflict problem.
[0073] See also Figure 2 As shown, Figure 2 A schematic diagram of device connection of a server provided by an embodiment of the present invention during normal application; see Figure 3 As shown, Figure 3 A schematic diagram of device connection during address conflict detection of a server provided in an embodiment of the present invention; in some embodiments, a processor of the server is connected to a first device via an address line;
[0074] The device address can also be changed by:
[0075] Sending a configuration instruction to the corresponding first device through the address line to configure a device address for the first device;
[0076] Modifying the device address of the first device corresponding to the consistent device address includes:
[0077] Determine a configuration instruction of the first device corresponding to the consistent device address;
[0078] The configuration instruction is modified, and the modified configuration instruction is sent to the corresponding first device through the address line.
[0079] It is understandable that the device address of the first device is configured by the processor, so the address (address line) of the first device is usually set, and this address line is connected to the processor. The processor sends instructions through this address line to implement the configuration process of the device address of the first device; when the device address of the first device is subsequently modified, the device address of the first device can also be changed through this address line. The specific type and implementation method of the configuration instruction are not specifically limited in this application. Usually, the CPLD in the processor implements the configuration and change process of the device address by sending a multi-bit level signal that controls the address pin of the first device.
[0080] Specifically, the address lines used by the processor when performing address configuration on the first device can be directly reused to implement the process of modifying the device address of the first device. This process is directly implemented by the processor adjusting the configuration instructions issued by itself, and can be effectively implemented through the software adjustment control mechanism, thereby avoiding the operation of changing hardware and greatly saving the development cost and maintenance cost of the server.
[0081] In some embodiments, it also includes:
[0082] When a configuration instruction of the first device is modified, recording the modified configuration instruction of the first device and the device address corresponding to the modification;
[0083] The access address of the first device is updated based on the modified device address, so that the first device can be accessed subsequently according to the updated access address.
[0084] It is not difficult to understand that in the normal application process, the processor needs to determine the location of each target device based on the device address, that is, the access address, so as to send the corresponding function instructions to the corresponding target device, so that the server can normally complete the required functions. Therefore, once the device address of the first device is changed, the processor needs to record the modified device address of the first device and synchronously modify its own access address to the first device, so as to achieve subsequent accurate access and control of the first device. Figure 2 and Figure 3 As shown, the processor includes a BMC and a CPLD. A communication connection is established between the BMC and the CPLD via a communication link i2c_bmc_cpld. The BMC can control the CPLD to perform link switching via this communication link. The CPLD can notify the BMC via this communication link when an address change occurs in the first device. After receiving the address change notification, the BMC changes the access address of the corresponding first device.
[0085] Specifically, in order to ensure the normal operation of the target device when the device address is changed, when the processor modifies the device address configured for the first device, the processor also needs to synchronously update the access address corresponding to the first device to ensure the accurate implementation of the subsequent normal operation of the server and avoid the situation where the server cannot access the first device normally due to the address change.
[0086] In some embodiments, before determining the device addresses of all target devices currently connected to the server, the method further includes:
[0087] Identify the current hardware connection status of the server;
[0088] Determine whether there is any change in the hardware configuration of the server based on the hardware connection status; the hardware configuration includes the number and type of hardware devices connected to the server;
[0089] If yes, jump to the step of determining the device addresses of all target devices currently connected to the server.
[0090] It is understandable that the target device connected to the server will only have an address conflict when the server has just been assembled or the server has changed its hardware configuration due to application requirements. Both situations can be judged based on whether there is a change in the server's hardware configuration. Therefore, the server's hardware connection status can be first identified to determine whether there is a change in its hardware configuration. When the server's hardware configuration has changed, for example, when the server has just been assembled, its hardware configuration will change from nothing to including the assembled hardware devices. When the server changes its hardware due to application requirements, the number of connected hardware devices and / or the type of connected hardware devices will be different before and after the configuration change. When the server is in these two situations, the device address change method provided by the present invention will be executed to detect whether the server has an address conflict. The specific method of changing the server's hardware configuration is not particularly limited in this application, and is not limited to changes in the number and type of devices in this embodiment.
[0091] Specifically, considering that the address conflict of the server will only occur when the server has just been assembled or there is a hardware configuration change, it is only necessary to perform address conflict detection in these two cases, and there is no need to perform this process all the time, thereby reducing the power consumption of the server.
[0092] In some embodiments, the communication port of the processor of the server establishes an original communication connection with all target devices currently connected to the server via a daisy chain topology;
[0093] Determine the device addresses of all target devices that the server is currently connected to, including:
[0094] Divide all target devices currently connected to the server into several device groups; the target devices in each device group are all first devices of the server or all external second devices;
[0095] Cut off the original communication connection between the device groups;
[0096] Establish independent communication connections between itself and each device group respectively; the independent communication connections corresponding to each device group are independent of each other, and the communication mode of the independent communication connection is consistent with the original communication connection;
[0097] For any device group, an address scanning instruction is issued through its corresponding independent communication connection;
[0098] Receive the response result of the device group to the address scanning instruction;
[0099] Determine the device address of each target device in the device group based on the response result;
[0100] Record the device address of each target device;
[0101] Determining a communication connection channel of a first device corresponding to a device address that is directly connected to the same device address includes:
[0102] The device group to which the first device corresponding to the consistent device address belongs is determined, and the independent communication connection corresponding to the device group to which it belongs is determined as a communication connection channel directly connected to the first device corresponding to the consistent device address.
[0103] It should be noted that, in the normal application process, the processor and the target device need to establish an original communication connection through a daisy chain topology, and the processor will send control instructions to each target device through this daisy chain topology, so as to realize different functions and data processing processes. This daisy chain topology allows the control instructions sent by the processor to be directly output to all target devices, and all target devices will respond to the control instructions. However, in the process of the processor obtaining the device address of each target device, if the processor sends an address scan instruction through the original communication connection, all target devices will return a response result through this original communication connection, and the processor cannot distinguish which target device returns the response result received by itself. Therefore, it is necessary to disconnect the original communication connection between the target device and the processor, and re-establish an independent communication connection between each target device and the processor. At this time, the processor sends an address scan instruction through each independent communication connection, and determines which target device each response result belongs to based on the corresponding relationship between the received response result and the independent communication connection, so as to obtain the device address of each target device and record it. The present application does not make any special limitations on the specific implementation methods of the original communication connection and the independent communication connection. The original communication connection is not limited to the daisy chain topology described in this embodiment. It can be a communication connection established between the server and the target device during the normal functional application process, and can be selected and adjusted according to the specific communication method adopted by the server.
[0104] It is understandable that the response result is a response returned by the target device after receiving the instruction of the processor, and the response includes the device address of the target device itself, so that the processor can clearly understand the correspondence between each response and each target device, and realize an accurate control process. The present application does not make any special restrictions on the specific types and implementation methods of the address scanning instruction and the response result.
[0105] Furthermore, in order to save costs and reduce workload, the target devices can be grouped to obtain several device groups. However, in order to avoid the situation where address conflicts exist in the same device group and are difficult to detect, only the first device is grouped into one group or the second device is grouped into one group during grouping. At this time, it is only necessary to establish an independent communication connection between the processor and each device group. The present application does not make any special restrictions on the specific number of devices in the device group and the grouping method. When the number of target devices is small, grouping is not required and one target device is directly used as a device group.
[0106] Specifically, considering that the normal functional application process of the server and the conflict detection process of the device address require different communication connections to implement the two processes normally, a communication connection switching process is required in the process of determining the device address to effectively detect possible address conflicts in the target device.
[0107] In some embodiments, the server further comprises a switching chip, the switching chip being arranged between two adjacent device groups, and there being a corresponding switching chip for any two adjacent device groups; the input end of the switching chip is connected to the communication output end of the first device group, the first output end is connected to the communication input end of the second device group, and the second output end is connected to the redundant communication port of the processor;
[0108] Cut off the original communication connection between the device groups, including:
[0109] Control the switching chip to cut off its own input end and the first output end;
[0110] Establish independent communication connections between itself and each device group, including:
[0111] The control switch chip is connected to its own input terminal and the second output terminal.
[0112] It is not difficult to understand that the switching process of the communication connection between the server and the target device can be implemented by switching the switch chip. A switching switch chip is added between two adjacent device groups, and a connection between the switching switch chip and the processor is established. The two connection states are switched by switching the switch chip. The specific type and implementation method of the switching switch chip are not particularly limited in this application.
[0113] As a specific embodiment, take the i2c bus used in the server as an example. Figure 2 As shown, Figure 2This is a connection diagram of the i2c bus when the server is working normally. The cross indicates that the connection is cut off. The i2c bus is connected from the BMC to the CPLD, and then connected to the target device through a daisy chain topology. The CPLD controls the switch to cut off the connection between the device group and the CPLD, and connects the i2c device groups in series to form a daisy chain topology. Figure 3 The connection diagram of the i2c bus in the case of address conflict detection when the server is powered on for the first time after assembly is completed, or when the server is powered on for the first time after the hardware configuration is changed. After the CPLD is powered on and detects that the hardware configuration of the server has been changed, the control switch chip interrupts the original i2c daisy chain topology. Each i2c device group is connected to the CPLD through a switch. There are preset switching instructions between the BMC and the CPLD. The BMC controls the CPLD through the preset switching instructions, and switches different i2c buses and target devices directly connected to the CPLD by outputting different switch control signals, that is, switching different independent communication connections to issue address scanning instructions, thereby realizing the situation of scanning all target devices.
[0114] Specifically, different communication connections required by the server in different situations can be implemented by switching the switch chip, and the processor can control the switching process of the two communication connections by controlling the switching switch chip, which is simple, effective and easy to implement.
[0115] In some embodiments, after recording the device address of each target device, the method further includes:
[0116] The control switching switch chip connects its own input end and the first output end, and cuts off its own input end and the second output end, so that the target device can restore the original communication connection.
[0117] It is not difficult to understand that after the processor completes scanning the device addresses of all target devices through independent communication connections, it is necessary to control the switching chip to restore the communication connection to the original communication connection so that the server can complete normal functional applications based on the original communication connection.
[0118] As a specific embodiment, see Figure 4 As shown, Figure 4A flow chart of another method for changing a device address provided in an embodiment of the present invention; after the server is assembled or the server changes its hardware configuration, the server's AC (alternating current power) is powered on, and after the CPLD program is loaded, the CPLD reads the current hardware connection status of the server, or determines whether the server's hardware configuration has been changed by judging whether the server's top cover has been opened. If the server's hardware connection status changes, it is necessary to scan all connected target devices after the AC is powered on. CPLD controls the switch according to the configuration file, switches the target device or device group that may be inserted with non-self-developed components and has unknown device addresses to the CPLD, and disconnects the connection between the device group and other device groups. CPLD tells BMC through GPIO signals that it needs to enter the device address scanning state. After the BMC firmware is loaded, BMC sends an address scanning instruction to CPLD. According to the mapping relationship between the switch chip inside CPLD and the corresponding device group, BMC scans the device address of the target device in each device group. CPLD records the scanned device address and performs address judgment. If the address is consistent, CPLD will change the device address of the first device on the self-developed board and notify BMC of the change of the device address. BMC will remember the changed device address. Finally, CPLD controls the switch to restore the communication connection of the i2c bus to the initial state, and informs BMC that there is no address conflict in the current system. BMC starts to work normally and performs normal functional applications of the server. If there is no address conflict, CPLD directly controls the switch to restore the i2c topology to the daisy chain form, and informs BMC that there is no address conflict in the current system and enters the normal working mode.
[0119] Specifically, in order to ensure the normal operation of the server, the processor will finally restore the communication connection between the server and the target device to the original state when there is no address conflict in the server, so that the processor can enter the normal working mode and ensure the normal function of the server.
[0120] See also Figure 5 As shown, Figure 5 A schematic diagram of the structure of a device address modification apparatus provided in an embodiment of the present invention. To solve the above technical problems, an embodiment of the present invention further provides a device address modification apparatus, which is applied to a processor of a server; the device address modification apparatus comprises:
[0121] An address scanning unit 11 is used to determine the device addresses of all target devices currently connected to the server; the target devices include a first device of the server and an external second device;
[0122] A conflict determination unit 12, configured to determine whether there is a consistent device address between the device address of the first device and the device address of the second device; if so, triggering an address modification unit 13;
[0123] The address modification unit 13 is used to determine a communication connection channel for directly connecting a first device corresponding to the consistent device address, and modify the device address of the first device corresponding to the consistent device address based on the communication connection channel.
[0124] In some embodiments, the processor of the server is connected to the first device via an address line; the device address changing device further comprises:
[0125] An address configuration unit, configured to send a configuration instruction to the corresponding first device through an address line, so as to configure a device address for the first device;
[0126] The address modification unit 13 comprises:
[0127] A historical instruction determination unit, used to determine a configuration instruction of a first device corresponding to a consistent device address;
[0128] The address modification subunit is used to modify the configuration instruction and send the modified configuration instruction to the corresponding first device through the address line.
[0129] In some embodiments, it also includes:
[0130] a change recording unit, configured to record the modified configuration instruction of the first device and the modified corresponding device address when a configuration instruction of the first device is modified;
[0131] The access updating unit is used to update the access address of the first device based on the modified device address, so as to access the first device according to the updated access address subsequently.
[0132] In some embodiments, it also includes:
[0133] A hardware status identification unit, used to identify the current hardware connection status of the server;
[0134] The server configuration determination unit is used to determine whether there is a change in the hardware configuration of the server based on the hardware connection status; the hardware configuration includes the number and type of hardware devices connected to the server; if so, trigger the address scanning unit 11.
[0135] In some embodiments, the communication port of the processor of the server establishes an original communication connection with all target devices currently connected to the server through a daisy chain topology; the address scanning unit 11 includes:
[0136] A grouping unit, used for dividing all target devices currently connected to the server into a plurality of device groups; the target devices in each device group are all first devices of the server or all external second devices;
[0137] A connection cutting unit, used for cutting off the original communication connection between the device groups;
[0138] A connection building unit, used to respectively establish independent communication connections between itself and each of the device groups; the independent communication connections corresponding to each of the device groups are independent of each other, and the communication mode of the independent communication connection is consistent with that of the original communication connection;
[0139] The address scanning subunit is used to send an address scanning instruction to any device group through its corresponding independent communication connection;
[0140] A response receiving unit, used for receiving a response result of the device group to the address scanning instruction;
[0141] An address determining unit, configured to determine a device address of each of the target devices in the device group based on the response result;
[0142] The address recording unit is used to record the device address of each target device.
[0143] In some embodiments, the server further includes a switching switch chip, the switching switch chip is arranged between two adjacent device groups, and there is a corresponding switching switch chip for any two adjacent device groups; the input end of the switching switch chip is connected to the communication output end of the first device group, the first output end is connected to the communication input end of the second device group, and the second output end is connected to the redundant communication port of the processor; the connection disconnection unit includes:
[0144] A connection disconnection subunit, used for controlling the switching switch chip to disconnect its own input end and the first output end;
[0145] The connection construction unit comprises:
[0146] The connection construction subunit is used to control the switching switch chip to connect its own input terminal and the second output terminal.
[0147] In some embodiments, it also includes:
[0148] The connection recovery unit is used to control the switching switch chip to connect its own input end and the first output end, and cut off its own input end and the second output end, so that the target device can restore the original communication connection.
[0149] For the description of the features of the device for changing the device address provided in the embodiment of the present invention, reference may be made to the relevant description of the embodiment of the method for changing the device address, which will not be described in detail here.
[0150] See also Figure 6 As shown, Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, the electronic device comprises: a memory 60, for storing a computer program;
[0151] The processor 61 is used to implement the steps of the method for changing the device address in the above embodiment when executing a computer program.
[0152] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0153] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0154] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the method for changing the device address disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include but is not limited to the data in the method for changing the device address, etc.
[0155] In some embodiments, the electronic device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0156] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.
[0157] For the description of the features in the electronic device provided by the embodiment of the present invention, reference may be made to the relevant description of the embodiment of the method for changing the device address, which will not be described in detail here.
[0158] It is understandable that if the device address change method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0159] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for changing the device address as described above are implemented.
[0160] For the description of the features in the computer-readable storage medium provided in the embodiment of the present invention, reference can be made to the relevant description of the embodiment of the method for changing the device address, which will not be described in detail here.
[0161] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the method for changing the device address described in the above embodiment when executed by a processor.
[0162] For descriptions of features in the computer program product provided by the embodiments of the present invention, reference may be made to the relevant descriptions of the embodiments of the method for changing a device address, which will not be described in detail here.
[0163] The above is a detailed introduction to a method for changing a device address provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0164] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0165] The above is a detailed introduction to a method for changing a device address provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for changing a device address, characterized in that: A processor applied to a server; the method for changing the device address includes: Determine the device addresses of all target devices currently connected to the server; the target devices include a first device and a second device, the first device is a device that supports the server to modify the device address, and the second device is a device that does not support the server to modify the device address; Determine whether there is a consistent device address between the device address of the first device and the device address of the second device; If so, a communication connection channel for directly connecting the first device corresponding to the consistent device address is determined, and the device address of the first device corresponding to the consistent device address is modified based on the communication connection channel.
2. The method for changing the device address according to claim 1, characterized in that: The processor of the server is connected to the first device via an address line; The method for changing the device address also includes: Sending a configuration instruction to the corresponding first device through the address line to configure a device address for the first device; The device address of the first device corresponding to the modified consistent device address includes: Determine a configuration instruction of the first device corresponding to the consistent device address; The configuration instruction is modified, and the modified configuration instruction is sent to the corresponding first device through the address line.
3. The method for changing the device address as claimed in claim 2, characterized in that: Also includes: When a configuration instruction of the first device is modified, recording the modified configuration instruction of the first device and the device address corresponding to the modification; The access address of the first device is updated based on the modified device address, so that the first device can be accessed subsequently according to the updated access address.
4. The method for changing the device address according to claim 1, characterized in that: Before determining the device addresses of all target devices currently connected to the server, the method further includes: Identify the current hardware connection status of the server; Determining whether there is a change in the hardware configuration of the server based on the hardware connection status; the hardware configuration includes the number and type of hardware devices connected to the server; If yes, jump to the step of determining the device addresses of all target devices currently connected to the server.
5. The method for changing a device address according to any one of claims 1 to 4, characterized in that: The communication port of the processor of the server establishes an original communication connection with all target devices currently connected to the server through a daisy chain topology; Determining the device addresses of all target devices currently connected to the server includes: Divide all target devices currently connected to the server into several device groups; the target devices in each device group are all first devices of the server or all external second devices; Cutting off the original communication connection between the device groups; Establishing independent communication connections between itself and each of the device groups respectively; the independent communication connections corresponding to each of the device groups are independent of each other, and the communication mode of the independent communication connection is consistent with that of the original communication connection; For any device group, an address scanning instruction is issued through its corresponding independent communication connection; receiving a response result of the device group to the address scanning instruction; Determine the device address of each of the target devices in the device group based on the response result; Recording the device address of each target device; The step of determining the communication connection channel of the first device corresponding to the device address that is directly connected to the same device address includes: The device group to which the first device corresponding to the consistent device address belongs is determined, and the independent communication connection corresponding to the device group to which it belongs is determined as a communication connection channel directly connected to the first device corresponding to the consistent device address.
6. The method for changing the device address as claimed in claim 5, characterized in that: The server further includes a switching switch chip, which is arranged between two adjacent device groups, and there is a corresponding switching switch chip for any two adjacent device groups; the input end of the switching switch chip is connected to the communication output end of the first device group, the first output end is connected to the communication input end of the second device group, and the second output end is connected to the redundant communication port of the processor; The cutting off of the original communication connection between the device groups includes: Controlling the switching switch chip to cut off its own input end and the first output end; The step of respectively establishing independent communication connections between itself and each of the device groups comprises: The switching switch chip is controlled to connect its own input terminal and the second output terminal.
7. The method for changing the device address as claimed in claim 5, characterized in that: After recording the device address of each target device, the method further includes: The switching switch chip is controlled to connect its own input end and the first output end, and to disconnect its own input end and the second output end, so that the target device can restore the original communication connection.
8. A device for changing a device address, characterized in that: A processor applied to a server; the device address changing device comprises: An address scanning unit, used to determine the device addresses of all target devices currently connected to the server; the target devices include a first device of the server and an external second device; a conflict determination unit, configured to determine whether a device address of the first device and a device address of the second device are consistent; if so, triggering an address modification unit; The address modification unit is used to determine a communication connection channel for directly connecting a first device corresponding to a consistent device address, and modify a device address of the first device corresponding to the consistent device address based on the communication connection channel.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method for changing the device address as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for changing the device address as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
First controller, second controller, and address conflict processing system and method
CN120256360A
First controller, second controller, address conflict processing system and method
CN120256360B
I2C address conflict processing method and device, equipment and storage medium
CN121907819A
