CN117478493A - Initialization method and system for local area network switch - Google Patents

Initialization method and system for local area network switch Download PDF

Info

Publication number
CN117478493A
CN117478493A CN202210866547.4A CN202210866547A CN117478493A CN 117478493 A CN117478493 A CN 117478493A CN 202210866547 A CN202210866547 A CN 202210866547A CN 117478493 A CN117478493 A CN 117478493A
Authority
CN
China
Prior art keywords
processor
area network
local area
network switches
switches
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210866547.4A
Other languages
Chinese (zh)
Inventor
徐芳俊
高陆军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yinwang Intelligent Technology Co ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210866547.4A priority Critical patent/CN117478493A/en
Publication of CN117478493A publication Critical patent/CN117478493A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0889Techniques to speed-up the configuration process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/35Switches specially adapted for specific applications
    • H04L49/351Switches specially adapted for specific applications for local area network [LAN], e.g. Ethernet switches

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The method is applied to a system comprising h local area network switches, the system comprises m processors for initializing the h local area network switches, h is more than or equal to 2, m is more than or equal to 1, m and h are integers, and the system can be applied to intelligent vehicles or new energy vehicles, and the method comprises the following steps: after a first processor of the m processors is powered on, the first processor initializes n local area network switches belonging to the h local area network switches, n is greater than or equal to 1 and less than or equal to h, n is an integer, and the first processor is also used for other tasks except initializing the n local area network switches. The method can realize the rapid initialization of a plurality of local area network switches without adding an external processor, thereby not only reducing the starting time consumption of the whole system, but also reducing the cost.

Description

一种局域网交换机的初始化方法和系统An initialization method and system for a local area network switch

技术领域Technical field

本申请涉及车辆技术领域,尤其涉及一种局域网交换机的初始化方法和系统。The present application relates to the field of vehicle technology, and in particular, to an initialization method and system for a local area network switch.

背景技术Background technique

随着科技发展,局域网交换机(local area network switch,LSW)也已经应用于汽车技术领域的车载通信中。局域网交换机在每次上电之后,需要先进行初始化才能正常工作,初始化主要包括固件加载和配置文件加载。在一些业务场景中,需要对多个局域网交换机快速完成初始化。With the development of science and technology, local area network switch (LSW) has also been used in vehicle communications in the field of automotive technology. After each power-on, the LAN switch needs to be initialized before it can work normally. Initialization mainly includes loading of firmware and configuration files. In some business scenarios, multiple LAN switches need to be initialized quickly.

但是,对多个局域网交换机进行初始化可能需要耗费较多的处理资源。因此,如何合理地使用处理资源来实现该多个局域网交换机的快速初始化,成为一项亟待解决的技术问题。However, initializing multiple LAN switches can require significant processing resources. Therefore, how to rationally use processing resources to achieve rapid initialization of multiple LAN switches has become an urgent technical issue that needs to be solved.

因此,如何能够低成本地实现对多个局域网交换机快速初始化,是一项亟待解决的技术问题。Therefore, how to quickly initialize multiple LAN switches at low cost is an urgent technical problem to be solved.

发明内容Contents of the invention

本申请提供了一种局域网交换机的初始化方法和系统,以期降低对多个局域网交换机快速完成初始化的成本。This application provides an initialization method and system for a local area network switch, in order to reduce the cost of quickly initializing multiple local area network switches.

第一方面,本申请提供一种局域网交换机的初始化方法,该方法应用于包括h个局域网交换机的系统中,以及该系统包括用于对这h个局域网交换机进行初始化的m个处理器,h≥2,m≥1,m、h为整数。该方法可以由该系统中的第一处理器来执行,第一处理器是这m个处理器中的任意一个处理器。In the first aspect, this application provides a method for initializing a LAN switch, which method is applied to a system including h LAN switches, and the system includes m processors for initializing the h LAN switches, h≥ 2. m≥1, m and h are integers. The method may be executed by a first processor in the system, which is any one of the m processors.

示例性地,该方法包括:在第一处理器上电后,第一处理器对n个局域网交换机进行初始化,这n个局域网交换机属于上述h个局域网交换机,1≤n≤h,n为整数,第一处理器还用于除初始化这n个局域网交换机以外的其他任务。Exemplarily, the method includes: after the first processor is powered on, the first processor initializes n LAN switches, which belong to the above-mentioned h LAN switches, 1≤n≤h, n is an integer , the first processor is also used for other tasks besides initializing the n LAN switches.

其中,第一处理器可用于初始化n个局域网交换机,还可用于其他任务,也即,达到了对第一处理器复用的效果。而第一处理器为m个处理器中的任意一个,因此,该m个处理器都可以是被用于初始化局域网交换机和其他任务的处理器,换言之,本方案通过复用系统中的m个处理器,来实现对系统中的h个局域网交换机进行初始化。Among them, the first processor can be used to initialize n local area network switches and can also be used for other tasks, that is, the effect of multiplexing the first processor is achieved. The first processor is any one of the m processors. Therefore, the m processors can be used to initialize the LAN switch and other tasks. In other words, this solution reuses m processors in the system. processor to initialize h LAN switches in the system.

因此,通过本申请提供的方法,可以合理地利用系统中的处理资源,来实现多个局域网交换机的快速初始化,而无需新增外部处理器,如此一来,处理资源得以高效利用,成本也得以降低。Therefore, through the method provided by this application, the processing resources in the system can be reasonably utilized to achieve rapid initialization of multiple LAN switches without the need to add an external processor. In this way, the processing resources can be efficiently utilized and the cost can be reduced. reduce.

此外,若对该m个处理器加以控制,使得该m个处理器的上电时刻相同,该m个处理器可以用于并行地对h个局域网交换机进行初始化。从而可以使得该h个局域网交换机的初始化得以快速完成,降低整个系统的启动耗时。换言之,使用本申请提供的方案,还有利于降低系统的启动耗时。In addition, if the m processors are controlled so that the m processors are powered on at the same time, the m processors can be used to initialize h LAN switches in parallel. Therefore, the initialization of the h LAN switches can be completed quickly, and the startup time of the entire system can be reduced. In other words, using the solution provided by this application is also beneficial to reducing the startup time of the system.

结合第一方面,在某些可能的实现方式中,在第一处理器上电后,该方法还可以包括:第一处理器确定与其对应的n个局域网交换机供电正常且未被初始化。In conjunction with the first aspect, in some possible implementations, after the first processor is powered on, the method may further include: the first processor determining that the n corresponding LAN switches are powered normally and have not been initialized.

结合第一方面,在某些可能的实现方式中,第一处理器包括至少一个核。In conjunction with the first aspect, in some possible implementations, the first processor includes at least one core.

也就是说,第一处理器可以是单核处理器,也可以是多核处理器。That is to say, the first processor may be a single-core processor or a multi-core processor.

可选地,第一处理器包括k个核,这k个核中的n个核对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化,1≤n≤k,k≥2,k为整数。Optionally, the first processor includes k cores, n cores among the k cores correspond to n processes, and one process among the n processes is used to initialize one of the above-mentioned n LAN switches. , 1≤n≤k, k≥2, k is an integer.

第一处理器可以是多核处理器,第一处理器中的n个核可以基于所对应的n个进程,对n个局域网交换机进行初始化。在n≥2时,第一处理器能够基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时。The first processor may be a multi-core processor, and the n cores in the first processor may initialize the n LAN switches based on the corresponding n processes. When n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware.

可选地,第一处理器包括一个核,这一个核对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化。Optionally, the first processor includes one core, and this core corresponds to n processes, and one process among the n processes is used to initialize one of the above-mentioned n LAN switches.

第一处理器可以是单核处理器,第一处理器中的这一个核可以基于n个进程,对n个局域网交换机进行初始化。在n≥2时,第一处理器能够基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时。The first processor may be a single-core processor, and this core in the first processor may initialize n local area network switches based on n processes. When n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware.

结合第一方面,在某些可能的实现方式中,第一处理器为微控制单元(microcontroller unit,MCU)或片上系统(system on chip,SOC)。Combined with the first aspect, in some possible implementations, the first processor is a microcontroller unit (microcontroller unit, MCU) or a system on chip (system on chip, SOC).

结合第一方面,在某些可能的实现方式中,m=1,第一处理器用于对上述h个局域网交换机进行初始化,n=h。Combined with the first aspect, in some possible implementations, m=1, the first processor is used to initialize the h local area network switches, n=h.

利用一个处理器,基于多个并行的进程,就可以并行地对多个局域网交换机进行初始化,能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。Using one processor and based on multiple parallel processes, multiple LAN switches can be initialized in parallel, which can quickly complete the initialization of multiple LAN switches without adding external hardware and reduce the startup consumption of the entire system. hour.

