Switch starting method, device and equipment and storage medium

By loading the firmware sent by the domain controller while the switch is in flashless mode, the problem of switch startup relies on external storage devices, achieving higher flexibility and security, and reducing costs.

CN120378385APending Publication Date: 2025-07-25GUANGZHOU XIAOPENG MOTORS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510446052.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The existing switch startup method relies on fixed external storage devices, resulting in low flexibility and inability to function properly when external storage devices fail.

Method used

The switch determines whether it is in flashless mode and loads the first firmware from the domain controller without flash memory into a normal working state. The first firmware is sent by the domain controller connected to the switch, and selects a safe and reliable transmission path through a preset policy.

Benefits of technology

Improves the flexibility and security of switch startup, reduces startup costs, avoids dependence on dedicated external storage devices, and ensures that it can still work properly in flashless mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120378385A_ABST
    Figure CN120378385A_ABST
Patent Text Reader

Abstract

The invention provides a switch starting method and device, equipment and a storage medium, relates to the technical field of computer networks, and is used for improving the flexibility of switch starting. The method is applied to a switch, the switch is connected with a plurality of domain controllers, and the plurality of domain controllers perform data transmission with other devices through the switch. The method comprises the following steps: judging whether the switch is in a flash-memory-free mode or not; under the condition that the switch is in the flash memory-free mode, first firmware is loaded to enable the switch to enter a normal working state, the first firmware is sent by the first domain controller, and the first domain controller is one of the multiple domain controllers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network technologies, and in particular, to a method, apparatus, device, and storage medium for starting a switch. Background Art

[0002] A switch is a key device in a computer network, mainly used for efficiently forwarding data frames within a local area network (LAN). A switch usually needs to load firmware to work properly, and the firmware contains various configurations and program codes required for the operation of the switch.

[0003] However, due to frequent firmware updates, a large storage space is required to store multiple versions of the firmware and backup firmware. Therefore, the firmware of the switch is usually stored in an external storage device, such as a flash memory (abbreviated as flash). When the switch starts up, the switch obtains the firmware from the external storage device to load the firmware for normal operation. It can be seen that the current switch startup method depends on a fixed external storage device, with low flexibility. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for starting a switch, which is used to improve the flexibility of switch startup.

[0005] In a first aspect, an embodiment of this application provides a method for starting a switch. The method is applied to a switch, and the switch is connected to multiple domain controllers. The multiple domain controllers perform data transmission with other devices through the switch. The method includes: determining whether the switch is in a flashless mode; and in the case where the switch is in the flashless mode, loading a first firmware to enable the switch to enter a normal operating state, where the first firmware is sent by a first domain controller, and the first domain controller is one of the multiple domain controllers.

[0006] In the embodiment of this application, even when the switch is in the flashless mode, the switch can still load the first firmware from the first domain controller to enter the normal operating state. This startup method does not need to depend on a fixed external storage device, improving the flexibility of switch startup. Moreover, the first domain controller is an existing communication device connected to the switch, rather than an external storage device specially configured to store the first firmware. That is, in the switch startup method provided in the embodiment of this application, there is no need to additionally configure a dedicated external storage device, reducing the cost of switch startup.

[0007] In a possible implementation, before loading the first firmware to enable the switch to enter the normal working state, the method further includes: sending first indication information to the multiple domain controllers, where the data encapsulation format of the first indication information is the same as the data encapsulation format specified by the target transmission protocol for transmitting the first firmware; receiving first response information from at least one candidate domain controller, where the at least one candidate domain controller belongs to the multiple domain controllers, and the data encapsulation format of the first response information is the same as the data encapsulation format specified by the target transmission protocol; determining the first domain controller from the at least one candidate domain controller according to a preset policy.

[0008] In this implementation, transmitting the firmware through a preset target transmission protocol is beneficial to improving the security and reliability of firmware transmission. Therefore, when determining the first domain controller from multiple domain controllers, the first domain controller can be determined from at least one candidate domain controller that supports the target transmission protocol to improve the security and reliability of firmware transmission.

[0009] In a possible implementation, the preset policy is a policy determined according to the transmission delay; the determining the first domain controller from the at least one candidate domain controller according to the preset policy includes: determining the transmission delay between the switch and the at least one candidate domain controller according to the sending time of the first indication information and the receiving time of the first response information of the at least one candidate domain controller; taking the domain controller with a transmission delay less than or equal to a first threshold among the at least one candidate domain controllers as the first domain controller.

[0010] In this implementation, selecting a domain controller with a lower transmission delay from at least one candidate domain controller as the first domain controller is beneficial to improving the transmission efficiency of the firmware.

[0011] In a possible implementation, the preset policy is a policy determined according to the remaining storage space; the determining the first domain controller from the at least one candidate domain controller according to the preset policy includes: sending second indication information to the at least one candidate domain controller, where the second indication information is used to obtain the remaining storage space of the non-volatile storage medium of the at least one candidate domain controller; receiving second response information from the at least one candidate domain controller; taking the domain controller with a remaining storage space greater than or equal to a second threshold among the at least one candidate domain controllers as the first domain controller.

[0012] In this embodiment, since the non-volatile storage medium can still ensure the reliability of the stored content under various special circumstances, therefore, a device with a larger remaining storage space of the non-volatile storage medium is selected from at least one candidate domain controller as the first domain controller, which can not only improve the reliability of storing the first firmware, but also ensure that the first domain controller has sufficient storage space to store multiple versions of the firmware and backup firmware.

[0013] In a possible implementation manner, the preset policy is a policy determined according to the virtual local area network where the switch is located; according to the preset policy, determining the first domain controller from the at least one candidate domain controller includes: sending third indication information to the at least one candidate domain controller, where the third indication information is used to obtain the Internet protocol address of the at least one candidate domain controller; receiving third response information from the at least one candidate domain controller; and taking the domain controller in the at least one candidate domain controller that is in the same virtual local area network as the switch as the first domain controller.

[0014] In this embodiment, selecting a domain controller in the same virtual local area network as the switch from at least one candidate domain controller as the first domain controller is beneficial to improving the efficiency, stability, and reliability of transmitting the first firmware.

[0015] In a possible implementation manner, before loading the first firmware, the method further includes: verifying the first firmware to determine whether the first firmware is complete; the loading the first firmware to enable the switch to enter a normal working state includes: if the verification passes, loading the first firmware to enable the switch to enter a normal working state.

