Switching equipment starting method and related device
By closing the CPU's writing channel to the switching chip when the switching device and the microcontroller are powered on at the same time, and using the microcontroller to configure the switching chip, the problem of the long startup time of the traditional switching device is solved, and fast startup and efficient communication are achieved.
Patent Information
- Application Number
- CN202510793737.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-07-18
AI Technical Summary
Traditional switching equipment has a long start time, which affects communication time, especially in on-board switching equipment.
When the switching device and the microcontroller are powered on at the same time, the CPU writes the switching chip, and pre-stores the driver structure configuration file through the microcontroller. The microcontroller directly configures the switching chip, adjusts the clock frequency of the serial peripheral device interface to shorten the write time.
It greatly shortens the startup working time of the switching chip, ensures the communication time of the switching equipment, and improves the starting speed of the equipment.
Smart Images

Figure CN120342981A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a method for starting a switching device and related apparatuses. Background Art
[0002] Quick information collection by a switching device is a key factor in ensuring the efficient operation and secure communication of a terminal system. When a traditional switching device starts up, it needs to start the CPU (Central Processing Unit) in sequence, initialize hardware devices, and establish a mapping table for the memory space, so as to establish an appropriate system software and hardware environment for loading the operating system. Then, the CPU converts the configuration information of the switching chip into a driver structure configuration file and writes it into the switching chip, so that the switching chip can perform normal data forwarding work.
[0003] However, since it is difficult to optimize the startup time of the CPU, the startup time of the switching chip is relatively long, which greatly affects the communication efficiency. Summary of the Invention
[0004] In view of the above problems, this application provides a method for starting a switching device and related apparatuses to achieve the purpose of shortening the startup time of the switching chip. The specific solutions are as follows:
[0005] A first aspect of this application provides a method for starting a switching device. The switching device includes a CPU and a switching chip, and a microcontroller is connected to the switching chip. The method for starting the switching device includes:
[0006] When the switching device and the microcontroller are powered on simultaneously, control the CPU to close the write channel to the switching chip;
[0007] Control the microcontroller to write a driver structure configuration file into the switching chip so that the switching chip can perform data forwarding; wherein, the driver structure configuration file is pre-stored in the microcontroller.
[0008] In a possible implementation, the method for pre-storing the driver structure configuration file in the microcontroller includes:
[0009] When the switching device is powered on, control the CPU to write the driver structure configuration file into the flash memory of the microcontroller.
[0010] In a possible implementation, the microcontroller is connected to the switching chip through a Serial Peripheral Interface (SPI). The method for starting the switching device further includes:
[0011] Adjust the clock frequency of the Serial Peripheral Interface to adjust the writing time of the microcontroller to the switching chip.
[0012] In a possible implementation, the method for starting the switching device further includes:
[0013] After the switching device finishes starting up, open the write channel.
[0014] The second aspect of this application provides a starting device for a switching device. The switching device includes a CPU and a switching chip, and a single-chip microcomputer is connected to the switching chip. The starting device of the switching device includes:
[0015] A file storage module, configured to pre-store the drive structure configuration file in the single-chip microcomputer;
[0016] A channel control module, configured to control the CPU to close the write channel to the switching chip when the switching device and the single-chip microcomputer are powered on simultaneously;
[0017] A chip writing module, configured to control the single-chip microcomputer to write the drive structure configuration file into the switching chip, so that the switching chip can perform data forwarding; wherein, the drive structure configuration file is pre-stored in the single-chip microcomputer.
[0018] In a possible implementation, the file storage module is specifically configured to:
[0019] When the switching device is powered on, control the CPU to write the drive structure configuration file into the flash memory of the single-chip microcomputer.
[0020] In a possible implementation, the single-chip microcomputer is connected to the switching chip through a serial peripheral interface. The chip writing module is further configured to:
[0021] Adjust the clock frequency of the serial peripheral interface to adjust the writing time of the single-chip microcomputer to the switching chip.
[0022] The third aspect of this application provides a computer program product, including computer-readable instructions. When the computer-readable instructions run on an electronic device, the electronic device is enabled to implement the method for starting a switching device according to the first aspect or any implementation manner of the first aspect.
[0023] The fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0024] The memory is used to store a computer program;
[0025] The processor is configured to execute the computer program, so that the electronic device can implement the method for starting a switching device according to the first aspect or any implementation manner of the first aspect.
[0026] The fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the startup method of the switching device according to the first aspect or any implementation manner of the first aspect.
[0027] By means of the above technical solution, the present application provides a startup method and related device for a switching device. The switching device includes a CPU and a switching chip, and the single-chip microcomputer establishes a connection with the switching chip. The driver structure configuration file of the switching chip is pre-stored in the single-chip microcomputer. When the switching device and the single-chip microcomputer are powered on simultaneously, the write channel of the CPU to the switching chip is closed; the single-chip microcomputer is controlled to write the driver structure configuration file into the switching chip so that the switching chip can perform data forwarding. In the present application, the switching device can be started according to the normal process. After the write channel of the CPU to the switching chip is closed, the CPU cannot configure the switching chip. Moreover, when the switching device is started, the single-chip microcomputer starts to directly configure the switching chip. Since the single-chip microcomputer has fewer startup items than the CPU, the startup working time of the switching chip can be greatly shortened, and the communication timeliness of the switching device can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.
[0029] Figure 1 It is a schematic flowchart of a startup method for a switching device provided by an embodiment of the present application;
[0030] Figure 2 It is another schematic flowchart of a startup method for a switching device provided by an embodiment of the present application;
[0031] Figure 3 It is a schematic structural diagram of a startup device for a switching device provided by an embodiment of the present application;
[0032] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0033] The following describes the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.
[0034] The embodiments of the present application will be described below with reference to the accompanying drawings. As is known to those of ordinary skill in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0035] The terms "first", "second", etc. in the description of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing objects with the same attributes when describing the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units not clearly listed or inherent to these processes, methods, products or devices.
[0036] Taking the in-vehicle switching device as an example, the ability of the in-vehicle switching device to collect information quickly and reliably is a key factor in ensuring the efficient operation and safe communication of the vehicle, which requires the in-vehicle switching device to be able to start quickly. The startup process of the traditional in-vehicle switching device is as follows:
[0037] Power on and perform self-check on the hardware; start the CPU; the uboot starts to establish an appropriate system software and hardware environment, and boot the linux operating system to load. During this process, peripherals such as the memory and flash memory (subsequently referred to as flash memory 1) of the in-vehicle switching device are initialized; the CPU loads the configuration information of the switching chip (such as the routing table, MAC table, etc.) in the flash memory 1, converts the configuration information format into a driver structure configuration file (named configfile file), and then writes the driver structure configuration file into the registers of the switching chip to complete the configuration of the switching chip. In this way, the startup of the in-vehicle switching device is completed, and the switching chip can subsequently forward network data normally.
[0038] The entire startup process of the above-mentioned in-vehicle switching device usually takes more than 40 seconds, which will affect the vehicle's handling feel and driving experience.
[0039] To solve the above problems, the embodiments of the present application provide a method for starting a switching device. By quickly configuring the switching chip through a microcontroller unit (MCU), the switching chip starts to work when powered on, combined with the normal CPU startup program of the switching device without interruption, greatly shortening the startup working time of the switching chip and ensuring the communication timeliness of the switching device. The method for starting the switching device in the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.
[0040] See Figure 1 , Figure 1Schematic flowchart of a startup method for a switching device provided by an embodiment of this application. The switching device includes a CPU and a switching chip, and the microcontroller is connected to the switching chip. Specifically, the microcontroller can be connected to the switching chip through a Serial Peripheral Interface (SPI). As Figure 1 shown, a startup method for a switching device provided by an embodiment of this application may include the following steps S101 to S102, and these steps will be described in detail below.
[0041] S101, when the switching device and the microcontroller are powered on simultaneously, control the CPU to close the write channel to the switching chip.
[0042] Specifically, in an embodiment of this application, when the switching device and the microcontroller are powered on and started simultaneously, the CPU can be controlled to close the write channel to the switching chip. This write channel is the channel for writing to the switching chip after the CPU converts the configuration information in Flash 1 into a driver configuration file.
[0043] Continuing to take the in-vehicle switching device as an example, after closing the write channel of the CPU to the switching chip, the startup process of the in-vehicle switching device is as follows: power on and perform self-check on the hardware when starting up; start the CPU; start uboot to boot and load the linux operating system to initialize peripherals such as the memory and Flash 1 of the in-vehicle switching device; the CPU loads the configuration information of the switching chip from Flash 1, converts the configuration information format into a driver structure configuration file, but does not write the driver structure configuration file into the registers of the switching chip.
[0044] S102, control the microcontroller to write the driver structure configuration file into the switching chip so that the switching chip can perform data forwarding; where the driver structure configuration file is pre-stored in the microcontroller.
[0045] Specifically, in an embodiment of this application, the driver structure configuration file obtained by converting the configuration of the switching chip is pre-stored in the microcontroller, and the driver structure configuration file contains the address and write value entries of the switching chip. For this reason, after the microcontroller is powered on, the microcontroller can be controlled to write the driver structure configuration file into the registers of the switching chip, thereby realizing the configuration of the switching chip by the microcontroller.
[0046] In a possible implementation, for a switching device with complex switching functions, its configuration is relatively complex. Therefore, the driver structure configuration file can be written into Flash 2 of the microcontroller by the CPU through a traditional switching device startup process. For this reason, a startup method for a switching device provided by an embodiment of this application, where the method of pre-storing the driver structure configuration file in the microcontroller may include the following steps, and these steps will be described in detail below.
[0047] When the switching device is powered on, the control CPU writes the driver structure configuration file into the flash memory of the microcontroller.
[0048] In the embodiments of the present application, the startup of the switching device can be divided into a preliminary preparation stage and a formal startup stage.
[0049] Continuing with the in-vehicle switching device as an example, in the preliminary preparation stage, the switching device performs the traditional startup process, including: power-on self-test of the hardware when starting up; CPU startup; uboot startup to boot the linux operating system for loading to initialize peripherals such as the memory and flash memory 1 of the in-vehicle switching device; the CPU loads the configuration information of the switching chip in the flash memory 1, converts the format of the configuration information into a driver structure configuration file, and writes the driver structure configuration file into the registers of the switching chip to complete the configuration of the switching chip. And, after the CPU converts the configuration information into a driver structure configuration file, it can control the CPU to write the driver structure configuration file into the flash memory 2 of the microcontroller. Specifically, the CPU can establish a communication connection with the microcontroller through the UART interface (the full English name is Universal Asynchronous Receiver / Transmitter, a commonly used serial communication interface). In this regard, the CPU can write the driver structure file into the flash memory 2 through the UART interface.
[0050] In the formal startup stage, the switching device and the microcontroller are powered on simultaneously. On the side of the switching device, after closing the write channel of the CPU to the switching chip, the startup process of the in-vehicle switching device is as follows: power-on self-test of the hardware when starting up; CPU startup; uboot startup to boot the linux operating system for loading to initialize peripherals such as the memory and flash memory 1 of the in-vehicle switching device; the CPU loads the configuration information of the switching chip from the flash memory 1, converts the format of the configuration information into a driver structure configuration file, but does not write the driver structure configuration file into the registers of the switching chip to avoid port disconnection caused by reconfiguration. On the side of the microcontroller, the driver structure configuration file stored in its flash memory 2 is written into the registers of the switching chip through the serial peripheral interface to complete the configuration of the switching chip. After the switching chip is configured, the switching chip can implement port up / down according to the configuration and forward network data according to the MAC table and routing table, etc. This can quickly start the switching chip through the microcontroller without affecting the normal startup of the switching device, so that the switching chip can work quickly after being powered on, greatly shortening the startup working time of the switching chip.
[0051] In a possible implementation, the microcontroller establishes a connection with the switching chip through the Serial Peripheral Interface, and can adjust the clock frequency of the Serial Peripheral Interface to achieve high-speed configuration, so as to complete the configuration within a few seconds. In this regard, a method for starting a switching device provided by an embodiment of the present application further includes the following steps:
[0052] Adjust the clock frequency of the Serial Peripheral Interface to adjust the writing time of the microcontroller to the switching chip.
[0053] Specifically, in the embodiment of the present application, the clock frequency of the Serial Peripheral Interface can be adjusted according to the actual scenario, so as to shorten the writing time for the microcontroller to write the drive structure configuration file into the switching chip.
[0054] In a possible implementation, after some switching devices are started, the CPU may still configure other functions for the switching chip, such as dynamic routing and setting the port status according to the STP protocol. The write channel of the CPU to the switching chip can be opened after the switching device is started successfully. Refer to Figure 2 , Figure 2 which is another schematic flowchart of a method for starting a switching device provided by an embodiment of the present application. As Figure 2 shown, a method for starting a switching device provided by an embodiment of the present application further includes the following step S103, and the following is a detailed description of this step.
[0055] S103, after the switching device is started successfully, open the write channel.
[0056] Specifically, in the embodiment of the present application, since the startup items of the microcontroller are fewer than those of the CPU, the microcontroller can complete the configuration of the switching chip before the switching device is started successfully, so as to realize the normal data forwarding of the switching chip. Moreover, the sign that the switching device is started successfully is that the CPU loads the configuration information of the switching chip from Flash 1 and converts it into a drive structure configuration file. In this regard, the write channel of the CPU to the switching chip can be opened after the switching device is started successfully, which does not affect the configuration of other functions of the CPU to the switching chip after the switching device is started successfully.
[0057] Through the above description, a method for starting a switching device provided by an embodiment of the present application can store the driver structure configuration file of the switching chip in the flash memory of the single-chip microcomputer in advance by the CPU writing the driver configuration file through a traditional switching device startup process. When the switching device and the single-chip microcomputer are powered on simultaneously, the write channel of the CPU to the switching chip is closed; on the switching device side, it performs a normal startup process but cannot write the driver configuration file to the registers of the switching chip; on the single-chip microcomputer side, it can write the driver configuration file in its flash memory to the registers of the single-chip microcomputer, thereby completing the configuration of the switching chip so that the switching chip can perform normal data forwarding work. Since the single-chip microcomputer has fewer startup items than the CPU, when the switching device and the single-chip microcomputer start up simultaneously, the configuration of the switching chip can be completed faster, greatly shortening the startup working time of the switching chip and ensuring the communication timeliness of the switching device.
[0058] Moreover, the present application can open the write channel of the CPU to the switching chip again after the switching device starts up successfully, so that the CPU can perform other function configurations on the switching chip.
[0059] In addition, the single-chip microcomputer can establish a connection with the switching chip through the Serial Peripheral Interface (SPI). The present application can adjust the writing time of the single-chip microcomputer to the switching chip by adjusting the clock frequency of the Serial Peripheral Interface, and shorten the time for the single-chip microcomputer to write the driver structure configuration file to the switching chip within a few seconds.
[0060] Continuing to take the in-vehicle switching device as an example, in the preliminary preparation stage, the switching device performs a traditional startup process, including: power-on self-check of hardware at startup; CPU startup; uboot startup to boot the Linux operating system for loading to initialize peripherals such as the memory and flash memory 1 of the in-vehicle switching device; the CPU loads the configuration information of the switching chip in the flash memory 1, converts the configuration information format into a driver structure configuration file, and while writing the driver structure configuration file into the switching chip, can write the driver structure configuration file to the flash memory 2 of the single-chip microcomputer through the UART interface.
[0061] In the formal startup phase, the switching device and the microcontroller are powered on simultaneously. On the side of the switching device, after the CPU closes the write channel to the switching chip, the startup process of the in-vehicle switching device is as follows: power on and perform self-check on the hardware; start the CPU; start uboot to boot and load the Linux operating system to initialize peripherals such as the memory and flash 1 of the in-vehicle switching device; the CPU loads the configuration information of the switching chip from flash 1, converts the configuration information format into a driver structure configuration file, but does not write the driver structure configuration file into the registers of the switching chip. On the side of the microcontroller, the driver structure configuration file stored in flash 2 is written into the registers of the switching chip through the Serial Peripheral Interface (SPI), thereby completing the configuration of the switching chip. By adjusting the clock frequency of the SPI, the writing time is shortened to within a few seconds.
[0062] After the microcontroller completes the configuration of the switching chip, the switching chip can set the configuration ports up / down and forward network data according to the MAC table, routing table, etc. This enables the switching chip to be quickly started by the microcontroller without affecting the normal startup of the switching device, allowing the switching chip to start working quickly after power-on and greatly shortening the startup time of the switching chip.
[0063] After the switching device starts up successfully, open the write channel of the CPU to the switching chip, which does not affect other functional configurations of the CPU to the switching chip after the switching device starts up successfully.
[0064] In summary, in this application, the switching device can be started according to the normal process. After closing the write channel of the CPU to the switching chip, the CPU cannot configure the switching chip. Moreover, when the switching device starts up, the microcontroller starts up and directly configures the switching chip. Since the microcontroller has fewer startup items than the CPU, the startup time of the switching chip can be greatly shortened, ensuring the communication efficiency of the switching device. By quickly configuring the switching chip by the microcontroller, the switching chip starts working after power-on. Then, combined with the normal CPU startup program of the switching device without interruption, the startup time of the traditional switching chip is greatly shortened.
[0065] The above introduces a startup method for a switching device provided by an embodiment of this application. The following will introduce the device for executing the above startup method of the switching device.
[0066] See Figure 3 , Figure 3 which is a schematic structural diagram of a startup device for a switching device provided by an embodiment of this application. As Figure 3 shown, a startup device for a switching device provided by an embodiment of this application includes:
[0067] A file storage module 301, which is used to pre-store a driver structure configuration file in the microcontroller.
[0068] A channel control module 302, configured to control the CPU to close the write channel to the switching chip when the switching device and the single-chip microcomputer are powered on simultaneously.
[0069] A chip writing module 303, configured to control the single-chip microcomputer to write a driver structure configuration file into the switching chip, so that the switching chip can perform data forwarding; wherein, the driver structure configuration file is pre-stored in the single-chip microcomputer.
[0070] In a possible implementation, the file storage module 301 is specifically configured to:
[0071] When the switching device is powered on, control the CPU to write the driver structure configuration file into the flash memory of the single-chip microcomputer.
[0072] In a possible implementation, the single-chip microcomputer establishes a connection with the switching chip through a serial peripheral interface. The chip writing module 303 is further configured to:
[0073] Adjust the clock frequency of the serial peripheral interface to adjust the writing time of the single-chip microcomputer to the switching chip.
[0074] In a possible implementation, the channel control module 302 is further configured to:
[0075] After the switching device starts up successfully, open the write channel.
[0076] It should be noted that for the refined functions of each module in the embodiments of the present application, reference can be made to the corresponding disclosed parts in the embodiments of the startup method of the above switching device, which will not be elaborated here.
[0077] Through the above description, for a startup device of a switching device provided in the embodiments of the present application, the file storage module can pre-store the driver structure configuration file of the switching chip in the flash memory of the single-chip microcomputer by the way that the CPU writes the driver configuration file through a traditional switching device startup process. When the switching device and the single-chip microcomputer are powered on simultaneously, the channel control module closes the write channel of the CPU to the switching chip; on the side of the switching device, it performs a normal startup process, but cannot write the driver configuration file to the registers of the switching chip; on the side of the single-chip microcomputer, the chip writing module can write the driver configuration file in its flash memory into the registers of the single-chip microcomputer, thereby completing the configuration of the switching chip, so that the switching chip can normally perform data forwarding work. And because the single-chip microcomputer has fewer startup items than the CPU, when the switching device and the single-chip microcomputer start at the same time, the configuration of the switching chip can be completed faster, greatly shortening the startup working time of the switching chip and ensuring the communication timeliness of the switching device.
[0078] Moreover, after the switching device completes startup, the channel control module re-opens the write channel of the CPU to the switching chip, enabling the CPU to perform other functional configurations on the switching chip.
[0079] In addition, the microcontroller can establish a connection with the switching chip through the Serial Peripheral Interface (SPI). The chip writing module can adjust the writing time of the microcontroller to the switching chip by adjusting the clock frequency of the Serial Peripheral Interface, shortening the time for the microcontroller to write the drive structure configuration file to the switching chip within a few seconds.
[0080] An embodiment of this application also provides an electronic device. Refer to Figure 4 , Figure 4 which is a schematic structural diagram of an electronic device provided by an embodiment of this application. The electronic device in the embodiment of this application can include, but is not limited to, fixed terminals such as mobile phones, laptop computers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), desktop computers, and so on. Figure 4 The electronic device shown is merely an example and should not impose any limitations on the functions and usage scope of the embodiment of this application.
[0081] As Figure 4 shown, the electronic device can include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage device 408 into the random access memory (RAM) 403. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0082] Generally, the following devices can be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a memory card, a hard disk, etc.; and a communication device 409. The communication device 409 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 4 the electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.
[0083] In an embodiment of the present application, there is also provided a computer program product including computer-readable instructions. When the computer-readable instructions run on an electronic device, the electronic device is enabled to implement any one of the startup methods of the switching device provided in the embodiments of the present application.
[0084] In an embodiment of the present application, there is also provided a computer-readable storage medium. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device is enabled to implement any one of the startup methods of the switching device provided in the embodiments of the present application.
[0085] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided in the present application, the connection relationships between the modules indicate that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures used to implement the same function can also be various, such as analog circuits, digital circuits or dedicated circuits. However, for the present application, in more cases, software program implementation is a better implementation manner. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disc of a computer, and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0087] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0088] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
Claims
1. A startup method for a switching device, characterized in that, The switching device includes a CPU and a switching chip, and a microcontroller is connected to the switching chip. The startup method of the switching device includes: When the switching device and the microcontroller are powered on simultaneously, control the CPU to close the write channel to the switching chip; Control the microcontroller to write the drive structure configuration file into the switching chip so that the switching chip can perform data forwarding; wherein, the drive structure configuration file is pre-stored in the microcontroller.
2. The startup method of the switching device according to claim 1, characterized in that, The method of pre-storing the drive structure configuration file in the microcontroller includes: When the switching device is powered on, control the CPU to write the drive structure configuration file into the flash memory of the microcontroller.
3. The startup method of the switching device according to claim 1, characterized in that, The microcontroller is connected to the switching chip through a serial peripheral interface. The startup method of the switching device further includes: Adjust the clock frequency of the serial peripheral interface to adjust the writing time of the microcontroller to the switching chip.
4. The startup method of the switching device according to claim 1, characterized in that, The startup method of the switching device further includes: After the switching device starts up successfully, open the write channel.
5. A startup device for a switching device, characterized in that, The switching device includes a CPU and a switching chip, and a microcontroller is connected to the switching chip. The startup device of the switching device includes: A file storage module for pre-storing the drive structure configuration file in the microcontroller; A channel control module for controlling the CPU to close the write channel to the switching chip when the switching device and the microcontroller are powered on simultaneously; A chip writing module for controlling the microcontroller to write the drive structure configuration file into the switching chip so that the switching chip can perform data forwarding; wherein, the drive structure configuration file is pre-stored in the microcontroller.
6. The startup device of the switching device according to claim 5, characterized in that, The file storage module is specifically used for: When the switching device is powered on, control the CPU to write the drive structure configuration file into the flash memory of the microcontroller.
7. The startup device of the switching device according to claim 5, characterized in that, The microcontroller is connected to the switching chip through a serial peripheral interface. The chip writing module is further used for: Adjust the clock frequency of the serial peripheral interface to adjust the writing time of the microcontroller to the switching chip.
8. A computer program product, characterized in that, Includes computer-readable instructions that, when run on an electronic device, cause the electronic device to implement the startup method of the switching device as described in any one of claims 1 to 4.
9. An electronic device, characterized in that, Includes at least one processor and a memory connected to the processor, wherein: The memory is used to store a computer program; The processor is used to execute the computer program so that the electronic device can implement the startup method of the switching device as described in any one of claims 1 to 4.
10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, can cause the electronic device to implement the startup method of the switching device as described in any one of claims 1 to 4.