结合第一方面,在某些可能的实现方式中,m≥2。Combined with the first aspect, in some possible implementations, m≥2.

利用至少两个处理器,来共同对多个局域网交换机进行初始化。在这多个处理器上电的时刻相同的情况下,实现并行地对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。Utilize at least two processors to jointly initialize multiple LAN switches. When multiple processors are powered on at the same time, multiple LAN switches can be quickly initialized in parallel, reducing the startup time of the entire system.

可选地,在m≥2时,上述m个处理器中包括至少一个MCU和至少一个SOC。Optionally, when m≥2, the m processors include at least one MCU and at least one SOC.

在利用至少两个处理器来共同对多个局域网交换机进行初始化时,处理器的类型可以不同,例如,m个处理器中包括至少一个MCU和至少一个SOC,在MCU比SOC上电早的情况下,MCU可以先对多个局域网交换机中的一部分进行初始化,后续上电的SOC可以对多个局域网交换机中剩余未上电的部分进行初始化,在MCU和SOC上电的时间间隔较小时,也能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。When using at least two processors to jointly initialize multiple LAN switches, the types of processors may be different. For example, the m processors include at least one MCU and at least one SOC. In the case where the MCU is powered on earlier than the SOC Under this condition, the MCU can first initialize part of the multiple LAN switches, and the subsequently powered-on SOC can initialize the remaining unpowered parts of the multiple LAN switches. When the power-on time interval between the MCU and the SOC is small, it can also It can quickly initialize multiple LAN switches without adding external hardware, reducing the startup time of the entire system.

结合第一方面,在某些可能的实现方式中,上述m个处理器中的每个处理器与上述h个局域网交换机中的每个局域网交换机的对应关系为预先设定的。With reference to the first aspect, in some possible implementations, the corresponding relationship between each of the m processors and each of the h LAN switches is preset.

应理解,预先设定后的对应关系可以是固定不变的,也即固定设置或默认设置,也可以是可以根据实际情况来进行灵活调整的,也即动态设置或灵活设置,本申请对此不作任何限定。It should be understood that the preset corresponding relationship may be fixed, that is, a fixed setting or a default setting, or it may be flexibly adjusted according to the actual situation, that is, a dynamic setting or a flexible setting. In this application, Without any qualification.

结合第一方面,在某些可能的实现方式中,第一处理器对n个局域网交换机进行初始化,包括:第一处理器将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,以实现上述n个局域网交换机的完整初始化。Combined with the first aspect, in some possible implementations, the first processor initializes the n LAN switches, including: the first processor configures the firmware content and configuration files of the n LAN switches to the corresponding LAN respectively. switch to achieve complete initialization of the above n LAN switches.

完整初始化可以理解为一次性地完成固件加载和配置文件加载。Complete initialization can be understood as completing firmware loading and configuration file loading in one go.

第一处理器对这n个局域网交换机一次性地先进行固件加载,再进行配置文件加载,而不是第一次先进行配置文件加载,第二次再进行固件加载,因此,可以实现对这n个局域网交换机的完整初始化。The first processor loads the firmware and then the configuration file for the n LAN switches at once, instead of loading the configuration file for the first time and then loading the firmware for the second time. Therefore, it is possible to load the n LAN switches at once. Complete initialization of a LAN switch.

结合第一方面,在某些可能的实现方式中,第一处理器将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,包括:第一处理器调用预设的n个接口的驱动,将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机;其中,上述n个接口中的一个接口对应于上述n个局域网交换机中的一个局域网交换机。Combined with the first aspect, in some possible implementations, the first processor configures the firmware content and configuration files of the n LAN switches to the corresponding LAN switches respectively, including: the first processor calls the preset n The driver of the interface configures the firmware content and configuration files of the above n LAN switches to the corresponding LAN switches respectively; wherein, one of the above n interfaces corresponds to one of the above n LAN switches.

可选地,上述预设的n个接口的类型包括以下一种或多种:串行外设接口(serialperipheral interface,SPI)、管理数据输入输出(management data input/output,MDIO)接口、内部集成电路(inter-integrated circuit,I2C)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、通用输入输出(general-purpose input/output,GPIO)接口、通用串行总线(universal serial bus,USB)接口、以太网(ethernet,ETH)接口、高速串行计算机扩展总线标准(peripheral componentinterconnect express,PCIE)接口。Optionally, the above-mentioned preset n interface types include one or more of the following: serial peripheral interface (SPI), management data input/output (MDIO) interface, internal integration Inter-integrated circuit (I2C) interface, universal asynchronous receiver/transmitter (UART) interface, general-purpose input/output (GPIO) interface, universal serial bus (universal serial bus , USB) interface, Ethernet (ethernet, ETH) interface, high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) interface.

可选地,在n≥2时,上述预设的n个接口包括至少两个类型相同的接口。Optionally, when n≥2, the above-mentioned preset n interfaces include at least two interfaces of the same type.

第二方面,本申请提供了一种局域网交换机系统,该系统包括m个处理器和h个局域网交换机,这m个处理器用于对这h个局域网交换机进行初始化,m≥1,h≥2,m、h为整数;其中,这m个处理器中的第一处理器用于,在上电后对n个局域网交换机进行初始化,这n个局域网交换机属于上述h个局域网交换机,1≤n≤h,n为整数,第一处理器还用于除初始化这n个局域网交换机以外的其他任务。In the second aspect, this application provides a LAN switch system, which includes m processors and h LAN switches. The m processors are used to initialize the h LAN switches, m≥1, h≥2, m and h are integers; among them, the first processor among the m processors is used to initialize n LAN switches after power-on. These n LAN switches belong to the above-mentioned h LAN switches, 1≤n≤h , n is an integer, and the first processor is also used for other tasks besides initializing the n LAN switches.

其中,第一处理器可用于初始化n个局域网交换机,还可用于其他任务,也即,达到了对第一处理器复用的效果。而第一处理器为m个处理器中的任意一个,因此,该m个处理器都可以是被用于初始化局域网交换机和其他任务的处理器,换言之,本方案通过复用系统中的m个处理器,来实现对系统中的h个局域网交换机进行初始化。Among them, the first processor can be used to initialize n local area network switches and can also be used for other tasks, that is, the effect of multiplexing the first processor is achieved. The first processor is any one of the m processors. Therefore, the m processors can be used to initialize the LAN switch and other tasks. In other words, this solution reuses m processors in the system. processor to initialize h LAN switches in the system.

因此,通过本申请提供的方法,可以合理地利用系统中的处理资源,来实现多个局域网交换机的快速初始化,而无需新增外部处理器,如此一来,处理资源得以高效利用,成本也得以降低。Therefore, through the method provided by this application, the processing resources in the system can be reasonably utilized to achieve rapid initialization of multiple LAN switches without the need to add an external processor. In this way, the processing resources can be efficiently utilized and the cost can be reduced. reduce.

此外,若对该m个处理器加以控制,使得该m个处理器的上电时刻相同,该m个处理器可以用于并行地对h个局域网交换机进行初始化。从而可以使得该h个局域网交换机的初始化得以快速完成,降低整个系统的启动耗时。换言之,使用本申请提供的方案,还有利于降低系统的启动耗时。In addition, if the m processors are controlled so that the m processors are powered on at the same time, the m processors can be used to initialize h LAN switches in parallel. Therefore, the initialization of the h LAN switches can be completed quickly, and the startup time of the entire system can be reduced. In other words, using the solution provided by this application is also beneficial to reducing the startup time of the system.

结合第二方面,在某些可能的设计中,第一处理器还用于确定与其对应的n个局域网交换机供电正常且未被初始化。Combined with the second aspect, in some possible designs, the first processor is also used to determine that the n corresponding LAN switches are powered normally and have not been initialized.

结合第二方面,在某些可能的设计中,第一处理器包括至少一个核。In conjunction with the second aspect, in some possible designs, the first processor includes at least one core.

也就是说,第一处理器可以是单核处理器,也可以是多核处理器。That is to say, the first processor may be a single-core processor or a multi-core processor.

可选地,第一处理器包括k个核,这k个核中的n个核对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化,1≤n≤k,k≥2,k为整数。Optionally, the first processor includes k cores, n cores among the k cores correspond to n processes, and one process among the n processes is used to initialize one of the above-mentioned n LAN switches. , 1≤n≤k, k≥2, k is an integer.

第一处理器可以是多核处理器,第一处理器中的n个核可以基于所对应的n个进程,对n个局域网交换机进行初始化。在n≥2时,第一处理器能够基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时。The first processor may be a multi-core processor, and the n cores in the first processor may initialize the n LAN switches based on the corresponding n processes. When n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware.

可选地,第一处理器包括一个核,这一个核对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化。Optionally, the first processor includes one core, and this core corresponds to n processes, and one process among the n processes is used to initialize one of the above-mentioned n LAN switches.