[0016] In this embodiment, performing an integrity verification on the first firmware before loading the first firmware can effectively avoid problems such as the switch being attacked or data being leaked due to loading the first firmware that has been maliciously tampered with, which is beneficial to improving the security of the switch startup.

[0017] In a possible implementation manner, the method further includes: if the verification fails, receiving a second firmware sent by a second domain controller other than the first domain controller among the multiple domain controllers, where both the first firmware and the second firmware are used to start the switch.

[0018] In this embodiment, when the first firmware sent by the first domain controller fails the verification, receiving a second firmware from other domain controllers (except the first domain controller) among the multiple domain controllers to start the switch, avoiding the switch relying on the first domain controller to start, and further improving the flexibility of the switch startup.

[0019] In a possible implementation, the method further includes: if the verification fails and the number of retry attempts initiated by the switch is greater than or equal to a third threshold, receiving a third firmware sent by a third domain controller among the multiple domain controllers other than the first domain controller, where both the third firmware and the first firmware are used to start the switch.

[0020] In this implementation, when the verification fails and the number of retry attempts initiated by the switch is greater than or equal to the third threshold, receiving the third firmware from other domain controllers of the multiple domain controllers to start the switch can avoid the problem that the switch cannot be started due to a single point of failure, which is beneficial to improving the flexibility of switch startup.

[0021] In a possible implementation, before loading the first firmware to enable the switch to enter the normal working state, the method further includes: sending a firmware transmission request to the first domain controller, where the firmware transmission request is used to request to obtain the first firmware.

[0022] In a possible implementation, before loading the first firmware to enable the switch to enter the normal working state, the method further includes: receiving a mode acquisition request sent by the first domain controller; in response to the mode acquisition request, sending mode response information to the first domain controller, where the mode response information is used to indicate that the switch is in the no-flash mode.

[0023] In a second aspect, an embodiment of the present application provides a switch startup device, which is applied to a switch. The switch is connected to multiple domain controllers, and the multiple domain controllers perform data transmission with other devices through the switch. The device includes: a judgment module, configured to judge whether the switch is in the no-flash mode; a loading module, configured to, when the switch is in the no-flash mode, load a first firmware to enable the switch to enter the normal working state, where the first firmware is sent by a first domain controller, and the first domain controller is one of the multiple domain controllers.

[0024] In a third aspect, an embodiment of the present application provides a switch startup device, including: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory and executes the method as described in the first aspect and any possible implementation.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method as described in the first aspect and any possible implementation is implemented.

[0026] Fifth aspect, an embodiment of the present application provides a computer program product, including a computer program which, when executed by a processor, implements the method as described in the first aspect and any possible implementation manners thereof. Description of the Drawings

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

[0028] Figure 1 Schematic diagram of an application scenario of a switch startup method provided by an embodiment of the present application Figure 1 ;

[0029] Figure 2 Schematic diagram of an application scenario of a switch startup provided by an embodiment of the present application Figure 2 ;

[0030] Figure 3 Flow chart of a switch startup method provided by an embodiment of the present application Figure 1 ;

[0031] Figure 4 Schematic flow chart of a method for a switch to determine a first domain controller provided by an embodiment of the present application;

[0032] Figure 5 Interaction diagram of a switch determining a first domain controller provided by an embodiment of the present application;

[0033] Figure 6 Schematic flow chart of a switch startup method provided by an embodiment of the present application Figure 2 ;

[0034] Figure 7 Schematic structural diagram of a switch startup device provided by an embodiment of the present application;

[0035] Figure 8 Schematic structural diagram of a switch startup device provided by an embodiment of the present application. Detailed Embodiments

[0036] The technical solutions in the present application will be described below with reference to the drawings.

[0037] For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and roles. For example, the first instruction and the second instruction are used to distinguish different user instructions, and their order is not limited. Those skilled in the art can understand that terms such as "first" and "second" do not limit the quantity and execution order, and terms such as "first" and "second" do not necessarily limit differences.

[0038] It should be noted that in the present application, words such as "exemplarily" or "for example" are used to give examples, illustrations or explanations. Any embodiment or design solution described as "exemplarily" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, the use of words such as "exemplarily" or "for example" is intended to present relevant concepts in a specific manner.

[0039] In addition, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item)" or its similar expression below refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, and c can represent: a, or b, or c, or a and b, or a and c, or b and c, or a, b, and c, where a, b, and c can be single or multiple.

[0040] In addition, the terms "include" and "have" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.

[0041] Currently, the firmware of a switch is usually stored in an external storage device, and the switch enters the normal working state by reading the firmware from the external storage device. In this startup method, if the external storage device fails or malfunctions, resulting in the switch being unable to obtain the firmware from the external storage device, and then the switch cannot work properly. In other words, the current switch startup method is not flexible enough.

[0042] In view of this, an embodiment of the present application provides a method for starting a switch. This method is applied to a switch and includes: determining whether the switch is in a flashless mode. If the switch is in the flashless mode, loading a first firmware to enable the switch to enter a normal working state. The first firmware is sent by a first domain controller, and the first domain controller is one of multiple domain controllers connected to the switch. The multiple domain controllers perform data transmission with other devices through the switch. Even if the switch is in the flashless mode, the switch can still load the first firmware from the first domain controller to enter the normal working state, solving the problem of relying on a fixed external storage device to start the switch in the traditional switch starting method, and improving the flexibility of switch startup. Moreover, since the first domain controller is an existing communication device connected to the switch and there is no need to additionally configure a dedicated external storage device, the cost of switch startup is also reduced.

[0043] Please refer to Figure 1 , which is a schematic diagram of the application scenario of a method for starting a switch provided by an embodiment of the present application Figure 1 . As Figure 1 shown, the schematic diagram includes a switch 110 and multiple domain controllers. The multiple domain controllers include a domain controller 121, a domain controller 122, a domain controller 123, and a domain controller 124. Among them, the multiple domain controllers can perform data transmission with each other through the switch 110, and the multiple domain controllers can also perform data transmission with other devices through the switch 110. Briefly speaking, the switch 110 provides a data forwarding function for these multiple domain controllers.

[0044] Among them, the switch 110 is a physical switch. Multiple ports can be set in the switch 110, and the switch 110 is communicatively connected to the multiple domain controllers through each port. In Figure 1 the shown scenario, the switch 110 can be a vehicle-mounted switch. It should be noted that in Figure 1 , the multiple domain controllers are exemplified by a domain controller 121, a domain controller 122, a domain controller 123, and a domain controller 124. However, in the actual scenario, the embodiment of the present application does not limit the number of the multiple domain controllers.

