Pluggable equipment management method and device based on SONiC operating system

By using the board status to determine the thread and voltage in the SONiC operating system, the problem of not being able to support module plug-in and unplug in the existing technology is solved, and the plug-in and unplug function is realized during the operating system startup, ensuring business normal transmission.

CN119045900AActive Publication Date: 2024-11-29ACCELINK TECHNOLOGIES CO LTD

Patent Information

Application Number
CN202411094036.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-11-29
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

The existing SONiC operating system cannot support the pluggable function of the module, resulting in the need to restart the operating system every time the module is plugged and unplugged, affecting the normal transmission of services.

Method used

The PMON module opens the board status and determines whether the board is in place using the voltage of the slot, and updates it to the board status database. The SWSS module issues business according to the board plug-in results, and supports the module to be launched during the operating system startup. plug-and-unplug operation.

Benefits of technology

The pluggable function of supporting modules in the SONiC operating system is realized, so that the module can be plugged and unplugged during startup without affecting the normal operation of other modules, and avoiding business interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045900A_ABST
    Figure CN119045900A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of operating systems, and provides a pluggable equipment management method and device based on an SONiC operating system. The method comprises the steps that a PMON module starts a board card state judgment thread; the board card state judgment thread obtains the ID number of each slot position, and scans the voltage of each slot position by using the ID number of each slot position; according to the voltage of each slot position, obtaining a board card plugging and unplugging result; wherein the board card plugging and unplugging result is used for representing whether a board card is in place or not; updating the board card plugging and unplugging result to a board card state database; the SWSS module reads a board card plugging and unplugging result from the board card state database; and performing service issuing on the board card according to the board card plugging and unplugging result. According to the method, whether the board card is in place or not is judged through the voltage of the slot position, so that the support of the SONiC operating system on the pluggable function of the board card is added, and the module can be subjected to plugging operation during the starting period of the SONiC operating system without influencing the normal operation of other modules in the SONiC operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of operating systems, and in particular to a pluggable device management method and device based on a SONiC operating system. Background Art

[0002] SONiC is a network operating system built on Linux. Traditional network devices are increasingly unable to meet the requirements of cloud computing for open interfaces and modular construction due to their black box characteristics and software and hardware binding characteristics. SONiC system came into being. It is built on the Linux system and uses key-value database (redis), container technology (docker), standardized hardware interface construction and other technologies to become a network operating system with software and hardware decoupling, loose module coupling, high reliability, easy expansion, and open source.

[0003] Due to its high degree of openness and scalability, more and more network hardware manufacturers have begun to adopt the SONiC operating system or expand on it to build personalized network operating systems.

[0004] The SONiC operating system is mainly used in switch products and transmission products. Currently, switch products are all integrated devices, that is, the switching chip is always in place, so the message channel of the SONiC operating system does not judge the in-place status of the device. However, in the transmission field, with the increase in communication needs, more and more devices or modules are designed to be pluggable, but the existing SONiC operating system cannot support pluggable modules, that is, the existing SONiC operating system cannot support the pluggable function of modules. This results in the need to restart the SONiC operating system every time a module is plugged in or out. During this process, other modules will also be powered off and restarted and cannot operate normally, and the business will be interrupted, affecting the normal transmission of the business.

[0005] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention

[0006] The technical problem to be solved by the present invention is that the existing SONiC operating system cannot support the pluggable function of the module.

[0007] The present invention adopts the following technical solution:

[0008] In a first aspect, the present invention provides a pluggable device management method based on a SONiC operating system, comprising:

[0009] The PMON module uses start_linecard_thread() to start the board status judgment thread;

[0010] The board status judgment thread uses the get_first_slot_id() interface to obtain the ID number of each slot, and uses the ID number of each slot to scan the voltage of each slot;

[0011] Obtaining a card plug-in result according to the voltage of each slot; wherein the card plug-in result is used to represent whether the card is in place;