第一处理器可以是单核处理器,第一处理器中的这一个核可以基于n个进程,对n个局域网交换机进行初始化。在n≥2时,第一处理器能够基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时。The first processor may be a single-core processor, and this core in the first processor may initialize n local area network switches based on n processes. When n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware.

结合第二方面,在某些可能的设计中,第一处理器为MCU或SOC。Combined with the second aspect, in some possible designs, the first processor is an MCU or SOC.

结合第二方面,在某些可能的设计中,m=1,第一处理器用于对上述h个局域网交换机进行初始化,n=h。Combined with the second aspect, in some possible designs, m=1, the first processor is used to initialize the above-mentioned h LAN switches, n=h.

利用一个处理器,基于多个并行的进程,就可以并行地对多个局域网交换机进行初始化,能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。Using one processor and based on multiple parallel processes, multiple LAN switches can be initialized in parallel, which can quickly complete the initialization of multiple LAN switches without adding external hardware and reduce the startup consumption of the entire system. hour.

结合第二方面,在某些可能的设计中,m≥2。Combined with the second aspect, in some possible designs, m≥2.

利用至少两个处理器,来共同对多个局域网交换机进行初始化。在这多个处理器上电的时刻相同的情况下,实现并行地对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。Utilize at least two processors to jointly initialize multiple LAN switches. When multiple processors are powered on at the same time, multiple LAN switches can be quickly initialized in parallel, reducing the startup time of the entire system.

可选地,在m≥2时,上述m个处理器中包括至少一个MCU和至少一个SOC。Optionally, when m≥2, the m processors include at least one MCU and at least one SOC.

在利用至少两个处理器来共同对多个局域网交换机进行初始化时,处理器的类型可以不同,例如,m个处理器中包括至少一个MCU和至少一个SOC,在MCU比SOC上电早的情况下,MCU可以先对多个局域网交换机中的一部分进行初始化,后续上电的SOC可以对多个局域网交换机中剩余未上电的部分进行初始化,在MCU和SOC上电的时间间隔较小时,也能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。When using at least two processors to jointly initialize multiple LAN switches, the types of processors may be different. For example, the m processors include at least one MCU and at least one SOC. In the case where the MCU is powered on earlier than the SOC Under this condition, the MCU can first initialize part of the multiple LAN switches, and the subsequently powered-on SOC can initialize the remaining unpowered parts of the multiple LAN switches. When the power-on time interval between the MCU and the SOC is small, it can also It can quickly initialize multiple LAN switches without adding external hardware, reducing the startup time of the entire system.

结合第二方面,在某些可能的设计中,上述m个处理器中的每个处理器与上述h个局域网交换机中的每个局域网交换机的对应关系为预先设定的。Combined with the second aspect, in some possible designs, the corresponding relationship between each of the m processors and each of the h LAN switches is preset.

应理解,预先设定后的对应关系可以是固定不变的,也即固定设置或默认设置,也可以是可以根据实际情况来进行灵活调整的,也即动态设置或灵活设置,本申请对此不作任何限定。It should be understood that the preset corresponding relationship may be fixed, that is, a fixed setting or a default setting, or it may be flexibly adjusted according to the actual situation, that is, a dynamic setting or a flexible setting. In this application, Without any qualification.

结合第二方面,在某些可能的设计中,第一处理器具体用于:将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,以实现上述n个局域网交换机的完整初始化。Combined with the second aspect, in some possible designs, the first processor is specifically used to: configure the firmware content and configuration files of the above n LAN switches to the corresponding LAN switches respectively, so as to realize the complete integration of the above n LAN switches. initialization.

完整初始化可以理解为一次性地完成固件加载和配置文件加载。Complete initialization can be understood as completing firmware loading and configuration file loading in one go.

第一处理器对这n个局域网交换机一次性地先进行固件加载,再进行配置文件加载,而不是第一次先进行配置文件加载,第二次再进行固件加载,因此,可以实现对这n个局域网交换机的完整初始化。The first processor loads the firmware and then the configuration file for the n LAN switches at once, instead of loading the configuration file for the first time and then loading the firmware for the second time. Therefore, it is possible to load the n LAN switches at once. Complete initialization of a LAN switch.

结合第二方面,在某些可能的设计中,第一处理器具体用于:调用预设的n个接口的驱动,将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机;其中,上述n个接口中的一个接口对应于上述n个局域网交换机中的一个局域网交换机。Combined with the second aspect, in some possible designs, the first processor is specifically used to: call the drivers of the preset n interfaces, and configure the firmware content and configuration files of the above n LAN switches to the corresponding LAN switches respectively. ; Wherein, one interface among the above n interfaces corresponds to one LAN switch among the above n LAN switches.

可选地,上述预设的n个接口的类型包括以下一种或多种:SPI、MDIO接口、I2C接口、UART接口、GPIO接口、USB接口、ETH接口、PCIE接口。Optionally, the above-mentioned preset n interface types include one or more of the following: SPI, MDIO interface, I2C interface, UART interface, GPIO interface, USB interface, ETH interface, and PCIE interface.

可选地,在n≥2时,上述预设的n个接口包括至少两个类型相同的接口。Optionally, when n≥2, the above-mentioned preset n interfaces include at least two interfaces of the same type.

可选地,上述系统应用于车辆。Optionally, the above system is applied to a vehicle.

第三方面,本申请提供了一种芯片系统,该芯片系统包括至少一个处理器,用于支持实现上述第一方面以及第一方面任一种可能实现方式所涉及的功能。In a third aspect, this application provides a chip system, which includes at least one processor and is configured to support the implementation of the functions involved in the above-mentioned first aspect and any possible implementation of the first aspect.

在一种可能的设计中,该芯片系统还包括存储器,存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。In a possible design, the chip system also includes a memory, which is used to store program instructions and data. The memory is located within the processor or outside the processor.

该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The chip system can be composed of chips or include chips and other discrete devices.

第四方面,提供了一种计算机可读存储介质,所述计算机存储介质上存储有计算机程序(也可以称为代码,或指令),当所述计算机程序在被计算机运行时,使得上述第一方面以及第一方面中任一种可能实现方式中的方法被执行。In a fourth aspect, a computer-readable storage medium is provided. A computer program (which may also be called a code, or an instruction) is stored on the computer storage medium. When the computer program is run by a computer, the above-mentioned first The method in any possible implementation manner of the first aspect and the first aspect is executed.

第五方面,提供了一种计算机程序产品,该计算机程序产品包括:计算机程序(也可以称为代码,或指令),当该计算机程序被运行时,使得上述第一方面以及第一方面中任一种可能实现方式中的方法被执行。In a fifth aspect, a computer program product is provided. The computer program product includes: a computer program (which can also be called a code, or an instruction). When the computer program is run, any of the above-mentioned aspects and the first aspect are enabled. The method in one possible implementation is executed.

应当理解的是,本申请的第三方面至第五方面与本申请的第一方面和第二方面的技术方案相对应,各方面及对应的可行实施方式所取得的有益效果相似,不再赘述。It should be understood that the third to fifth aspects of the present application correspond to the technical solutions of the first and second aspects of the present application, and the beneficial effects achieved by each aspect and corresponding feasible implementations are similar, and will not be described again. .

附图说明Description of the drawings

图1是本申请实施例提供的一种局域网交换机系统的系统架构示意图;Figure 1 is a schematic system architecture diagram of a local area network switch system provided by an embodiment of the present application;

图2是本申请实施例提供的局域网交换机的初始化方法的一种示意性流程图;Figure 2 is a schematic flow chart of the initialization method of the LAN switch provided by the embodiment of the present application;

图3是本申请实施例提供的局域网交换机的初始化方法的一种示意图;Figure 3 is a schematic diagram of the initialization method of the LAN switch provided by the embodiment of the present application;

图4是本申请实施例提供的另一种局域网交换机系统的系统架构示意图。Figure 4 is a schematic system architecture diagram of another LAN switch system provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in this application will be described below with reference to the accompanying drawings.

为便于清楚描述本申请实施例的技术方案,首先做出如下说明。In order to clearly describe the technical solutions of the embodiments of the present application, the following description is first made.

第一,在本申请实施例中,“至少一种(个)”是指一种(个)或者多种(个)。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系,但并不排除表示前后关联对象是一种“和”的关系的情况,具体表示的含义可以结合上下文进行理解。First, in the embodiments of this application, “at least one type” refers to one type or multiple types. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship, but it does not exclude the situation that the related objects are in an "and" relationship. The specific meaning can be understood based on the context.