[0045] Exemplarily, after the switch 110 is powered on, it can determine whether it is currently in the flashless mode. If the switch 110 is in the flashless mode, the switch 110 loads the first firmware to enter the normal working state. The first firmware is sent by a first domain controller, and the first domain controller can be any one of the domain controller 121, the domain controller 122, the domain controller 123, and the domain controller 124.

[0046] Among them, the switch 110 and the first domain controller can transmit the first firmware through communication methods such as Ethernet and system management interrupt (SMI), and the embodiments of the present application do not limit this.

[0047] Please refer to Figure 2 , which is a schematic diagram of the application scenario of a switch startup method provided by the embodiments of the present application. Figure 2 . Among them, Figure 2 The switch 210 shown can be, for example, Figure 1 the switch 110 shown, Figure 2 The multiple domain controllers shown can be, for example, Figure 1 the multiple domain controllers shown.

[0048] As Figure 2 shown, the schematic diagram includes a switch 210 and multiple domain controllers. Among them, the switch 210 includes a switch chip 211, and the multiple domain controllers include a domain controller 221, a domain controller 222, a domain controller 223, and a domain controller 224. These multiple domain controllers can perform data transmission with each other through the switch 210, or perform data transmission with other devices. The switch chip 211 can be used to implement the functions of the switch 210. For example, the switch chip 211 can be used to forward data packets transmitted by multiple domain controllers through the switch. For another example, the switch chip 211 can be used to execute the switch startup method provided by the embodiments of the present application.

[0049] It should be noted that Figure 1 or Figure 2 The schematic diagram of the application scenario shown is a schematic diagram of the switch startup method in a vehicle-mounted scenario. The switch startup method provided by the embodiments of the present application can also be applied to other scenarios, such as enterprise scenarios, industrial scenarios, smart home scenarios, and so on. In different application scenarios, the multiple domain controllers connected to the switch can also be devices that match their application scenarios. For example, in a smart home scenario, the multiple domain controllers can be replaced by smart home devices; in an industrial scenario, the multiple domain controllers can be replaced by industrial devices; in an enterprise scenario, the multiple domain controllers can be replaced by servers in a data center or an enterprise network.

[0050] Please refer to Figure 3 , which is a flowchart of a switch startup method provided by the embodiments of the present application. Figure 1 . Among them, the following is described by taking the switch executing Figure 3 the steps shown. Figure 3 The embodiments shown are applicable to Figure 1 or Figure 2 the application scenarios shown. Figure 3 The switch involved, for example Figure 1The switch 110 shown Figure 3 Any one of the first domain controllers involved, such as domain controller 121, domain controller 122, domain controller 123, and domain controller 124. Or, Figure 3 The switch involved is, for example, Figure 2 The switch 210 shown Figure 3 Any one of the first domain controllers involved, such as domain controller 221, domain controller 222, domain controller 223, and domain controller 224. In this case, Figure 2 The switch chip 211 shown can execute Figure 3 The steps executed by the switch in

[0051] S301, Determine whether the switch is in the flashless mode.

[0052] Among them, the firmware of the switch is stored in the external flash memory. When the switch detects that an external flash memory is connected, the switch can obtain the firmware from the external flash memory to enter the normal working state. In this case, the mode in which the switch is currently located can be called the flash mode. When the switch detects that no external flash memory is connected, the switch cannot obtain the firmware from the external flash memory. In this case, the mode in which the switch is currently located can be called the flashless mode.

[0053] Therefore, after the switch is powered on, it can be determined whether the switch is in the flashless mode. Specifically, the switch can determine whether the switch is in the flashless mode by detecting and identifying the port level signal corresponding to the mode or by obtaining the register status.

[0054] Taking the switch detecting and identifying the port level signal corresponding to the mode to determine whether the switch is in the flashless mode as an example, the switch can detect and identify the port level signal corresponding to the mode. If the port level signal corresponding to the identification mode is low level, it can indicate that the switch is in the flashless mode. If the port level signal corresponding to the identification mode is high level, it can indicate that the switch is in the flash mode.

[0055] When the switch is in the flashless mode, step S302 is executed, that is, the first firmware is loaded to make the switch enter the normal working state. The first firmware is sent by the first domain controller. When the switch is in the flash mode, the switch can obtain the firmware from the external flash memory to enter the normal working state. It should be noted that the switch startup method provided by the embodiments of the present application is executed when the switch is in the flashless mode.

[0056] S302, When the switch is in the flashless mode, load the first firmware to make the switch enter the normal working state. The first firmware is sent by the first domain controller, and the first domain controller is one of the multiple domain controllers.

[0057] When the switch is in the flashless mode, the switch can load the first firmware and thus enter the normal working state.

[0058] Among them, the first firmware is used to start the switch, and various configurations and program codes required for the operation of the switch are included in the first firmware. The first firmware is sent by the first domain controller to the switch. That is, before loading the first firmware, the first domain controller can send the first firmware to the switch. Correspondingly, the switch receives the first firmware from the first domain controller. Therefore, when the switch is in the flashless mode, the switch can obtain and load the first firmware and thus enter the normal working state.

[0059] Among them, the first firmware can be pre-stored in the first domain controller. Or, the first firmware can be obtained by the first domain controller from the network management platform of the switch. The network management platform of the switch refers to a software tool for centrally managing and monitoring switches in the network. The network management platform can pre-store the switch firmware and the updated firmware of the switch, and can also pre-store the configuration file and download address for downloading the switch firmware. Or, the first firmware can also be downloaded by the first domain controller from the official download website based on the configuration file. The configuration file can include information such as the download address, download tool, authorization information, and switch model. The configuration file can be pre-configured in the first domain controller or can be queried by the first domain controller from the network management platform. The official download website refers to the official website provided by the device manufacturer corresponding to the switch for downloading the firmware.

[0060] In a possible implementation manner, before the switch loads the first firmware, the switch can request the first domain controller to obtain the first firmware. Specifically, the switch can send a firmware transfer request to the first domain controller. The firmware transfer request is used to request to obtain the first firmware. Then, after the first domain controller receives the firmware transfer request, the first domain controller sends the first firmware to the switch. Correspondingly, the switch receives the first firmware sent by the first domain controller.

