Board card configuration method, electronic equipment and computer readable storage medium

By independently storing port configuration files in the configuration file library, the problem of configuration errors caused by mixed insertion of boards is solved, and a one-to-one correspondence between board types and slot numbers is achieved, ensuring quick configuration recovery and ease of device hot swapping. Maintainability.

CN118860933APending Publication Date: 2024-10-29ZTE CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310488801.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

During the hot-swap process of boards, due to operator errors, different types of boards were mixed, resulting in incorrect board configuration information and affecting the normal use of the equipment.

Method used

By independently storing port configuration files in the configuration file library, each file corresponds to a board type and a slot number, achieving one-to-one correspondence between board types and slot numbers, providing board configuration methods and devices, and obtaining board Type and slot number, find or initialize the configuration file, and save it for reuse.

Benefits of technology

In the case of mixed board insertion, it ensures the normal use of the equipment, improves the recovery speed of hot-swappable services, and improves the performance and ease of maintenance of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860933A_ABST
    Figure CN118860933A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a board card configuration method, electronic equipment and a computer readable storage medium, and belongs to the technical field of communication. The board card configuration method comprises the following steps: in response to insertion of a current board card into a current board card slot, obtaining a target board card type of the current board card and a target slot number of the current board card slot; according to the target board card type and the target slot number, whether a specified configuration file exists in a configuration file library or not is searched, the configuration file library comprises independently stored port configuration files, and each port configuration file comprises configuration data corresponding to one board card type and one slot number; the specified configuration file is a port configuration file corresponding to the target board card type and the target slot position number; and under the condition that the specified configuration file does not exist in the configuration file library, performing initialization configuration on the current board card to generate the specified configuration file. According to the embodiment of the invention, the technical problem that normal use of equipment is affected by wrong configuration information of the board cards under the condition of mixed insertion of the board cards is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a board configuration method, an electronic device, and a computer-readable storage medium. Background Art

[0002] At present, hot-plugging (or Hot Swap) technology is widely used to perform hot plugging and unplugging of boards and cards on network devices. However, in the actual use of hot-plugging of boards and cards, different types of boards and cards may be mixed due to human operating errors, which may lead to incorrect board configuration information and affect the normal use of the equipment. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide a board configuration method, an electronic device and a computer-readable storage medium, which independently store corresponding port configuration files based on slot numbers and board types, and can still ensure normal use of the device when boards are mixed.

[0004] To achieve the above object, an embodiment of the present application provides a board configuration method, the board configuration method comprising:

[0005] In response to the current board being inserted into the current board slot, acquiring a target board type of the current board and a target slot number of the current board slot;

[0006] Searching whether there is a designated configuration file in a configuration file library according to the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of the port configuration files includes configuration data corresponding to a board type and a slot number, and the designated configuration file is a port configuration file corresponding to the target board type and the target slot number;

[0007] If the specified configuration file does not exist in the configuration file library, initializing the configuration of the current board to generate the specified configuration file;

[0008] The specified configuration file is saved to the configuration file library, so that after a board card of the same type as the target board card is inserted into the current board card slot again, configuration data corresponding to the target board card type and the target slot number is loaded based on the specified configuration file.

[0009] In addition, to achieve the above-mentioned purpose, the embodiment of the present application further provides a board configuration device, the board configuration device comprising:

[0010] an acquisition module, the acquisition module being used for acquiring a target board type of the current board and a target slot number of the current board slot in response to the current board being inserted into the current board slot;

[0011] A search module, the search module is used to search whether there is a specified configuration file in a configuration file library according to the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of the port configuration files includes configuration data corresponding to a board type and a slot number, and the specified configuration file is a port configuration file corresponding to the target board type and the target slot number;

[0012] A configuration module, wherein the configuration module is used to initialize the configuration of the current board to generate the specified configuration file when the specified configuration file does not exist in the configuration file library;

[0013] A storage module, wherein the storage module is used to save the specified configuration file to the configuration file library, so that after a board card of the same board type as the current board card is inserted into the current board card slot again, the configuration data of the board card of the same board type as the current board card is loaded based on the specified configuration file.

[0014] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the board configuration method as described above is implemented.

[0015] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the board configuration method as described above is implemented.

[0016] The embodiment of the present application provides a board configuration method, an electronic device and a computer-readable storage medium. In the board configuration method, after receiving information that a current board is inserted into a current board slot, the electronic device first obtains a target board type of the current board and a target slot number of the current board slot; then searches a configuration file library for a specified configuration file based on the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of which includes configuration data corresponding to a board type and a slot number, and the specified configuration file is a port configuration file corresponding to the target board type and the target slot number; if the specified configuration file does not exist in the configuration file library, it means that the current board is inserted into the current board slot for the first time, so the current board needs to be initialized and configured to generate the specified configuration file; then, the specified configuration file is saved to the configuration file library, so that after a board with the same board type as the target board type is inserted into the current board slot again, the configuration data corresponding to the target board type and the target slot number is loaded based on the specified configuration file to achieve rapid configuration recovery of the board.

[0017] In the board configuration method provided in the embodiment of the present application, one slot number can be bound to multiple board types, one configuration file corresponds to one board type and a slot number, and multiple independent port configuration files can be stored in the configuration file library, thereby realizing a one-to-one correspondence between the configuration file and the slot number and board type combination. As a result, when the boards of electronic devices are hot-plugged, not only can the mixed insertion of various types of boards be supported, but also during the mixed insertion process, the recovery of the configuration will not be confused or have adverse effects due to changes in the type of the inserted boards. In actual use, the hot-plug service recovery speed of the electronic equipment can be accelerated, and the performance and maintainability of the electronic equipment can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A schematic diagram of a flow chart of a board configuration method provided in one embodiment of the present application;

[0020] Figure 2 A schematic diagram of an application scenario of a board configuration method provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of an application scenario of a board configuration method provided by another embodiment of the present application;

[0022] Figure 4 A schematic diagram of the structure of a board configuration device provided in one embodiment of the present application;

[0023] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0024] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the embodiments of the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the embodiments of the present application.

[0025] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0026] It should also be understood that the references to "one embodiment" or "some embodiments" described in the specification of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0027] Generally speaking, hot swapping means hot swapping while powered on. The hot swapping function allows users to remove and replace damaged hard disks, power supplies, or boards without shutting down the system or cutting off the power, thereby improving the system's ability to recover from disasters in a timely manner, scalability, and flexibility. For example, some disk mirroring systems for high-end applications can provide hot swapping of disks. Board hot swapping technology, that is, hot swapping of boards on network devices while powered on, generally results in the following situations in actual applications:

[0028] 1) Hot-swap of boards with the same model: This type of hot-swap of boards usually occurs when the original board is damaged, or when the board needs to be swapped out for other reasons. The replacement board is of the same model as the original board and is an identical board. This type of hot-swap of boards requires that the configuration of the board remain unchanged.

[0029] 2) Hot-swapping of boards with the same number of ports (the port types may be different): For this type of board, since the number of ports of the new board is the same as that of the original board, the service type configuration will not change after hot-swapping, but the port configuration may change due to the difference in board types (for example, pulling out an optical port board and inserting an electrical port board, etc.);

[0030] 3) Hot-swapping of completely different boards: This situation means that the board is completely changed, and the unplugged and inserted boards are completely inconsistent. At this time, the service and port configuration may change.

[0031] In the related technology, there is good support for the rapid configuration recovery of completely identical boards (because their configurations remain completely unchanged); there is also certain support for hot-swapping of boards with the same number of ports, but changes in port configurations are often not supported, requiring manual supplementary configuration; and there is basically no rapid and effective support for hot-swapping of completely different boards, which require complete reconfiguration.

[0032] Based on this, the embodiment of the present application provides a board configuration method, an electronic device and a computer-readable storage medium, which are intended to achieve rapid configuration recovery of hot-swappable boards, especially for the service recovery of mixed-insertion boards, which will provide fast and effective support, and finally achieve the effect that the board configuration follows the board type. In the board configuration method provided in the embodiment of the present application, a slot number can be bound to multiple board types, a configuration file corresponds to a board type and a slot number, and a configuration file library can store multiple independent port configuration files, which realizes a one-to-one correspondence between the configuration file and the slot number and board type combination, so that the board of the electronic device can not only support mixed insertion of various types of boards when hot-plugging, but also in the process of mixed insertion, the recovery of the configuration will not be confused and cause adverse effects due to the change of the board type of the inserted board, which can accelerate the hot-plug service recovery speed of the electronic device in actual use, and improve the performance and maintainability of the electronic device.

[0033] The board configuration method, electronic device and computer-readable storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the board configuration method in the embodiments of the present application is described.

[0034] Reference Figure 1 , Figure 1A schematic diagram of a process flow of a board configuration method provided in an embodiment of the present application, the board configuration method can be applied to electronic devices, such as Figure 1 As shown, the board configuration method provided in this embodiment includes steps S10 to S40.

[0035] Step S10, in response to the current board being inserted into the current board slot, obtaining a target board type of the current board and a target slot number of the current board slot;

[0036] It should be noted that, in the present embodiment, the executing subject is an electronic device, and a number of board card slots are preset on the electronic device. The electronic device will dynamically monitor the working status of each board card slot, that is, detect whether a board card is inserted into the board card slot. When a board card is detected to be inserted into the board card slot at the current moment, the board card can be regarded as the current board card, and the board card slot can be regarded as the current board card slot, and then the position of the current board card slot where the board card insertion event occurs is located and its target slot number is obtained, and at the same time, the target board card type of the current board card inserted into the current board card slot is obtained.

[0037] As an example, the execution subject in this embodiment may be a network device such as a switch or a router.

[0038] As an example, the target slot number of this embodiment may be slot 1, slot 2, slot 4, etc.

[0039] As an example, the target board type in this embodiment may be 8-port 10G electrical, 8-port 10G optical, 4-port 40G optical, etc.

[0040] Step S20, searching whether there is a designated configuration file in a configuration file library according to the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of the port configuration files includes configuration data corresponding to a board type and a slot number, and the designated configuration file is a port configuration file corresponding to the target board type and the target slot number;

[0041] It should be noted that in the related art, there is generally only one configuration file in a network device, which saves all the configurations of the network device. Therefore, when processing hot-plugging of boards, the configuration can be restored very quickly for boards that are exactly the same; and for boards with the same number of ports, the port-related configuration can be restored; but for boards of completely different types, a more chaotic situation will occur when restoring the configuration, and it may be completely impossible to restore it, or it may be possible to restore the configuration of some ports with the same number of ports as the original, and so on.

[0042] In order to overcome the defects in the related art, Figure 2In this embodiment, the configuration file that has only one copy in the related art is split into multiple copies, the global configuration file that is completely unrelated to the port configuration is saved separately, and the configuration file related to the port configuration is stored independently based on the one-to-one correspondence between the board type and the slot number, so that multiple port configuration files are stored in the configuration file library, such as Figure 2 Port Profile 1, Port Profile 2, Port Profile 3, Port Profile n, etc. are shown.

[0043] As an example, when an 8-port 10G electrical port board is inserted into slot 1, the target board type is the 8-port 10G electrical port board, the target slot number is slot 1, and the specified profile is port profile 1; when an 8-port 10G optical port board is inserted into slot 2, the target board type is the 8-port 10G optical port board, the target slot number is slot 2, and the specified profile is port profile 2; when a 4-port 40G optical port board is inserted into slot 2, the target board type is the 4-port 40G optical port board, the target slot number is slot 2, and the specified profile is port profile 3.

[0044] Step S30, when the specified configuration file does not exist in the configuration file library, initializing the configuration of the current board to generate the specified configuration file;

[0045] It can be understood that after searching from the configuration file library based on step S20, if the search result is that the specified configuration file does not exist in the configuration file library, it means that the current board is inserted into the current board slot for the first time, because the configuration file library does not exist a port configuration file that matches the target board type of the current board and the target slot number of the current board slot. In this case, the current board needs to be initialized and configured to generate the specified configuration file.