[0012] Updating the board plug-in and plug-out results into the board status database;

[0013] The state management process in the SWSS module uses the isLineCardStateOk() interface to read the board card plug-in and plug-out results from the board card state database;

[0014] According to the results of card removal and insertion, services are issued to the cards.

[0015] Preferably, the issuing of services to the board according to the result of plugging and unplugging the board specifically includes:

[0016] When the result of the card plugging and unplugging is that the card is not in place, the state management process periodically reads the result of the card plugging and unplugging;

[0017] When the result of the board plugging and unplugging is that the board is in place, the initial configuration data is sent to the board;

[0018] After the initial configuration data is sent to the board, the service is sent to the board.

[0019] Preferably, after the initial configuration data is sent to the board, the service is sent to the board, which specifically includes:

[0020] The business management process of the SWSS module calls the checkRestartReady() interface to determine whether the initial configuration data of the board has been sent;

[0021] When it is determined that the initial configuration data of the board is completed, the createLinecard() interface is called to create the board object;

[0022] The board object is used to call the doLinecardStateTask() interface to send business data to the board.

[0023] Preferably, the method further comprises:

[0024] The business management process of the SWSS module also uses the checkRestartReady() interface to determine whether the board is restarted after being shut down;

[0025] The incremental configuration data received during the process of shutting down and restarting the board is stored in the database;

[0026] After the board is restarted, the incremental configuration data is sent to the board, and then the service is sent to the board.

[0027] Preferably, the incremental configuration data received during the process of shutting down and restarting the board is stored in a database, specifically including:

[0028] When the board is shut down, the skipPendingTaskCheck() interface is called to stop sending services to the board and store the incremental configuration data in the database.

[0029] Preferably, after the board is restarted, sending the incremental configuration data to the board specifically includes:

[0030] After the board is restarted, the initConfigTotalNum() interface is called to read the number of stored incremental configuration data from the database;

[0031] The doLinecardStateTask() interface is called to send the incremental configuration data in the database to the board. When the number of incremental configuration data sent reaches the number of incremental configuration data stored in the database, the stopPreConfigProc() interface is called to stop sending.

[0032] Preferably, after the board is restarted, the service management process also calls the checkRestartNoFreeze() interface to determine whether the restart type of the board is a cold start or a hot start;

[0033] When it is determined that the restart type of the board is a hot start, the incremental configuration data is directly sent down.

[0034] When it is determined that the restart type of the board is a cold start, the initial configuration data is first re-sent to the board, and after the initial configuration data is sent, the incremental configuration data is sent to the board.

[0035] Preferably, before issuing the service to the board, the method further includes:

[0036] The PMON module also uses the driver to obtain the actual board type from the board, matches the actual board type with the preset board type stored in the database, and determines whether the board is a supported board according to the matching result;

[0037] If it is determined that the board is a supported board, the board is powered on to start the board.

[0038] In a second aspect, the present invention further provides a pluggable device management device based on a SONiC operating system, which is used to implement the pluggable device management method based on a SONiC operating system described in the first aspect, and the device includes:

[0039] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the pluggable device management method based on the SONiC operating system described in the first aspect.

[0040] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the pluggable device management method based on the SONiC operating system described in the first aspect.

[0041] In a fourth aspect, a chip is provided, comprising: a processor and an interface, for calling and running a computer program stored in the memory from a memory, and executing the method of the first aspect.

[0042] According to a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a computer or a processor, the computer or the processor executes the method according to the first aspect.

[0043] The present invention determines whether a board is in place by the voltage of the slot, thereby adding support for the pluggable function of the board to the SONiC operating system, so that the module can be plugged in and out during the startup of the SONiC operating system without affecting the normal operation of other modules in the SONiC operating system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 It is a flowchart of a first pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0046] Figure 2 It is a flow chart of a second pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0047] Figure 3It is a flowchart of a third pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0048] Figure 4 It is a flowchart of a fourth pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0049] Figure 5 It is a flowchart of a fifth pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0050] Figure 6 It is a flowchart of a sixth pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0051] Figure 7 It is a schematic diagram of a pluggable device management method based on a SONiC operating system provided by an embodiment of the present invention;