[0061] In a possible implementation manner, in order to ensure network security and the stable operation of the switch, before the switch loads the first firmware, the integrity of the first firmware can be verified to ensure that the first firmware does not have problems such as being maliciously tampered with, damaged, or missing. Specifically, the switch verifies the first firmware to determine whether the first firmware is complete. If the verification passes, the first firmware is loaded to enable the switch to enter the normal working state. If the verification fails, the startup process is exited.

[0062] That is to say, if the verification of the first firmware passes, it indicates that the first firmware is complete and trustworthy. Therefore, the switch can load the first firmware to enter the normal working state. If the verification of the first firmware fails, it indicates that there may be problems such as malicious tampering, damage, or missing of the first firmware. In this case, the switch can exit the startup process.

[0063] The switch can verify the integrity of the first firmware through methods such as digital signature and hash value calculation. For example, taking digital signature as an example, the switch can use the public key provided by the manufacturer to verify whether the digital signature carried in the first firmware is consistent with the manufacturer's digital signature. If they are consistent, it is determined that the first firmware is complete; if not, it is determined that the first firmware is incomplete.

[0064] In a possible implementation manner, when the verification of the first firmware fails, the switch can also receive the second firmware from the second domain controller other than the first domain controller among multiple domain controllers to ensure that the switch can successfully start and enter the normal working state. In this case, the second domain controller can be any domain controller other than the first domain controller among the multiple domain controllers, and both the second firmware and the first firmware are used to start the switch.

[0065] Exemplarily, please continue to refer to Figure 1 and use Figure 1 as an example where the switch firmware is pre - stored in each of the multiple domain controllers shown. The first domain controller is Figure 1 the domain controller 121 shown. The switch receives the first firmware sent by the domain controller 121 and verifies the first firmware, and the verification of the first firmware fails. In this case, the switch can receive the second firmware from the second domain controller, and the second domain controller can be any one of the domain controller 122, the domain controller 123, and the domain controller 124.

[0066] In this implementation manner, when the switch fails to successfully start after receiving the first firmware sent by the first domain controller, it can also receive the second firmware from the second domain controller, which improves the reliability of the switch's successful startup and also improves the flexibility of the switch's startup.

[0067] In a possible implementation, when the verification of the first firmware fails, the switch can also determine whether to obtain the third firmware from the third domain controller according to the retry count of the switch startup, so as to avoid misdetection of the first firmware by the switch or the problem of partial data loss of the first firmware during transmission due to network reasons. In this case, the third domain controller can be any domain controller other than the first domain controller among multiple domain controllers. The third domain controller and the second domain controller can be the same device or different devices, which is not limited in the embodiments of the present application. Both the third firmware and the first firmware are used to start the switch. Specifically, when the verification of the first firmware fails, the switch can determine whether the current retry count of the switch startup is greater than or equal to the third threshold. If the retry count is greater than or equal to the third threshold, the switch can receive the third firmware sent by the third domain controller other than the first domain controller among multiple domain controllers. If the retry count is less than the third threshold, the retry count is updated, and a startup failure message is sent to the first domain controller. Among them, the third threshold can be preconfigured in the switch, and the third threshold can be set according to actual needs. For example, the third threshold is 3, 5, etc., which is not limited in the embodiments of the present application.

[0068] It can be understood that after receiving the startup failure message, the first domain controller can determine the retry count of the switch according to the number of startup failure messages received from the switch, judge whether the retry count is greater than or equal to the third threshold. If the retry count is less than the third threshold, the first firmware is continued to be sent to the switch. If the retry count is greater than or equal to the third threshold, the first firmware is no longer sent to the switch.

[0069] Exemplarily, taking the third threshold as 3 as an example, after the switch receives the first firmware, the verification of the first firmware fails, and it is determined that the current retry count of the switch startup is 3, that is, the retry count is equal to the third threshold, then the switch receives the third firmware sent by the third domain controller. For another example, the verification of the first firmware by the switch fails, and it is determined that the current retry count of the switch startup is 2, that is, the retry count is less than the third threshold, then the switch sends a startup failure message to the first domain controller and updates the retry count, that is, adds 1 to the current retry count, 2 + 1 = 3, and the updated retry count is 3.

[0070] In some scenarios with high security requirements, specific target transfer protocols are usually selected to transfer the first firmware to ensure the security and reliability of the firmware. Examples of target transfer protocols include some common file transfer protocols, proprietary protocols pre-configured in switches, etc. Examples of file transfer protocols include Trivial File Transfer Protocol (TFTP), File Transfer Protocol (FTP), Secure Shell (SSH) File Transfer Protocol (SFTP), Secure Copy Protocol (SCP), etc. Proprietary protocols are developed by device manufacturers, and the proprietary protocols of different manufacturers are different. In practical applications, the corresponding target transfer protocol can be selected based on the security requirements of the scenario where the switch is located. For example, in an enterprise-level data center with high security requirements, the proprietary protocol or a protocol with high security such as SFTP or SCP can be used as the target transfer protocol. The target transfer protocol can refer to a single transfer protocol or multiple transfer protocols, and the embodiments of this application do not limit this. Based on this, before the switch receives the first firmware sent by the first domain controller, the switch can screen out the first domain controller that supports the target transfer protocol and complies with the preset policy from multiple domain controllers based on the target transfer protocol and the preset policy.

[0071] The following will combine Figure 4 with the flowchart of a method for determining the first domain controller shown in the figure to illustrate the specific implementation of the switch to determine the first domain controller from multiple domain controllers based on the target transfer protocol and the preset policy.

[0072] S401, the switch sends the first indication information to multiple domain controllers, and the data encapsulation format of the first indication information is the same as the data encapsulation format specified by the target transfer protocol for transferring the first firmware.

[0073] Among them, the target transfer protocol for transferring the first firmware is pre-configured in the switch, and the content of the target transfer protocol can be referred to the content described above, which will not be elaborated here.

[0074] Different transfer protocols have different data encapsulation formats. Different data encapsulation formats define different data structures, fields, and protocol requirements. Simply put, different data encapsulation formats result in different transfer rules. Therefore, the same data encapsulation format of the first indication information and the target transfer protocol indicates that the transfer rules of the first indication information and the first firmware are the same.

[0075] S402, the switch receives first response information from at least one candidate domain controller. The at least one candidate domain controller belongs to multiple domain controllers, and the data encapsulation format of the first response information is the same as the data encapsulation format specified by the target transport protocol.

[0076] Due to different data encapsulation formats, the transmission rules are also different. Therefore, when the switch receives the first response information from at least one candidate domain controller, it indicates that the at least one candidate domain controller supports the transmission rules defined by the target transport protocol. Thus, the at least one candidate domain controller can successfully receive the first indication information and send the first response information to the switch. Furthermore, the switch can also determine that the at least one candidate domain controller can correctly transmit the first firmware according to the transmission rules of the target transport protocol.

[0077] It should be understood that if a certain domain controller among the multiple domain controllers does not support the target transport protocol, it cannot receive the first indication information sent by the switch, and thus will not send the first response information to the switch. Therefore, when the switch receives the first response information from at least one candidate domain controller, it can indicate that the at least one candidate domain controller is a device that supports the target transport protocol.

[0078] Exemplarily, taking the target transport protocol as the TFTP protocol as an example, combined with Figure 5 a schematic diagram of a scenario where a switch determines the first domain controller, the scenario where the switch determines at least one candidate domain controller is illustrated. As Figure 5 shown, the switch 510 is communicatively connected to multiple domain controllers through ports. The multiple domain controllers include domain controller 501, domain controller 502, domain controller 503, and domain controller 504. The TFTP protocol is pre-configured in the switch 510, the FTP protocol and the TFTP protocol are pre-configured in the domain controllers 501 and 504, the TFTP protocol is pre-configured in the domain controller 502, and the SCP protocol and the FTP protocol are pre-configured in the domain controller 503. The switch 510 encapsulates the first indication information based on the data encapsulation format specified by the TFTP protocol and sends the first indication information to the domain controllers 501, 502, 503, and 504. Since the TFTP protocol is not configured in the domain controller 503, the domain controller 503 cannot receive the first indication information. However, since the TFTP protocol is pre-configured in the domain controllers 501, 502, and 504, the domain controllers 501, 502, and 504 can all receive the first indication information and encapsulate the first response information based on the data encapsulation format specified by the TFTP protocol, and send the first response information to the switch 510. That is, the domain controllers 501, 502, and 504 are the at least one candidate domain controller determined by the switch 510.

[0079] S403: The switch determines a first domain controller from at least one candidate domain controller according to a preset policy.

[0080] The preset strategy is preconfigured in the switch, and the preset strategy may include one or more of the following:

[0081] 1. The preset policy indicates that the first domain controller is randomly determined;

[0082] 2. The preset strategy is determined based on the transmission delay;

[0083] 3. The preset strategy is determined based on the remaining storage space;

[0084] 4. The preset strategy is determined based on the virtual LAN where the switch is located.

[0085] The following describes the methods of determining the first domain controller from at least one candidate domain controller based on the above four strategies.

[0086] 1. The preset policy indicates that the first domain controller is randomly determined.

[0087] In this implementation, the switch randomly selects a device from at least one candidate domain controller as the first domain controller.

[0088] For example, please refer to Figure 5 , with at least one candidate domain controller as Figure 5 Taking the domain controller 501, the domain controller 502 and the domain controller 504 as examples, under this policy, the switch can determine any one of the domain controllers 501, 502 and 504 as the first domain controller.

[0089] 2. The preset strategy is determined based on the transmission delay.

[0090] In this implementation, the switch can determine the transmission delay between the switch and at least one candidate domain controller according to the sending time of the first indication information and the receiving time of the first response information of at least one candidate domain controller, and then use the device of at least one candidate domain controller that is less than or equal to the first threshold as the first domain controller. The first threshold is pre-configured in the switch, and the first threshold can be set according to actual needs, such as 1ms, and this embodiment of the application does not limit this.

[0091] Alternatively, in another implementation, the switch may use a device with the lowest transmission delay among at least one candidate domain controller as the first domain controller.

[0092] For example, please refer to Figure 5 , with at least one candidate domain controller asFigure 5 Taking the domain controllers 501, 502, and 504 shown, and the first threshold being 1 ms as an example. The switch 510 determines that the transmission delay of the domain controller 501 is 0.1 ms, the transmission delay of the domain controller 502 is 1.4 ms, and the transmission delay of the domain controller 504 is 0.7 ms. Since the switch 510 determines that the transmission delays of the domain controller 501 and the domain controller 504 are less than the first threshold, the switch 510 can use the domain controller 501 or the domain controller 504 as the first domain controller. Alternatively, the switch 510 can use the domain controller 501 with the lowest transmission delay as the first domain controller.

[0093] 3. The preset policy is a policy determined according to the remaining storage space.

[0094] In this embodiment, the switch can send second indication information to at least one candidate domain controller. The second indication information is used to obtain the remaining storage space of the non-volatile storage medium in at least one candidate domain controller. The switch can receive second response information from at least one candidate domain controller. The second response information is used to indicate the remaining storage space of the non-volatile storage medium in at least one candidate domain controller. Then, the switch can, according to the second response information, use the domain controller in at least one candidate domain controller whose remaining storage space is greater than or equal to the second threshold as the first domain controller. Among them, the second threshold can be pre-configured in the switch, and the second threshold can be set according to the switch model and function. For example, the second threshold is 300 MB, 500 MB, etc. The embodiments of the present application do not limit this.

[0095] Alternatively, in another embodiment, the switch can determine the domain controller with the largest remaining storage space among at least one candidate domain controller as the first domain controller.

[0096] For example, please continue to refer to Figure 5 taking at least one candidate domain controller as Figure 5 the domain controllers 501, 502, and 504 shown, and the second threshold being 300 MB as an example. The switch 510 determines that the remaining storage space of the domain controller 501 is 500 MB, the remaining storage space of the domain controller 502 is 1 GB, and the remaining storage space of the domain controller 504 is 1.2 GB. Since the switch determines that the remaining storage spaces of the domain controller 501, the domain controller 502, and the domain controller 504 are all greater than the second threshold, the switch 510 can use any one of the domain controllers 501, 502, and 504 as the first domain controller. Alternatively, the switch 510 can use the domain controller 504 with the largest remaining storage space as the first domain controller.

[0097] To ensure the stability and reliability of the switch startup, storing the firmware in a non-volatile storage medium can ensure that the firmware remains retained after a power outage or device restart. Therefore, in this embodiment, the switch determines the first domain controller based on the remaining storage space of the non-volatile storage medium in at least one candidate domain controller. The non-volatile storage medium can be, for example, flash memory, solid-state drive, electrically erasable programmable read-only memory (EEPROM), read-only memory (ROM), hard disk drive, and so on. Moreover, the first domain controller can also separately partition a storage area from the storage space to store firmware of various versions of the switch and backup firmware.

[0098] In a possible embodiment, the switch can carry information indicating the acquisition of the remaining storage space in the first indication information and send it to multiple domain controllers to save communication resources.

[0099] 4. The preset policy is a policy determined according to the virtual local area network (VLAN) where the switch is located.

[0100] In this embodiment, the switch can send third indication information to at least one candidate domain controller, and the third indication information is used to acquire the Internet Protocol address of at least one candidate domain controller. Correspondingly, at least one candidate domain controller responds to the third indication information and sends third response information to the switch. The switch receives the third response information of at least one candidate domain controller, and the third response information is used to indicate the Internet Protocol (IP) address of at least one candidate domain controller. Furthermore, the switch can determine the subnet mask of each candidate domain controller based on the IP address of at least one candidate domain controller, and thus determine whether it is in the same virtual local area network as the switch according to the IP address and the subnet mask. Finally, the devices in at least one candidate domain controller that are in the same virtual local area network as the switch are used as the first domain controller.

[0101] Exemplarily, for example, please continue to refer to Figure 5 , with at least one candidate domain controller being Figure 5Taking the domain controllers 501, 502, and 504 shown as an example, and the virtual local area network (VLAN) where the switch 510 is located being VLAN1. The switch 510 determines that the virtual local area network where the domain controller 501 is located is VLAN2, the virtual local area network where the domain controller 502 is located is VLAN1, and the virtual local area network where the domain controller 504 is located is VLAN1. The switch 510 determines that the virtual local area networks where the domain controllers 502 and 504 are located are the same as the virtual local area network where the switch 510 is located. Therefore, the switch 510 can determine the domain controller 502 or the domain controller 504 as the first domain controller.

[0102] In a possible implementation manner, the switch can carry information indicating to obtain the IP addresses of at least one candidate domain controller in the first indication information and send it to multiple domain controllers to save communication resources.

[0103] In some scenarios, the second, third, and fourth strategies can also be combined and used. For example, when the second and third strategies are combined, devices with a transmission delay less than or equal to the first threshold and a remaining storage space greater than or equal to the second threshold are screened out from at least one candidate domain controller as the first domain controller.

[0104] Exemplarily, continuing to refer to the examples shown in the second and third strategies above, the switch 510 determines that the transmission delays of the domain controllers 501 and 504 are less than the first threshold, and the remaining storage spaces of the domain controllers 501, 502, and 504 are all greater than the second threshold. Therefore, the switch 510 can determine the domain controller 501 or the domain controller 504 as the first domain controller.

[0105] For another example, when the second, third, and fourth strategies are combined and used, devices with a transmission delay less than or equal to the first threshold, a remaining storage space greater than or equal to the second threshold, and devices within the same virtual local area network as the switch are screened out from at least one candidate domain controller as the first domain controller.

[0106] Exemplarily, continuing to refer to the examples shown in the second, third, and fourth strategies above, the switch 510 determines that the transmission delays of the domain controllers 501 and 504 are less than the first threshold, the remaining storage spaces of the domain controllers 501, 502, and 504 are all greater than the second threshold, and the virtual local area networks where the domain controllers 502 and 504 are located are the same as the virtual local area network where the switch 510 is located. Therefore, the switch 510 can determine the domain controller 504 as the first domain controller.

[0107] Of course, in practical applications, the priorities of transmission delay, remaining storage space, and virtual local area network can be defined according to actual requirements. That is, if there are multiple devices in at least one candidate domain controller that meet the above combination strategy, the first domain controller can also be determined based on the priorities of transmission delay, remaining storage space, and virtual local area network.

[0108] For example, taking the combination of the second and third strategies mentioned above, where the priority of remaining storage space is higher than the priority of transmission delay as an example. The switch 510 determines that the transmission delays of the domain controller 501 and the domain controller 504 are less than the first threshold, and the remaining storage spaces of the domain controller 501, the domain controller 502, and the domain controller 504 are all greater than the second threshold. Based on this, the switch 510 can determine that both the domain controller 501 and the domain controller 504 meet the second and third strategies. Since the priority of remaining storage space is higher than the priority of transmission delay, the remaining storage space of the domain controller 501 is 500MB, and the remaining storage space of the domain controller 504 is 1.2GB. Therefore, the switch 510 can determine the domain controller 504 as the first domain controller.

[0109] In another possible implementation, before loading the first firmware, specifically, before the switch receives the first firmware sent by the first domain controller, the switch can also receive a mode acquisition request sent by the first domain controller, which is used to acquire the current mode of the switch. In response to the mode acquisition request, the switch sends mode response information to the first domain controller. When the mode response information is used to indicate that the switch is in the flashless mode, the switch can receive the first firmware sent by the first domain controller. When the mode response information is used to indicate that the switch is in the flash mode, there is no need to send the first firmware to the switch.

[0110] The mode response information may include the current register status of the switch, and the register status may include flash directory information. Furthermore, the first domain controller can determine whether there is firmware in the flash based on the flash directory information, so as to determine whether the switch is in the flash mode or the flashless mode.

[0111] In a possible implementation, before the first domain controller receives the firmware transmission request sent by the switch, after determining that the switch is currently in the flashless mode, the first firmware can be sent to the switch.

[0112] In a possible implementation, the device manufacturer corresponding to the switch may update the switch firmware for reasons such as developing new functions, optimizing performance, and fixing vulnerabilities. Therefore, when the switch firmware needs to be updated, the switch can receive the updated first firmware sent by the first domain controller. Among them, the updated first firmware can be obtained by the first domain controller from the network management platform of the switch or downloaded from a preset official download website. The content of the network management platform and the official download website can be referred to the content described above, which will not be elaborated here.

[0113] Exemplarily, the first domain controller can receive firmware update indication information from the network management platform, and based on this firmware update indication information, download the updated first firmware from the official download website. Alternatively, the first domain controller can also query whether there is an updated version of the first firmware from the official download website or the network management platform at preset time intervals. If so, download the updated first firmware. Among them, the preset time interval is pre-configured in the first domain controller, and the preset time interval can be set according to actual needs, such as 1 week, 1 month, 3 months, etc., which is not limited in the embodiments of the present application.

[0114] The following combines Figure 6 The flow diagram of a switch startup method shown Figure 2 to illustrate the switch startup method provided by the embodiments of the present application by way of example. Among them, Figure 6 The first domain controller shown, for example, is Figure 1 Any one of the domain controllers 121, domain controller 122, domain controller 123, and domain controller 124 shown, Figure 6 The switch shown, for example, is Figure 1 The switch 110 shown. Alternatively, Figure 6 The first domain controller shown is Figure 2 Any one of the domain controllers 221, domain controller 222, domain controller 223, and domain controller 224 shown, Figure 6 The switch shown, for example, is Figure 2 The switch 210 shown. In this case, Figure 2 The switch chip 211 shown can execute Figure 6 The steps executed by the switch shown.

[0115] S601, the switch determines whether the switch is in the flashless mode.

[0116] Among them, the specific content of the switch determining whether the switch is in the flashless mode can be referred to the content described above, which will not be elaborated here.

[0117] S602, the switch sends a firmware transfer request to the first domain controller.

[0118] Correspondingly, the first domain controller receives a firmware transfer request sent by the switch. Among them, the content of the firmware transfer request can be correspondingly referred to the content described above.

[0119] S603. The first domain controller sends a mode acquisition request to the switch.

[0120] Correspondingly, the switch receives the mode acquisition request sent by the first domain controller. Among them, the content of the mode acquisition request can be correspondingly referred to the content described above.

[0121] S604. The switch sends mode response information to the first domain controller, and the mode response information is used to indicate that the mode of the switch is the flashless mode.

[0122] Correspondingly, the first domain controller receives the mode response information from the switch.

[0123] It should be noted that in the embodiment of the present application, the example is described with the switch in the flashless mode.

[0124] S605. The first domain controller sends the first firmware to the switch.

[0125] When the first domain controller determines that the switch is currently in the flashless mode, it sends the first firmware to the switch. Correspondingly, the switch receives the first firmware sent by the first domain controller.

[0126] S606. The switch verifies the first firmware to determine whether the first firmware is complete.

[0127] Among them, the specific implementation manner for the switch to verify whether the first firmware is complete can be correspondingly referred to the content described above, and will not be elaborated here.

[0128] S607. The switch loads the first firmware to enable the switch to enter the normal working state.

[0129] S608. The switch determines whether the retry count is greater than or equal to the third threshold.

[0130] If the retry count is greater than or equal to the third threshold, the current startup process ends, or a second domain controller is determined from the domain controllers other than the first domain controller among multiple domain controllers to re - execute the switch startup process. The specific content can be correspondingly referred to the content described above and will not be elaborated here. If the retry count is less than the third threshold, the retry count is updated, and steps S602 to S608 are re - executed.

[0131] Based on the same inventive concept, the embodiment of the present application provides a switch startup device, and this device is used to implement any of the above - mentioned switch startup methods. For example, Figure 3 Or Figure 6The switch startup method shown, and the device can also implement the functions of the switch in the previous text.

[0132] Please refer to Figure 7 , which is a schematic structural diagram of a switch startup device provided by an embodiment of the present application. As Figure 7 shown, the switch startup device 700 includes a judgment module 701 and a loading module 702. The switch startup device 700 can be applied to a switch. The switch is connected to multiple domain controllers, and the multiple domain controllers perform data transmission with other devices through the switch.

[0133] Exemplarily, the judgment module 701 is used to judge whether the switch is in a flashless mode; the loading module 702 is used to load the first firmware to make the switch enter the normal working state when the switch is in the flashless mode. The first firmware is sent by the first domain controller, and the first domain controller is one of the multiple domain controllers.

[0134] In a possible implementation manner, the loading module 702 is further used to send first indication information to the multiple domain controllers before loading the first firmware to make the switch enter the normal working state. The data encapsulation format of the first indication information is the same as the data encapsulation format specified by the target transmission protocol for transmitting the first firmware; receive first response information from at least one candidate domain controller. At least one candidate domain controller belongs to the multiple domain controllers, and the data encapsulation format of the first response information is the same as the data encapsulation format specified by the target transmission protocol; determine the first domain controller from at least one candidate domain controller according to a preset policy.

[0135] In a possible implementation manner, the preset policy is a policy determined according to the transmission delay; the loading module 702 is specifically used to: determine the transmission delay between the switch and at least one candidate domain controller according to the sending time of the first indication information and the receiving time of the first response information of at least one candidate domain controller; use the domain controller with a transmission delay less than or equal to the first threshold among at least one candidate domain controller as the first domain controller.

[0136] In a possible implementation manner, the preset policy is a policy determined according to the remaining storage space; the loading module 702 is specifically used to: send second indication information to at least one candidate domain controller, and the second indication information is used to obtain the remaining storage space of the non-volatile storage medium of at least one candidate domain controller; receive second response information from at least one candidate domain controller; use the domain controller with a remaining storage space greater than or equal to the second threshold among at least one candidate domain controller as the first domain controller.

[0137] In a possible implementation, the preset policy is a policy determined according to the virtual local area network where the switch is located; the loading module 702 is specifically configured to: send third indication information to at least one candidate domain controller, where the third indication information is used to obtain the Internet protocol addresses of at least one candidate domain controller; receive third response information from at least one candidate domain controller; and use the domain controller within the same virtual local area network as the switch among at least one candidate domain controller as the first domain controller.

[0138] In a possible implementation, the loading module 702 is further configured to: before loading the first firmware, verify the first firmware to determine whether the first firmware is complete; if the verification passes, load the first firmware to enable the switch to enter the normal working state.

[0139] In a possible implementation, the loading module 702 is further configured to: if the verification fails, receive the second firmware sent by the second domain controller other than the first domain controller among multiple domain controllers, where both the first firmware and the second firmware are used to start the switch.

[0140] In a possible implementation, the loading module 702 is further configured to: if the verification fails and the retry count for starting the switch is greater than or equal to the third threshold, receive the third firmware sent by the third domain controller other than the first domain controller among multiple domain controllers, where both the third firmware and the first firmware are used to start the switch.

[0141] In a possible implementation, the loading module 702 is further configured to: before loading the first firmware to enable the switch to enter the normal working state, send a firmware transfer request to the first domain controller, where the firmware transfer request is used to request to obtain the first firmware.

[0142] In a possible implementation, the loading module 702 is further configured to: before loading the first firmware to enable the switch to enter the normal working state, receive a mode acquisition request sent by the first domain controller; in response to the mode acquisition request, send mode response information to the first domain controller, where the mode response information is used to indicate that the switch is in the no-flash mode.