[0046] As an example, the step of initializing the configuration of the current board to generate the specified configuration file in step S30 may include:

[0047] Step S301, creating an initial configuration file based on the target board type and the target slot number;

[0048] Step S302, in response to writing the port configuration information of the current board, modifying the initial configuration file based on the port configuration information to generate the specified configuration file, the port configuration information and the specified configuration file include port number configuration information corresponding to the target board type and the target slot number.

[0049] It should be noted that, in the present embodiment, the initialization configuration is not an operation that the electronic device itself can independently complete. After the electronic device creates a new initial configuration file that matches the target board type and the target slot number, the user is still required to assist in inputting the port configuration information related to the current board and merging this part of the port configuration information into the initial configuration file. Only then can a designated configuration file containing the port number configuration information corresponding to the target board type and the target slot number be obtained.

[0050] As an example, the port number configuration information may include configuration information such as the number of ports required by the target board type and the port IP address.

[0051] Step S40, saving the specified configuration file to the configuration file library, so that after a board of the same type as the current board is inserted into the current board slot again, configuration data of the board of the same type as the current board is loaded based on the specified configuration file.

[0052] It can be understood that after completing the initialization configuration of the current board to obtain the specified configuration file, in order to ensure that the current board or a board of the same type as the current board can directly load the corresponding port configuration information based on the specified configuration file when it is inserted into the current board slot next time, avoid repeated configuration, and improve processing efficiency, it is necessary to save the specified configuration file to the configuration file library. In this way, the corresponding configuration data can be directly loaded based on the specified configuration file during the subsequent search process.

[0053] In some feasible embodiments, after step S20 in the above embodiments, the board configuration method may further include:

[0054] Step A30: if the specified configuration file exists in the configuration file library, load the configuration data of the current board based on the specified configuration file.

[0055] It can be understood that the search result obtained after searching from the configuration file library based on step S20 includes the situation where the specified configuration file is not found corresponding to the embodiment described in the above step S30, and the situation where the specified configuration file is found corresponding to the present embodiment. In the case where the specified configuration file is found, it means that the board type corresponding to the current board is not the first time to be inserted into the current board slot, that is, the newly inserted board is exactly the same as the boss card. It is only necessary to generate the configuration data of the current board based on the specified configuration file corresponding to the board type and slot number, so that the current board can be normally configured for use on the electronic device.

[0056] In some feasible embodiments, the board configuration method may further include:

[0057] Step S50, in response to the current board being pulled out of the current board slot, updating a port configuration file corresponding to the target board type and the target slot number.

[0058] In the present embodiment, for the hot-pull stage of all boards, the configuration information of the boards must be forcibly written into the corresponding port configuration files, regardless of whether the user has executed the instruction to write the configuration files at this time, to ensure that the port configuration files related to the boards are the latest configurations during the hot-pull. At this time, the port-related configuration information stored in the port configuration files is not only the configuration information under the port configuration mode, but also includes all the configuration information related to the ports under the global configuration mode, so that it can be ensured that when the configuration is quickly restored, there will be no configuration loss if there is the business information of the global configuration.

[0059] As an example, while updating the port configuration file, in order to avoid invalid cache occupation, the configuration data currently configured in the electronic device and related to the unplugged board will be cleared.

[0060] In some feasible embodiments, the board configuration method may further include:

[0061] In response to a configuration information display instruction, the slot number of the board slot into which the board is currently inserted and the board type of the board currently inserted into the board slot are used as indexes to be displayed; based on the indexes to be displayed, a configuration file to be displayed is searched from the configuration file library; and in step Z, the configuration information contained in the configuration file to be displayed is output.

[0062] It should be noted that, in actual use, the user may need to view the current configuration information of the electronic device. In the present embodiment, when the device configuration information needs to be displayed, only the configuration information related to all currently valid boards is displayed, and it is combined with the configuration information unrelated to the device port to display a complete device configuration information. That is to say, the information contained in all the configuration files in the configuration file library will not be displayed. Only the information contained in the global configuration file of the electronic device and the information of the port configuration file corresponding to the board type and slot number of the currently working board are integrated and displayed to the user for viewing.