[0052] Figure 8 is a schematic diagram of another pluggable device management method based on the SONiC operating system provided by an embodiment of the present invention;

[0053] Fig. 9 It is a schematic diagram of the architecture of a pluggable device management device based on the SONiC operating system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0055] Unless the context requires otherwise, throughout the specification and claims, the term "including" is to be interpreted as open inclusion, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" and the like are intended to indicate that specific features, structures, materials or characteristics associated with the embodiment or example are included in at least one embodiment or example of the present disclosure. The schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner, that is, although they may be carried in the embodiments or examples of the above terms due to reasons such as the order and position of appearance, it is not limited to that they can be carried in combination by one embodiment or example.

[0056] In the description of the present invention, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, for example, the same type of nouns may be described as two independent individuals by adding "A" and "B" at the end. In this case, the corresponding features defined as "A" and "B" are only used to distinguish the same type of individuals for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.

[0057] In the description of the present invention, the expression "A and / or B" (where A and B are used to formally represent specific characteristic contents) will be involved, and the corresponding expressions include the following three combinations: only A, only B, and a combination of A and B.

[0058] As used herein, "about," "substantially," or "approximately" includes the stated value and an average value that is within an acceptable range of deviation from the particular value as determined by one of ordinary skill in the art taking into account the measurements in question and the errors associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).

[0059] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0060] Embodiment 1:

[0061] Embodiment 1 of the present invention provides a pluggable device management method based on a SONiC operating system, such as Figure 1 As shown, including:

[0062] In step 201, the platform module daemons (PMON) module uses start_linecard_thread() to start the board status judgment thread; wherein the PMON module exists as an independent container, and is mainly used for the management of the main control related peripheral devices and the power on and off processing of the single disk, that is, through the remote procedure call (rpc) thrift client and the driver DevMgr (also called the thrift server) to communicate to obtain the central processing unit (CPU) information, the presence of fans, power supplies, etc., the production number (PN), the serial number (SN), the temperature, the voltage and other information. DevMgr is a driver service program, which is used to provide the driver-related application program interface (API) and communicate with the PM model through the thrift interface.

[0063] In step 202, the board state determination thread uses the get_first_slot_id() interface to obtain the ID number of each slot, and uses the ID number of each slot to scan the voltage of each slot.

[0064] In step 203, the board plug-in result is obtained according to the voltage of each slot; wherein the board plug-in result is used to represent whether the board is in place; the voltage of the slot is specifically the voltage of the in-place signal of the slot, and whether the board is in place can be determined based on the in-place signal.

[0065] In step 204, the board plugging and unplugging result is updated to the board status database.

[0066] In step 205, the state management process in the SONiC switch state service (SWSS) module uses the isLineCardStateOk() interface to read the board plug-in result from the board state database; the state management process is also called cfgmgr in actual use, and the SWSS module is also called a logic control module.

[0067] In step 206, services are issued to the board according to the board plug-in result. Specifically, when the board is plugged in, the service is issued, and when the board is plugged out, the service is stopped.

[0068] This embodiment determines whether the board is in place by the voltage of the slot, thereby adding support for the pluggable function of the board in the SONiC operating system, so that the module can be plugged in and out during the startup of the SONiC operating system without affecting the normal operation of other modules in the SONiC operating system.

[0069] In a specific application scenario, the service is issued to the board according to the result of plugging and unplugging the board, such as Figure 2 As shown, specifically including:

[0070] In step 301, when the result of the card plugging and unplugging is that the card is not in place, the state management process periodically reads the result of the card plugging and unplugging; the specific reading period can be obtained by those skilled in the art according to demand analysis.

