Method and apparatus for determining device number, and electronic device and storage medium
By automatically comparing and counting port numbers in a decentralized DDC system, the problem of cumbersome determination of equipment numbers and poor expansion and useability is solved, the automation and uniqueness of equipment numbers are realized, and the ease of use and stability of the system is improved.
Patent Information
- Application Number
- PCT/CN2024/089464
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-18
- Filing Date
- 2024-04-24
- Publication Date
- 2024-11-21
AI Technical Summary
In a decentralized DDC system, the process of determining device numbers is cumbersome, especially when there are many devices and no NCC management, newly added devices need to manually configure numbers to avoid conflicts, resulting in poor system expansion and useability.
By designing a device numbering method in the DDC system, the device number is automatically determined using the comparison and statistics of multiple port numbers to ensure the uniqueness of the number, and store it in the configuration information for use after restart, avoiding manual configuration.
It simplifies the process of determining equipment number, improves the ease of expansion of the system, reduces manual intervention, and ensures the uniqueness and stability of communication between equipment.
Smart Images

Figure CN2024089464_21112024_PF_FP_ABST
Abstract
Description
Device number confirmation method, device, electronic device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on May 18, 2023, with application number 202310563491.X and invention name “A device numbering method, apparatus and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for confirming a device number. Background Art
[0004] The traditional distributed disaggregate chassis (DDC) network device system includes a network cloud controller (NCC), a network cloud fabric (NCF), and a network cloud packet forwarder (NCP).
[0005] Based on the traditional DDC system architecture, a decentralized DDC system has evolved. This decentralized DDC system removes the NCC and retains the NCP and NCF.
[0006] Summary of the Invention
[0007] Each exemplary embodiment of the present application provides a device numbering method, apparatus, and storage medium.
[0008] In a first aspect, the present application provides a method for confirming a device number, for determining the device number of a first device in a distributed split rack network (DDC) system, wherein the first device is respectively connected to at least one second port of a plurality of second devices in the DDC system, the method comprising:
[0009] respectively obtaining a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices; and
[0010] The device number of the first device is confirmed based on the plurality of port numbers.
[0011] Optionally, confirming the device number of the first device based on the multiple port numbers includes:
[0012] confirming whether the multiple port numbers are consistent; and
[0013] If the plurality of port numbers are consistent, the device number is confirmed based on one of the plurality of port numbers.
[0014] Optionally, confirming the device number of the first device based on the multiple port numbers further includes:
[0015] If there is inconsistency between the plurality of port numbers, the device number is confirmed based on the port number that appears the most times among the plurality of port numbers.
[0016] Optionally, if there is inconsistency between the multiple port numbers, confirming the device number based on the port number that appears the most times among the multiple port numbers includes:
[0017] Outputting prompt information, where the prompt information is used to prompt that a connection error exists between the first device and the at least one port of the plurality of second devices.
[0018] Optionally, the first device is respectively connected to two or more second ports of the multiple second devices of the DDC system, and the number of first ports of the first device connected to the multiple second devices is the same as the number of the second ports of each of the multiple second devices.
[0019] Optionally, when a new NCP device joins the system, the new NCP device is the first device, and the number of the new NCP device is equal to the number of any port of the NCF connected to the new NCP device / the number of ports of the new NCP connected to any NCF+1.
[0020] Optionally, respectively acquiring multiple port numbers corresponding to the at least one second port of the first device and the multiple second devices includes:
[0021] The first device detects the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device.
[0022] Optionally, the first device detecting the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device includes:
[0023] The first device sends a first message to each of the plurality of second devices respectively, wherein the first message is configured to request the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device; and
[0024] The first device receives a plurality of second messages from each of the plurality of second devices, wherein the plurality of second messages respectively include the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device.
[0025] Optionally, the first device detecting the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device includes:
[0026] The detection is performed through the SERDES connection detection mode of the ASIC chip or the LLDP detection protocol.
[0027] Optionally, before respectively acquiring the multiple port numbers corresponding to the at least one second port of the first device and the multiple second devices, the method further includes:
[0028] The device number of the initialized first device is an initial device number, and the initial device number does not conflict with the device numbers of other first devices.
[0029] Optionally, after confirming the device number of the first device based on the multiple port numbers, the method further includes:
[0030] The device number of the first device is stored in configuration information, where the device number of the first device in the configuration information is the device number used after the first device is restarted next time.
[0031] In a second aspect, the present application provides a device number confirmation apparatus for determining the device number of a first device of a distributed split rack network (DDC) system, wherein the first device is respectively connected to at least one second port of a plurality of second devices of the DDC system, comprising:
[0032] a receiving module configured to respectively obtain a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices; and
[0033] The determining module is configured to confirm the device number of the first device based on the multiple port numbers.
[0034] Optionally, the determining module is configured to confirm whether the multiple port numbers are consistent; and
[0035] If the plurality of port numbers are consistent, the device number is confirmed based on one of the plurality of port numbers.
[0036] Optionally, confirming the device number of the first device based on the multiple port numbers further includes:
[0037] If there is inconsistency between the plurality of port numbers, the device number is confirmed based on the port number that appears the most times among the plurality of port numbers.
[0038] Optionally, if there is inconsistency between the multiple port numbers, confirming the device number based on the port number that appears the most times among the multiple port numbers includes:
[0039] Outputting prompt information, where the prompt information is used to prompt that a connection error exists between the first device and the at least one port of the plurality of second devices.
[0040] Optionally, the first device is respectively connected to two or more second ports of the multiple second devices of the DDC system, and the number of first ports of the first device connected to the multiple second devices is the same as the number of the second ports of each of the multiple second devices.
[0041] Optionally, the confirmation module is further configured to, when the number of the at least one port is greater than or equal to 2, confirm that the device number of the first device is a ratio of one of the multiple port numbers to the number of the at least one port, rounded up.
[0042] Optionally, the device further comprises:
[0043] a sending module configured to send a first message to each of the plurality of second devices, wherein the first message is configured to request the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device; and a receiving module configured to receive a plurality of second messages from each of the plurality of second devices, wherein the plurality of second messages respectively include the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device.
[0044] The determining module is configured to determine that the number of the first device is any one of the N port numbers if the N port numbers are the same.
[0045] In a third aspect, the present application provides a device numbering method applicable to a distributed split-rack network device (DDC) system. The DDC system includes a first device and at least one second device. For example, the method includes: the first device sending M first messages to each of at least one second device. Each of the M ports in each second device is connected to M ports in the first device. The M first messages corresponding to the i-th second device are used to request the numbers of the M ports in the i-th second device connected to the first device. The M first messages correspond one-to-one with the M ports, where M is a positive integer greater than or equal to 1. The first device is an NCF and the second device is an NCP, or the first device is an NCP and the second device is an NCF. The first device receives M second messages from each of the at least one second device. The M second messages corresponding to the i-th second device include the numbers of the M ports in the i-th second device. The M second messages correspond one-to-one with the M ports. All second messages received by the first device from the at least one second device correspond to a total of N port numbers, where N is a positive integer greater than or equal to 1. If the N port numbers are the same, the first device determines that the number of the first device is any one of the N port numbers.
[0046] Optionally, when the N port numbers are inconsistent and M=1, the method further includes: the first device determining the port number that appears the most times among the N port numbers as the number of the first device.
[0047] Optionally, the method further includes: outputting prompt information, where the prompt information is used to prompt that there is a connection error between the first device and at least one second device.
[0048] Optionally, when the N port numbers are inconsistent and M is greater than 1, the method further includes: the first device determining the number of the first device as a ratio of any one of the N port numbers to M rounded up.
[0049] Optionally, after the first device determines that the number of the first device is any port number among N port numbers, the method further includes: the first device stores the number of the first device in the configuration information, and the number of the first device in the configuration information is the number used after the first device is restarted next time.
[0050] In a second aspect, the present application provides a device numbering apparatus, comprising: a sending module, a receiving module, and a determining module. The sending module is configured to send M first messages to each of at least one second device. The M ports in each second device are connected to M ports in the first device. The M first messages corresponding to the i-th second device are used to request the numbers of the M ports in the i-th second device connected to the first device. The M first messages correspond one-to-one with the M ports, where M is a positive integer greater than or equal to 1. The first device is an NCF and the second device is an NCP, or the first device is an NCP and the second device is an NCF. The receiving module is configured to receive M second messages from each of at least one second device. The M second messages corresponding to the i-th second device include the numbers of the M ports in the i-th second device. The M second messages correspond one-to-one with the M ports. All second messages received by the first device from at least one second device correspond to a total of N port numbers, where N is a positive integer greater than or equal to 1. The determining module is configured to determine that the number of the first device is any one of the N port numbers if the N port numbers are the same.
[0051] Optionally, the determining module is further configured to: determine the port number that appears the most times among the N port numbers as the number of the first device.
[0052] Optionally, the determination module is further used to: output prompt information, where the prompt information is used to prompt that there is a connection error between the first device and at least one second device.
[0053] Optionally, the determination module is further configured to determine that the number of the first device is a ratio of any one of the N port numbers to M, rounded up.
[0054] Optionally, the determination module is further configured to: store the number of the first device in the configuration information, where the number of the first device in the configuration information is the number used by the first device after the next restart.
[0055] In a fourth aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory in communication with the processor, wherein the memory stores computer-executable instructions that are executed by the processor to enable the processor to perform any of the methods described in the first aspect.
[0056] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes any one of the methods described in the first aspect above.
[0057] In the sixth aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor can read the computer program from the computer-readable storage medium, and when the processor executes the computer program, it can implement any of the methods described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, they can also obtain drawings of other embodiments based on these drawings without paying any creative work.
[0059] FIG1 is a schematic diagram of the system architecture of a DDC system provided by related art.
[0060] FIG2 is a schematic diagram of the system architecture of a decentralized DDC system provided by related technologies.
[0061] FIG3 is a schematic diagram of the architecture of a fabric channel provided in an embodiment of the present application.
[0062] FIG4 is a flow chart of a device numbering method provided in an embodiment of the present application.
[0063] FIG5 is a flow chart of a device numbering method provided in an embodiment of the present application.
[0064] FIG6 is a schematic diagram of the numbering and connection of NCPs and NCFs provided in an embodiment of the present application.
[0065] FIG7 is a schematic diagram of the structure of the device numbering apparatus provided in an embodiment of the present application.
[0066] FIG8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0067] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0068] In this application, the use of ordinal terms such as "first," "second," etc. to modify elements does not indicate any priority, ranking, or order of one element relative to another, or a temporal order of performing actions in a method. Unless otherwise specifically stated, such ordinal terms are used merely as labels to distinguish one element having a particular name from another element having the same name (excluding the ordinal term).
[0069] When “including,” “having,” and “comprising” are used in the present application, another component may be added unless a clear limiting term such as “only,” “consisting of,” etc. is used. Unless mentioned otherwise, a term in the singular form may include a plural form and should not be understood as having only one number.
[0070] It should be noted that, in this application, "connection" includes one or more of "mechanical connection", "electrical connection", and "communication connection". In addition, in the context, it should be understood that when it is mentioned that one element is connected "on" or "under" another element, it can not only be directly connected "on" or "under" the other element, but also be indirectly connected "on" or "under" the other element through an intermediate element.
[0071] This application relates to a device numbering method, which can be used to number devices in a decentralized DDC system. Since the decentralized DDC system is evolved from the traditional DDC system, a brief introduction to the DDC system is first given.
[0072] As shown in Figure 1, a DDC system is a traditional, separate rack network device system developed based on an application-specific integrated circuit (ASIC) chip. The DDC system separates the NCC, NCF, and NCP, making them physically independent devices that are interconnected via cables to form a logical rack switch. The NCP is equivalent to a line card in a rack system, the NCF is equivalent to a switching fabric board, and the NCC is equivalent to a management board. The NCC can connect to the NCP and / or NCF via a management network device.
[0073] The NCC can control the NCP and / or NCF by managing network devices. For example, the NCC can aggregate global table entry information and distribute it to the NCP and / or NCF through the management network devices. Global table entry information includes media access control layer (MAC) information, address resolution protocol (ARP) messages, and routing information. Accordingly, the NCP and / or NCF can report global table entry information to the NCC through the management network devices.
[0074] In this system, information synchronization between NCPs is performed through the NCC. For example, an NCP must report global table entries, device information, and port numbers to the NCC via the management network device. The NCC then forwards this information to the other NCP using the device information and port numbers provided by the NCP.
[0075] Because NCPs, NCFs, and NCCs are physically independent, the number of NCPs, NCFs, and NCCs in the system is not limited by the number of slots in the switch rack and can be flexibly expanded. For example, the number of NCPs in a DDC system can be increased to 100 or even more. However, as the number of NCPs in a DDC system increases, the risk of failure in the DDC system gradually increases. For example, when an NCC manages a large number of NCPs, it is prone to failures on the network nodes connected to the NCPs and / or NCFs, causing the NCC to lose connection with the NCPs and / or NCFs. Once the NCC loses connection with the NCPs and / or NCFs, the DDC system will lose control, affecting the normal operation of the NCPs and / or NCFs in the network.
[0076] As shown in Figure 2, a decentralized DDC system architecture proposed in the related art.
[0077] This decentralized DDC system eliminates the NCC and management network devices, retaining the NCP and NCF. NCPs and NCFs are fully connected. An NCP can connect to all NCFs in the system, and similarly, an NCF can connect to all NCPs in the system. Global table entry information, previously aggregated and distributed by the NCC to individual devices, is now directly processed by the NCP in a distributed manner. This allows the NCP in the system to have control-related (also known as the control plane) and management-related (also known as the management plane) functions similar to those of the NCC, allowing the NCP to communicate with other devices independently of the NCC.
[0078] Considering that the NCC, NCP, and NCF devices in a DDC system can be designed based on ASIC chips, the ASIC chips support adding a header layer to messages forwarded between chips, forming a fabric message. The ASIC chips configure registers to designate the chip interconnect ports as fabric ports, which are used to forward fabric messages encapsulated with the header. In other words, the NCP and NCF designed based on ASIC chips can send fabric messages through the fabric ports. Specifically, to minimize bandwidth usage, the ASIC chip header occupies an 8-byte preamble and a 4-byte interpacket gap (IPG).
[0079] As shown in Figure 3, NCPs and NCFs are connected through fabric ports, and NCFs are connected to each other through fabric ports. This NCP-NCF-NCP fabric channel forms a fabric channel. When an NCP needs to synchronize information with another NCP, it sends global table entry information, device information, and port numbers to the NCF connected to it through the NCP-NCF-NCP fabric channel. The NCF then forwards the information to the other NCP, achieving information synchronization.
[0080] However, this decentralized DDC system has a large number of devices, and without an NCC to number the NCPs and / or NCFs, determining device numbers is a complex process. Furthermore, when new NCPs and / or NCFs are added to the system, device numbers must be manually assigned to avoid conflicts with other devices. This makes expansion of the system difficult.
[0081] In view of this, embodiments of the present application provide a device numbering method. This method allows devices in the system to automatically determine their device numbers based on their connections to other devices, making it more convenient. Furthermore, there's no need to manually configure device numbers for newly added devices, making the system easier to expand.
[0082] Please refer to Figure 4, which shows a flow chart of a method for determining a device number based on the system architecture shown in Figure 3. The method includes the following steps.
[0083] S301: Obtain multiple port numbers corresponding to the first device and the at least one second port of the multiple second devices respectively.
[0084] Specifically, the first device can obtain port number a of a port connected to the first device from the second device A, and obtain port number b of a port connected to the first device from the second device B, that is, the multiple port numbers include port number a and port number b.
[0085] S303: Confirm the device number of the first device based on the multiple port numbers.
[0086] Please refer to Figure 5, which shows a flow chart of a device numbering method based on the system architecture shown in Figure 3. This method can be applied to electronic devices with processing capabilities, and the electronic devices can be NCPs, NCFs, etc. in the above-mentioned decentralized DDC system. Of course, the electronic device can also be other types of devices, such as tablet computers (PADs), personal computers (PCs), etc., and the types of electronic devices in the embodiments of the present application are not limited to this. In the subsequent introduction, considering that the electronic device establishes a connection with other electronic devices in the system, in order to distinguish the electronic device for which the device number needs to be determined from the other electronic devices connected to it, the electronic device for which the device number needs to be determined is referred to as the first device, and the other electronic devices connected to the first device are referred to as the second device.
[0087] S401. The first device sends M first messages to each of the at least one second device, wherein the M ports in each second device are connected to the M ports in the first device, and the M first messages corresponding to the i-th second device are used to request the numbers of the M ports in the i-th second device connected to the first device. The M first messages correspond one-to-one to the M ports, and M is a positive integer greater than or equal to 1; the first device is an NCF, and the second device is an NCP, or the first device is an NCP and the second device is an NCF.
[0088] The connectivity of multiple devices in a system is complex. A single device often needs to establish connections with multiple other devices. Figure 6 illustrates the connectivity between multiple devices in a decentralized DDC system. Typically, NCPs and NCFs in the system are fully connected. That is, an NCP needs to establish connections with all NCFs, and similarly, an NCF needs to establish connections with all NCPs. When an NCP establishes a connection with at least one NCF, and when determining the device number of the NCP, the NCP can be considered the first device, and the at least one NCF connected to it can be considered the second device, corresponding to at least one second device. Alternatively, when an NCF establishes a connection with at least one NCP, and when determining the device number of the NCF, the NCF can be considered the first device, and the at least one NCP connected to it can be considered the second device. For ease of description, the process of determining the NCP's device number will be described using the NCP as the first device. The process of determining the device number when the first device is an NCF is similar and will not be further described.
[0089] Typically, the first device and the second device are provided with multiple ports (for example, multiple fabric ports), and the M ports in the first device can establish connections with the M ports of each second device to achieve networking of multiple first devices and multiple second devices. Here, M can be considered as the number of port connections between the first device and the second device, and M is a positive integer greater than or equal to 1. Since the port connection has a one-to-one correspondence, and the number of ports of each first device and second device is limited, different numbers of port connections M between the first device and the second device can be set according to different connection strategies. For example, in order to achieve the maximum scale networking of the system, one port connection between the first device and the second device can be set, that is, M is 1, so that the system can accommodate as many devices as possible. The maximum number of first devices in the system is the number of ports set on the second device, and the maximum number of second devices is the number of ports set on the first device. For another example, in order to achieve better bandwidth utilization, the first device can be set to be connected to at least two ports of each second device, that is, M is greater than 1. In this way, the system can accommodate a relatively small number of first devices, but the first devices are connected to more ports of the second devices. Therefore, each first device can occupy more resources of the second device. When the ports of the second device are not fully occupied, the utilization of the idle bandwidth of the second device can be improved.
[0090] Based on this networking model of the first and second devices, the devices in the system need to be numbered to prevent conflicts between them. For example, as shown in Figure 6, multiple NCPs can be numbered NCP1, NCP2, NCP3, NCP4, and so on, and multiple NCFs can be numbered NCF1, NCF2, NCF3, NCF4, and so on. When a first device (e.g., NCP1) communicates with an NCP in the system (e.g., NCP2) via a fabric channel, NCP1 reports information to the NCF. This information includes the number of NCP1's communication partner, namely, NCP2's number. The NCF forwards the information reported by NCP1 to NCP2 based on NCP2's number in the information reported by NCP1. Accordingly, NCP2 needs to feedback information to NCP1 based on NCP1's number. Therefore, each device in the system should have its own unique number to uniquely identify it, preventing conflicts between devices in the system.
[0091] Similarly, to prevent conflicts between ports during communication between devices, which could lead to information transmission errors, the ports on each device can be numbered. For example, the ports of NCP1 could be numbered 1_1, 1_2, 1_3, 1_4, etc., and the ports of NCP2 could be numbered 2_1, 2_2, 2_3, 2_4, etc. After the ports of each device are numbered, the devices can communicate through fixed ports.
[0092] Therefore, each device in the system should have a device number that is unique to other devices, and only devices assigned a device number can be used in the system. However, in some cases, a device number may not exist. For example, a first device may not have a device number when it is newly added to the system. Another example is when the configuration information related to the device number is manually deleted, the first device's device number may no longer exist. In related technologies, when a device number does not exist, it is necessary to manually assign a device number to the device.
[0093] In an embodiment of the present application, considering that the M ports in the first device are connected to the M ports of each second device, the first device can send a request to at least one connected second device to request the numbers of the M ports in the i-th second device that are connected to the first device. Since the ports on the second devices are usually occupied in sequence, that is, when each first device occupies a port on the second device, it occupies the port immediately adjacent to the previously occupied port. Therefore, the first device can determine the occupancy status of the ports on the second device based on the M port numbers requested in the first message, and further determine the number of the first device in the system based on the occupancy status of the ports on the second device.
[0094] The first device edits a first message and requests the numbers of the M ports connected to the first device in the i-th second device through the first message. For the number of each port of the second device, the first device requests the number of the port by sending a first message, that is, for each second device, the first device sends M first messages, and the M first messages correspond one-to-one to the M ports. The first device can send M first messages to each of the at least one second device connected to it. Since the first device and the second device are connected through a fabric port, the first message sent by the first device can be a fabric message. There are many ways for the first device to send the first message. For example, it can be detected through the serializer / deserializer (SERializer / DESerializer, SERDES) connection detection method built into the ASIC chip, or a detection protocol similar to the Link Layer Discovery Protocol (LLDP). Before sending the first message, to prevent conflicts with other devices, the first device can set a default device number that does not conflict with other devices, such as number 0.
[0095] S402: The first device receives M second messages from each of the at least one second device. All second messages received by the first device from the at least one second device correspond to a total of N port numbers. If the N port numbers are the same, the first device determines that the number of the first device is any one of the N port numbers. The M second messages corresponding to the i-th second device include the numbers of the M ports. The M second messages correspond one-to-one to the M ports, and N is a positive integer greater than or equal to 1.
[0096] The first device sends M first messages to each second device. Accordingly, for each first message, the i-th second device sends back a second message to the first device. The first device can then receive M second messages sent by each of the at least one second device, with the M second messages corresponding one-to-one to the M ports. The M first messages sent by the first device request the numbers of the M ports connected to the first device on the i-th second device. The second message, which carries the port number of the i-th second device, serves as a response to the first message. The M second messages include the port numbers of the M second devices. A total of N port numbers correspond to all second messages received by the first device from at least one second device, meaning that at least one second device corresponds to N port numbers. The first device can determine its own device number based on these N port numbers. When determining its own device number based on the N port numbers, the first device can categorize the port number determination into various situations, depending on the number M of port connections between the first device and each second device.
[0097] Case 1: The first device is connected to one port of each second device, that is, M is 1. In this case, the first device only requests one port number of the i-th second device, and the number of port numbers N in the second message received by the first device is the same as the number of second devices. The first device can compare whether these N port numbers are consistent. For example, it can be determined based on the comparison whether these N port numbers are all m at the same time. If these N port numbers are all m at the same time, it can be considered that the first device is the m-th device occupying the port of the second device. Before this, there is already an m-1-th device occupying the port of each second device in sequence. And when each device occupies the port of the second device, it occupies the port immediately after the last occupied port. In this way, the N port numbers obtained by the first device are all m at the same time. Therefore, the first device can determine that the device number of the first device is any port number m among the N port numbers.
[0098] Of course, the N port numbers obtained by the first device may be inconsistent. This is because the first device may have made a connection error when connecting to a port of the second device and may not have occupied the ports of the second device in the correct order, resulting in an inconsistency in the N port numbers obtained by the first device. In this case, the first device may indicate a connection error. Specifically, the first device may output a prompt indicating that a connection error has occurred between the first device and at least one second device.
[0099] In this case, it can be assumed that a few ports have connection errors, while the majority of ports are connected normally. In this case, the device number of the first device can still be determined. The first device can determine the device number of the first device based on the port number that appears the most times among the N port numbers. For example, if the port number that appears the most times is m, then m can be determined as the device number of the first device.
[0100] After the device number of the first device is determined, the determined device number is saved in the configuration information of the first device. After the device number is saved, it is necessary to restart the device or restart the process to reinitialize all services that rely on the device number. After the first device is restarted again, the first device uses the device number included in the configuration information. This allows the first device to use this device number to conduct services when communicating with other devices in the system.
[0101] Case 2: The first device is connected to at least two ports of the second device, that is, M is greater than 1. In this case, the number N of port numbers in the second message received by the first device is M times the number of second devices.
[0102] Since the number of port connections between the first device and each second device is M, and the number of port connections between other devices and each second device is also M, when each first device is connected to a port of a second device, it occupies the port immediately after the last occupied port. Even if there are many differences between the N port numbers obtained by the first device, for example, when M is 3, the N port numbers obtained by the first device include 3, 4, 5, 3, 4, 5, 3, 4, 5, 3, 4, 5..., the device number of the first device can also be determined.
[0103] The first device determines the device number of the first device as the ratio of any one of the N port numbers to M, rounded up. For example, when M is 3 and the N port numbers obtained by the first device include 3, 4, 5, 3, 4, 5, 3, 4, 5, 3, 4, 5, ..., the ratio of any one of the N port numbers to the number of port connections M is rounded up to 2. That is, in this example, the device number of the first device is 2.
[0104] Similarly, after the device number of the first device is determined, the determined device number is saved in the configuration information of the first device. After the device number is saved, it is necessary to restart the device or restart the process to reinitialize all services that rely on the device number so that the first device can use the device number to perform services when communicating with other devices in the system.
[0105] Please refer to Figure 7. Based on the same inventive concept, an embodiment of the present application also provides a device numbering device 600. The device 600 includes: a sending module 601, a receiving module 602 and a determining module 603. The sending module 601 is used to send M first messages to each of the at least one second device. The M ports in each second device are connected to the M ports in the first device, and the M first messages corresponding to the i-th second device are used to request the numbering of the M ports in the i-th second device connected to the first device. The M first messages correspond one-to-one to the M ports, and M is a positive integer greater than or equal to 1. The first device is an NCF, the second device is an NCP, or the first device is an NCP and the second device is an NCF. The receiving module 602 is configured to receive M second messages from each of at least one second device, where the M second messages corresponding to the i-th second device include the numbers of the M ports in the i-th second device. The M second messages correspond one-to-one to the M ports. All second messages received by the first device from the at least one second device correspond to a total of N port numbers, where N is a positive integer greater than or equal to 1. The determining module 603 is configured to determine that the number of the first device is any one of the N port numbers if the N port numbers are the same.
[0106] Optionally, the determining module 603 is further configured to: determine the port number that appears the most times among the N port numbers as the number of the first device.
[0107] Optionally, the determination module 603 is further configured to output prompt information, where the prompt information is configured to prompt that a connection error exists between the first device and at least one second device.
[0108] Optionally, the determining module 603 is further configured to determine that the number of the first device is a ratio of any one of the N port numbers to M, rounded up.
[0109] Optionally, the determination module 603 is further configured to: store the number of the first device in the configuration information, where the number of the first device in the configuration information is the number used by the first device after the next restart.
[0110] Based on the same inventive concept, an embodiment of the present application provides an electronic device, comprising at least one processor 701 and a memory 702 communicatively connected to the at least one processor. The memory stores instructions executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any of the above embodiments.
[0111] The specific connection medium between processor 701 and memory 702 is not limited in the embodiments of the present application. FIG8 illustrates the connection between processor 701 and memory 702 via bus 700. Bus 700 is represented by a bold line in FIG8 . The connection methods between other components are merely illustrative and are not intended to be limiting. Bus 700 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG8 shows only a single bold line, but this does not imply that there is only one bus or only one type of bus.
[0112] The computing device in the embodiment of the present application may further include a communication interface 703 , which is, for example, a network port, and the computing device may receive or send data through the communication interface 703 .
[0113] The processor 701 is the control center of the computing device. It can connect the various parts of the entire device using various interfaces and lines. By running or executing instructions stored in the memory 702 and calling data stored in the memory 702, the various functions of the computing device and processing data are performed, thereby monitoring the computing device as a whole. Optionally, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system and application programs, and the modem processor mainly processes wireless communications. It is understood that the above-mentioned modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0114] Optionally, the processor 701 can specifically be a general-purpose processor, such as a central processing unit, an application-specific integrated circuit (ASIC), one or more integrated circuits for controlling program execution, a hardware circuit developed using a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the device numbering method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0115] By designing and programming the processor 701, the code corresponding to the device numbering method introduced in the aforementioned embodiment can be solidified into the chip, so that the chip can execute the steps of the aforementioned device numbering method during operation. How to design and program the processor 701 is a technology well known to those skilled in the art and will not be repeated here.
[0116] Optionally, in an embodiment of the present application, the memory 702 stores instructions that can be executed by at least one processor 701, and at least one processor 701 can perform the steps included in the aforementioned device numbering method by executing the instructions stored in the memory 702. The memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. The memory 702 may include at least one type of storage medium, for example, a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device capable of performing a storage function, for storing program instructions and / or data. The number of memories 702 can be one or more. The memory 702 is shown in FIG8 , but it should be noted that the memory 702 is not a required functional module and is therefore shown in FIG8 with a dashed line.
[0117] Based on the same inventive concept, embodiments of the present application provide a computer storage medium storing computer program instructions for executing the method of any of the above embodiments. In a specific implementation, the computer-readable storage medium includes: a Universal Serial Bus flash drive (USB), a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other storage media capable of storing program code.
[0118] In some possible implementations, various aspects of the device numbering method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computing device, the program code is used to enable the computing device to execute the steps of the device numbering method according to various exemplary implementations of the present application described above in this specification.
[0119] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0121] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0122] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0123] If the integrated unit 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art 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, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a universal serial bus flash disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0124] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. A method for confirming a device number, for determining the device number of a first device of a distributed split rack network DDC system, wherein: The first device is respectively connected to at least one second port of a plurality of second devices of the DDC system, and the method comprises: Respectively obtaining a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices; and A device number of the first device is confirmed based on the plurality of port numbers.
2. The method of claim 1, wherein: The confirming the device number of the first device based on the multiple port numbers includes: confirming whether the multiple port numbers are consistent; and If the plurality of port numbers are consistent, the device number is confirmed based on one of the plurality of port numbers.
3. The method of claim 2, wherein: The confirming the device number of the first device based on the multiple port numbers further includes: If there is inconsistency between the multiple port numbers, the device number is confirmed based on the port number that appears most frequently among the multiple port numbers.
4. The method of claim 3, wherein: If there is inconsistency between the multiple port numbers, confirming the device number based on the port number that appears most frequently among the multiple port numbers includes: Outputting prompt information, where the prompt information is used to prompt that a connection error exists between the first device and the at least one port of the plurality of second devices.
5. The method according to any one of claims 1 to 4, wherein: The first device is respectively connected to two or more second ports of the plurality of second devices of the DDC system, and the number of the first ports of the first device connected to the plurality of second devices is the same as the number of the second ports of each of the plurality of second devices.
6. The method of claim 5, wherein: When a new NCP device joins the system, the new NCP device is the first device, and the number of the new NCP device is equal to the number of any port of the NCF connected to the new NCP device / the number of ports of the new NCP connected to any NCF+1.
7. The method according to any one of claims 1 to 6, wherein: The obtaining a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices respectively includes: The first device detects the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device.
8. The method of claim 7, wherein: The first device detects the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device, including: The first device sends a first message to each of the plurality of second devices respectively, wherein the first message is configured to request the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device; and The first device receives a plurality of second messages from each of the plurality of second devices, wherein the plurality of second messages respectively include the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device.
9. The method of claim 7, wherein: The first device detects the multiple port numbers corresponding to the at least one second port of the multiple second devices connected to the first device, including: The detection is performed through the SERDES connection detection mode of the ASIC chip or the LLDP detection protocol.
10. The method according to any one of claims 1 to 9, wherein: Before respectively acquiring a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices, the method further includes: The device number of the first device is initialized as an initial device number, and the initial device number does not conflict with the device numbers of other first devices.
11. The method of claim 1, wherein: After confirming the device number of the first device based on the multiple port numbers, the method further includes: The device number of the first device is stored in configuration information, where the device number of the first device in the configuration information is the device number used after the first device is restarted next time.
12. A device number confirmation device for determining the device number of a first device in a distributed split rack network (DDC) system, wherein: The first device is respectively connected to at least one second port of a plurality of second devices of the DDC system, including: a receiving module configured to respectively obtain a plurality of port numbers corresponding to the first device and the at least one second port of the plurality of second devices; and The determination module is configured to confirm the device number of the first device based on the multiple port numbers.
13. The device of claim 12, wherein: The determination module is configured to confirm whether the multiple port numbers are consistent; and If the plurality of port numbers are consistent, the device number is confirmed based on one of the plurality of port numbers.
14. The apparatus of claim 13, wherein the confirming the device number of the first device based on the plurality of port numbers further comprises: If there is inconsistency between the multiple port numbers, the port number that appears most frequently among the multiple port numbers is The port number confirms the device number.
15. The device of claim 14, wherein: If there is inconsistency between the multiple port numbers, confirming the device number based on the port number that appears most frequently among the multiple port numbers includes: Outputting prompt information, where the prompt information is used to prompt that a connection error exists between the first device and the at least one port of the plurality of second devices.
16. The device according to any one of claims 12 to 15, wherein: The first device is respectively connected to two or more second ports of the plurality of second devices of the DDC system, and the number of the first ports of the first device connected to the plurality of second devices is the same as the number of the second ports of each of the plurality of second devices.
17. The apparatus as claimed in claim 16, wherein the confirmation module is further configured to, when the number of the at least one port is greater than or equal to 2, confirm that the device number of the first device is a ratio of one of the multiple port numbers to the number of the at least one port rounded up.
18. The apparatus of claim 17, further comprising: a sending module configured to send a first message to each of the plurality of second devices, wherein the first message is configured to request the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device; and a receiving module configured to receive a plurality of second messages from each of the plurality of second devices, wherein the plurality of second messages respectively include the plurality of port numbers of the at least one port of the plurality of second devices connected to the first device. The determination module is configured to determine that the number of the first device is any one of the N port numbers if the N port numbers are the same.
19. An electronic device comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 11.
20. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, wherein the computer-executable instructions are used to implement the method according to any one of claims 1 to 11 when executed by a processor.
Citation Information
Patent Citations
Universal PCI EXPRESS port
CN105531684A
PCIe system expansion method, PCIe switching device and PCIe system
CN114006875A
Communication method and device
CN114640973A
Circuit and method for automatically and sequentially numbering devices connected to field bus
CN115277290A
Method and device for distributing PCIE equipment identification and related equipment
CN115878529A
Cited By
Port information synchronization method and device
CN120729874A