[0063] As an example, see Figure 2 , when an 8-port 10G electrical port board is inserted in slot 1, the index to be displayed is used to search for port profile 1.

[0064] As an example, in this embodiment, when the device card is online, the device is configured and loaded normally, and the configuration file is saved. At this time, the configuration file is stored as a configuration related to the device itself and a configuration related to the port. The configuration file related to the port can be organized in a management method of card slot number + card type, that is, the configuration file of the corresponding type of the card is saved in each card slot number. When the card is online, the slot and card type of the card are recorded, and the relevant card configuration related to it is saved. In this way, when the board is hot-plugged, it can be judged and processed according to the situation of the newly inserted board. The basic processing principles for judgment and processing are as follows: 1. If the newly inserted board is exactly the same as the boss card, the original board slot + board type configuration file is directly used for loading; 2. If the newly inserted board is inconsistent with the boss card type (as long as the model is inconsistent, it is considered inconsistent, and there is no need to consider whether the number of ports is consistent with the boss card), then find out whether there is a configuration file of the board slot + board type in the configuration file library. If it does not exist, create this configuration file, and create and save the relevant user configuration. If the configuration file exists, use the found configuration file to configure the board. The above can complete the processing of hot-plug configuration fast recovery of all boards. When any board is hot-plugged, the configuration information of this board is formed. When a new board is inserted, the relevant configuration of this board is restored in the configuration file library. All configurations only need to be initialized once when a new board is inserted for the first time, and then the port can be hot-plugged at any time.

[0065] The present embodiment provides a board configuration method, in which, after receiving information that a current board is inserted into a current board slot, the electronic device first obtains a target board type of the current board and a target slot number of the current board slot; then searches a configuration file library for a specified configuration file based on the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each port configuration file includes configuration data corresponding to a board type and a slot number, and the specified configuration file is a port configuration file corresponding to the target board type and the target slot number; if the specified configuration file does not exist in the configuration file library, it means that the current board is inserted into the current board slot for the first time, and therefore the current board needs to be initialized and configured to generate the specified configuration file; then, the specified configuration file is saved to the configuration file library, so that after a board with the same board type as the target board type is inserted into the current board slot again, the configuration data corresponding to the target board type and the target slot number is loaded based on the specified configuration file, thereby realizing rapid configuration recovery of the board.

[0066] In the board configuration method provided in the embodiment of the present application, one slot number can be bound to multiple board types, one configuration file corresponds to one board type and a slot number, and multiple independent port configuration files can be stored in the configuration file library, thereby realizing a one-to-one correspondence between the configuration file and the slot number and board type combination. As a result, when the boards of electronic devices are hot-plugged, not only can the mixed insertion of various types of boards be supported, but also during the mixed insertion process, the recovery of the configuration will not be confused or have adverse effects due to changes in the type of the inserted boards. In actual use, the hot-plug service recovery speed of the electronic equipment can be accelerated, and the performance and maintainability of the electronic equipment can be improved.

[0067] Reference Figure 3 In another embodiment, the configuration file library involved in the above embodiments may further include: a port number configuration file, wherein the port number configuration file includes general port number configuration information adapted to the maximum number of ports corresponding to the current slot number;

[0068] Before the above step S20, the board configuration method may further include:

[0069] Step S11, preloading the current board based on the port number configuration file.

[0070] As an example, the above step S11 may include:

[0071] Step S110, determining the number of ports of the current board according to the target board type;

[0072] Step S111 : selecting part of the port number configuration information that matches the number of ports of the current board from the general port number configuration information to preload the current board.

[0073] As an example, the step of initializing the configuration of the current board to generate the specified configuration file in the above step S30 may include:

[0074] Creating an initial configuration file based on the target board type and the target slot number;

[0075] In response to writing the difference configuration information of the current board, the initial configuration file is modified based on the difference configuration information to generate the specified configuration file, and the difference configuration information and the specified configuration file do not include the port number configuration information corresponding to the target board type and the target slot number.