[0143] Based on the same inventive concept, an embodiment of the present application provides a switch startup device, which is used to implement any of the above switch startup methods, such as Figure 3 or Figure 6 the switch startup method shown, and the device can further implement the functions of the switch in the foregoing text.

[0144] Please refer to Figure 8 for the structural schematic diagram of a switch startup device provided by an embodiment of the present application. As shown in Figure 8As shown, the switch startup device 800 includes at least one processor 801 and a memory 802 communicatively connected to the at least one processor 801.

[0145] Among them, the processor 801 can be a general-purpose processor or a special-purpose processor, etc. The processor 801 includes, for example: a baseband processor or a central processing unit, etc. The baseband processor can be used to process communication protocols and communication data. The central processing unit can be used to control the switch startup device 800, execute software programs, and / or process data. Different processors can be independent devices or can be arranged in one or more processing circuits. For example, they can be integrated on one or more application-specific integrated circuits.

[0146] In one embodiment, the memory 802 stores instructions executable by the at least one processor 801, and the at least one processor 801 realizes the functions of the foregoing switch by executing the instructions stored in the memory 802. Correspondingly, the steps executed by the foregoing switch can also be realized.

[0147] In this embodiment, the switch startup device 800 can also realize the functions of the foregoing switch startup device 700, and at least one processor 801 in the switch startup device 800 can also realize the functions of the foregoing determination module 701 and loading module 702.

[0148] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium stores computer instructions. When the computer instructions run on a computer, the computer is made to execute the switch startup method as described in any of the foregoing, for example Figure 3 or Figure 6 the switch startup method shown.

[0149] Based on the same inventive concept, an embodiment of the present application provides a computer program product, which contains computer instructions. When it runs on a computer, the switch startup method as described in any of the foregoing is realized, for example Figure 3 or Figure 6 the switch startup method shown.

[0150] It should be understood that in the embodiments of the present application, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0151] In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor or the instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory, and the processor executes the instructions in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0152] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by the combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0153] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0154] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, 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 displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.

[0155] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0157] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0158] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A method for starting a switch, characterized in that, The method is applied to a switch, and the switch is connected to multiple domain controllers. The multiple domain controllers perform data transmission with other devices through the switch. The method includes: Determine whether the switch is in a flashless mode; When the switch is in the flashless mode, load a first firmware to enable the switch to enter a normal working state. The first firmware is sent by a first domain controller, and the first domain controller is one of the multiple domain controllers.

2. The method according to claim 1, characterized in that, Before loading the first firmware to enable the switch to enter a normal working state, the method further includes: Send first indication information to the multiple domain controllers. The data encapsulation format of the first indication information is the same as the data encapsulation format specified by the target transmission protocol for transmitting the first firmware; Receive first response information from at least one candidate domain controller. The at least one candidate domain controller belongs to the multiple domain controllers, and the data encapsulation format of the first response information is the same as the data encapsulation format specified by the target transmission protocol; Determine the first domain controller from the at least one candidate domain controller according to a preset policy.

3. The method according to claim 2, wherein The preset policy is a policy determined according to transmission delay. Determining the first domain controller from the at least one candidate domain controller according to the preset policy includes: Determine the transmission delay between the switch and the at least one candidate domain controller according to the sending time of the first indication information and the receiving time of the first response information of the at least one candidate domain controller; Use the domain controller among the at least one candidate domain controllers with a transmission delay less than or equal to a first threshold as the first domain controller.

4. The method according to claim 2, wherein The preset policy is a policy determined according to the remaining storage space; Determining the first domain controller from the at least one candidate domain controller according to the preset policy includes: Send second indication information to the at least one candidate domain controller. The second indication information is used to obtain the remaining storage space of the non-volatile storage medium of the at least one candidate domain controller; Receive second response information from the at least one candidate domain controller; Use the domain controller among the at least one candidate domain controllers with a remaining storage space greater than or equal to a second threshold as the first domain controller.

5. The method according to claim 2, wherein The preset policy is a policy determined according to the virtual local area network where the switch is located. Determining the first domain controller from the at least one candidate domain controller according to the preset policy includes: Send third indication information to the at least one candidate domain controller. The third indication information is used to obtain the Internet protocol address of the at least one candidate domain controller; Receive third response information from the at least one candidate domain controller; Use the domain controller among the at least one candidate domain controllers that is in the same virtual local area network as the switch as the first domain controller.

6. The method according to claim 1, wherein Before loading the first firmware to enable the switch to enter a normal working state, the method further includes: Verify the first firmware to determine whether the first firmware is complete; Loading the first firmware to enable the switch to enter the normal working state includes: If the verification passes, load the first firmware to enable the switch to enter the normal working state.

7. The method according to claim 6, characterized in that, The method further includes: If the verification fails, receive a second firmware sent by a second domain controller other than the first domain controller among the multiple domain controllers. Both the first firmware and the second firmware are used to start the switch.

8. The method according to claim 6, characterized in that, The method further includes: If the verification fails and the retry count of starting the switch is greater than or equal to a third threshold, receive a third firmware sent by a third domain controller other than the first domain controller among the multiple domain controllers. Both the third firmware and the first firmware are used to start the switch.

9. The method according to any one of claims 1-8, characterized in that Before loading the first firmware to enable the switch to enter the normal working state, the method further includes: Send a firmware transmission request to the first domain controller, where the firmware transmission request is used to request to obtain the first firmware.

10. The method according to any one of claims 1-8, characterized in that, Before loading the first firmware to enable the switch to enter the normal working state, the method further includes: Receive a mode acquisition request sent by the first domain controller; In response to the mode acquisition request, send mode response information to the first domain controller, where the mode response information is used to indicate that the switch is in the no-flash mode.

11. A switch startup device, characterized in that, The device is applied to a switch, the switch is connected to multiple domain controllers, and the multiple domain controllers perform data transmission with other devices through the switch; the device includes: A judgment module, configured to judge whether the switch is in the no-flash mode; A loading module, configured to, when the switch is in the no-flash mode, load the first firmware to enable the switch to enter the normal working state. The first firmware is sent by a first domain controller, and the first domain controller is one of the multiple domain controllers.

12. A switch startup device, characterized in that, Includes: A memory storing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory and executes the method according to any one of claims 1-10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1-10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1-10.