第二,在本申请实施例中,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列模组、模块或单元的装置、系统、产品或设备不必限于清楚地列出的那些模组、模块或单元,而是可包括没有清楚地列出的或对于这些装置、系统、产品或设备固有的其它模组、模块或单元。Second, in the embodiments of this application, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, devices, systems, and products that include a series of modules, modules or units. or devices are not necessarily limited to those modules, modules or units expressly listed, but may include other modules, modules or units not expressly listed or inherent to such devices, systems, products or devices.

另外,以下对本申请实施例中涉及到的参数做简单说明。In addition, the parameters involved in the embodiments of this application are briefly described below.

h:局域网交换机系统中所包括的全部的局域交换机的个数,h≥2,h为整数。h: The number of all LAN switches included in the LAN switch system, h≥2, h is an integer.

m:局域网交换机系统中所包括的用于初始化h个局域网交换机的处理器的个数,m≥1,m为整数。m: The number of processors included in the LAN switch system for initializing h LAN switches, m≥1, m is an integer.

n:m个处理器中的第一处理器需要初始化的局域交换机的个数,1≤n≤h,n为整数。n: The number of local area switches that the first processor among m processors needs to be initialized, 1≤n≤h, n is an integer.

k:第一处理器所包括的全部的核的个数,1≤n≤k,k≥2,k为整数。k: the number of all cores included in the first processor, 1≤n≤k, k≥2, and k is an integer.

随着科技发展,局域网交换机也已经应用于车辆技术领域的车载通信中。有一类局域网交换机在每次上电之后,需要先进行初始化才能正常工作,初始化主要包括固件加载和配置文件加载。在一些应用场景中,需要对多个局域网交换机快速完成初始化。目前,一种已知的初始化多个局域网交换机的方案,需要额外增加一个处理器,来专门对多个局域网交换机进行初始化,这种方案的实现方式复杂,并且依赖于额外增加的处理器,成本较高;另外一种已知的初始化多个局域网交换机的方案,固件加载和配置文件加载分两次进行,第一次先进行配置文件加载,第二次再进行固件加载,这种方案不能一次性完成对多个局域网交换机的完整初始化。With the development of science and technology, LAN switches have also been used in vehicle communications in the field of vehicle technology. There is a type of LAN switch that needs to be initialized before it can work properly every time it is powered on. Initialization mainly includes loading firmware and loading configuration files. In some application scenarios, multiple LAN switches need to be initialized quickly. Currently, a known solution for initializing multiple LAN switches requires an additional processor to specifically initialize multiple LAN switches. The implementation of this solution is complex and relies on additional processors, which is costly. Higher; another known solution for initializing multiple LAN switches is to load the firmware and the configuration file in two steps. The first time is to load the configuration file, and the second time to load the firmware. This solution cannot be done at once. Complete initialization of multiple LAN switches simultaneously.

综上所述,对多个局域网交换机进行初始化可能需要耗费较多的处理资源,如何合理地使用处理资源来实现该多个局域网交换机的快速初始化,成为一项亟待解决的技术问题。因此,本申请实施例提供一种局域网交换机的初始化方法和系统,可以合理地利用系统中的处理资源,来实现多个局域网交换机的快速初始化,而无需新增外部处理器,如此一来,处理资源得以高效利用,成本也得以降低。To sum up, initializing multiple LAN switches may require a lot of processing resources. How to rationally use processing resources to achieve rapid initialization of multiple LAN switches has become an urgent technical issue that needs to be solved. Therefore, embodiments of the present application provide a method and system for initializing a LAN switch, which can reasonably utilize the processing resources in the system to achieve rapid initialization of multiple LAN switches without adding an external processor. In this way, the processing Resources are used efficiently and costs are reduced.

图1是本申请实施例提供的一种局域网交换机系统的系统架构示意图。Figure 1 is a schematic system architecture diagram of a local area network switch system provided by an embodiment of the present application.

如图1所示,局域网交换机系统可以包括h个局域网交换机,例如,局域网交换机1、局域网交换机2、局域网交换机3、局域网交换机4、局域网交换机5、局域网交换机6、局域网交换机7、……、局域网交换机h,以及m个用于初始化这h个局域网交换机的处理器,例如,处理器1、处理器2、……、处理器m。As shown in Figure 1, the LAN switch system may include h LAN switches, for example, LAN switch 1, LAN switch 2, LAN switch 3, LAN switch 4, LAN switch 5, LAN switch 6, LAN switch 7, ..., LAN Switch h, and m processors used to initialize these h LAN switches, for example, processor 1, processor 2,..., processor m.

图2是本申请实施例提供的局域网交换机的初始化方法的一种示意性流程图。Figure 2 is a schematic flow chart of the initialization method of a LAN switch provided by an embodiment of the present application.

图2所示的方法可以应用于图1所示的局域网交换机的系统中,该方法可以由该系统中的第一处理器来执行,第一处理器是上述m个处理器中的任意一个处理器。The method shown in Figure 2 can be applied to the system of the LAN switch shown in Figure 1. The method can be executed by the first processor in the system. The first processor is any one of the above m processors. device.

如图2所示,该方法200可以包括步骤210和步骤220。下面对图2中的各步骤做详细说明。As shown in FIG. 2 , the method 200 may include step 210 and step 220 . Each step in Figure 2 is described in detail below.

在步骤210中,第一处理器上电后,确定与其对应的n个局域网交换机供电正常且未被初始化。In step 210, after the first processor is powered on, it is determined that the n corresponding LAN switches are powered normally and have not been initialized.

需要说明的是,上述m个处理器中的每个处理器与上述h个局域网交换机中的每个局域网交换机的对应关系为预先设定的。还需要说明的是,预先设定后的对应关系可以是固定不变的,也即固定设置或默认设置,也可以是可以根据实际情况来进行灵活调整的,也即动态设置或灵活设置。本申请对此不作任何限定。It should be noted that the corresponding relationship between each of the above-mentioned m processors and each of the above-mentioned h LAN switches is preset. It should also be noted that the preset corresponding relationship can be fixed, that is, fixed settings or default settings, or can be flexibly adjusted according to actual conditions, that is, dynamic settings or flexible settings. This application does not make any limitation on this.

示例性地,第一处理器上电后,也即第一处理器启动后,第一处理器可以判断与其对应的n个局域网交换机供电是否正常,并可以判断这n个局域网交换机中的每一个局域网交换机是否未被初始化。For example, after the first processor is powered on, that is, after the first processor is started, the first processor can determine whether the power supply of the n corresponding LAN switches is normal, and can determine whether the power supply of each of the n LAN switches is normal. Whether the LAN switch has not been initialized.

在步骤220中,第一处理器对n个局域网交换机进行初始化。In step 220, the first processor initializes n LAN switches.

第一处理器在确定与其对应的n个局域网交换机供电正常,例如,对其中的每一个局域网交换机的供电的电压值都小于或等于第一预设电压值,以及,大于或等于第二预设电压值(第二预设电压值<第一预设电压值),且这n个局域网交换机中的每一个局域网交换机均未被初始化后,可以对这n个局域网交换机进行初始化。The first processor determines that the power supply of the corresponding n LAN switches is normal. For example, the voltage value of the power supply to each of the LAN switches is less than or equal to the first preset voltage value, and is greater than or equal to the second preset voltage value. voltage value (the second preset voltage value < the first preset voltage value), and each of the n LAN switches has not been initialized, the n LAN switches can be initialized.

应理解,在n个局域网交换机中的一个或多个局域网交换机供电不正常,但这一个或多个局域网交换机未被初始化的情况下,第一处理器可以不对这一个或多个供电不正常的局域网交换机进行初始化。例如,第一处理器确定对局域网交换机1的供电不正常(例如,对局域网交换机1的供电的电压大于第一预设电压值或小于第二预设电压值),且局域网交换机1未被初始化,则第一处理器可以不对局域网交换机1进行初始化。It should be understood that in the case where one or more of the n LAN switches have abnormal power supply but the one or more LAN switches have not been initialized, the first processor may not supply power to the one or more LAN switches if the power supply is abnormal. The LAN switch is initialized. For example, the first processor determines that the power supply to the LAN switch 1 is abnormal (for example, the voltage of the power supply to the LAN switch 1 is greater than the first preset voltage value or less than the second preset voltage value), and the LAN switch 1 has not been initialized. , then the first processor may not initialize the LAN switch 1.

还应理解,在n个局域网交换机中的一个或多个局域网交换机供电已被初始化的情况下,不论对这一个或多个局域网交换机的供电是否正常,第一处理器可以不对这一个或多个已被初始化的局域网交换机进行初始化。例如,第一处理器确定对局域网交换机2已被初始化,但对局域网交换机2的供电不正常,则第一处理器可以不对局域网交换机2进行初始化。It should also be understood that when the power supply to one or more of the n LAN switches has been initialized, regardless of whether the power supply to the one or more LAN switches is normal, the first processor may not provide the power to the one or more LAN switches. The LAN switch that has been initialized is initialized. For example, if the first processor determines that the LAN switch 2 has been initialized but the power supply to the LAN switch 2 is abnormal, the first processor may not initialize the LAN switch 2 .

