CN114416185A - Network port ordering method, device, equipment and storage medium - Google Patents

Network port ordering method, device, equipment and storage medium Download PDF

Info

Publication number
CN114416185A
CN114416185A CN202111616153.5A CN202111616153A CN114416185A CN 114416185 A CN114416185 A CN 114416185A CN 202111616153 A CN202111616153 A CN 202111616153A CN 114416185 A CN114416185 A CN 114416185A
Authority
CN
China
Prior art keywords
identification information
network port
target
card slot
network
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111616153.5A
Other languages
Chinese (zh)
Other versions
CN114416185B (en
Inventor
查锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202111616153.5A priority Critical patent/CN114416185B/en
Publication of CN114416185A publication Critical patent/CN114416185A/en
Application granted granted Critical
Publication of CN114416185B publication Critical patent/CN114416185B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0026PCI express
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a network port ordering method, which comprises the following steps: under the condition that a target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is detected, a second target file is obtained; the second target file comprises peripheral equipment interconnection standard PCI/peripheral equipment expansion interconnection standard PCIe bus tree information of a network card corresponding to the network port information in the first target file, and the first target file and the second target file are preset in a mirror image file of a target operating system; acquiring a first card slot position identification information set and a first internet access identification information set; obtaining a target network port sorting sequence based on a second target file, a first card slot position identification information set, a first network port identification information set and a reference network port sorting sequence; and writing the ordering sequence of the target network ports into the first target file. The embodiment of the application also discloses a network port sequencing device, equipment and a storage medium.

Description

Network port ordering method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for ordering network ports.
Background
The network card in the server or desktop host in the market is usually set to be pluggable, and a slot capable of expanding the network card is set, so that a user can conveniently replace the network card or insert more network cards according to the requirement, and the network service function of the server or desktop host is improved. At present, two commonly used implementation methods for determining the network port sequence are: one method determines the network port order by binding the device physical Address (MAC Address) of the Peripheral Component Interconnect standard (PCI)/Peripheral Component Interconnect Express (PCIe) with the network port name, and the other method realizes the determination of the network port order by binding the identification information of the network card with the network port name.
However, in the two foregoing solutions for determining the internet access, the names and naming sequences of the internet access still become confused in the situations of adding a network card to a server or a desktop host, removing the network card, replacing the network card in the same slot, replacing the slot of the network card, and the like. Therefore, when the network port sequence needs to be adjusted to ensure that the network port names and the sequence are consistent under the conditions that the network sequence is disordered and the like of the server or the desktop host, the currently common adjustment mode is to close the server or the desktop host, then manually plug and unplug the network card by a user, and then search a corresponding network port sequence number from a specific file, such as a rule (rule) file corresponding to the device manager Udev, to perform manual sequencing adjustment. Therefore, the operation of the network port sequence number adjusting process is complex and time-consuming, and the efficiency of determining the network port sequence number is low.
Content of application
In view of this, embodiments of the present application are expected to provide a method, an apparatus, a device, and a storage medium for ordering network ports, which solve the problem that the operation process for determining the serial numbers of the network ports is complicated at present, and provide a method for ordering network ports, which simplifies the process for determining the serial numbers of the network ports and improves the efficiency for determining the serial numbers of the network ports.
In order to achieve the purpose, the technical scheme of the application is realized as follows:
in a first aspect, a method for ordering network ports includes:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is detected, a second target file is obtained; the second target file comprises peripheral component interconnect standard (PCI)/peripheral component interconnect express (PCIe) bus tree information of a network card corresponding to the network port information corresponding to the first target file, and the first target file and the second target file are preset in a mirror image file of the target operating system;
acquiring a first card slot position identification information set and a first internet access identification information set; the first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card;
obtaining a target network port sorting sequence based on the second target file, the first card slot position identification information set, the first network port identification information set and the reference network port sorting sequence;
and writing the target network port sorting sequence into the first target file to replace the reference network port sorting sequence in the first target file.
Optionally, the obtaining a target socket sorting order based on the second target file, the first card slot identifier information set, the first socket identifier information set, and the reference socket sorting order includes:
acquiring a reference card slot identification information set and a reference internet access identification information set which are included in the second target file;
determining a newly added card slot position identification information set based on the first card slot position identification information set and the reference card slot position identification information set; the newly added card slot position identification information set comprises newly added card slot position identification information;
determining the network port identification information corresponding to the newly-added card slot position identification information set from the first network port identification information set to obtain a newly-added network port identification information set;
and obtaining the target network port sequencing sequence based on the newly added card slot position identification information set, the newly added network port identification information set and the reference network port sequencing sequence.
Optionally, the obtaining the target network port sorting order based on the newly added card slot identifier information set, the newly added network port identifier information set, and the reference network port sorting order includes:
acquiring mainboard configuration information and network card configuration information;
based on the fact that the mainboard configuration information comprises a physical position serial number, sorting the card slot position identification information in the newly-added card slot position identification information set to obtain a first sorting sequence;
sorting the network port identification information corresponding to each card slot position identification information in the newly added network port identification information set to the reference network port sorting sequence according to the first sorting sequence to obtain a first sorting result;
and sorting the network port identification information corresponding to each card slot position identification information in the first sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain the target network port sorting sequence.
Optionally, the method further includes:
determining card slot position identification information which is not included in the first card slot position identification information set from the reference card slot position identification information set to obtain at least one card slot position identification information to be deleted;
determining the network port identification information corresponding to at least one card slot position identification information to be deleted from a reference network port identification information set to obtain at least one network port identification information to be deleted;
and deleting at least one piece of network port identification information to be deleted in the reference network port sequencing sequence, and reserving the sequencing sequence number in the reference network port sequencing sequence to obtain a target network port sequencing sequence.
Optionally, the method further includes:
determining the same card slot position identification information in the reference card slot position identification information set and the first card slot position identification information set to obtain at least one card slot position identification information to be analyzed;
determining a first network port identification information subset corresponding to each card slot position identification information to be analyzed from the first network port identification information set;
determining a second network port identification information subset corresponding to each card slot position identification information to be analyzed from the reference network port identification information set;
if the first network port identification information subset is determined to be different from the corresponding second network port identification information subset, determining a first target network port name and a corresponding first target sorting sequence number of the corresponding card slot position identification information to be analyzed from the reference network port sorting sequence;
determining that the port name corresponding to each card slot position identification information to be analyzed in the target sorting sequence is the corresponding first target port name, and determining that the sorting sequence number corresponding to each card slot position identification information to be analyzed is the first target sorting sequence number.
Optionally, the method further includes:
determining the network port identification information belonging to the same network card in the first network port identification information set and the reference network port identification information set to obtain at least one network port identification information set;
determining first card slot position identification information corresponding to each network port identification information set from the first card slot position identification information sets;
determining second card slot position identification information corresponding to each network port identification information set from the reference card slot position identification information set;
if the first card slot position identification information is different from the corresponding second card slot position identification information, determining a second target network port name corresponding to the second card slot position identification information and a corresponding second target sorting sequence number from the reference network port sorting sequence;
and in the target sorting sequence, reserving the second target internet access name corresponding to the second card slot position identification information and the corresponding second target sorting sequence number.
Optionally, the method further includes:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference network port sequencing sequence is not detected, acquiring mainboard configuration information and network card configuration information;
acquiring a second card slot position identification information set of the target operating system currently inserted with a second target network card and a second network port identification information set included by the target operating system;
sorting the card slot position identification information in the second card slot position identification information set based on the physical position serial number included in the mainboard configuration information to obtain a second sorting sequence;
sorting the network port identification information corresponding to each card slot position identification information in the second network port identification information set according to the second sorting order to obtain a second sorting result;
sorting the network port identification information corresponding to each card slot position identification information in the second sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain the reference network port sorting sequence;
and recording the reference internet access sequencing sequence to the first target file.
Optionally, under the condition that the target operating system is in the starting state, if the first target file including the reference port sorting order is not detected, acquiring the motherboard configuration information and the network card configuration information, including:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is not detected, acquiring mainboard identification information;
and if the mainboard identification information belongs to preset identification information, acquiring the mainboard configuration information and the network card configuration information.
Optionally, the method further includes:
acquiring current PCI/PCIe bus tree information;
and updating the PCI/PCIe bus tree information in the second target file into the current PCI/PCIe bus tree information.
In a second aspect, an apparatus for ordering network ports comprises: the device comprises a first acquisition unit, a second acquisition unit, an obtaining unit and an updating unit; wherein:
the first obtaining unit is used for obtaining a second target file if a first target file comprising a reference internet access sorting sequence is detected under the condition that the target operating system is in a starting state; the second target file comprises peripheral equipment interconnection standard PCI/peripheral expansion equipment interconnection standard PCIe bus tree information of a network card corresponding to the network port information corresponding to the first target file;
the second obtaining unit is used for obtaining a first card slot position identification information set and a first internet access identification information set; the first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card;
the obtaining unit is configured to obtain a target internet access ordering order based on the second target file, the first card slot identifier information set, the first internet access identifier information set, and the reference internet access ordering order;
the updating unit is configured to write the target port sorting order into the first target file to replace the reference port sorting order in the first target file.
In a third aspect, a portal sequencing apparatus includes: the device comprises a card slot position, a first target network card, a memory, a processor and a communication bus; wherein:
the card inserting groove position is used for installing a network card;
the first target network card is used for realizing the communication of the network port sequencing equipment on a computer network;
the memory to store executable instructions;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the port sorting program stored in the memory, so as to implement the steps of the port sorting method according to any one of the above descriptions.
In a fourth aspect, a storage medium is characterized in that the storage medium has stored thereon a portal sequencing program, and the portal sequencing program, when executed by a processor, implements the steps of the portal sequencing method according to any one of the above.
According to the network port ordering method, device, equipment and storage medium provided by the embodiment of the application, under the condition that a target operating system is in a starting state, if a first target file including a reference network port ordering sequence is detected, a second target file is obtained, a first card slot bit identification information set and a first network port identification information set are obtained, then a target network port ordering sequence is obtained based on the second target file, the first card slot bit identification information set, the first network port identification information set and the reference network port ordering sequence, and the target network port ordering sequence is written into the first target file to replace the reference network port ordering sequence in the first target file. Therefore, consistency of the network port names and the network port sequencing sequence is achieved through the first target file and the second target file which are preset in the mirror image file of the target operating system, the problem that the operation process for determining the network port serial number is complex at present is solved, the method for sequencing the network ports is provided, the process for determining the network port serial number is simplified, and the efficiency for determining the network port serial number is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for ordering network ports according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another network port ordering method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another network port sorting method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of an embodiment of a method for ordering network ports according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a name identifier of a network interface with a network card inserted in a server backplane according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating a network port name identifier of another server backplane provided in the embodiment of the present application, where a network card is inserted;
fig. 7 is a schematic structural diagram of a portal sequencing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a portal sequencing device according to an embodiment of the present application.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
An embodiment of the present application provides a method for ordering network ports, where the method is applied to a network port ordering device, and as shown in fig. 1, the method includes the following steps:
step 101, under the condition that the target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is detected, a second target file is obtained.
The second target file includes Peripheral Component Interconnect (PCI)/Peripheral Component Interconnect Express (PCIe) bus tree information having a network card corresponding to the portal information corresponding to the first target file, and the first target file and the second target file are preset in an image file of the target operating system.
In this embodiment of the present application, after detecting that the target operating system receives a start instruction of the target operating system, the target operating system is in a start state, where the start instruction of the target operating system may refer to a power-on instruction detected by the socket sorting device, that is, the target operating system receives a start instruction. The first target file and the second target file are files which can be operated in the starting process of the target operating system, and the second target file comprises PCI/PCIe bus tree information in a corresponding historical operating state under the current starting instruction and the previous starting condition. The portal ordering device may be a device having a network card, and may be, for example, a server, a computer device, or the like. And if the first target file comprising the reference network port sorting sequence is detected, indicating that the target operating system is in a restarting state.
Step 102, a first card slot identification information set and a first internet access identification information set are obtained.
The first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card.
In the embodiment of the present application, the network interface ordering device detects slot positions for installing the network cards, determines to obtain all slot positions into which the first target network card is inserted, obtains a first card insertion slot identification information set, and determines network interface identification information of at least one network interface included in all currently inserted first target network cards, to obtain a first network interface identification information set.
And 103, obtaining a target network port sorting sequence based on the second target file, the first card slot identification information set, the first network port identification information set and the reference network port sorting sequence.
In this embodiment of the application, the device identification information included in the second target file, the first card slot position identification information set, and the first port identification information set are analyzed to determine a changed port, and based on the determined changed port, a reference port sorting order is processed to obtain a target port sorting order.
And 104, writing the ordering sequence of the target network ports into the first target file.
And writing the target network port sorting sequence into the first target file to replace the reference network port sorting sequence in the first target file.
In the embodiment of the application, the reference port sorting order in the first target file is updated to the target port sorting order, so that the port sorting device calls the corresponding port to perform communication based on the updated reference port sorting order.
In the network port ordering method provided by the embodiment of the application, when a target operating system is in a start state, if a first target file including a reference network port ordering sequence is detected, a second target file is obtained, a first card slot bit identification information set and a first network port identification information set are obtained, then the target network port ordering sequence is obtained based on the second target file, the first card slot bit identification information set, the first network port identification information set and the reference network port ordering sequence, and the target network port ordering sequence is written into the first target file to replace the reference network port ordering sequence in the first target file. Therefore, consistency of the network port names and the network port sequencing sequence is achieved through the first target file and the second target file which are preset in the mirror image file of the target operating system, the problem that the operation process for determining the network port serial number is complex at present is solved, the method for sequencing the network ports is provided, the process for determining the network port serial number is simplified, and the efficiency for determining the network port serial number is improved.
Based on the foregoing embodiments, an embodiment of the present application provides a method for ordering network ports, where the method is applied to a network port ordering device, and the method includes the following steps:
step 201, under the condition that the target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is detected, a second target file is obtained.
The second target file comprises peripheral equipment interconnection standard PCI/peripheral expansion equipment interconnection standard PCIe bus tree information of a network card corresponding to the network port information in the first target file, and the first target file and the second target file are preset in a mirror image file of the target operating system.
In this embodiment of the present application, after the socket ordering device receives the boot instruction, a Basic Input Output System (BIOS) running in the embedded controller runs to boot an operating System image file running in a Central Processing Unit (CPU), and the socket ordering device detects whether the running operating System image file includes a first target file, and if it is detected that the operating System image file includes the first target file, obtains a second target file including PCI/PCIe bus tree information. The second target file comprises all PCI devices which are currently accessed to the PCI/PCIe, such as an accessed network card and the like.
Step 202, a first card slot identification information set and a first internet access identification information set are obtained.
The first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card.
In this embodiment of the application, the BIOS in the portal sequencing device scans the current PCI/PCIe bus tree information, and may scan a first slot bit identification information set currently inserted with the first target network card and a corresponding first portal identification information set.
Step 203, obtaining a target network port sorting sequence based on the second target file, the first card slot identification information set, the first network port identification information set and the reference network port sorting sequence.
And step 204, writing the target internet access sequencing sequence into the first target file.
And writing the target network port sorting sequence into the first target file to replace the reference network port sorting sequence in the first target file.
In the embodiment of the application, the reference port sorting sequence in the first target file is updated to the target port sorting sequence, so that the method for sorting the ports is realized under the condition that the network cards are increased, the consistency of the port sorting sequence is ensured, and the probability of disorder of the ports is reduced.
Based on the foregoing embodiments, in other embodiments of the present application, step 203 may be implemented by steps 203a to 203 d:
step 203a, acquiring a reference card slot identification information set and a reference gateway identification information set included in the second target file.
In other embodiments of the present application, the kernel of the portal sequencing device performs scanning analysis on the second target file to obtain a reference slot position identification information set formed by the slot positions into which the network cards are inserted in the second target file, and corresponding portal identification information sets of all the portals.
Step 203b, determining a newly added card slot position identification information set based on the first card slot position identification information set and the reference card slot position identification information set.
And the newly added card slot position identification information set comprises newly added card slot position identification information.
In the embodiment of the application, the first card slot position identification information set and the reference card slot position identification information set, and the first network port identification information set and the reference network port identification information set are analyzed, so as to determine the currently added network card in the network card sorting device. However, in the process of determining the added network card, the first card slot position identification information set and the reference card slot position identification information set need to be analyzed first, and the slot position where the network card is installed is determined to be added, so that a newly added card slot position identification information set is obtained.
Step 203c, determining the network port identification information corresponding to the newly added card slot position identification information set from the first network port identification information set to obtain a newly added network port identification information set.
And the newly added network port identification information set comprises newly added card slot position identification information.
In this embodiment, from the first portal identification information set, portal identification information corresponding to each card slot location identification information in the newly added card slot location identification information set is determined, so as to obtain a newly added portal identification information set. The network port identification information may specifically be a network port bus number of the network port. It should be noted that, in the first portal identification information set and the reference portal identification information set, the portal identification information is stored according to the network card as a unit. For example, it is assumed that the first portal identification information set may be denoted as ((wa1, wa2, wa3), (wb1, wb2, wb3, wb4), (wc1, wc2)) where (wa1, wa2, wa3) is the portal identification information corresponding to the network card wa, (wb1, wb2, wb3, wb4) is the portal identification information corresponding to the network card wb, and (wc1, wc2) is the portal identification information corresponding to the network card wc.
And step 203d, obtaining a target network port sequencing sequence based on the newly added card slot position identification information set, the newly added network port identification information set and the reference network port sequencing sequence.
In the embodiment of the application, the card slot position identification information in the newly added card slot position identification information set is sorted, and according to the sorting sequence of the card slot position identification information in the newly added card slot position identification information set, the network port identification information corresponding to each network port in the newly added network port identification information set is sorted in the reference network port sorting sequence in sequence, so as to obtain the target network port sorting sequence.
Based on the foregoing embodiments, in other embodiments of the present application, the step 203d may be implemented by the steps a 11-a 14:
step a11, acquiring mainboard configuration information and network card configuration information.
In this embodiment, the motherboard configuration information and the network port configuration information are configuration information that is input by a user in advance and includes a sorting rule for sorting the slot position and the network port. The mainboard configuration information at least comprises the following parameters: the slot position loading sequence number and the slot position direction that slot position quantity, physical position serial number on mainboard, mainboard model, the mainboard are expected also are called the slot position direction etc. wherein, the slot position direction specifically can include one of following three kinds of directions: the notch is upward, the notch is rightward and the notch is leftward. The network card configuration information at least comprises the following parameters: the network card model, the network card name, the network interface number of the network card, the network interface loading sequence after the network card is electrified and the like.
Step a12, based on the physical position serial number included in the motherboard configuration information, sorting the slot position identification information in the newly added slot position identification information set to obtain a first sorting order.
In the embodiment of the application, card slot bit identification information in a newly-added card slot bit identification information set is sorted according to a physical position serial number included in mainboard configuration information, so as to obtain a first sorting order.
For example, assuming that the newly added card slot identification information set is (c2, c4, c5), the physical position number of c2 is 6, the physical position number of c4 is 4, the physical position number of c5 is 3 in the corresponding physical position numbers, and correspondingly, c2, c4, and c5 are sorted in the order from small to large of the physical position numbers, so that the first sorting order is c5, c4, and c 2.
Step a13, sorting the net mouth identification information corresponding to each card slot position identification information in the newly added net mouth identification information set to a reference net mouth sorting sequence according to the first sorting sequence, and then obtaining a first sorting result.
In the embodiment of the application, according to a first sorting order, the network port identification information corresponding to each card slot bit identification information in the newly added network port identification information set is sorted according to the first sorting order, and after the network port identification information is sorted to a reference sorting order, a first sorting result is obtained.
Illustratively, the newly added portal identification information set is ((w21, w22, w23), (w41, w41, w41, w 41), (w41 ), wherein (w41, w41, w 41) is the portal identification information of the network card inserted in the slot c 41, (w41 ) is the portal identification information of the network card inserted in the slot c 41, and it is assumed that the reference portal sorting order is (w41, w41, w 41), so that the newly added portal identification information set ((w 41, w41, w 41), (w41, w41, w 41)) is sorted according to the first sorting order, and the result is obtained as (w41, w41, and the result is obtained.
Step a14, sorting the network port identification information corresponding to each card slot position identification information in the first sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain a target network port sorting sequence.
In the embodiment of the application, the network port identification information corresponding to each card slot bit identification information in the first sequencing result is sequenced according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information, so as to obtain the target network port sequencing sequence.
Illustratively, the first ordering result (w01, w02, w03), (w51, w52), (w41, w42, w43, w44), (w21, w22, w23) is ordered according to the card slot direction included in the motherboard configuration information and the network interface loading order included in the network card configuration information, where the network interface loading order is usually from left to right and from bottom to top after power is turned on first, and thus, it is assumed that the final target network interface ordering order is obtained: w01, w02, w03, w51, w52, w42, w44, w41, w43, w22, w21 and w 23.
Based on the foregoing embodiment, in other embodiments of the present application, after the network interface sorting device executes step 203a, it may further select to execute steps 203e to 203g, so as to implement a scheme for sorting network interfaces when pulling out a network card application scenario:
step 203e, determining card slot position identification information which is not included in the first card slot position identification information set from the reference card slot position identification information set, and obtaining at least one card slot position identification information to be deleted.
In the embodiment of the application, from the reference card slot identification information set, card slot identification information that is not included in the first card slot identification information set is determined, and the slot position identification information of the slot position where the network card is pulled out can be determined, so that at least one piece of card slot identification information to be deleted can be obtained.
For example, assuming that the reference card slot id information set is (d1, d2, d6, d8) and the first card slot id information set is (d2, d3, d5, d6), it may be determined that the reference card slot id information set includes at least one piece of to-be-deleted card slot id information that is not included in the first card slot id information set, such as d1 and d 8.
Step 203f, determining the network port identification information corresponding to the at least one card slot position identification information to be deleted from the reference network port identification information set, and obtaining the at least one network port identification information to be deleted.
In the embodiment of the application, at least one piece of slot identifier to be deleted is determined to be the port identifier corresponding to d1 and d8 from the reference identifier set, so as to obtain at least one piece of port identifier to be deleted. Assuming that the portal identification information corresponding to d1 is wd11, wd12 and wd13, and the portal identification information corresponding to d8 is wd81 and wd82, the obtained at least one piece of portal identification information to be deleted is wd11, wd12, wd13, wd81 and wd 82.
And 203g, deleting at least one network port identification information to be deleted in the reference network port sequencing sequence, and reserving a sequencing serial number of the at least one network port identification information to be deleted to obtain a target network port sequencing sequence.
In the embodiment of the present application, it is assumed that the reference portal sorting order is (wd11, wd12, wd13, wd82, wd81, wd64, wd63, wd61, wd62, wd21, wd22), and the corresponding sorting numbers are increased from 1, so that at least one of the portal identification information wd11 to be deleted, wd12, wd13, wd81, and wd82 may be deleted, but the portal sorting order remaining in the reference portal sorting order is not changed, so that the target portal sorting order may be (0, 0, 0, 0, 0, wd64, wd63, wd61, wd62, wd21, wd 22).
Based on the foregoing embodiment, in other embodiments of the present application, in an application scenario where the network card is replaced in the same slot, after the portal sequencing device performs step 203a, it may further select to perform steps 203h to 203 l:
step 203h, determining the same card slot position identification information in the reference card slot position identification information set and the first card slot position identification information set to obtain at least one card slot position identification information to be analyzed.
In this embodiment of the present application, the same card slot location identification information in the reference card slot location identification information set and the first card slot location identification information set may be determined by using an intersection operation. Assuming that the reference card slot identification information set is (d1, d2, d6, d8), the first card slot bit identification information set is (d2, d3, d5, d6), and correspondingly, the obtained at least one piece of card slot bit identification information to be analyzed is d2 and d 6.
Step 203i, determining a first network port identification information subset corresponding to each card slot position identification information to be analyzed from the first network port identification information set.
In this embodiment of the application, a first portal identification information subset corresponding to card slot identification information d2 to be analyzed and a first portal identification information subset corresponding to card slot identification information d6 to be analyzed are obtained from the first portal identification information set.
Step 203j, determining a second network port identification information subset corresponding to each card slot bit identification information to be analyzed from the reference network port identification information set.
In this embodiment, a second portal identification information subset corresponding to the card slot identifier to be analyzed d2 and a second portal identification information subset corresponding to the card slot identifier to be analyzed d6 are obtained from the reference portal identification information set.
Step 203k, if it is determined that the first subset of network port identification information is different from the corresponding second subset of network port identification information, determining a first target network port name and a corresponding first target sorting sequence number of the corresponding card slot identification information to be analyzed from the reference network port sorting sequence.
In this embodiment of the application, it is assumed that a second subset of network port identification information corresponding to card slot identification information d2 to be analyzed is different from a first subset of network port identification information corresponding to card slot identification information d2 to be analyzed, which indicates that a network card on card slot identification information d2 to be analyzed is replaced, that is, a user performs a situation of replacing the network card in the same slot, at this time, a first target network port name corresponding to network port identification information wd21 corresponding to card slot identification information d2 to be analyzed is eth9, a first target ranking sequence number is 10, a first target network port name corresponding to network port identification information wd22 corresponding to card slot identification information d2 to be analyzed is eth10, and a first target ranking sequence number is 3611 from a reference network port ranking sequence (wd11, wd12, wd13, wd82, wd81, wd64, wd63, wd61, wd62, wd21, and wd 22).
Step 203l, determining the port name corresponding to each card slot identifier to be analyzed in the target sorting sequence as a corresponding first target port name, and determining the sorting sequence number corresponding to each card slot identifier to be analyzed as a first target sorting sequence number.
In this embodiment of the application, in the target sorting order, the sorting sequence number of the network port of the replaced network card on the card slot identification information d2 to be analyzed remains unchanged, 10 and 11, and the corresponding network port name also remains unchanged, still remains eth9 and eth10, that is to say, when the network port identification information of the replaced network card is wd2A and wd2B, the corresponding target sorting order is (wd11, wd12, wd13, wd82, wd81, wd64, wd63, wd61, wd62, wd2A, wd 2B). Therefore, the network port name and the network port sequencing sequence are not changed along with the change of the network card, and the consistency of the network port sequence is ensured.
Based on the foregoing embodiment, in other embodiments of the present application, in a scenario of replacing a slot for a network card, after the network interface ordering device performs step 203a, it may further select to perform steps 203m to 203 p:
step 203m, determining the network port identification information belonging to the same network card in the first network port identification information set and the reference network port identification information set, and obtaining at least one network port identification information set.
In this embodiment, an intersection calculation manner may be used to determine the portal identification information sets belonging to the same network card in the first portal identification information set and the reference portal identification information set.
Step 203n, determining first card slot position identification information corresponding to each network port identification information set from the first card slot position identification information sets.
Step 203n, determining second card slot position identification information corresponding to each network port identification information set from the reference card slot position identification information sets.
Step 203o, if it is determined that the first card slot position identification information is different from the corresponding second card slot position identification information, determining a second target port name and a corresponding second target sorting sequence number corresponding to the second card slot position identification information from the reference port sorting sequence.
In this embodiment, if the first card slot identifier information and the second card slot identifier information of the same portal identifier information set are different, it may be determined that a situation of a network card replacement slot occurs, that is, each corresponding portal identifier information set is updated from a slot corresponding to the second card slot identifier information to a slot corresponding to the first card slot identifier information. Illustratively, from the reference portal sorting order (wd11, wd12, wd13, wd82, wd81, wd64, wd63, wd61, wd62, wd21, wd22), it is assumed that the second card slot identifier information is determined to be d1, the corresponding second target portal names are eth0, eth1, and eth2 in this order, and the corresponding second target sorting order numbers are 1, 2, and 3 in this order.
And 203p, reserving a second target internet access name corresponding to the second card slot position identification information and a corresponding second target sorting sequence number in the target sorting sequence.
In the embodiment of the present application, when the target sorting order is determined, the second target port name and the second target sorting order number corresponding to the second card slot identifier d1 are not adjusted, in the target sorting order, the second target port name is still eth0, eth1, and eth2, and the corresponding second target sorting order number is 1, 2, and 3 in sequence.
It should be noted that steps 203b to 203d, steps 203e to 203g, steps 203h to 203l, and steps 203m to 203p may be arbitrarily combined to determine the target sorting order according to the actual application scenario.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 2, the portal sequencing apparatus is further configured to perform steps 205 to 210:
step 205, under the condition that the target operating system is in the starting state, if the first target file including the reference port sorting order is not detected, acquiring the mainboard configuration information and the network card configuration information.
For example, the motherboard configuration information may be as follows:
[mother_board]
manufacturer OEM// manufacturer
family as SMC-X10// model
[count]
slot count 5// total number of slots included
[slot1]
bus _ info ═ pci0000:00/0000:00:03.2/0000:04: 00.0// slot bus number
number 1// physical location number
direction right/card slot direction
[slot2]
bus_info=/pci0000:80/0000:80:01.0/0000:81:00.0
number=2
direction=up
[slot3]
bus_info=/pcioo00:80/0000:80:03.0/0000:82:00.0
number=3
direction=up
[slot4]
bus_info=/pcioooo:00/0000:00:03.0/0000:03:00.0
number=4
direction=up
[slot5]
bus_info=/pci0000:00/0000:00:02.0/0000:02:00.0
number=5
direction=up。
The network card configuration information may be as follows:
[8086:1521-2 ]// network card model
name Intel Corporation I350 Gigabit Network Connection// Network card name
iface _ count 2// network card including network port number
load _ order ═ asc// network port loading sequence
[15b3:1017-2]
name=Mellanox Technologies MT27800 Family[ConnectX-5]
iface_count=2
load_order=asc
[15ad:07bo-1]
name=VMware VMXNET3 Ethernet Controller
iface_count=1
load_order=asc。
Step 206, a second card slot identification information set of the target operating system currently inserted with a second target network card and a second network port identification information set included by the target operating system are obtained.
In this embodiment of the application, the obtaining of the second card slot bit identification information set of the target operating system into which the second target network card is currently inserted and the second portal identification information set included in the target operating system may be obtained by scanning and determining the PCI/PCIe bus tree through the BIOS operating system.
And step 207, sorting the card slot position identification information in the second card slot position identification information set based on the physical position serial number included in the mainboard configuration information to obtain a second sorting order.
And 208, sorting the network port identification information corresponding to each card slot position identification information in the second network port identification information set according to a second sorting sequence to obtain a second sorting result.
Step 209, network port identification information corresponding to each card slot position identification information in the second sorting result is sorted according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information, so as to obtain a reference network port sorting sequence.
Step 210, recording the reference port ordering sequence to the first target file.
In this embodiment of the present application, the first target file may be a rule (rules) file, and the customized portal order validation may be implemented by loading and identifying through an operating system component (udev).
Based on the foregoing embodiments, in other embodiments of the present application, step 205 may be implemented by steps 205a to 205 b:
step 205a, under the condition that the target operating system is in the starting state, if the first target file comprising the reference port sorting order is not detected, acquiring the mainboard identification information.
In this embodiment, the motherboard identification information may be a motherboard name or a motherboard model.
Step 205b, if the motherboard identification information belongs to the preset identification information, acquiring the motherboard configuration information and the network card configuration information.
In this embodiment of the present application, the preset identification information is motherboard identification information used for indicating that the ordering order of the network ports can be determined by using the scheme of the present application. If the mainboard identification information does not belong to the preset identification information, the network port sequencing equipment adopts a default network port sequencing rule to sequence the network ports.
Based on the foregoing embodiments, in other embodiments of the present application, referring to fig. 3, after the step 204 or the step 210 is executed by the portal sequencing apparatus, the portal sequencing apparatus is further configured to execute steps 211 to 212:
and step 211, acquiring the information of the current PCI/PCIe bus tree.
And step 212, updating the PCI/PCIe bus tree information in the second target file into current PCI/PCIe bus tree information.
In the embodiment of the present application, the second object file appears in pair with the first object file.
Based on the foregoing embodiments, in other embodiments of the present application, an embodiment of the present application provides a method for ordering network ports, which is shown in fig. 4 and specifically includes the following implementation procedures:
step 301, start.
Step 302, the server equipment judges whether a 98-remap-iface.rules file exists in the/udev/rules.d/directory, and if the 98-remap-iface.rules file does not exist in the/udev/rules.d/directory, the steps 303 to 308 are executed; if the 98-remap-i-cache.rule file exists in the/udev/rule.d/directory, execute steps 309-313.
A rule file corresponds to the first target file.
Step 303, reading the motherboard configuration file mobo.
The main board configuration file mobo.ini records a mapping relation among a device serial number (BUS _ ID), a card slot direction and a device serial number, namely the physical position serial number. The mainboard configuration file is the mainboard configuration information.
Step 304, reading the nic.ini of the network port configuration file.
The network interface configuration file nic.ini records the network card type, the network interface number and the loading sequence. The network port configuration file is the network port configuration information.
And 305, reading the serial number of the current card inserting slot of the system.
The slot bit sequence number is matched with the slot bit identification information, and can be represented by device _ id.
And step 306, sequencing the serial number of the current slot position in the current system according to the sequence stated in the mainboard configuration file.
And 307, sequencing the network ports in each slot position according to the sequencing of the serial number of the current slot position, based on the network port configuration file and the network port sequence of the network card in the slot position and according to a rule of increasing the sequencing sequence, and obtaining a network port sequencing result.
Wherein the target sorting result corresponds to the reference port sorting order.
And 308, writing the network port sequencing result into a 98-remap-iface. rule file.
Wherein, if the 98-remap-i-cache.rule file does not exist in the/udev/rule.d/directory, the current system reinstallation process is indicated.
And 309, reading the init _ iface _ map.
Wherein the init _ iface _ map. ini file corresponds to the second target file.
And step 310, reading the serial number of the current card slot of the system and the information of the network interface bus of the network card.
And 311, processing the init _ iface _ map.ini file, the serial number of the current card slot and the network card port information, and determining a removed network port, an unchanged network port and an added network port.
And step 312, updating the determined sorting sequence of the removed net ports, the unchanged net ports and the added net ports based on a preset rule and the net port sorting sequence in the 98-remap-iface. rule file to obtain a target sorting sequence.
The preset rules can be shown in the following table.
Figure BDA0003436435650000161
And 313, writing the finally determined target sorting sequence into a 98-remap-access. rule file.
And step 314, ending.
In some application scenarios, when kernel initialization is performed in the starting process of the server device, the mainboard model of the server device is scanned, and when the mainboard model is judged to be matched with the configuration file allowing the use of the steps 301 to 314 to realize network port sequencing, the precondition of the steps 301 to 314 is executed, and if the mainboard model is not matched with the configuration file, a default network port sequence determination method is adopted to determine the network port sequence.
The logic diagram of the server backplane slot can be shown in fig. 5, and includes PCIe-B, PCIe-C, PCIe-D, PCIe-E and a network card moterboard soldered to the server MotherBoard. Assuming that the slots recorded in the init _ iface _ map. ini file are the moterboard and PCIe-B with network cards inserted therein, the corresponding reference port sequence is shown in fig. 5, and the port ordering of the moterboard and PCIe-B with the network cards inserted therein is consistent with the port naming name: eth0, Eth1, Eth2, Eth3, Eth4, Eth5, Eth6, Eth7, Eth8, and Eth 9. Assuming that when it is determined that the network card inserted into the slot PCIe-B is switched to the slot PCIe-E, since the slot PCIe-B is not provided with a new network card, but the network port ordering sequence and the network port name originally inserted into the slot PCIe-B are reserved to ensure consistency of the network port sequence, the updated network port ordering sequence is as shown in fig. 6: eth0, Eth1, Eth2, Eth3, Eth4, Eth5, Eth6, Eth7, Eth8, Eth9, Eth10, Eth11, Eth12, Eth13, Eth14, Eth 15. Thus, when a new network card is installed on the slot PCIe-B, the port names and the port ordering order of the corresponding network cards are Eth4, Eth5, Eth6, Eth7, Eth8, and Eth 9.
It should be noted that, for the explanation of the same steps or concepts in the present embodiment as in the other embodiments, reference may be made to the description in the other embodiments, and details are not described here.
In the network port ordering method provided by the embodiment of the application, when a target operating system is in a start state, if a first target file including a reference network port ordering sequence is detected, a second target file is obtained, a first card slot bit identification information set and a first network port identification information set are obtained, then the target network port ordering sequence is obtained based on the second target file, the first card slot bit identification information set, the first network port identification information set and the reference network port ordering sequence, and the target network port ordering sequence is written into the first target file to replace the reference network port ordering sequence in the first target file. Therefore, consistency of the network port names and the network port sequencing sequence is achieved through the first target file and the second target file which are preset in the mirror image file of the target operating system, the problem that the operation process for determining the network port serial number is complex at present is solved, the method for sequencing the network ports is provided, the process for determining the network port serial number is simplified, and the efficiency for determining the network port serial number is improved.
Based on the foregoing embodiments, the present application provides a portal sequencing device 4, where the portal sequencing device 4 may be applied to the embodiments corresponding to fig. 1 to 3, and as shown in fig. 7, the portal sequencing device 4 includes: a first acquisition unit 41, a second acquisition unit 42, an obtaining unit 43, and an updating unit 44; wherein:
a first obtaining unit 41, configured to, when the target operating system is in a start state, obtain a second target file if a first target file including a reference portal sorting order is detected; the second target file comprises peripheral equipment interconnection standard PCI/peripheral equipment expansion interconnection standard PCIe bus tree information of a network card corresponding to the network port information corresponding to the first target file;
a second obtaining unit 42, configured to obtain a first card slot identifier information set and a first gateway identifier information set; the first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card;
an obtaining unit 43, configured to obtain a target port sorting order based on the second target file, the first card slot identifier information set, the first port identifier information set, and the reference port sorting order;
an updating unit 44, configured to write the target port sorting order into the first target file to replace the reference port sorting order in the first target file.
In other embodiments of the present application, the obtaining unit 43 includes: the device comprises a first acquisition module, a determination module and an acquisition module; wherein:
the first acquisition module is used for acquiring a reference card slot identification information set and a reference internet access identification information set which are included in the second target file;
the determining module is used for determining a newly added card slot position identification information set based on the first card slot position identification information set and the reference card slot position identification information set; the newly added card slot position identification information set comprises newly added card slot position identification information;
the determining module is further used for determining the network port identification information corresponding to the newly-added card slot position identification information set from the first network port identification information set to obtain a newly-added network port identification information set;
and the obtaining module is used for obtaining a target network port sequencing sequence based on the newly added card slot position identification information set, the newly added network port identification information set and the reference network port sequencing sequence.
In other embodiments of the present application, the obtaining module is specifically configured to implement the following steps:
acquiring mainboard configuration information and network card configuration information;
based on the fact that the mainboard configuration information comprises the physical position serial number, sorting the card slot position identification information in the newly-added card slot position identification information set to obtain a first sorting sequence;
sorting the network port identification information corresponding to each card slot position identification information in the newly added network port identification information set to a reference network port sorting sequence according to a first sorting sequence to obtain a first sorting result;
and sorting the network port identification information corresponding to each card slot position identification information in the first sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain a target network port sorting sequence.
In other embodiments of the present application, the obtaining module is further configured to determine, from a reference card slot location identification information set, card slot location identification information that is not included in the first card slot location identification information set, and obtain at least one card slot location identification information to be deleted;
the obtaining module is further used for determining the network port identification information corresponding to the at least one card slot position identification information to be deleted from the reference network port identification information set to obtain at least one network port identification information to be deleted;
and the obtaining module is also used for deleting at least one piece of network port identification information to be deleted in the reference network port sequencing sequence, and reserving the sequencing serial number in the reference network port sequencing sequence to obtain the target network port sequencing sequence.
In other embodiments of the present application, the obtaining module is further configured to perform the following steps:
determining card slot position identification information which is the same in the reference card slot position identification information set and the first card slot position identification information set to obtain at least one card slot position identification information to be analyzed;
determining a first network port identification information subset corresponding to each card slot position identification information to be analyzed from the first network port identification information set;
determining a second network port identification information subset corresponding to each card slot position identification information to be analyzed from the reference network port identification information set;
if the first network port identification information subset is different from the corresponding second network port identification information subset, determining a first target network port name and a corresponding first target sorting sequence number of the corresponding card slot position identification information to be analyzed from the reference network port sorting sequence;
and determining that the network port name corresponding to each card slot position identification information to be analyzed in the target sorting sequence is a corresponding first target network port name, and determining that the sorting sequence number corresponding to each card slot position identification information to be analyzed is a first target sorting sequence number.
In other embodiments of the present application, the obtaining module is further configured to perform the following steps:
determining the network port identification information belonging to the same network card in the first network port identification information set and the reference network port identification information set to obtain at least one network port identification information set;
determining first card slot position identification information corresponding to each network port identification information set from the first card slot position identification information sets;
determining second card slot position identification information corresponding to each network port identification information set from the reference card slot position identification information set;
if the first card slot position identification information is different from the corresponding second card slot position identification information, determining a second target network port name corresponding to the second card slot position identification information and a corresponding second target sorting sequence number from the reference network port sorting sequence;
and in the target sorting sequence, reserving a second target internet access name corresponding to the second card slot position identification information and a corresponding second target sorting sequence number.
In other embodiments of the present application, the portal sequencing apparatus further includes: a recording unit; wherein:
the first obtaining unit is further configured to obtain motherboard configuration information and network card configuration information if a first target file including a reference network port sorting order is not detected under the condition that the target operating system is in a starting state;
the second obtaining unit is further configured to obtain a second card slot bit identification information set of the target operating system currently plugged with a second target network card and a second network port identification information set included in the target operating system;
the obtaining unit is further configured to sort the slot inserting position identification information in the second slot inserting position identification information set based on the physical position serial number included in the motherboard configuration information, so as to obtain a second sorting order;
the obtaining unit is further configured to sort, according to a second sorting order, the portal identification information corresponding to each card slot position identification information in the second portal identification information set to obtain a second sorting result;
the obtaining unit is further configured to sort, according to the slot direction included in the motherboard configuration information and the network interface loading order included in the network card configuration information, the network interface identification information corresponding to each slot position identification information in the second sorting result, so as to obtain a reference network interface sorting order;
and the recording unit is also used for recording the reference port sorting sequence to the first target file.
In other embodiments of the present application, the first obtaining unit further includes: a second acquisition module and a third acquisition module; wherein:
the second acquisition module is used for acquiring the mainboard identification information if the first target file comprising the reference internet access sequencing sequence is not detected under the condition that the target operating system is in a starting state;
and the third acquisition module is used for acquiring the mainboard configuration information and the network card configuration information if the mainboard identification information belongs to the preset identification information.
In other embodiments of the present application, the second obtaining unit is further configured to obtain current PCI/PCIe bus tree information;
and the updating unit is also used for updating the PCI/PCIe bus tree information in the second target file into the current PCI/PCIe bus tree information.
It should be noted that, in the present embodiment, the information interaction process between the unit and the module may refer to the information interaction process described in the foregoing method embodiment, and details are not described here again.
In the network port sorting device provided in the embodiment of the application, when the target operating system is in a start state, if a first target file including a reference network port sorting order is detected, a second target file is obtained, a first card slot bit identification information set and a first network port identification information set are obtained, then a target network port sorting order is obtained based on the second target file, the first card slot bit identification information set, the first network port identification information set and the reference network port sorting order, and the target network port sorting order is written into the first target file to replace the reference network port sorting order in the first target file. Therefore, consistency of the network port names and the network port sequencing sequence is achieved through the first target file and the second target file which are preset in the mirror image file of the target operating system, the problem that the operation process for determining the network port serial number is complex at present is solved, the method for sequencing the network ports is provided, the process for determining the network port serial number is simplified, and the efficiency for determining the network port serial number is improved.
Based on the foregoing embodiments, an embodiment of the present application provides a portal sequencing apparatus 5, where the portal sequencing apparatus 5 may be applied to embodiments corresponding to fig. 1 to 3, and as shown in fig. 8, the portal sequencing apparatus 5 includes: a card slot 51, a first target network card 52, a memory 53, a processor 54 and a communication bus 55; wherein:
the card inserting groove position 51 is used for installing a network card;
the first target network card 52 is used for realizing the communication of the network port sequencing equipment on a computer network;
a memory 53 for storing executable instructions;
a communication bus 55 for implementing a communication connection between the processor 54 and the memory 53;
the processor 54 is configured to execute the port sequencing program stored in the memory to implement the interaction process in the method embodiments corresponding to fig. 1 to 3, which is not described herein again.
Based on the foregoing embodiments, embodiments of the present application provide a computer-readable storage medium, which is referred to as a storage medium for short, where the computer-readable storage medium stores one or more network port sequencing programs, and the one or more network port sequencing programs can be executed by one or more processors to implement the network port sequencing method provided in the embodiments corresponding to fig. 1 to 3, which is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present application may be substantially or partially embodied in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), and including instructions for enabling a terminal (such as a mobile phone, a computer, … …, an air conditioner, or a network communication link device) to execute the method described in the embodiments of the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (12)

1. A method for ordering network ports, the method comprising:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is detected, a second target file is obtained; the second target file comprises peripheral component interconnect standard (PCI)/peripheral component interconnect express (PCIe) bus tree information of a network card corresponding to the network port information corresponding to the first target file, and the first target file and the second target file are preset in a mirror image file of the target operating system;
acquiring a first card slot position identification information set and a first internet access identification information set; the first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card;
obtaining a target network port sorting sequence based on the second target file, the first card slot position identification information set, the first network port identification information set and the reference network port sorting sequence;
and writing the target network port sorting sequence into the first target file to replace the reference network port sorting sequence in the first target file.
2. The method of claim 1, wherein obtaining a target socket ordering order based on the second target file, the first card slot identifier information set, the first socket identifier information set, and the reference socket ordering order comprises:
acquiring a reference card slot identification information set and a reference internet access identification information set which are included in the second target file;
determining a newly added card slot position identification information set based on the first card slot position identification information set and the reference card slot position identification information set; the newly added card slot position identification information set comprises newly added card slot position identification information;
determining the network port identification information corresponding to the newly-added card slot position identification information set from the first network port identification information set to obtain a newly-added network port identification information set;
and obtaining the target network port sequencing sequence based on the newly added card slot position identification information set, the newly added network port identification information set and the reference network port sequencing sequence.
3. The method of claim 2, wherein obtaining the target socket ranking based on the newly added card slot identifier information set, the newly added socket identifier information set, and the reference socket ranking comprises:
acquiring mainboard configuration information and network card configuration information;
based on the fact that the mainboard configuration information comprises a physical position serial number, sorting the card slot position identification information in the newly-added card slot position identification information set to obtain a first sorting sequence;
sorting the network port identification information corresponding to each card slot position identification information in the newly added network port identification information set to the reference network port sorting sequence according to the first sorting sequence to obtain a first sorting result;
and sorting the network port identification information corresponding to each card slot position identification information in the first sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain the target network port sorting sequence.
4. The method of claim 2, further comprising:
determining card slot position identification information which is not included in the first card slot position identification information set from the reference card slot position identification information set to obtain at least one card slot position identification information to be deleted;
determining the network port identification information corresponding to at least one card slot position identification information to be deleted from a reference network port identification information set to obtain at least one network port identification information to be deleted;
and deleting at least one piece of network port identification information to be deleted in the reference network port sequencing sequence, and reserving the sequencing sequence number in the reference network port sequencing sequence to obtain a target network port sequencing sequence.
5. The method according to any one of claims 2 to 4, further comprising:
determining the same card slot position identification information in the reference card slot position identification information set and the first card slot position identification information set to obtain at least one card slot position identification information to be analyzed;
determining a first network port identification information subset corresponding to each card slot position identification information to be analyzed from the first network port identification information set;
determining a second network port identification information subset corresponding to each card slot position identification information to be analyzed from the reference network port identification information set;
if the first network port identification information subset is determined to be different from the corresponding second network port identification information subset, determining a first target network port name and a corresponding first target sorting sequence number of the corresponding card slot position identification information to be analyzed from the reference network port sorting sequence;
determining that the port name corresponding to each card slot position identification information to be analyzed in the target sorting sequence is the corresponding first target port name, and determining that the sorting sequence number corresponding to each card slot position identification information to be analyzed is the first target sorting sequence number.
6. The method according to any one of claims 2 to 4, further comprising:
determining the network port identification information belonging to the same network card in the first network port identification information set and the reference network port identification information set to obtain at least one network port identification information set;
determining first card slot position identification information corresponding to each network port identification information set from the first card slot position identification information sets;
determining second card slot position identification information corresponding to each network port identification information set from the reference card slot position identification information set;
if the first card slot position identification information is different from the corresponding second card slot position identification information, determining a second target network port name corresponding to the second card slot position identification information and a corresponding second target sorting sequence number from the reference network port sorting sequence;
and in the target sorting sequence, reserving the second target internet access name corresponding to the second card slot position identification information and the corresponding second target sorting sequence number.
7. The method of claim 1, further comprising:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference network port sequencing sequence is not detected, acquiring mainboard configuration information and network card configuration information;
acquiring a second card slot position identification information set of the target operating system currently inserted with a second target network card and a second network port identification information set included by the target operating system;
sorting the card slot position identification information in the second card slot position identification information set based on the physical position serial number included in the mainboard configuration information to obtain a second sorting sequence;
sorting the network port identification information corresponding to each card slot position identification information in the second network port identification information set according to the second sorting order to obtain a second sorting result;
sorting the network port identification information corresponding to each card slot position identification information in the second sorting result according to the card slot direction included in the mainboard configuration information and the network port loading sequence included in the network card configuration information to obtain the reference network port sorting sequence;
and recording the reference internet access sequencing sequence to the first target file.
8. The method according to claim 7, wherein the obtaining the motherboard configuration information and the network card configuration information if the first target file including the reference port sorting order is not detected under the condition that the target operating system is in the boot state includes:
under the condition that a target operating system is in a starting state, if a first target file comprising a reference internet access sequencing sequence is not detected, acquiring mainboard identification information;
and if the mainboard identification information belongs to preset identification information, acquiring the mainboard configuration information and the network card configuration information.
9. The method of claim 1 or 7, further comprising:
acquiring current PCI/PCIe bus tree information;
and updating the PCI/PCIe bus tree information in the second target file into the current PCI/PCIe bus tree information.
10. An apparatus for ordering network ports, the apparatus comprising: the device comprises a first acquisition unit, a second acquisition unit, an obtaining unit and an updating unit; wherein:
the first obtaining unit is used for obtaining a second target file if a first target file comprising a reference internet access sorting sequence is detected under the condition that the target operating system is in a starting state; the second target file comprises peripheral equipment interconnection standard PCI/peripheral expansion equipment interconnection standard PCIe bus tree information of a network card corresponding to the network port information corresponding to the first target file;
the second obtaining unit is used for obtaining a first card slot position identification information set and a first internet access identification information set; the first slot position identification information set comprises at least one slot position identification information of a first target network card currently inserted into the target operating system, and the first network port identification information set comprises network port identification information of at least one network port included in the first target network card;
the obtaining unit is configured to obtain a target internet access ordering order based on the second target file, the first card slot identifier information set, the first internet access identifier information set, and the reference internet access ordering order;
the updating unit is configured to write the target port sorting order into the first target file to replace the reference port sorting order in the first target file.
11. A portal sequencing device, comprising: the device comprises a card slot position, a first target network card, a memory, a processor and a communication bus; wherein:
the card inserting groove position is used for installing a network card;
the first target network card is used for realizing the communication of the network port sequencing equipment on a computer network;
the memory to store executable instructions;
the communication bus is used for realizing communication connection between the processor and the memory;
the processor is configured to execute the portal sequencing program stored in the memory, and implement the steps of the portal sequencing method according to any one of claims 1 to 9.
12. A storage medium having stored thereon a portal ordering program, which when executed by a processor implements the steps of the portal ordering method according to any of claims 1 to 9.
CN202111616153.5A 2021-12-27 2021-12-27 Network port ordering method, device, equipment and storage medium Active CN114416185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111616153.5A CN114416185B (en) 2021-12-27 2021-12-27 Network port ordering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111616153.5A CN114416185B (en) 2021-12-27 2021-12-27 Network port ordering method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114416185A true CN114416185A (en) 2022-04-29
CN114416185B CN114416185B (en) 2024-04-09

Family

ID=81269200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111616153.5A Active CN114416185B (en) 2021-12-27 2021-12-27 Network port ordering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114416185B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374281A (en) * 2002-06-13 2002-12-26 Fujitsu Ltd Distributor for fixed-length cell
JP2011118663A (en) * 2009-12-03 2011-06-16 Hitachi Ltd Nic selection method and program
JP2012244581A (en) * 2011-05-24 2012-12-10 Fujitsu Semiconductor Ltd Communication device, semiconductor device, and setting method for device id
CN108696394A (en) * 2018-05-18 2018-10-23 深圳市智微智能科技开发有限公司 The means of communication and equipment of multiple PCIE network interface cards under a kind of Linux system
CN109117197A (en) * 2018-08-28 2019-01-01 郑州云海信息技术有限公司 A method of it is chaotic to solve the name of cluster network interface card
CN109445872A (en) * 2018-10-22 2019-03-08 成都安恒信息技术有限公司 A method of each network interface physical location is determined applied to multi-gateway Linux server
CN110943859A (en) * 2019-11-21 2020-03-31 深信服科技股份有限公司 Network port sequence adjusting method, device, equipment and storage medium
CN112671942A (en) * 2020-12-04 2021-04-16 浪潮电子信息产业股份有限公司 Method, device, equipment and storage medium for setting network port name
WO2021237434A1 (en) * 2020-05-26 2021-12-02 西安诺瓦星云科技股份有限公司 Display screen configuration method, apparatus and system, and computer-readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002374281A (en) * 2002-06-13 2002-12-26 Fujitsu Ltd Distributor for fixed-length cell
JP2011118663A (en) * 2009-12-03 2011-06-16 Hitachi Ltd Nic selection method and program
JP2012244581A (en) * 2011-05-24 2012-12-10 Fujitsu Semiconductor Ltd Communication device, semiconductor device, and setting method for device id
CN108696394A (en) * 2018-05-18 2018-10-23 深圳市智微智能科技开发有限公司 The means of communication and equipment of multiple PCIE network interface cards under a kind of Linux system
CN109117197A (en) * 2018-08-28 2019-01-01 郑州云海信息技术有限公司 A method of it is chaotic to solve the name of cluster network interface card
CN109445872A (en) * 2018-10-22 2019-03-08 成都安恒信息技术有限公司 A method of each network interface physical location is determined applied to multi-gateway Linux server
CN110943859A (en) * 2019-11-21 2020-03-31 深信服科技股份有限公司 Network port sequence adjusting method, device, equipment and storage medium
WO2021237434A1 (en) * 2020-05-26 2021-12-02 西安诺瓦星云科技股份有限公司 Display screen configuration method, apparatus and system, and computer-readable storage medium
CN112671942A (en) * 2020-12-04 2021-04-16 浪潮电子信息产业股份有限公司 Method, device, equipment and storage medium for setting network port name

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
VIEWSKY11: "TP-Link WR703N OpenWRT 固件修改 WAN LAN排序", Retrieved from the Internet <URL:《www.blog.csdn.net/viewsky11/article/details/18449703》> *
凌晨: "基于物联网的信息安全传输***的研究与应用", 《中国优秀硕士论文 信息科技》 *

Also Published As

Publication number Publication date
CN114416185B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
WO2017219983A1 (en) Method and terminal for acquiring application program between terminals
CN109901847B (en) Memory card based mass production system firmware mass production method
CN106648463B (en) Nand Flash block management method and system
CN107426041B (en) Method and device for analyzing command
CN110597523A (en) Board card firmware burning method, device and system, board card and terminal equipment
CN113608790A (en) Linux system based self-adaptive management method and system for serial device and storage medium
CN115114600A (en) Unified management and control method and system for internal equipment and external equipment
US6708229B2 (en) Configuring computer components
CN114416185A (en) Network port ordering method, device, equipment and storage medium
CN102521195B (en) Address resource allocation method and memorizer
US20230185464A1 (en) Method for determining a hard disk connection slot connected to a hard disk and terminal device
CN113849379B (en) Method, device, equipment and readable medium for collecting server asset information
CN113448847B (en) Test method and system
CN111338700B (en) Method and device for loading FPGA version and storage medium
CN113031970A (en) Automatic installation and deployment method and system
CN112650702A (en) Port binding method and system of multi-port USB device
CN107977335B (en) Method and device for accessing resources
CN104980603A (en) USB_3G network card user state automatic identification and dialing method and device
CN110532040A (en) Loading method and device, the storage medium and electronic equipment of firmware program
CN113904930B (en) Network port ordering method, device, equipment and storage medium
JP7519571B2 (en) Method for binding and arranging bus adapters and channels, mapping management device and connection system
CN112685341B (en) Configuration method, device and equipment of storage system adapter and storage medium
US12026393B2 (en) Apparatus and method for selecting storage location based on data usage
CN115460161A (en) Optical module code changing method, device, equipment and storage medium
US11231833B2 (en) Prioritizing information when app display size is reduced

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant