Board configuration method, electronic device, and computer readable storage medium
By independently storing port configuration files in the configuration file library, and generating and saving configuration files based on board card types and slot numbers, the problem of configuration errors caused by mixed insertion of boards is solved, and rapid recovery of board configurations and equipment performance improvement are achieved. .
Patent Information
- Application Number
- PCT/CN2023/141640
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2023-12-25
- Publication Date
- 2024-10-31
AI Technical Summary
During the board hot-swapping process, different types of boards are mixed due to operator errors, resulting in incorrect board configuration information and affecting the normal use of the equipment. It is difficult for existing technology to quickly and effectively support completely different board hot-swapping situations. , requiring manual reconfiguration.
By independently storing port configuration files in the configuration file library, and generating and saving specified configuration files according to one-to-one correspondence between board types and slot numbers, rapid configuration recovery of boards is achieved, and mixed insertion of different types of boards is supported. It accelerates service recovery during hot swapping and improves equipment performance and ease of maintenance.
It realizes the rapid recovery of board configuration, supports the mixed insertion of different types of boards, reduces the need for manual configuration, and improves the recovery speed of hot-swappable services and the performance of equipment.
Smart Images

Figure CN2023141640_31102024_PF_FP_ABST
Abstract
Description
Board configuration method, electronic device, and computer-readable storage medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 202310488801.6 filed on April 28, 2023, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] 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
[0004] Currently, hot-plugging (or Hot Swap) technology is widely used to hot-swap cards on network devices. However, during the actual use of hot-plugging cards, different types of cards may be mixed due to operator errors, which may lead to incorrect card configuration information and affect the normal use of the equipment.
[0005] Summary of the Invention
[0006] 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 the normal use of the device when boards are mixed.
[0007] To achieve the above objectives, an embodiment of the present application provides a board configuration method, the board configuration method comprising:
[0008] 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;
[0009] Searching, according to the target board type and the target slot number, whether a specified configuration file exists in a configuration file library, 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 the port configuration file corresponding to the target board type and the target slot number;
[0010] 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;
[0011] 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.
[0012] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a board configuration device, the board configuration device comprising:
[0013] an acquisition module, configured to acquire a target board type of the current board and a target slot number of the current board slot in response to a current board being inserted into the current board slot;
[0014] a search module, the search module being configured to search 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 the port configuration files including configuration data corresponding to a board type and a slot number, and the specified configuration file being the port configuration file corresponding to the target board type and the target slot number;
[0015] A configuration module, configured to initialize the configuration of the current board to generate the specified configuration file if the specified configuration file does not exist in the configuration file library;
[0016] A storage module is used to save the specified configuration file to the configuration file library, so that after a board card of the same 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 type as the current board card is loaded based on the specified configuration file.
[0017] 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 capable of running on the processor, and when the computer program is executed by the processor, the board configuration method as described above is implemented.
[0018] 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. When the computer program is executed by a processor, the board configuration method described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. 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 any creative work.
[0020] FIG1 is a schematic diagram of a flow chart of a board configuration method provided in an embodiment of the present application;
[0021] FIG2 is a schematic diagram of an application scenario of a board configuration method provided by an embodiment of the present application;
[0022] FIG3 is a schematic diagram of an application scenario of a board configuration method provided by another embodiment of the present application;
[0023] FIG4 is a schematic structural diagram of a board configuration device provided in one embodiment of the present application;
[0024] FIG5 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation to facilitate 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 obstructing the description of the embodiments of the present application.
[0026] It should be noted that although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the flowcharts. The terms "first," "second," and the like in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0027] It should also be understood that references to "one embodiment" or "some embodiments" described in the description 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 phrases "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 rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0028] Generally speaking, hot swapping refers to hot swapping while the system is powered on. The hot swapping function allows users to remove and replace damaged hard drives, power supplies, or card components without shutting down the system or cutting off the power, thereby improving the system's ability to recover from disasters, scalability, and flexibility. For example, some disk mirroring systems for high-end applications offer hot swapping of disks. Card hot swapping technology, which allows hot swapping of cards on network equipment, often results in the following situations in actual use:
[0029] 1) Hot-swappable boards with identical models: This type of hot-swappable board usually occurs when the original board is damaged, or when the board needs to be swapped out for other reasons. The replacement board must be of the same model as the original board and is therefore identical. This type of hot-swappable board requires that the configuration of the board remain unchanged.
[0030] 2) Hot-swapping of boards with the same number of ports (port types may be different): For this type of board, since the number of ports on the new board is the same as the original board, the service type configuration will not change after hot-swapping. However, the port configuration may change due to the different board types (for example, removing an optical board and inserting an electrical board).
[0031] 3) Hot-swapping of completely different boards: This situation involves completely changing the boards. The boards removed and inserted are completely different, and both the service and port configurations may change.
[0032] 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 requires complete reconfiguration.
[0033] 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 business recovery of mixed-insertion boards, which will provide fast and effective support, and ultimately achieve the effect of the board configuration following 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, thereby enabling the electronic device's board to not only support mixed insertion of various types of boards during hot plugging, but also, during the mixed insertion process, the configuration recovery will not be confused or adversely affected due to changes in the type of the inserted board. In actual use, it can accelerate the hot-plug business recovery speed of the electronic device and improve the performance and maintainability of the electronic device.
[0034] The board configuration method, electronic device, and computer-readable storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the board configuration method in the embodiments of the present application is described.
[0035] Refer to Figure 1, which is a flow chart of a board configuration method provided in an embodiment of the present application. The board configuration method can be applied to electronic devices. As shown in Figure 1, the board configuration method provided in this embodiment includes steps S10 to S40.
[0036] 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;
[0037] In this embodiment, the execution subject is an electronic device, and a number of board slots are preset on the electronic device. The electronic device will dynamically monitor the working status of each board slot, that is, detect whether a board is inserted into the board slot. When a board is detected to be inserted into the board slot at the current moment, the board can be regarded as the current board, and the board slot can be regarded as the current board slot. Then, the position of the current board slot where the board insertion event occurs is located and its target slot number is obtained, and at the same time, the target board type of the current board inserted into the current board slot is obtained.
[0038] As an example, the execution subject in this embodiment may be a network device such as a switch or a router.
[0039] As an example, the target slot number of this embodiment may be slot 1, slot 2, slot 4, etc.
[0040] As an example, the target board type in this embodiment may be 8-port 10G electrical, 8-port 10G optical, 4-port 40G optical, and so on.
[0041] Step S20, searching a configuration file library for a designated 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 designated configuration file is a port configuration file corresponding to the target board type and the target slot number;
[0042] In the related art, there is generally only one configuration file in a network device, which stores all the configurations of the network device. Therefore, when processing hot-plugging of boards, the configuration can be restored very quickly for completely identical boards; and for boards with the same number of ports, the port-related configuration can be restored; but for completely different types of boards, 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.
[0043] In order to overcome the defects existing in the related art, referring to Figure 2, in this embodiment, the configuration file that is only one 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 port configuration file 1, port configuration file 2, port configuration file 3, port configuration file n, etc. as shown in Figure 2.
[0044] For example, if 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. If 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. If 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.
[0045] 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;
[0046] After searching 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.
[0047] As an example, the step of initializing the configuration of the current board to generate the specified configuration file in step S30 may include:
[0048] Step S301, creating an initial configuration file based on the target board type and the target slot number;
[0049] 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.
[0050] In this embodiment, the initialization configuration is not an operation that the electronic device itself can complete independently. After the electronic device creates a new initial configuration file that matches the target board type and target slot number, the user is required to assist in entering the port configuration information related to the current board and merge this part of the port configuration information into the initial configuration file. Only then can a specified configuration file containing the port number configuration information corresponding to the target board type and target slot number be obtained.
[0051] 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 addresses.
[0052] 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.
[0053] After completing the initialization configuration of the current board and obtaining 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, avoiding repeated configuration and improving 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.
[0054] In some feasible embodiments, after step S20 in the above embodiments, the board configuration method may further include:
[0055] 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.
[0056] The search results obtained after searching from the configuration file library based on step S20 include the case where the specified configuration file is not found corresponding to the embodiment described in the above step S30, and the case where the specified configuration file is found corresponding to this 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.
[0057] In some feasible embodiments, the board configuration method may further include:
[0058] 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.
[0059] In this embodiment, during the hot-pull phase of all boards, the board's configuration information must be forcibly written into the corresponding port configuration file, regardless of whether the user has executed the write configuration file instruction. This ensures that the board's port configuration file is the latest configuration at the time of hot-pull. The port-related configuration information stored in the port configuration file includes not only the configuration information in the port configuration mode but also all port-related configuration information in the global configuration mode. This ensures that even during a fast configuration recovery, any globally configured service information will not be lost.
[0060] As an example, when updating the port configuration file, in order to avoid invalid cache occupation, the configuration data related to the unplugged board card currently configured in the electronic device will be cleared.
[0061] In some feasible embodiments, the board configuration method may further include:
[0062] 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; a configuration file to be displayed is searched from the configuration file library based on the index to be displayed; and in step Z, the configuration information contained in the configuration file to be displayed is output.
[0063] During actual use, users may need to view the current configuration information of electronic devices. In this 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 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.
[0064] As an example, referring to FIG. 2 , when an 8-port 10G electrical port board is inserted into slot 1, the index to be displayed is used to search for port configuration file 1 .
[0065] As an example, in this embodiment, when a device card goes online, the device is configured and loaded normally, and the configuration file is saved. At this point, the configuration file is stored as both device-specific and port-specific configurations. Port-specific configuration files can be organized using a card slot number + card type management method, with the corresponding card type configuration file stored for each card slot. When a card goes online, its slot location and card type are recorded, and the associated card configuration is saved. In this way, when a board is hot-plugged, the system can judge and process the situation of the newly inserted board according to the situation of the newly inserted board. The basic principles of 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 to load it; 2. If the newly inserted board is inconsistent with the boss card type (as long as the model is inconsistent, it is considered inconsistent. There is no need to consider whether the number of ports is consistent with the boss card), then the configuration file library is searched to see if there is a configuration file for the board slot + board type. If it does not exist, a new configuration file is created and the relevant user configuration is created and saved. If a configuration file exists, the found configuration file is used to configure the board. The above process can complete the fast recovery of hot-plug configurations for all boards. When any board is hot-plugged, the configuration information of this board is generated. 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. After that, the ports can be hot-plugged at any time.
[0066] This embodiment provides a board configuration method. In this 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 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 indicates 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 when a board of the same board type as the target board 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.
[0067] 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 the electronic device 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 device can be accelerated, and the performance and maintainability of the electronic device can be improved.
[0068] 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;
[0069] Before the above step S20, the board configuration method may further include:
[0070] Step S11: preload the current board based on the port number configuration file.
[0071] As an example, the above step S11 may include:
[0072] Step S110, determining the number of ports of the current board according to the target board type;
[0073] 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 and preloading the current board.
[0074] As an example, the step of initializing the configuration of the current board to generate the specified configuration file in step S30 may include:
[0075] Creating an initial configuration file based on the target board type and the target slot number;
[0076] 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.
[0077] 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.
[0078] 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 configuration information such as port attributes based on 8-port 10G optical port card board 2; 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 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.
[0079] As an example, consider the hot-swapped 4-port 40G optical port card 2: 1) The device determines the card type and finds it is a 4-port 40G optical port card, located in slot 2. 2) The device searches for port number-related configuration information. Since the newly added card is a 4-port card, only the port number configuration information for ports 2-1 through 2-4 is extracted and delivered to the newly added 4-port 40G optical port card. 3) The device searches for the 40G optical port configuration information for slots 2 and 4. If the configuration information is found, the newly added card is configured using this information. If not, a new 40G optical port configuration file for slots 2 and 4 is generated, waiting for the network management or user to deliver the configuration information, and the configuration is saved.
[0080] The above completes the entire process of using a series of configuration files to quickly restore and issue the configuration when the board is hot-swapped. Through this process, you can avoid configuring the board multiple times and also form different configuration files corresponding to different types of boards in each slot during use, so that the hot-swapped board configuration can be quickly and accurately restored.
[0081] This embodiment provides a board configuration method. Based on the above embodiment, the configuration file library of this embodiment may further include a port number configuration file for storing port number configuration information. Port number-related configurations are stored separately, and all port number-related configurations can be saved and updated as boards are hot-plugged. Port type-related configuration information is stored based on the board slot number and board type. Because the amount of port type-related configuration information is relatively small, when a user inserts a new board, the new board's configuration is first restored using the port number-related configuration information file. The board slot number and board type configuration information in the configuration information library are then queried to restore the port type-related configuration information. This minimizes user configuration input and reduces configuration difficulty.
[0082] In addition, an embodiment of the present application also provides a board configuration device. Referring to Figure 4, Figure 4 is a structural schematic diagram of a board configuration device provided by an embodiment of the present application. As shown in Figure 4, 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.
[0083] The acquisition module 100 acquires 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;
[0084] The search module 200 is used to search for 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 which includes configuration data corresponding to a board type and a slot number, and the specified configuration file is the port configuration file corresponding to the target board type and the target slot number;
[0085] The configuration module 300 is used to initialize the configuration of the current board to generate the specified configuration file if the specified configuration file does not exist in the configuration file library;
[0086] 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 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 type as the current board card is loaded based on the specified configuration file.
[0087] The board configuration device provided in this embodiment and the board configuration method provided in the above embodiment belong to the same inventive concept. 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.
[0088] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0089] In addition, an embodiment of the present application also provides an electronic device, and the above-mentioned board configuration method applied to the electronic device can be executed by a board configuration device, and the board configuration device can be implemented by software and / or hardware and integrated into the electronic device. The electronic device can be a network device such as a switch and a router.
[0090] Referring to Figure 5, Figure 5 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. As shown in Figure 5, 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 user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may 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.
[0091] Those skilled in the art will appreciate that the structure shown in FIG5 does not limit the electronic device and may include more or fewer components than shown, or combine certain components, or arrange the components differently. As shown in FIG5 , 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.
[0092] In the electronic device shown in Figure 5, 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.
[0093] 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.
[0094] In addition, an embodiment of the present application also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the board configuration method provided in any of the above embodiments is implemented.
[0095] Those skilled in the art will appreciate that all or some of the steps and systems in the method disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include computer storage media (or non-transitory media) and communication media (or temporary media). As known to those skilled in the art, the term computer storage media is included in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data) and is volatile and non-volatile, removable, and non-removable. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory, or other memory technology, 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 can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, 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.
[0096] The above is a specific description of the optional 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 art 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, in, 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, in, 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, in, 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 as claimed in claim 3, in, 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 as claimed in claim 3, in, 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, in, 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, in, 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, in, 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, in, 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, in, 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
Patent Citations
Method for processing configuration information of hot plug board card, and network communication device
CN103346898A
A system and a method for multi-board auto-configuration and task auto-distribution
CN109165181A
Self-adaptive configuration method and device of server, equipment and storage medium
CN111258667A
Slot state control method, intelligent terminal and storage medium
CN111290982A
Method and device for determining matching degree of board card and slot position, equipment and storage medium
CN115113943A
Cited By
Electronic device, data processing method, device, medium and program product
CN120578624A