需要说明的是,在上述方法200中,在第一处理器上电后,第一处理器也可以不执行确定与其对应的n个局域网交换机供电正常且未被初始化的步骤,也即,第一处理可以不判断与其对应的n个局域网交换机中的每个局域网交换机供电是否正常,也不判断这n个局域网交换机中的每个局域网交换机是否未被初始化。也就是说,步骤210为可选的步骤,第一处理器在上电后,可以直接对n个局域网交换机进行初始化。本申请实施例对此不作限定。It should be noted that in the above method 200, after the first processor is powered on, the first processor may not perform the step of determining that the n corresponding LAN switches are powered normally and have not been initialized. That is, the first processor The processing may not determine whether the power supply of each of the corresponding n LAN switches is normal, nor whether each of the n LAN switches has not been initialized. That is to say, step 210 is an optional step. After being powered on, the first processor can directly initialize the n LAN switches. The embodiments of the present application do not limit this.

示例性地,如图3所示,第一处理器在上电后,可以同时启动对与其对应的n个局域网交换机进行初始化。For example, as shown in Figure 3, after the first processor is powered on, it can start initializing n corresponding LAN switches at the same time.

在一种可能的实现方式中,第一处理器对n个局域网交换机进行初始化,包括:第一处理器将n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,以实现上述n个局域网交换机的完整初始化。In a possible implementation, the first processor initializes n LAN switches, including: the first processor configures the firmware content and configuration files of the n LAN switches to the corresponding LAN switches respectively, so as to realize the above n Complete initialization of a LAN switch.

其中,上述n个局域网交换机的固件内容和配置文件可以预先烧录存储在第一处理器的存储单元(例如闪存)中。固件内容可以包括芯片驱动软件表,该芯片驱动软件表中例如可以包括与端口信息初始化、芯片内部随机存取存储器(random access memory,RAM)初始化等相关的内容。配置文件可以包括与端口报文收发控制、协议内容支持、虚拟局域网(virtual local area network,VLAN)配置、路由控制等相关的内容。Wherein, the firmware contents and configuration files of the n local area network switches may be pre-burned and stored in the storage unit (for example, flash memory) of the first processor. The firmware content may include a chip driver software table, which may include, for example, content related to port information initialization, chip internal random access memory (RAM) initialization, etc. The configuration file may include content related to port packet sending and receiving control, protocol content support, virtual local area network (VLAN) configuration, routing control, etc.

另外,完整初始化可以理解为一次性地完成固件加载和配置文件加载。In addition, complete initialization can be understood as completing firmware loading and configuration file loading in one go.

在第一处理器上电后,第一处理器可以读取n个局域网交换机的固件内容,并将各局域网交换机的固件内容分别写入相应的局域网交换机中,也即,对这n个局域网交换机中的每个局域网交换机进行固件加载;然后,第一处理器可以读取n个局域网交换机的配置文件,并将各局域网交换机的配置文件写入相应的局域网交换机中,也即,对这n个局域网交换机中的每个局域网交换机进行配置文件加载。After the first processor is powered on, the first processor can read the firmware contents of the n LAN switches and write the firmware contents of each LAN switch into the corresponding LAN switches respectively, that is, for the n LAN switches Firmware is loaded for each LAN switch in Configuration files are loaded for each of the LAN switches.

第一处理器对这n个局域网交换机一次性地先进行固件加载,再进行配置文件加载,而不是第一次先进行配置文件加载,第二次再进行固件加载,因此,可以实现对这n个局域网交换机的完整初始化。The first processor loads the firmware and then the configuration file for the n LAN switches at once, instead of loading the configuration file for the first time and then loading the firmware for the second time. Therefore, it is possible to load the n LAN switches at once. Complete initialization of a LAN switch.

可选地,第一处理器将n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,包括:第一处理器调用预设的n个接口的驱动,将上述n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机;其中,上述n个接口中的一个接口对应于上述n个局域网交换机中的一个局域网交换机。Optionally, the first processor configures the firmware contents and configuration files of the n LAN switches to the corresponding LAN switches respectively, including: the first processor calls the preset drivers of the n interfaces, and converts the n LAN switches to The firmware content and configuration file are respectively configured to the corresponding LAN switches; wherein, one of the above-mentioned n interfaces corresponds to one of the above-mentioned n LAN switches.

示例性地,第一处理器可以通过预设的n个接口与其相对应的n个局域网交换机相连接,由此,第一处理器可以通过调用预设的这n个接口的驱动,将与其对应的n个局域网交换机的固件内容和配置文件分别配置到对应的局域网交换机,也即,通过调用预设的这n个接口的驱动,来实现对这n个局域网交换机的固件加载和配置文件加载,从而实现对这n个局域网交换机的完整初始化。For example, the first processor can be connected to its corresponding n LAN switches through preset n interfaces. Therefore, the first processor can call the preset drivers of the n interfaces to connect the corresponding n LAN switches to the preset n interfaces. The firmware content and configuration files of the n LAN switches are configured to the corresponding LAN switches respectively. That is, by calling the preset drivers of the n interfaces, the firmware loading and configuration file loading of the n LAN switches are implemented. Thus achieving complete initialization of these n LAN switches.

可选地,预设的n个接口的类型可以包括以下一种或多种:SPI、MDIO接口、I2C接口、UART接口、GPIO接口、USB接口、ETH接口、PCIE接口等。Optionally, the preset n interface types may include one or more of the following: SPI, MDIO interface, I2C interface, UART interface, GPIO interface, USB interface, ETH interface, PCIE interface, etc.

可选地,第一处理器为MCU或SOC。Optionally, the first processor is an MCU or SOC.

需要说明的,在当前的技术中,MCU不支持ETH接口和MDIO接口的同时使用,也就是说,在第一处理器为MCU时,上述预设的n个接口中如果包括至少一个ETH接口,则这n个接口中就不包括MDIO接口;上述预设的n个接口中如果包括至少一个MDIO接口,则这n个接口中就不包括ETH接口。但这并不能限定在未来的技术中,MCU可以支持ETH接口和MDIO接口的同时使用时对本方案的实施,本申请实施例对此不作任何限定。It should be noted that in current technology, MCU does not support the simultaneous use of the ETH interface and the MDIO interface. That is to say, when the first processor is an MCU, if the above-mentioned preset n interfaces include at least one ETH interface, Then these n interfaces do not include the MDIO interface; if the above-mentioned preset n interfaces include at least one MDIO interface, then these n interfaces do not include the ETH interface. However, this is not limited to future technologies. The MCU can support the implementation of this solution when the ETH interface and the MDIO interface are used simultaneously. The embodiments of this application do not impose any limitation on this.

在一种可能的实现方式中,在n≥2时,上述预设的n个接口包括至少两个类型相同的接口。In a possible implementation manner, when n≥2, the above-mentioned preset n interfaces include at least two interfaces of the same type.

也就是说,在预设的多个接口中,可以存在相同类型的接口。例如,n=4,预设的4个接口中可以包括2个MDIO接口、1个I2C接口和1个UART接口。That is to say, the same type of interface can exist among the preset multiple interfaces. For example, n=4, the preset 4 interfaces may include 2 MDIO interfaces, 1 I2C interface and 1 UART interface.

当然,在另外的一些实现方式中,在n≥2时,上述预设的n个接口可以包括n个类型不相同的接口。例如,n=6,预设的6个接口中可以包括1个SPI、1个MDIO接口、1个I2C接口、1个UART接口、1个GPIO接口和1个USB接口。Of course, in some other implementations, when n≥2, the above-mentioned preset n interfaces may include n interfaces of different types. For example, n=6, the preset 6 interfaces can include 1 SPI, 1 MDIO interface, 1 I2C interface, 1 UART interface, 1 GPIO interface and 1 USB interface.

在一种可能的实现方式中,第一处理器包括至少一个核。In a possible implementation, the first processor includes at least one core.

也就是说,第一处理器可以是单核处理器(包括1个核的处理器),也可以是多核处理器,例如,第一处理器可以包括k个核,k≥2,这k个核中的n个核可以用于初始化n个局域网交换机,在k>n时,其他的k-n个核可以不用于初始化局域网交换机,本申请实施例对此不作任何限定。目前,常用的处理器包括单核处理器、四核处理器、六核处理器和八核处理器,这些类型的处理器均适用于本申请实施例提供的局域网交换机的初始化方法。本申请实施例对此不作限定。That is to say, the first processor may be a single-core processor (a processor including 1 core) or a multi-core processor. For example, the first processor may include k cores, k≥2, and the k The n cores in the core may be used to initialize n LAN switches. When k>n, the other k-n cores may not be used to initialize the LAN switches. This embodiment of the present application does not impose any limitation on this. Currently, commonly used processors include single-core processors, quad-core processors, six-core processors, and eight-core processors. These types of processors are all suitable for the initialization method of a LAN switch provided by the embodiment of the present application. The embodiments of the present application do not limit this.

