Network equipment name determination method and device, equipment and storage medium

By extracting and parsing the target interface data, network device names are generated based on device naming rules, which solves the problem of inaccurate naming when the operating system is not installed, and flexible and efficient device name generation is achieved.

CN119854260APending Publication Date: 2025-04-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411698599.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-18

Smart Images

  • Figure CN119854260A_ABST
    Figure CN119854260A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a network equipment name determination method and device, equipment and a storage medium, and the method comprises the steps: obtaining target interface data, carrying out the field extraction of the target interface data, and obtaining target field data; based on a device naming rule, performing data analysis and matching on the target field data, and determining a device type and device parameters; and based on the equipment type and the equipment parameters, filling the equipment name model to obtain an equipment name. Thus, the target field data is obtained by performing collection and field extraction on the target interface data, the device type and the device parameter are determined by performing data analysis and matching on the target field data based on the device naming rule, and the device name model is filled based on the device type and the device parameter to obtain the device name. Therefore, the name of the network equipment can be directly generated through the equipment naming rule without installing an operating system, the project implementation period is shortened, and the working efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for determining a network device name. Background Art

[0002] In the past, network interfaces on Linux were named in a way similar to eth0 and eth1, but since modern computers usually have multiple network interfaces, this naming method is no longer accurate and flexible. To solve this problem, Linux introduced a predictive network interface naming scheme; this scheme assigns a unique name to each network interface based on the identifiable attributes of the device, improving the accuracy and flexibility of naming, but it also means that you need to install the operating system first before you can know the name of the network device. Summary of the invention

[0003] In view of this, the present invention provides a method, apparatus, device and storage medium for determining a network device name to solve the problem that the name of the network device cannot be determined when the operating system is not installed.

[0004] In a first aspect, the present invention provides a method for determining a network device name, the method comprising:

[0005] Obtain target interface data, and perform field extraction on the target interface data to obtain target field data;

[0006] Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters;

[0007] Based on the device type and device parameters, the device name model is filled to obtain the device name.

[0008] In an optional implementation, performing field extraction on the target interface data to obtain target field data includes:

[0009] Filter and classify the target interface data to obtain device data;

[0010] Perform field extraction on device data to obtain target field data.

[0011] In an optional implementation, based on the device naming rule, data parsing and matching are performed on the target field data to determine the device type and device parameters, including:

[0012] Parse the target field data to obtain type data and parameter data in the target field data;

[0013] Matching the type data with the preset device type to determine the device type corresponding to the type data;

[0014] Based on the preset segmentation characters, the parameter data is segmented and extracted to obtain the device parameters corresponding to the parameter data.

[0015] In an optional implementation, the parameter data includes bus data, and the device parameters include bus numbers; based on a preset segmentation character, the parameter data is segmented and extracted to obtain device parameters corresponding to the parameter data, including:

[0016] Performing character string recognition on the bus data to determine the first character in the bus data;

[0017] Segment and extract the data after the first character in the bus data to obtain the bus number character corresponding to the bus data;

[0018] Remove leading zeros from the bus number characters to obtain the bus number.

[0019] In an optional implementation, the parameter data includes slot data, and the device parameter includes a slot number; based on a preset segmentation character, the parameter data is segmented and extracted to obtain the device parameter corresponding to the parameter data, including:

[0020] Performing character string recognition on the slot data to determine the second character in the slot data;

[0021] Segment and extract the data after the second character in the slot data to obtain the slot number character;

[0022] The slot number is obtained by removing leading zeros from the slot number characters.

[0023] In an optional implementation, the device name model is filled based on the device type and device parameters to obtain the device name, including:

[0024] Based on the device type, determine the device name model;

[0025] Fill the device parameters into the corresponding positions of the device name model to obtain the device name.

[0026] In an optional embodiment, the method further includes:

[0027] Classify and sort the target interface data to obtain the device sequence;

[0028] Based on the device sequence, a name suffix corresponding to each device name is generated, and the name suffix is ​​added to the end of the corresponding device name.

[0029] In a second aspect, the present invention provides a network device name determination device, the device comprising:

[0030] A field extraction module is used to obtain target interface data and perform field extraction on the target interface data to obtain target field data;

[0031] The data parsing module is used to parse and match the target field data based on the device naming rules to determine the device type and device parameters;

[0032] The model filling module is used to fill the device name model based on the device type and device parameters to obtain the device name.

[0033] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the network device name determination method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining a network device name according to the first aspect or any corresponding embodiment thereof.

[0035] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for determining a network device name according to the first aspect or any corresponding embodiment thereof.

[0036] The present invention provides a method for determining the name of a network device. The method collects target interface data and extracts fields to obtain target field data, performs data parsing and matching on the target field data based on device naming rules to determine the device type and device parameters, and fills the device name model based on the device type and device parameters to obtain the device name. Therefore, without the need to install an operating system, the name of the network device can be directly generated through the device naming rules, thereby shortening the project implementation cycle and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 is a flow chart of a method for determining a network device name according to an embodiment of the present invention;

[0039] Figure 2is a flow chart of another method for determining a network device name according to an embodiment of the present invention;

[0040] Figure 3 is a flow chart of another method for determining a network device name according to an embodiment of the present invention;

[0041] Figure 4 is a flow chart of another method for determining a network device name according to an embodiment of the present invention;

[0042] Figure 5 is a structural block diagram of a device for determining a network device name according to an embodiment of the present invention;

[0043] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0045] In the past, network interfaces on Linux were named in a way similar to eth0 and eth1, but since modern computers usually have multiple network interfaces, this naming method is no longer accurate and flexible. To solve this problem, Linux introduced a predictive network interface naming scheme; this scheme assigns a unique name to each network interface based on the identifiable attributes of the device, improving the accuracy and flexibility of naming, but it also means that you need to install the operating system first before you can know the name of the network device.

[0046] Based on this, an embodiment of the present invention provides a method for determining the name of a network device, which obtains target field data by collecting and extracting target interface data, performs data parsing and matching on the target field data based on device naming rules to determine the device type and device parameters, and fills the device name model based on the device type and device parameters to obtain the device name. In this way, the name of the network device can be directly generated according to the device naming rules without the need to install an operating system, thereby shortening the project implementation cycle and improving work efficiency.

[0047] According to an embodiment of the present invention, an embodiment of a method for determining a network device name is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0048] In this embodiment, a method for determining a network device name is provided, which can be used for computer devices, servers, etc. Figure 1 is a flow chart of a method for determining a network device name according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0049] Step S101, acquiring target interface data, and performing field extraction on the target interface data to obtain target field data.

[0050] In the embodiment of the present invention, the target interface data is obtained by collecting data related to the hardware in the server or computer device, which at least includes: onboard devices, MAC addresses, PCI, USB, package slots, firmware, BIOS, PCIe, ACPI interface labels and indexes, etc. The identifier field related to the device name in the target interface data is extracted to obtain the target field data.

[0051] In an optional implementation, the target interface data may include hardware data of multiple network devices. Field extraction is performed on the target interface data to obtain target field data of multiple network devices. The device names corresponding to the multiple network devices are determined simultaneously through the target field data of the multiple network devices, thereby improving working efficiency.

[0052] In an optional implementation, third-party tools such as ipmitool and lspci may be used to collect target interface data.

[0053] Step S102: Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters.

[0054] In an embodiment of the present invention, the device naming rule represents the rule for naming network devices based on the target interface data. The device naming rule sets a set of naming rules for various different types of devices, and flexibly adapts to the naming of network devices on various software and hardware platforms. Based on the device naming rule, the target field data is parsed to determine the data related to the device type and device parameters in the target field data, and the device type and device parameters corresponding to the target interface data are determined using the rules defined in the device naming rule. Among them, the device type represents the type of network device corresponding to the target interface data, such as onboard devices, PCI devices, etc.; the device parameters represent the index number, port number, address information and other data of the network device corresponding to the target interface data, which are specifically related to the device type of the network device.

[0055] In an optional implementation, if there are target field data of multiple network devices, the number of network devices is determined simultaneously to ensure that the number of device names finally determined is consistent with the number of network devices.

[0056] Step S103: Fill in the device name model based on the device type and device parameters to obtain the device name.

[0057] In the embodiment of the present invention, the device name model is a general model set according to the device naming rules, wherein different device types correspond to different device name models. The device name model uses an identifier to represent the part that needs to be filled, that is, the device type and device parameter part. When filling the device name model, the corresponding identifier position is filled to obtain the device name.

[0058] In this embodiment, a method for determining a network device name is provided, which can be used for computer devices, servers, etc. Figure 2 is a flow chart of another method for determining a network device name according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0059] Step S201, acquiring target interface data, and performing field extraction on the target interface data to obtain target field data.

[0060] Specifically, step S201 includes:

[0061] Step S2011, filtering and classifying the target interface data to obtain device data.

[0062] In the embodiment of the present invention, the target interface data is filtered and classified to select device data, wherein the device data at least includes: onboard device index number, valid MAC address, PCI geographic location, USB port number chain, network card expansion slot, network card firmware information, PCIe slot index number and other information.

[0063] Step S2012, extracting fields from device data to obtain target field data.

[0064] In an embodiment of the present invention, field extraction is performed on the device to extract valid identification fields therein, such as extracting a character string corresponding to an onboard device index number, extracting a character string corresponding to a valid MAC address, etc., to obtain target field data.

[0065] Step S202: Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0066] Step S203: Fill the device name model based on the device type and device parameters to obtain the device name. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0067] In this embodiment, a method for determining a network device name is provided, which can be used for computer devices, servers, etc. Figure 3 is a flowchart of another method for determining a network device name according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0068] Step S301, obtain target interface data, and perform field extraction on the target interface data to obtain target field data. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0069] Step S302: Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters.

[0070] Specifically, step S302 includes:

[0071] Step S3021, performing data parsing on the target field data to obtain type data and parameter data in the target field data.

[0072] In the embodiment of the present invention, the target field data is parsed to extract type data that can characterize the device type and parameter data that can characterize the device parameters. For example, the target field data is parsed to obtain type data of "Ethernet".

[0073] Step S3022: Match the type data with a preset device type to determine the device type corresponding to the type data.

[0074] In the embodiment of the present invention, each preset device type corresponds to different type data. The type data obtained by parsing is matched with the type data corresponding to each preset device type, and the preset device type that matches is used as the corresponding device type.

[0075] In an optional implementation, in order to improve the accuracy and precision of the determined device type, other information in the target field data can be combined when determining the device type, such as device parameters and device connection methods, etc., to further refine the device type. Taking the type data "Ethernet" as an example, if there is no slot data in the target field data, the device type is determined to be an integrated network card. If there is slot data in the target field data, the device type is determined to be a hot-swappable slot device. In the case where there is slot data in the target field data, it can be further refined according to the connection method. If the connection method is USB, the device type is determined to be a USB device. If the connection method is not USB, the device type is determined to be a physical slot device.

[0076] Step S3023, based on the preset segmentation characters, the parameter data is segmented and extracted to obtain the device parameters corresponding to the parameter data.

[0077] In the embodiment of the present invention, different parameter data have different preset segmentation characters. The preset segmentation characters in the parameter data are identified, and the parameter data are segmented based on the position of the preset segmentation characters in the parameter data, and the character data representing the device parameters are extracted, and then the character data is processed accordingly, such as removing the leading zeros therein, to obtain the final device parameters.

[0078] In an optional implementation, in order to improve the uniqueness of the device name, the device parameters may include a unique identifier of the device, such as a MAC address, a bus address, and the like. In this embodiment, taking the bus address as an example, the parameter data includes bus data, and the device parameters include a bus number. At this time, the process of segmenting and extracting the parameter data to obtain the device parameters is as follows: First, character string recognition is performed on the bus data to determine the first character in the bus data. For the bus data, the first character is ":". Then, the data after the first character in the bus data is segmented and extracted to obtain the bus number character corresponding to the bus data; the bus data is segmented based on the position of the first character in the bus data to obtain two parts of data, and the part of the data after the first character is used as the bus number character. Finally, the leading zeros in the bus number character are removed to obtain the bus number.

[0079] For example, if the bus data is 0000:05, the bus data is segmented based on the first character ":" to obtain the data "0000" before the first character and the data "05" after the first character. "05" is used as the bus number character, and the leading zero is removed to obtain the bus number "5".

[0080] In an optional implementation, for slot devices, such as physical slot devices and USB devices, in order to clarify the location of the device slot, the device parameters may include the slot number, and accordingly, the parameter data includes the slot data. At this time, the process of segmenting and extracting the parameter data to obtain the device parameters is as follows: First, character string recognition is performed on the slot data to determine the second character in the slot data. For the slot data, the second character is ".". Then, the data after the second character in the slot data is segmented and extracted to obtain the slot number character; the slot data is segmented based on the position of the second character in the slot data to obtain two parts of data, and the part of the data after the second character is used as the slot number character. Finally, the leading zeros in the slot number character are removed to obtain the slot number.

[0081] For example, if the slot data is 00.0, the slot data is segmented based on the second character "." to obtain the data "00" before the second character and the data "0" after the second character. "0" is used as the slot number character. Since it does not contain a leading zero, it can be used as the slot number, that is, the slot number is "0".

[0082] In an optional implementation, the above only uses the bus number and slot number as an example to explain the specific method of obtaining device parameters. In actual applications, the device parameters may also include more or fewer parameters, and the actual information is subject to the information contained in the parsed parameter data. For example, if the parameter data includes the port data of the device, the device parameters may also include port parameters, which are represented by function numbers and are not specifically limited here.

[0083] Step S303: Fill the device name model based on the device type and device parameters to obtain the device name. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0084] In this embodiment, a method for determining a network device name is provided, which can be used for computer devices, servers, etc. Figure 4 FIG. 1 is a flowchart of another method for determining a network device name according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:

[0085] Step S401, obtain target interface data, and perform field extraction on the target interface data to obtain target field data. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0086] Step S402: Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0087] Step S403: Fill in the device name model based on the device type and device parameters to obtain the device name.

[0088] Specifically, step S403 includes:

[0089] Step S4031, determine the device name model based on the device type.

[0090] In the embodiment of the present invention, different device types use different device name models. Therefore, the device name model corresponding to the determined device type is determined as the adopted device name model.

[0091] In an optional implementation, the device name model may adopt a structure of network name+device identifier.

[0092] Among them, the network name is related to the network type adopted by the network device, and can be determined based on the device type or type data, which includes the following three types: en, which represents Ethernet, and the corresponding device type includes "Ethernet", so the network name can be determined as en; wl, which represents local area network, and the corresponding device type includes "WLAN", so the network name can be determined as wl; ww, which represents wireless local area network, and the corresponding device type includes "WWAN", so the network name can be determined as ww.

[0093] The device identifier may include but is not limited to the following types. In specific use, the content contained in the device identifier may be adjusted according to the data contained in the target field data or type data and parameter data actually obtained. For example, if the obtained parameter data does not contain the function number, the device identifier may remove [f <function>]This part of the content:

[0094] o <index>,in, <index>Part of it is the onboard device index number;

[0095] s <slot> [f <function>][d<dev_id> ],in, <slot>part is the slot number, <function>Part is the function number,<dev_id> Number the device for the part;

[0096] x <mac>,in <mac>Part of it is the MAC address;

[0097] [P <domain> ]p <bus> s <slot> [f <function>][d<dev_id> ],in, <domain>The part is the PCI geographic location, which is used only when the PCI address is not 0. <bus>The bus number is part of the

[0098] Step S4032, fill the device parameters into the corresponding positions of the device name model to obtain the device name.

[0099] In the embodiment of the present invention, the device parameters are filled into the corresponding positions of the device name model corresponding to the device type. If there are multiple parameters in the device parameters, the multiple parameters are filled into the corresponding positions of the device name model respectively, thereby obtaining the device name.

[0100] In an optional implementation, if the acquired target interface data contains data of multiple network devices, then after obtaining the device name, the target interface data is classified and sorted to obtain a device order; based on the device order, a name suffix corresponding to each device name is generated, and the name suffix is ​​added to the end of the corresponding device name.

[0101] In an optional implementation, after the device name is obtained, the device name is sent to a console of a server or a computer device.

[0102] The method for determining the name of a network device provided in an embodiment of the present invention obtains target field data by collecting and extracting fields from target interface data, performs data parsing and matching on the target field data based on device naming rules to determine the device type and device parameters, and fills the device name model based on the device type and device parameters to obtain the device name. In this way, the name of the network device can be directly generated through the device naming rules without the need to install an operating system, thereby shortening the project implementation cycle and improving work efficiency.

[0103] In this embodiment, a network device name determination device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0104] This embodiment provides a device for determining a network device name, such as Figure 5 As shown, including:

[0105] The field extraction module 501 is used to obtain target interface data and perform field extraction on the target interface data to obtain target field data;

[0106] The data analysis module 502 is used to analyze and match the target field data based on the device naming rules to determine the device type and device parameters;

[0107] The model filling module 503 is used to fill the device name model based on the device type and device parameters to obtain the device name.

[0108] In an optional implementation, the field extraction module 501 includes:

[0109] A data filtering unit, used to filter and classify target interface data to obtain device data;

[0110] The field extraction unit is used to extract fields from device data to obtain target field data.

[0111] In an optional implementation, the data parsing module 502 includes:

[0112] A data parsing unit, used to parse the target field data to obtain type data and parameter data in the target field data;

[0113] A device type determination unit, used to match the type data with a preset device type and determine the device type corresponding to the type data;

[0114] The device parameter determination unit is used to perform data segmentation and extraction on the parameter data based on the preset segmentation characters to obtain the device parameters corresponding to the parameter data.

[0115] In an optional implementation, the parameter data includes bus data, and the device parameter includes a bus number; and the device parameter determination unit includes:

[0116] The character string recognition subunit is used to perform character string recognition on the bus data and determine the first character in the bus data;

[0117] A data segmentation subunit, used for segmenting and extracting the data after the first character in the bus data to obtain the bus number character corresponding to the bus data;

[0118] The bus number determination subunit is used to remove the leading zeros in the bus number characters to obtain the bus number.

[0119] In an optional implementation, the parameter data includes slot data, and the device parameter includes a slot number; and the device parameter determination unit includes:

[0120] The character string recognition subunit is further used to perform character string recognition on the slot data to determine the second character in the slot data;

[0121] The data segmentation subunit is further used to segment and extract the data after the second character in the slot data to obtain the slot number character;

[0122] The slot number determination subunit is used to remove leading zeros from the slot number characters to obtain the slot number.

[0123] In an optional implementation, the model filling module 503 includes:

[0124] A device name model determination unit, used for determining a device name model based on a device type;

[0125] The device name determination unit is used to fill the device parameters into the corresponding positions of the device name model to obtain the device name.

[0126] In an optional embodiment, the device further includes:

[0127] The device sequence determination module is used to classify and sort the target interface data to obtain the device sequence;

[0128] The name suffix adding module is used to generate the name suffix corresponding to each device name based on the device sequence, and add the name suffix to the end of the corresponding device name.

[0129] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0130] The network device name determination device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0131] The embodiment of the present invention also provides a computer device having the above Figure 5 The network device name shown is determined by the device.

[0132] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0133] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0134] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0135] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0136] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0137] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0138] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0139] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0140] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the present invention.< / bus> < / domain> < / function> < / slot> < / bus> < / domain> < / mac> < / mac> < / function> < / slot> < / function> < / slot> < / index> < / index> < / function>

Claims

1. A method for determining a network device name, characterized in that: The method comprises: Acquire target interface data, and perform field extraction on the target interface data to obtain target field data; Based on the device naming rules, the target field data is parsed and matched to determine the device type and device parameters; Based on the device type and the device parameters, the device name model is filled to obtain a device name.

2. The method according to claim 1, characterized in that The step of extracting fields from the target interface data to obtain target field data includes: Filtering and classifying the target interface data to obtain device data; Field extraction is performed on the device data to obtain the target field data.

3. The method according to claim 1, characterized in that The data parsing and matching of the target field data based on the device naming rule to determine the device type and device parameters include: Parsing the target field data to obtain type data and parameter data in the target field data; Matching the type data with a preset device type to determine the device type corresponding to the type data; Based on the preset segmentation characters, the parameter data is segmented and extracted to obtain the device parameters corresponding to the parameter data.

4. The method according to claim 3, characterized in that The parameter data includes bus data, and the device parameters include bus numbers; the parameter data is segmented and extracted based on a preset segmentation character to obtain device parameters corresponding to the parameter data, including: Performing character string recognition on the bus data to determine the first character in the bus data; Segmenting and extracting the data after the first character in the bus data to obtain a bus number character corresponding to the bus data; The leading zeros in the bus number characters are removed to obtain the bus number.

5. The method according to claim 3, characterized in that: The parameter data includes slot data, and the device parameter includes a slot number; the parameter data is segmented and extracted based on a preset segmentation character to obtain the device parameter corresponding to the parameter data, including: Performing character string recognition on the slot data to determine a second character in the slot data; Segmenting and extracting the data after the second character in the slot data to obtain a slot number character; The leading zeros in the slot number characters are removed to obtain the slot number.

6. The method according to claim 1, characterized in that The device name model is filled based on the device type and the device parameters to obtain the device name, including: Based on the device type, determining the device name model; Fill the device parameters into the corresponding positions of the device name model to obtain the device name.

7. The method according to claim 1, characterized in that The method further comprises: Classifying and sorting the target interface data to obtain a device sequence; Based on the device sequence, a name suffix corresponding to each of the device names is generated, and the name suffix is ​​added to the end of the corresponding device name.

8. A device for determining a network device name, characterized in that: The device comprises: A field extraction module, used to obtain target interface data and perform field extraction on the target interface data to obtain target field data; A data analysis module, used to analyze and match the target field data based on the device naming rules to determine the device type and device parameters; The model filling module is used to fill the device name model based on the device type and the device parameters to obtain the device name.

9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining the name of a network device according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining a network device name according to any one of claims 1 to 7.

Citation Information

Cited By

  • Honeycomb multi-module naming method and device, host equipment and program product

    CN120710980A