[0071] In step 302, until the result of the board plugging and unplugging is that the board is in place, initial configuration data is sent to the board; the initial configuration data can be understood as configuration data pre-stored in a database by a person skilled in the art.

[0072] In step 303, after the initial configuration data is sent to the board, services are sent to the board.

[0073] After the initial configuration data is sent to the board, the service is sent to the board, such as Figure 3 As shown, specifically including:

[0074] In step 401, the service management process of the SWSS module calls the checkRestartReady() interface to determine whether the initial configuration data of the board has been sent down; the service management process is also called orchagent in actual use.

[0075] In step 402, when it is determined that the initial configuration data of the board is completed, the createLinecard() interface is called to create a board object; the board object is different from the board. The board is a module on the hardware, and the board object can be understood as a software object on the software used to send services to the hardware board, such as an instance of a class used to send services to the hardware board.

[0076] In step 403, the board object is used to call the doLinecardStateTask() interface to send business data to the board.

[0077] In some embodiments, the board may restart after startup, and cannot work normally from shutdown to restart. However, since the SONiC operating system is still working normally, it may also receive business or incremental configuration data. In order to ensure that the board can work normally after restart, Figure 4 As shown, the method also includes:

[0078] In step 501, the service management process of the SWSS module also uses the checkRestartReady() interface to determine whether the board is restarted after being shut down.

[0079] In step 502, the incremental configuration data received during the process of shutting down and restarting the board is stored in the database; the incremental configuration data can be understood as the configuration data sent to the board by the upstream or the user after the board is started. It can be understood that the initial configuration data can realize the normal operation of the board, and the incremental configuration data can enable the board to work normally according to business requirements.

[0080] In step 503, after the board is restarted, the incremental configuration data is sent to the board, and then the service is sent to the board. Therefore, the related devices do not need to sense the restart of the board in the corresponding device, and the incremental configuration data can still be sent after the board is shut down, and the incremental configuration data is sent to the board after the board is restarted, so that it can work normally after the restart.

[0081] The incremental configuration data received during the process of shutting down and restarting the board is stored in the database, which specifically includes: when the board is shut down, calling the skipPendingTaskCheck() interface to stop sending services to the board, and storing the incremental configuration data in the database.

[0082] After the board is restarted, the incremental configuration data is sent to the board, such as Figure 5 As shown, specifically including:

[0083] In step 601, after the board is restarted, the initConfigTotalNum() interface is called to read the number of stored incremental configuration data from the database.

[0084] In step 602, the doLinecardStateTask() interface is called to send the incremental configuration data in the database to the board until the number of incremental configuration data sent reaches the number of incremental configuration data stored in the database, that is, when all the incremental configuration data received from the board shutdown to the restart process are sent to the board, the stopPreConfigProc() interface is called to stop sending.

[0085] In actual use, the restart of the board itself includes cold start and hot start. Cold start means that the board restarts after power failure. During the restart process, it can be considered that the stored data in the volatile medium of the board is completely lost, so it needs to be rewritten after the restart. The hot start is based on the control logic of the board and can be understood as the initialization of the board. Since the power is not cut off, the stored data can still be retained. Therefore, the processing after cold start and hot start is also different, such as Figure 6 As shown, specifically:

[0086] In step 701, after the board is restarted, the service management process also calls the checkRestartNoFreeze() interface to determine whether the restart type of the board is a cold start or a hot start.

[0087] In step 702, when it is determined that the restart type of the board is a hot start, the incremental configuration data is directly sent down.

[0088] In step 703, when it is determined that the restart type of the board is a cold start, the initial configuration data is first re-issued to the board, and after the initial configuration data is issued, the incremental configuration data is issued to the board.

[0089] In actual use, there may be multiple types of boards. Before using the board, it is necessary to determine whether the SONiC system supports the inserted type of board, that is, before issuing services to the board, the method also includes:

[0090] The PMON module also uses the driver to obtain the actual board type from the board, matches the actual board type with the preset board type stored in the database, and determines whether the board is a supported board based on the matching result; the preset board type can be understood as the board type supported by the SONiC system, which can be obtained in advance by technical personnel in this field based on empirical analysis and stored in the database, and the matching of the actual board type with the preset board type stored in the database can be: determining whether the actual board type is consistent with a preset board type, and when there is a preset board type that is consistent with the actual board type, the board is a supported board, otherwise, the board is not a supported board.

[0091] If it is determined that the board is a supported board, the board is powered on to start the board.

[0092] It should be noted here that when performing board presence detection, what is detected is the voltage of the slot presence signal, which is used to indicate whether a board is inserted in the slot. Powering on the board here refers to powering on the power supply port of the slot so that it can provide the working voltage for the board, thereby starting the board.

[0093] Embodiment 2:

[0094] The present invention is based on the method described in Example 1, combined with specific application scenarios, and uses technical descriptions in related scenarios to illustrate the implementation process of the present invention in characteristic scenarios.

[0095] This embodiment is as follows Figure 7 Taking the SONiC operating system architecture shown as an example, the PMON module is mainly used for the management of the main control related peripheral devices and the power on and off processing of a single disk. The PMON module exists as an independent container and communicates with the driver program DevMgr (thrift server) through the rpcthrift client to obtain the presence, PN, SN, temperature, voltage and other information of the CPU, fan, power supply, etc.; the SWSS module is also called the logic control module. The linecardmgrd process in the SWSS module consumes the LINECARD table in CFG_DB and decides whether to write it to APPL_DB according to the online status of the board for consumption by orchagent; the SYNCD module is also called the line card control module. The syncd process in the SYNCD module, as a consumer of ASIC_DB, receives the subcard configuration message issued by orchagent, and configures the subcard according to the subcard configuration information; the DEVMGR module, as a driver service program, provides the driver-related interface API and communicates with the PM model through the thrift interface.

[0096] The functions implemented in this embodiment specifically include:

[0097] (1) Identify board insertion and removal, and configure the logic of the control module through the database.

[0098] (2) Save each configuration and determine whether to send it based on the board status.

[0099] (3) Identify hot and cold restarts of the board and determine the logic for saving and sending incremental configurations.

[0100] Among them, the SONiC operating system provides four default config_db.json configuration files for four daughter cards (the number depends on the hardware form) when it leaves the factory by default. These config_db.json default configurations are differentiated according to the board type and the default configuration is restored.

[0101] The PMON module determines whether to "power on" the board by judging whether the real board type is consistent with the configuration database type (for OBX chassis, the real type is obtained directly by the driver from the single-disk E2POM; for O2 chassis, the real type is obtained by syncd from LAI). After power-on, the board power-on information (poweron) is written into the status database.

[0102] After the syncd LAI interface successfully initializes the board, it will write the board READY (indicating that the board is in place) into the status database (that is, the board plug-in result is written into the board status database); the SWSS module will send the configuration (that is, the initial configuration data) to syncd only after determining that the board is in the READY state.

[0103] This embodiment first adds a database table to the SONiC operating system, including:

[0104] Add the CFG_LINECARD_TABLE_NAME table in config_db and name it "LINECARD".

[0105] Add the STATE_LINECARD_TABLE_NAME table in state_db and name it "LINECARD".

[0106] Add the APP_LINECARD_TABLE_NAME table in app_db and name it "APP_LINECARD".

[0107] Add member functions (i.e. interfaces) for board power-on judgment in the PMON module, including:

[0108] start_linecard_thread() interface: used to start the board status judgment thread.

[0109] get_first_slot_id() interface: used to determine the slot id.

[0110] LineCardControl() interface: used to control database configuration according to the power-on status.

[0111] Create the LineCardMgr class in the cfgmgr process of the SWSS module and add member functions in the LineCardMgr class, including:

[0112] LineCardMgr() interface: Constructor used to initialize database table items.