可选地,第一处理器包括k个核,这k个核中的n个核一一对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化。Optionally, the first processor includes k cores, n cores among the k cores correspond to n processes one-to-one, and one process among the n processes is used to process one of the above-mentioned n LAN switches. Perform initialization.

在这种实现方式中,第一处理器可以是多核处理器,第一处理器中的n个核可以基于所对应的n个进程,对n个局域网交换机进行初始化。可以理解的是,在n≥2时,这n个进程可以是并行的n个进程,从而初始化这n个局域网交换机中的被初始化时消耗的时间最长的那个局域网交换机所对应的初始化的时长,即为对这n个局域网交换机进行初始化所消耗的总时长。In this implementation, the first processor may be a multi-core processor, and n cores in the first processor may initialize n LAN switches based on corresponding n processes. It can be understood that when n ≥ 2, these n processes can be n processes in parallel, so as to initialize the initialization time corresponding to the LAN switch that takes the longest time to initialize among the n LAN switches. , which is the total time consumed to initialize these n LAN switches.

需要说明的是,在n≥2时,本申请实施例中所提到的“并行的n个进程”可以理解为,多个程序段同时在运行,这些程序段的执行在时间上是重叠的,并不限定是严格意义上的完全重合。也即,本申请实施例中所提到的“并行”是允许存在时间上的误差,并非严格意义上的“同时”,本领域技术人员可以理解。It should be noted that when n ≥ 2, the "parallel n processes" mentioned in the embodiment of this application can be understood as multiple program segments running at the same time, and the execution of these program segments overlaps in time. , is not limited to complete overlap in a strict sense. That is to say, the "parallel" mentioned in the embodiments of this application allows for time errors, and is not "simultaneous" in the strict sense, as can be understood by those skilled in the art.

也就是说,在n≥2时,第一处理器可以基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时,从而降低成本。That is to say, when n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware. Thereby reducing costs.

一示例,k≥2,n=1,也就是说,第一处理器为多核处理器,第一处理器可以基于这多个核中的一个核,对一个局域网交换机进行初始化。As an example, k≥2, n=1, that is to say, the first processor is a multi-core processor, and the first processor can initialize a local area network switch based on one of the multiple cores.

再一示例,k=6,n=6,也就是说,第一处理器为六核处理器,第一处理器可以基于这六个核,并行地对六个局域网交换机进行初始化。In another example, k=6, n=6, that is to say, the first processor is a six-core processor, and the first processor can initialize six LAN switches in parallel based on these six cores.

又一示例,k=8,n=6,也就是说,第一处理器为八核处理器,第一处理器可以基于这八个核中的六个核,并行地对六个局域网交换机进行初始化。In another example, k=8, n=6, that is to say, the first processor is an eight-core processor, and the first processor can perform processing on six LAN switches in parallel based on six of the eight cores. initialization.

可选地,在某些可能的实现方式中,第一处理器包括一个核,这一个核对应于n个进程,n个进程中的一个进程用于对上述n个局域网交换机中的一个局域网交换机进行初始化。Optionally, in some possible implementations, the first processor includes a core, which core corresponds to n processes, and one of the n processes is used to control one of the n LAN switches. Perform initialization.

在这种实现方式中,第一处理器可以是单核处理器,第一处理器中的这一个核可以基于n个进程,并行地对n个局域网交换机进行初始化,能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,进而降低整个系统的启动耗时。可以理解的是,在n≥2时,这n个进程可以是并行的n个进程,从而初始化这n个局域网交换机中的被初始化时消耗的时间最长的那个局域网交换机所对应的初始化的时长,即为对这n个局域网交换机进行初始化所消耗的总时长。In this implementation, the first processor can be a single-core processor. This core in the first processor can initialize n LAN switches in parallel based on n processes, which can be done without adding external hardware. In this case, multiple LAN switches can be initialized quickly, thereby reducing the startup time of the entire system. It can be understood that when n ≥ 2, these n processes can be n processes in parallel, so as to initialize the initialization time corresponding to the LAN switch that takes the longest time to initialize among the n LAN switches. , which is the total time consumed to initialize these n LAN switches.

也就是说,在n≥2时,第一处理器可以基于n个并行的进程,实现对多个局域网交换机快速完成初始化,能够在不增加外部硬件的情况下,降低整个系统的启动耗时。That is to say, when n ≥ 2, the first processor can quickly initialize multiple LAN switches based on n parallel processes, which can reduce the startup time of the entire system without adding external hardware.

在一种可能的实现方式中,m=1,第一处理器用于对上述h个局域网交换机进行初始化,n=h。In a possible implementation, m=1, the first processor is used to initialize the h local area network switches, n=h.

在这种实现方式中,上述局域网交换机系统可以包括一个用于初始化h个局域网交换机的处理器,利用这一个处理器,基于多个并行的进程,就可以并行地对多个局域网交换机进行初始化,能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。In this implementation, the above-mentioned LAN switch system may include a processor for initializing h LAN switches. Using this processor, multiple LAN switches can be initialized in parallel based on multiple parallel processes. It can quickly initialize multiple LAN switches without adding external hardware, reducing the startup time of the entire system.

图4是本申请实施例提供的另一种局域网交换机系统的系统架构示意图。Figure 4 is a schematic system architecture diagram of another LAN switch system provided by an embodiment of the present application.

作为示例而非限定,如图4所示,局域网交换机系统中包括一个用于初始化h个局域网交换机的处理器,该处理器即为第一处理器,该第一处理器可以是SOC,该第一处理器可以利用其包括的h个核,同时启动h个并行的进程,来并行地对该局域网交换机系统中所包括的全部的局域网交换机(也就是h个局域网交换机)进行初始化。As an example and not a limitation, as shown in Figure 4, the LAN switch system includes a processor for initializing h LAN switches. The processor is a first processor. The first processor may be a SOC. The first processor may be a SOC. A processor can use its h cores to start h parallel processes at the same time to initialize all LAN switches (that is, h LAN switches) included in the LAN switch system in parallel.

更为详细地,第一处理器可以利用核1,通过调用MDIO接口1的驱动来实现对局域网交换机1的完整初始化;可以利用核2,通过调用MDIO接口2的驱动来实现对局域网交换机2的完整初始化;可以利用核3,通过调用I2C接口的驱动来实现对局域网交换机3的完整初始化;可以利用核4,通过调用ETH接口的驱动来实现对局域网交换机4的完整初始化;可以利用核5,通过调用UART接口的驱动来实现对局域网交换机5的完整初始化;可以利用核6,通过调用GPIO接口的驱动来实现对局域网交换机6的完整初始化;可以利用核7,通过调用USB接口的驱动来实现对局域网交换机7的完整初始化;可以利用核h,通过调用PCIE接口的驱动来实现对局域网交换机h的完整初始化。在以上整个过程中,无需新增外部处理器,就能实现对多个局域网交换机快速完成初始化,能够降低整个系统的启动耗时。In more detail, the first processor can use core 1 to realize the complete initialization of the LAN switch 1 by calling the driver of the MDIO interface 1; it can use the core 2 to realize the complete initialization of the LAN switch 2 by calling the driver of the MDIO interface 2. Complete initialization; you can use core 3 to achieve complete initialization of LAN switch 3 by calling the driver of the I2C interface; you can use core 4 to achieve complete initialization of LAN switch 4 by calling the driver of the ETH interface; you can use core 5 to achieve complete initialization of LAN switch 3. The complete initialization of the LAN switch 5 can be realized by calling the driver of the UART interface; the complete initialization of the LAN switch 6 can be realized by calling the driver of the GPIO interface using the core 6; the complete initialization of the LAN switch 6 can be realized by calling the driver of the USB interface using the core 7 Complete initialization of LAN switch 7; you can use core h to achieve complete initialization of LAN switch h by calling the driver of the PCIE interface. In the entire above process, multiple LAN switches can be quickly initialized without adding an external processor, which can reduce the startup time of the entire system.

在一种可能的实现方式中,m≥2。In one possible implementation, m≥2.

在这种实现方式中,上述局域网交换机系统可以包括多个用于初始化h个局域网交换机的处理器,利用这多个处理器,来共同对多个局域网交换机进行初始化。在这多个处理器的上电时刻相同的情况下,实现并行地对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。In this implementation manner, the above-mentioned LAN switch system may include multiple processors for initializing h LAN switches, and these multiple processors are used to jointly initialize multiple LAN switches. When the power-on time of these multiple processors is the same, multiple LAN switches can be quickly initialized in parallel, reducing the startup time of the entire system.