[0076] It can be understood that when the port number related configuration information has been uniformly saved in an independent port number configuration file, the user only needs to enter the configuration information related to the port type of the current board, that is, the difference configuration information, such as optical port board, electrical port board and other information, and the specified configuration file generated in this embodiment no longer contains the port number configuration information.

[0077] As an example, for the case where 8-port 10G optical port card board 2 is hot-plugged and offline: 1) the device has generated configuration information, and the complete configuration information includes global configuration information, port number related configuration information (2-1 to 2-8 port configuration information is related to board 2) and port attributes based on 8-port 10G optical port card board 2 and other configuration information; 2) 8-port 10G optical port card board 2 is hot-plugged and offline; 3) after the board is offline and is sensed by the system, the system saves the port number related configuration information (2-1 to 2-8 port configuration information), and saves the port attribute related information of this 8-port 10G optical port card, and saves it in the slot 2+8-port 10G optical port card position in the configuration file library.

[0078] As an example, for the case where the 4-port 40G optical port card 2 is hot-plugged and put online: 1) The device determines the type of the online card, which is a 4-port 40G optical port card, and the online slot is slot 2; 2) The device searches for the port number related configuration information. Since the newly online card is a 4-port card, only the port configuration information 2-1 to 2-4 of the port number related configuration information is extracted and sent to the newly online 4-port 40G optical port card; 3) The device searches for the slot 2+4 port 40G optical port configuration information. If it is found, this configuration information is directly used to configure the newly online card. If it is not found, a new slot 2+4 port 40G optical port configuration file is generated, waiting for the configuration to be sent by the network management or user, and the configuration is saved.

[0079] The above is the entire process of using a series of configuration files to form a quick recovery and distribution of the configuration when the board is hot-swapped. Through this process, it is possible to avoid multiple configurations of the board, and different configuration files corresponding to different types of boards in each slot can be formed during use, so that the configuration of the board hot-swapped can be quickly and accurately restored.

[0080] This embodiment provides a board configuration method. On the basis of the above embodiment, the configuration file library of this embodiment can also include a port number configuration file for storing port number configuration information, and a separate configuration information is saved for the port number related configuration. All port number related configurations can also be saved and updated as the board is hot-plugged, and the port type related configuration information is saved according to the board slot number + board type. Since the configuration amount of the port type related configuration information is relatively small, that is, when the user inserts a new board, the port number related configuration information file is first used to restore the configuration of the new board, and then the board slot number + board type configuration information in the configuration information library is queried to restore the port type related configuration information, which can minimize the user's configuration input and reduce the configuration difficulty.

[0081] In addition, the present application also provides a board configuration device, referring to Figure 4 , Figure 4 A schematic diagram of a board configuration device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, in this embodiment, the board configuration device includes: an acquisition module 100, a search module 200, a configuration module 300 and a storage module 400.

[0082] The acquisition module 100 is used for acquiring the target board type of the current board and the target slot number of the current board slot in response to the current board being inserted into the current board slot;

[0083] The search module 200 is used to search whether there is a specified configuration file in the configuration file library according to the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of which includes configuration data corresponding to a board type and a slot number, and the specified configuration file is a port configuration file corresponding to the target board type and the target slot number;

[0084] The configuration module 300 is used to initialize the configuration of the current board to generate the specified configuration file when the specified configuration file does not exist in the configuration file library;

[0085] The storage module 400 is used to save the specified configuration file to the configuration file library, so that after a board card of the same board type as the current board card is inserted into the current board card slot again, the configuration data of the board card of the same board type as the current board card can be loaded based on the specified configuration file.

[0086] The board configuration device provided in this embodiment and the board configuration method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to any of the above embodiments, and this embodiment has the same beneficial effects as executing the board configuration method.

[0087] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0088] In addition, an embodiment of the present application also provides an electronic device, and the above-mentioned board card configuration method applied to the electronic device can be executed by a board card configuration device, and the board card configuration device can be implemented by software and / or hardware and integrated in the electronic device. The electronic device can be a network device such as a switch or a router.