[0113] setLineCardAttr() interface: used to set detailed parameters of the app_db data table.

[0114] isLineCardStateOk() interface: used to determine whether the board status is normal.

[0115] doTask() interface: used to determine whether to send the database according to the power-on status.

[0116] Create the LinecardOrch class in the orchaget process of the SWSS module and add member functions in the LinecardOrch class, including:

[0117] checkRestartReady() interface: used to determine the power-on status of the board.

[0118] checkRestartNoFreeze() interface: used to determine the cold or hot restart status of the board.

[0119] skipPendingTaskCheck() interface: used to skip board blocking tasks.

[0120] checkRestartReadyDone() interface: used to determine whether the board is restarted successfully.

[0121] createLinecard() interface: used to create a linecard.

[0122] initConfigTotalNum() interface: used to initialize the number of pre-configurations (i.e. incremental configuration data).

[0123] stopPreConfigProc() interface: used to stop preconfiguration.

[0124] doLinecardStateTask() interface: used to issue corresponding services according to the status of the board.

[0125] After adding the above member functions, perform the following steps:

[0126] When the SONiC operating system is initialized, the cfgmgr process of the SWSS module calls LineCardMgr() for initialization and calls setLineCardAttr() to set the board parameters.

[0127] The PMON module calls start_linecard_thread() to start the board status judgment thread and starts scanning the board. Specifically: it calls get_first_slot_id() to obtain the ID of each slot, and uses the slot ID to obtain the voltage of the slot's in-place signal (i.e., power-on status) to determine whether the board is in place, and calls LineCardControl() to control the database configuration according to the power-on status. When the board is online, the corresponding value stored is ON, and when the board is not in place, the corresponding value stored is FALSE.

[0128] The cfgmgr process of the SWSS module calls isLineCardStateOk() to obtain the corresponding value from the database, that is, whether the state of the board is ON.

[0129] When the state of the board is obtained to be ON, dotask() is called to send the appdb task (i.e., the initial configuration data). Before this, the board is powered on to start the board. In actual use, before the board is powered on, it is also checked whether the board can be supported by the current device, such as Figure 8 As shown, the PMON module obtains the actual board type from the board through DevMgr, and determines whether the actual board type is consistent with a preset board type pre-stored in the database. When there is a preset board type that is consistent with the actual board type, the board is a supportable board, the board is powered on, and the subsequent configuration data delivery action is executed. Otherwise, the board is not a supportable board, and the board is not powered on.

[0130] The orchagent process of the SWSS module calls checkRestartReady() to determine the status of the board database, that is, to determine whether the initial configuration data is successfully sent. If it is successfully sent, it calls createLinecard() to create a board object, and uses the board object to call doLinecardStateTask() to send corresponding services according to the board status.

[0131] This embodiment allows the SONIC network operating system to support pluggable modules and can adapt to the service card issuance of various DCI scenarios.

[0132] Embodiment 3:

[0133] like Fig. 9 , which is a schematic diagram of the architecture of a pluggable device management device based on a SONiC operating system according to an embodiment of the present invention. The pluggable device management device based on a SONiC operating system according to this embodiment includes one or more processors 21 and a memory 22. Fig. 9 A processor 21 is taken as an example.

[0134] The processor 21 and the memory 22 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0135] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the pluggable device management method based on the SONiC operating system in Example 1. The processor 21 executes the pluggable device management method based on the SONiC operating system by running the non-volatile software programs and instructions stored in the memory 22.

[0136] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the pluggable device management method based on the SONiC operating system in the above-mentioned embodiment 1 is executed.

[0138] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0139] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0140] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A pluggable device management method based on SONiC operating system, characterized in that: include: The PMON module uses start_linecard_thread() to start the board status judgment thread; The board status judgment thread uses the get_first_slot_id() interface to obtain the ID number of each slot, and uses the ID number of each slot to scan the voltage of each slot; Obtaining a card plug-in result according to the voltage of each slot; wherein the card plug-in result is used to represent whether the card is in place; Updating the board plug-in and plug-out results into the board status database; The state management process in the SWSS module uses the isLineCardStateOk() interface to read the board card plug-in and plug-out results from the board card state database; According to the results of card removal and insertion, services are issued to the cards.