需要说明的是,这多个处理器上电的时刻可以相同,也可以不同。例如,当这多个处理器均为MCU或者均为SOC时,这多个处理器上电的时刻可以相同,也可以不同。当这多个处理器即包括MCU,又包括SOC时,这多个处理器上电的时刻可以不同。本申请实施例对此不作限定。It should be noted that the times at which these multiple processors are powered on may be the same or different. For example, when the multiple processors are all MCUs or all are SOCs, the times at which the multiple processors are powered on may be the same or different. When the multiple processors include both MCUs and SOCs, the times at which the multiple processors are powered on may be different. The embodiments of the present application do not limit this.

可选地,在m≥2时,上述m个处理器中包括至少一个MCU和至少一个SOC。Optionally, when m≥2, the m processors include at least one MCU and at least one SOC.

在利用这至少两个处理器来共同对多个局域网交换机进行初始化时,处理器的类型可以不同,例如,m个处理器中包括至少一个MCU和至少一个SOC,在MCU比SOC上电早的情况下,MCU可以先对多个局域网交换机中的一部分进行初始化,后续上电的SOC可以对多个局域网交换机中剩余未上电的部分进行初始化,在MCU和SOC上电的时间间隔较小时,也能够在不增加外部硬件的情况下,实现对多个局域网交换机快速完成初始化,降低整个系统的启动耗时。When using these at least two processors to jointly initialize multiple LAN switches, the types of processors may be different. For example, the m processors include at least one MCU and at least one SOC, and the MCU is powered on earlier than the SOC. In this case, the MCU can first initialize part of the multiple LAN switches, and the subsequently powered-on SOC can initialize the remaining unpowered parts of the multiple LAN switches. When the power-on time interval between the MCU and the SOC is small, It can also quickly initialize multiple LAN switches without adding external hardware, reducing the startup time of the entire system.

示例性地,h=10,m=2,也就是说,局域网交换机系统包括十个局域网交换机和两个处理器中,这两个处理器中,一个可以是单核的SOC,另一个可以是多核的MCU,该多核的MCU可以是八核的MCU。该八核的MCU在上电后,可以利用它的六个核,启动六个并行的进程,调用六个预设的接口的驱动,来初始化与该八核的MCU所对应的六个局域网交换机;该单核的SOC在上电后,可以利用它的这一个核,启动四个并行的进程,调用四个预设的接口的驱动,来初始化与该单核的SOC所对应的四个局域网交换机。在以上整个过程中,无需新增外部处理器,就能实现对这十个局域网交换机快速完成初始化,能够降低整个系统的启动耗时。For example, h=10, m=2, that is to say, the LAN switch system includes ten LAN switches and two processors. Of the two processors, one can be a single-core SOC and the other can be A multi-core MCU may be an eight-core MCU. After the eight-core MCU is powered on, it can use its six cores to start six parallel processes and call six preset interface drivers to initialize the six LAN switches corresponding to the eight-core MCU. ; After the single-core SOC is powered on, it can use its core to start four parallel processes and call the drivers of the four preset interfaces to initialize the four LANs corresponding to the single-core SOC. switch. During the entire above process, the ten LAN switches can be quickly initialized without adding an external processor, which can reduce the startup time of the entire system.

需要说明的是,在本申请实施例提供的局域网交换机的初始化方法中,对多个局域网交换机的固件加载和配置文件的加载,同时使用了直接存储器访问(direct memoryaccess,DMA)技术和任务分时调用技术,采用DMA技术就相当于从处理器的内部存储器往处理器的运行内存搬运数据,相较于输入输出(input/output,IO)读写方式,能够提升加载速度,从而提高了初始化多个局域网交换机的速度,也即提升了包括多个局域网交换机的系统的启动速度。并且,在处理器中的核对局域网交换机的固件内容和配置文件进行读写的同时,处理器的核还能够切出去执行其他的任务,能够充分利用处理器的资源。It should be noted that in the initialization method of a LAN switch provided by the embodiment of the present application, the direct memory access (DMA) technology and task time sharing are simultaneously used to load the firmware and configuration files of multiple LAN switches. Calling technology, using DMA technology is equivalent to transferring data from the internal memory of the processor to the running memory of the processor. Compared with the input/output (IO) reading and writing method, it can improve the loading speed, thus improving the initialization time. The speed of a LAN switch, that is, the startup speed of a system including multiple LAN switches is improved. Moreover, while the core in the processor is reading and writing the firmware content and configuration files of the LAN switch, the core of the processor can also be cut off to perform other tasks, making full use of the processor's resources.

基于上述方案,通过复用系统中的m个处理器,来实现对系统中的h个局域网交换机进行初始化,可以合理地利用系统中的处理资源,来实现多个局域网交换机的快速初始化,而无需新增外部处理器,如此一来,处理资源得以高效利用,成本也得以降低。此外,若对该m个处理器加以控制,使得该m个处理器的上电时刻相同,该m个处理器可以用于并行地对h个局域网交换机进行初始化。从而可以使得该h个局域网交换机的初始化得以快速完成,降低整个系统的启动耗时。换言之,使用本申请提供的方案,还有利于降低系统的启动耗时。Based on the above solution, by reusing m processors in the system to initialize h LAN switches in the system, the processing resources in the system can be reasonably utilized to achieve rapid initialization of multiple LAN switches without By adding an external processor, processing resources can be efficiently utilized and costs can be reduced. In addition, if the m processors are controlled so that the m processors are powered on at the same time, the m processors can be used to initialize h LAN switches in parallel. Therefore, the initialization of the h LAN switches can be completed quickly, and the startup time of the entire system can be reduced. In other words, using the solution provided by this application is also beneficial to reducing the startup time of the system.

本申请实施例还提供了一种局域网交换机系统,该系统包括m个处理器和h个局域网交换机,这m个处理器用于对这h个局域网交换机进行初始化,m≥1,h≥2,m、h为整数;其中,这m个处理器中的每个处理器可用于实现上述方法200。也即,这m个处理器中的任意一个处理器可以是上述方法200中的第一处理器。相关描述可以参看前文中的相关内容,为了简洁,此处不再赘述。The embodiment of the present application also provides a LAN switch system, which includes m processors and h LAN switches. The m processors are used to initialize the h LAN switches, m≥1, h≥2, m , h is an integer; wherein, each of the m processors can be used to implement the above method 200. That is, any one of the m processors may be the first processor in the above method 200. For relevant descriptions, please refer to the relevant content in the previous article. For the sake of brevity, I will not repeat them here.

图1和图4中示出的局域网交换机系统即为本申请实施例提供了局域网交换机系统的两个示例。相关描述可以参看前文中的相关内容,为了简洁,此处不再赘述。The LAN switch systems shown in FIG. 1 and FIG. 4 provide two examples of the LAN switch system according to the embodiments of the present application. For relevant descriptions, please refer to the relevant content in the previous article. For the sake of brevity, I will not repeat them here.

作为示例而非限定,上述局域网交换机系统可以应用于车辆。By way of example and not limitation, the above-mentioned LAN switch system may be applied to vehicles.

也就是说,本申请实施例所提供的局域网交换机系统可以部署在车辆上。本申请实施例对此不作任何限定。That is to say, the LAN switch system provided by the embodiment of the present application can be deployed on a vehicle. The embodiments of this application do not limit this in any way.

本申请还提供了一种芯片系统,所述芯片系统包括至少一个处理器,用于实现上述图2所示实施例中第一处理器执行的方法中所涉及的功能。The present application also provides a chip system, which includes at least one processor for implementing the functions involved in the method executed by the first processor in the embodiment shown in FIG. 2 .

在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存程序指令和数据,存储器位于处理器之内或处理器之外。In a possible design, the chip system further includes a memory, the memory is used to store program instructions and data, and the memory is located within the processor or outside the processor.

该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The chip system can be composed of chips or include chips and other discrete devices.

本申请还提供一种计算机程序产品,所述计算机程序产品包括:计算机程序(也可以称为代码或指令),当所述计算机程序被运行时,使得计算机执行如图2所示实施例的方法。This application also provides a computer program product. The computer program product includes: a computer program (which may also be called a code or an instruction). When the computer program is run, it causes the computer to execute the method of the embodiment shown in Figure 2 .

本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序(也可以称为代码或指令)。当所述计算机程序被运行时,使得计算机执行如图2所示实施例的方法。The present application also provides a computer-readable storage medium that stores a computer program (which may also be referred to as code or instructions). When the computer program is run, the computer is caused to execute the method of the embodiment shown in FIG. 2 .