[0089] Reference Figure 5 , Figure 5 The hardware structure diagram of an electronic device provided in one embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0090] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Figure 5As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a computer program.

[0091] exist Figure 5 In the electronic device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in this embodiment can be set in the electronic device, and the electronic device calls the computer program stored in the memory 1005 through the processor 1001, and executes the board configuration method applied to the electronic device provided in any of the above embodiments.

[0092] The electronic device proposed in this embodiment and the board card configuration method applied to the electronic device proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to any of the above embodiments, and this embodiment has the same beneficial effects as executing the board card configuration method.

[0093] In addition, an embodiment of the present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the board configuration method provided in any of the above embodiments is implemented.

[0094] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0095] The above is a specific description of the preferred implementation of the embodiments of the present application, but the embodiments of the present application are not limited to the above-mentioned implementation methods. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the embodiments of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the embodiments of the present application.

Claims

1. A board configuration method, characterized in that: The board configuration method comprises: In response to the current board being inserted into the current board slot, acquiring a target board type of the current board and a target slot number of the current board slot; Searching whether there is a designated configuration file in a configuration file library according to the target board type and the target slot number, wherein the configuration file library includes independently stored port configuration files, each of the port configuration files includes configuration data corresponding to a board type and a slot number, and the designated configuration file is a port configuration file corresponding to the target board type and the target slot number; If the specified configuration file does not exist in the configuration file library, initializing the configuration of the current board to generate the specified configuration file; The specified configuration file is saved to the configuration file library, so that after a board card of the same type as the target board card is inserted into the current board card slot again, configuration data corresponding to the target board card type and the target slot number is loaded based on the specified configuration file.

2. The board configuration method according to claim 1, characterized in that: The step of initializing the configuration of the current board to generate the specified configuration file includes: Creating an initial configuration file based on the target board type and the target slot number; In response to writing the port configuration information of the current board, the initial configuration file is modified based on the port configuration information to generate the specified configuration file, and the port configuration information and the specified configuration file include port number configuration information corresponding to the target board type and the target slot number.

3. The board configuration method according to claim 1, characterized in that: The configuration file library also includes: a port number configuration file, wherein the port number configuration file includes general port number configuration information adapted to the maximum number of ports corresponding to the current slot number; Before the step of searching the configuration file library for a specified configuration file according to the target board type and the target slot number, the board configuration method further includes: The current board is preloaded based on the port number configuration file.

4. The board configuration method according to claim 3, characterized in that: The step of preloading the current board based on the port number configuration file includes: Determine the number of ports of the current board according to the target board type; Part of the port number configuration information matching the number of ports of the current board is selected from the general port number configuration information to preload the current board.

5. The board configuration method according to claim 3, characterized in that: The step of initializing the configuration of the current board to generate the specified configuration file includes: Creating an initial configuration file based on the target board type and the target slot number; In response to writing the difference configuration information of the current board, the initial configuration file is modified based on the difference configuration information to generate the specified configuration file, and the difference configuration information and the specified configuration file do not include the port number configuration information corresponding to the target board type and the target slot number.

6. The board configuration method according to any one of claims 1 to 5, characterized in that: After the step of searching the configuration file library for a specified configuration file according to the target board type and the target slot number, the board configuration method further includes: In the case that the designated configuration file exists in the configuration file library, the configuration data of the current board is loaded based on the designated configuration file.

7. The board configuration method according to claim 1, characterized in that: The board configuration method also includes: In response to the current board being pulled out of the current board slot, a port configuration file corresponding to the target board type and the target slot number is updated.

8. The board configuration method according to claim 1, characterized in that: The board configuration method also includes: In response to the configuration information display instruction, the slot number of the board slot into which the board is currently inserted and the board type of the board currently inserted into the board slot are used as indexes to be displayed; Searching for a configuration file to be displayed from the configuration file library based on the to-be-displayed index; Output the configuration information contained in the configuration file to be displayed.

9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the board configuration method according to any one of claims 1 to 8 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the board configuration method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Signal machine configuration updating method, device and system

    CN119728420A