2. The pluggable device management method based on the SONiC operating system according to claim 1 is characterized in that: The issuing of services to the board according to the result of board plugging and unplugging specifically includes: When the result of the card plugging and unplugging is that the card is not in place, the state management process periodically reads the result of the card plugging and unplugging; When the result of the board plugging and unplugging is that the board is in place, the initial configuration data is sent to the board; After the initial configuration data is sent to the board, the service is sent to the board.

3. The pluggable device management method based on the SONiC operating system according to claim 2 is characterized in that: After the initial configuration data is sent to the board, the service is sent to the board, specifically including: The business management process of the SWSS module calls the checkRestartReady() interface to determine whether the initial configuration data of the board has been sent; When it is determined that the initial configuration data of the board is completed, the createLinecard() interface is called to create the board object; The board object is used to call the doLinecardStateTask() interface to send business data to the board.

4. The pluggable device management method based on the SONiC operating system according to claim 1 is characterized in that: The method also includes: The business management process of the SWSS module also uses the checkRestartReady() interface to determine whether the board is restarted after being shut down; The incremental configuration data received during the process of shutting down and restarting the board is stored in the database; After the board is restarted, the incremental configuration data is sent to the board, and then the service is sent to the board.

5. The pluggable device management method based on the SONiC operating system according to claim 4 is characterized in that: The incremental configuration data received during the process of shutting down and restarting the board is stored in the database, specifically including: When the board is shut down, the skipPendingTaskCheck() interface is called to stop sending services to the board and store the incremental configuration data in the database.

6. The pluggable device management method based on the SONiC operating system according to claim 4 is characterized in that: After the board is restarted, the incremental configuration data is sent to the board, specifically including: After the board is restarted, the initConfigTotalNum() interface is called to read the number of stored incremental configuration data from the database; The doLinecardStateTask() interface is called to send the incremental configuration data in the database to the board. When the number of incremental configuration data sent reaches the number of incremental configuration data stored in the database, the stopPreConfigProc() interface is called to stop sending.

7. The pluggable device management method based on SONiC operating system according to claim 4 is characterized in that: After the board is restarted, the service management process also calls the checkRestartNoFreeze() interface to determine whether the restart type of the board is a cold start or a hot start; When it is determined that the restart type of the board is a hot start, the incremental configuration data is directly sent; When it is determined that the restart type of the board is a cold start, the initial configuration data is first re-sent to the board, and after the initial configuration data is sent, the incremental configuration data is sent to the board.

8. The pluggable device management method based on the SONiC operating system according to claim 1 is characterized in that: Before issuing services to the board, the method further includes: The PMON module also uses the driver to obtain the actual board type from the board, matches the actual board type with the preset board type stored in the database, and determines whether the board is a supported board according to the matching result; If it is determined that the board is a supported board, the board is powered on to start the board.

9. A pluggable device management device based on SONiC operating system, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the pluggable device management method based on the SONiC operating system as described in any one of claims 1-8.

10. A non-volatile computer storage medium, characterized in that: The computer storage medium stores computer executable instructions, which are executed by one or more processors to complete the pluggable device management method based on the SONiC operating system as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Firmware security detection method of electronic equipment and related equipment

    CN111008379A

  • Method and device for enhancing reliability of SONiC and medium

    CN111124520A

  • Slot state control method, intelligent terminal and storage medium

    CN111290982A

  • Method for automatically selecting operating system according to slot position based on dual-system board card

    CN112988253A

  • Systems And Methods Of Updating Hot-Pluggable Devices

    US20170242686A1

Cited By

  • Port management method, system and device of network equipment and network equipment

    CN119766761A