应理解,本申请实施例中的处理器可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(digitalsignal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in the embodiment of the present application may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method embodiment can be completed through an integrated logic circuit of hardware in the processor or instructions in the form of software. The above-mentioned processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable processors. Logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是RAM,其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should also be understood that the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory can be RAM, which acts as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (direct rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

本说明书中使用的术语“单元”、“模块”等,可用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。The terms "unit", "module", etc. used in this specification may be used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各种说明性逻辑块(illustrative logical block)和步骤(step),能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。Those of ordinary skill in the art will appreciate that the various illustrative logical blocks and steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or a combination of computer software and electronic hardware. accomplish. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed to multiple network modules. 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, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more units can be integrated into one module.

在上述实施例中,各功能模块的功能可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令(程序)。在计算机上加载和执行所述计算机程序指令(程序)时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, the functions of each functional module can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (program) 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 device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated therein. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, digital video discs, DVDs), or semiconductor media (eg, solid state disks, SSDs) )wait.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the 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 the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause 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 aforementioned storage media include: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (27)

1. The initialization method of the local area network switch is characterized in that the method is applied to a system comprising h local area network switches, the system comprises m processors for initializing the h local area network switches, the powering-on moments of the m processors are the same, h is more than or equal to 2, m is more than or equal to 1, m and h are integers, and the method comprises the following steps:
after a first processor of the m processors is powered on, the first processor initializes n local area network switches, the n local area network switches belong to the h local area network switches, n is greater than or equal to 1 and less than or equal to h, n is an integer, and the first processor is also used for other tasks except initializing the n local area network switches.
2. The method of claim 1, wherein the first processor comprises at least one core.
3. The method of claim 2, wherein the first processor comprises k cores, n cores of the k cores correspond to n processes, one of the n processes to initialize one of the n local area network switches, 1 n k, k 2 k being an integer.
4. The method of claim 2, wherein the first processor comprises a core, the core corresponding to n processes, one of the n processes to initialize one of the n lan switches.
5. The method of any one of claims 1 to 4, wherein the first processor is a micro control unit, MCU, or a system on chip, SOC.
6. The method of any of claims 1 to 5, wherein m = 1, the first processor is configured to initialize the h local area network switches, n = h.
7. The method of any one of claims 1 to 5, wherein m.gtoreq.2.
8. The method of any one of claims 1 to 7, wherein a correspondence between each of the m processors and each of the h lan switches is preset.
9. The method of any of claims 1-8, wherein the first processor initializing n local area network switches comprises:
the first processor configures the firmware content and the configuration file of the n local area network switches to the corresponding local area network switches respectively so as to realize complete initialization of the n local area network switches.
10. The method of claim 9, wherein the first processor respectively configures firmware content and configuration files of the n local area network switches to corresponding local area network switches, comprising:
The first processor calls preset n interfaces to drive, and the firmware content and the configuration files of the n local area network switches are respectively configured to the corresponding local area network switches;
wherein one of the n interfaces corresponds to one of the n lan switches.
11. The method of claim 10, wherein the type of the predetermined n interfaces includes one or more of: serial peripheral interface SPI, management data input and output MDIO interface, internal integrated circuit I2C interface, universal asynchronous receiving and transmitting transmitter UART interface, universal input and output GPIO interface, universal serial bus USB interface, ethernet ETH interface, high-speed serial computer expansion bus standard PCIE interface.
12. The method according to claim 10 or 11, wherein the preset n interfaces comprise at least two interfaces of the same type when n is ≡2.
13. The local area network switch system is characterized by comprising m processors and h local area network switches, wherein the m processors are used for initializing the h local area network switches, m is more than or equal to 1, h is more than or equal to 2, and m and h are integers;
the first processor of the m processors is used for initializing n local area network switches after power-on, the n local area network switches belong to the h local area network switches, n is more than or equal to 1 and less than or equal to h, and n is an integer, and the first processor is also used for other tasks except initializing the n local area network switches.
14. The system of claim 13, wherein the first processor comprises at least one core.
15. The system of claim 14, wherein the first processor comprises k cores, n cores of the k cores correspond to n processes, one of the n processes to initialize one of the n local area network switches, 1 n k, k 2, k being an integer.
16. The system of claim 14, wherein the first processor comprises a core, the core corresponding to n processes, one of the n processes to initialize one of the n local area network switches.
17. The system of any one of claims 13 to 16, wherein the first processor is a micro control unit, MCU, or a system on chip, SOC.
18. The system of any of claims 13 to 17, wherein m = 1, the first processor is configured to initialize the h local area network switches, n = h.
19. The system of any one of claims 13 to 18, wherein m is ≡2.
20. The system according to any one of claims 13 to 19, wherein a correspondence between each of the m processors and each of the h lan switches is preset.
21. The system of any one of claims 13 to 20, wherein the first processor is specifically configured to:
and respectively configuring the firmware content and the configuration files of the n local area network switches to the corresponding local area network switches to realize the complete initialization of the n local area network switches.
22. The system of claim 21, wherein the first processor is specifically configured to:
invoking preset drives of n interfaces, and respectively configuring firmware content and configuration files of the n local area network switches to corresponding local area network switches;
wherein one of the n interfaces corresponds to one of the n lan switches.
23. The system of claim 22, wherein the type of the predetermined n interfaces includes one or more of: serial peripheral interface SPI, management data input and output MDIO interface, internal integrated circuit I2C interface, universal asynchronous receiving and transmitting transmitter UART interface, universal input and output GPIO interface, universal serial bus USB interface, ethernet ETH interface, high-speed serial computer expansion bus standard PCIE interface.
24. The system of claim 22 or 23, wherein the predetermined n interfaces comprise at least two interfaces of the same type when n is ≡2.
25. The system of any one of claims 13 to 24, wherein the system is applied to a vehicle.
26. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed, causes a computer to perform the method of any of claims 1 to 12.
27. A computer program product comprising a computer program which, when run, causes a computer to perform the method of any one of claims 1 to 12.
CN202210866547.4A 2022-07-22 2022-07-22 Initialization method and system for local area network switch Pending CN117478493A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210866547.4A CN117478493A (en) 2022-07-22 2022-07-22 Initialization method and system for local area network switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210866547.4A CN117478493A (en) 2022-07-22 2022-07-22 Initialization method and system for local area network switch

Publications (1)

Publication Number Publication Date
CN117478493A true CN117478493A (en) 2024-01-30

Family

ID=89631696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210866547.4A Pending CN117478493A (en) 2022-07-22 2022-07-22 Initialization method and system for local area network switch

Country Status (1)

Country Link
CN (1) CN117478493A (en)

Similar Documents

Publication Publication Date Title
CN114138702B (en) Computing system, PCI device manager and initialization method thereof
US10078361B2 (en) Methods and apparatus for running and booting an inter-processor communication link between independently operable processors
US10585816B1 (en) System and method for serial communication at a peripheral interface device
US8838865B2 (en) Hot plug ad hoc computer resource allocation
US9081709B2 (en) Virtualizable and forward-compatible hardware-software interface
US20060106962A1 (en) USB On-The-Go implementation
US10509758B1 (en) Emulated switch with hot-plugging
US9860189B2 (en) Systems and methods to enable network communications for management controllers
US20220335002A1 (en) Control Method and Apparatus
US20140280960A1 (en) Methods and apparatus for dynamically allocating devices between multiple controllers
US9098640B2 (en) Controller, electronic equipment unit, and USB device control method
CN110837488B (en) Message transmission method and device
CN113742269B (en) Data transmission method, processing device and medium for EPA device
CN101452430B (en) Communication method between multi-processors and communication device comprising multi-processors
CN116627520A (en) System operation method of baseboard management controller and baseboard management controller
WO2023174146A1 (en) Offloading-card namespace management system and method, and input/output request processing system and method
EP4478204A1 (en) Hardware interface signal generation method and apparatus and electronic device
CN116540952A (en) Disk access method and device, storage medium and electronic equipment
CN115934623A (en) Data processing method, device and medium based on remote direct memory access
TW202143061A (en) I3c hub promoting backward compatibility with ic
US11288223B2 (en) Bridge chip with function of expanding external devices and associated expansion method
CN117478493A (en) Initialization method and system for local area network switch
CN115061958B (en) Hard disk identification method, identification system, storage medium and computer equipment
US20190391876A1 (en) Method and Apparatus for Non-Volatile Memory Array Improvement Using a Command Aggregation Circuit
CN116860680A (en) Hot plug method, PCIE equipment and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20241106

Address after: 518129 Huawei Headquarters Office Building 101, Wankecheng Community, Bantian Street, Longgang District, Shenzhen, Guangdong

Applicant after: Shenzhen Yinwang Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd.

Country or region before: China

SE01 Entry into force of request for substantive examination