CN112463255B - Virtual interface loading method and device, physical network card and storage medium - Google Patents

Virtual interface loading method and device, physical network card and storage medium Download PDF

Info

Publication number
CN112463255B
CN112463255B CN202011455931.2A CN202011455931A CN112463255B CN 112463255 B CN112463255 B CN 112463255B CN 202011455931 A CN202011455931 A CN 202011455931A CN 112463255 B CN112463255 B CN 112463255B
Authority
CN
China
Prior art keywords
interface
virtual interface
target
virtual
parameters
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.)
Active
Application number
CN202011455931.2A
Other languages
Chinese (zh)
Other versions
CN112463255A (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.)
Guangzhou Xaircraft Technology Co Ltd
Original Assignee
Guangzhou Xaircraft Technology 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 Guangzhou Xaircraft Technology Co Ltd filed Critical Guangzhou Xaircraft Technology Co Ltd
Priority to CN202011455931.2A priority Critical patent/CN112463255B/en
Publication of CN112463255A publication Critical patent/CN112463255A/en
Application granted granted Critical
Publication of CN112463255B publication Critical patent/CN112463255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • 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)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a virtual interface loading method and device, a physical network card and a storage medium, and relates to the technical field of virtual interfaces. In the application, firstly, a virtual interface reload instruction is obtained, wherein the virtual interface reload instruction comprises virtual interface identification information, and the virtual interface identification information is used for identifying a target virtual interface needing to be reloaded. And secondly, acquiring a target interface parameter based on the virtual interface identification information, wherein the target interface parameter is a new interface parameter corresponding to the interface parameter of the target virtual interface. The target virtual interface is then reloaded based on the target interface parameters. Based on the method, the problem of poor connection stability based on virtual interface establishment in the prior art can be solved.

Description

Virtual interface loading method and device, physical network card and storage medium
Technical Field
The present application relates to the field of virtual interface technologies, and in particular, to a virtual interface loading method and apparatus, a physical network card, and a storage medium.
Background
In order to reduce the equipment cost, a plurality of virtual interfaces are generally configured for one physical network card, so as to realize different services. However, according to the research of the inventor, in the technology of configuring a plurality of virtual interfaces by one physical network card, the connection established based on the virtual interfaces has the problem of poor stability.
Disclosure of Invention
In view of the above, the present application aims to provide a method and apparatus for loading a virtual interface, a physical network card and a storage medium, so as to solve the problem in the prior art that the connection stability established based on the virtual interface is poor.
In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme:
A virtual interface loading method is applied to a physical network card configured with a plurality of virtual interfaces, and comprises the following steps:
Obtaining a virtual interface reload instruction, wherein the virtual interface reload instruction comprises virtual interface identification information, and the virtual interface identification information is used for identifying a target virtual interface needing to be reloaded;
acquiring a target interface parameter based on the virtual interface identification information, wherein the target interface parameter is a new interface parameter corresponding to the interface parameter of the target virtual interface;
reloading the target virtual interface based on the target interface parameters.
In a preferred option of the embodiment of the present application, in the above method for loading a virtual interface, the step of reloading the target virtual interface based on the target interface parameter includes:
closing and deleting the target virtual interface;
establishing a new target virtual interface based on the target interface parameters;
And starting the new target virtual interface so that the new target virtual interface performs interface work based on the target interface parameters.
In a preferred option of the embodiment of the present application, in the above method for loading a virtual interface, the step of reloading the target virtual interface based on the target interface parameter includes:
establishing a new target virtual interface based on the target interface parameters;
Starting the new target virtual interface to enable the new target virtual interface to execute interface work based on the target interface parameters;
and sending an interface switching instruction generated based on the new target virtual interface to target equipment connected with the target virtual interface, so that the target equipment disconnects the connection with the target virtual interface based on the interface switching instruction and establishes connection with the new target virtual interface.
In a preferred option of the embodiment of the present application, in the above method for loading a virtual interface, the step of obtaining a virtual interface reload instruction includes:
judging whether new interface parameters are generated for the target virtual interface or not;
And if the new interface parameters are generated for the target virtual interface, generating a virtual interface reload instruction comprising virtual interface identification information of the target virtual interface.
In a preferred option of the embodiment of the present application, in the above virtual interface loading method, the virtual interface loading method further includes:
Obtaining a parameter updating instruction, wherein the parameter updating instruction comprises virtual interface identification information;
and generating new interface parameters according to the interface parameters of the target virtual interface corresponding to the virtual interface identification information and based on the parameter updating instruction.
In a preferred option of the embodiment of the present application, in the above virtual interface loading method, the step of generating new interface parameters for the interface parameters of the target virtual interface corresponding to the virtual interface identification information based on the parameter update instruction includes:
determining a target configuration file based on the virtual interface identification information, wherein the target configuration file is provided with interface parameters of a target virtual interface corresponding to the virtual interface identification information;
deleting interface parameters in the target configuration file;
and writing interface updating parameters included in the parameter updating instruction into the target configuration file, wherein the interface updating parameters are used as new interface parameters.
In a preferred option of the embodiment of the present application, in the above virtual interface loading method, the step of generating new interface parameters for the interface parameters of the target virtual interface corresponding to the virtual interface identification information based on the parameter update instruction includes:
determining a target configuration file based on the virtual interface identification information, wherein the target configuration file is provided with interface parameters of a target virtual interface corresponding to the virtual interface identification information;
reading the interface parameters from the target configuration file;
Updating the interface parameters based on the interface updating parameters included in the parameter updating instruction to obtain new interface parameters;
and writing the new interface parameters into the target configuration file.
The embodiment of the application also provides a virtual interface loading device which is applied to a physical network card configured with a plurality of virtual interfaces, and comprises:
the system comprises a reload instruction acquisition module, a reload instruction processing module and a reload instruction processing module, wherein the reload instruction acquisition module is used for acquiring a reload instruction of a virtual interface, and the reload instruction of the virtual interface comprises virtual interface identification information which is used for identifying a target virtual interface needing reloading;
the interface parameter acquisition module is used for acquiring target interface parameters based on the virtual interface identification information, wherein the target interface parameters are new interface parameters corresponding to the interface parameters of the target virtual interface;
and the virtual interface loading module is used for reloading the target virtual interface based on the target interface parameters.
On the basis of the above, the embodiment of the application also provides a physical network card, which comprises:
A memory for storing a computer program;
and the processor is connected with the memory and is used for executing the computer program stored in the memory so as to realize the virtual interface loading method.
On the basis of the above, the embodiment of the application also provides a computer readable storage medium, which stores a computer program, and when the computer program is executed, the virtual interface loading method is realized.
According to the virtual interface loading method and device, the physical network card and the storage medium, the virtual interface reloading instruction comprising the virtual interface identification information is obtained, so that the target virtual interface corresponding to the virtual interface identification information can be reloaded in a targeted manner based on the virtual interface identification information. Therefore, the problem that the connection established based on other virtual interfaces is disconnected due to the fact that the other virtual interfaces are reloaded in the process of reloading the target virtual interfaces can be avoided, the stability of the connection established based on the plurality of virtual interfaces is improved as a whole, the problem that the stability of the connection established based on the virtual interfaces in the prior art is poor is further improved, reliable operation of communication service is guaranteed, and high practical value is achieved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
Fig. 1 is a block diagram of a physical network card according to an embodiment of the present application.
Fig. 2 is a flow chart of a virtual interface loading method according to an embodiment of the present application.
Fig. 3 is a flow chart illustrating the sub-steps included in step S110 in fig. 2.
Fig. 4 is a flow chart illustrating the sub-steps included in step S130 in fig. 2.
Fig. 5 is a flow chart illustrating other sub-steps included in step S130 in fig. 2.
Fig. 6 is a flowchart illustrating other steps included in the virtual interface loading method according to the embodiment of the present application.
Fig. 7 is a flow chart illustrating the sub-steps included in step S150 in fig. 6.
Fig. 8 is a flow chart illustrating other sub-steps included in step S150 in fig. 6.
Fig. 9 is a system block diagram of a communication system of an unmanned aerial vehicle according to an embodiment of the present application.
Fig. 10 is a block diagram of a virtual interface loading device according to an embodiment of the present application.
Icon: 10-a physical network card; 12-memory; 14-a processor; 100-virtual interface loading means; 110-a reload instruction acquisition module; 120-an interface parameter acquisition module; 130-virtual interface loading module.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments of the present application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In some current applications of the physical network card, a plurality of virtual interfaces are generally configured based on consideration of cost, so that different services can be implemented. For example, in the bridge mode of a router, two virtual interfaces may be configured, one virtual interface may be used to connect to a superior router and the other virtual interface may be used to create a new local area network.
The inventor of the application discovers that the problem of disconnection easily occurs based on the connection established between the plurality of virtual interfaces and other devices aiming at the application scene of configuring the plurality of virtual interfaces of the physical network card, so that the stability of the connection is poor.
Further, further studies by the inventors of the present application have found that the cause of the problem that disconnection easily occurs based on connection established by a plurality of virtual interfaces with other devices is that:
Based on a certain requirement, after the interface parameters of any one virtual interface are modified, all virtual interfaces are reloaded, and the reloading can disconnect the connection established based on each virtual interface, so that the connection established based on a plurality of virtual interfaces is caused, and the problem of poor stability is presented on the whole.
For example, for a bridge mode of a home router, the first virtual interface may be used as a CLIENT for connecting to a higher level router, and the second virtual interface may be used as an AP (access point) for opening a new lan for accessing other devices (such as a cell phone, etc.). Therefore, if the router of the upper level with better network needs to be changed, the interface parameter of the first virtual interface needs to be modified or updated, then, after the interface parameter is modified or updated, in order to ensure that the modified or updated interface parameter can be effectively used, the virtual interface needs to be reloaded, and the reloaded object not only comprises the first virtual interface but also comprises the second virtual interface, so that the connection between other devices such as a mobile phone and the second virtual interface is disconnected.
It is based on the above-mentioned technical problem and the finding of the cause of the technical problem that, in order to overcome the technical problem, as shown in fig. 1, an embodiment of the present application provides a physical network card 10, which may include a memory 12, a processor 14 and a virtual interface loading device 100.
Wherein, the memory 12 and the processor 14 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, electrical connection may be made to each other via one or more communication buses or signal lines. The virtual interface loading device 100 includes at least one software functional module that may be stored in the memory 12 in the form of software or firmware (firmware). The processor 14 is configured to execute an executable computer program stored in the memory 12, for example, a software function module and a computer program included in the virtual interface loading device 100, so as to implement the virtual interface loading method provided by the embodiment of the present application.
Alternatively, the Memory 12 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
Also, the processor 14 may be a general-purpose processor including a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), and the like.
It is to be understood that the configuration shown in fig. 1 is merely illustrative, and that the physical network card 10 may also include more or fewer components than those shown in fig. 1, or have a different configuration than that shown in fig. 1. For example, the physical network card 10 may further include a communication unit for information interaction with other devices.
The physical network card 10 may exist in any form, for example, in an alternative example, the physical network card 10 may be a router.
Referring to fig. 2, the embodiment of the present application further provides a virtual interface loading method, which can be applied to the above-mentioned physical network card 10. The physical network card 10 may be configured with a plurality of virtual interfaces, and method steps defined by a flow related to the virtual interface loading method may be implemented by the physical network card 10.
The specific flow shown in fig. 2 will be described in detail.
Step S110, obtaining a virtual interface reload instruction.
In this embodiment, the physical network card 10 may obtain a virtual interface reload instruction for reloading the target virtual interface. The virtual interface reload instruction may include virtual interface identification information, where the virtual interface identification information is used to identify the target virtual interface that needs to be reloaded.
Step S120, obtaining the target interface parameter based on the virtual interface identification information.
In this embodiment, after the virtual interface reload instruction is obtained based on step S110, the physical network card 10 may obtain, based on the virtual interface identification information included in the virtual interface reload instruction, the target interface parameter of the target virtual interface corresponding to (identified by) the virtual interface identification information.
The target interface parameter is a new interface parameter corresponding to the interface parameter of the target virtual interface.
Step S130, reloading the target virtual interface based on the target interface parameter.
In this embodiment, after the target interface parameter is acquired based on step S120, the physical network card 10 may reload the target virtual interface based on the target interface parameter.
Based on the method, the virtual interface reloading instruction comprising the virtual interface identification information is obtained, so that the target virtual interface corresponding to the virtual interface identification information can be reloaded in a targeted manner based on the virtual interface identification information. Therefore, the problem that the connection established based on other virtual interfaces is disconnected due to the fact that the other virtual interfaces are reloaded in the process of reloading the target virtual interfaces can be avoided, the stability of the connection established based on the plurality of virtual interfaces is improved as a whole, the problem that the stability of the connection established based on the virtual interfaces is poor in the prior art is further improved, and reliable communication service is guaranteed.
In the first aspect, it should be noted that, in step S110, a specific manner of obtaining the virtual interface reload instruction is not limited, and may be selected according to actual application requirements.
For example, in an alternative example, in order to ensure timely and efficient reloading of the target virtual interface, step S110 may include step S111 and step S113, as described below.
Step S111, determining whether a new interface parameter is generated for the target virtual interface.
In this embodiment, in order to obtain the virtual interface reload instruction in time, it may be determined whether a new interface parameter is generated for the target virtual interface.
When it is determined that a new interface parameter is generated for the target virtual interface, step S113 may be executed to generate a virtual interface reload instruction.
Step S113, generating a virtual interface reload instruction including virtual interface identification information of the target virtual interface.
In this embodiment, when it is determined that new interface parameters are generated for the target virtual interface based on step S111, in order to enable targeted reloading of the target virtual interface, a virtual interface reload instruction including virtual interface identification information of the target virtual interface may be generated, so when the virtual interface reload instruction is executed, targeted reloading of the target virtual interface may be performed based on the virtual interface identification information, and error reloads of other virtual interfaces may be avoided.
As another example, in another alternative example, the target virtual interface may not need to be reloaded immediately after new interface parameters are generated for the target virtual interface based on the needs of the user. Based on this, after generating new interface parameters for the target virtual interface, it may be determined whether a certain condition is reached, for example, a certain time condition is reached or certain trigger information is obtained (for example, a trigger instruction is generated based on the operation of the user), and after reaching a certain condition, a virtual interface reload instruction is generated.
In the second aspect, it should be noted that, in step S120, a specific manner of obtaining the target interface parameter is not limited, and may be selected according to actual application requirements.
For example, in an alternative example, a corresponding configuration file may be determined based on the virtual interface identification information and a pre-established correspondence, and then parameters may be read from the configuration file, so that the target interface parameters may be obtained.
For another example, in an alternative example, the virtual interface identification information may be used to traverse the existing multiple configuration files, so that the corresponding configuration files may be determined, and then the parameters are read from the configuration files, so that the target interface parameters may be obtained.
In the third aspect, it should be noted that, in step S130, a specific manner of reloading the target virtual interface is not limited, and may be selected according to actual application requirements.
For example, in an alternative example, in order to avoid virtual interface resource waste and the problem of virtual interface collision that may occur, in conjunction with fig. 4, step S130 may include step S131, step S132, and step S133, which are described in detail below.
Step S131, closing and deleting the target virtual interface.
In this embodiment, for the target virtual interface, an operation of closing and deleting may be performed.
Step S132, establishing a new target virtual interface based on the target interface parameters.
In this embodiment, after the target virtual interface is closed and deleted based on step S131, a new target virtual interface may be established based on the target interface parameters acquired in step S120, that is, based on the new interface parameters corresponding to the target virtual interface.
Step S133, starting the new target virtual interface so that the new target virtual interface executes interface work based on the target interface parameters.
In this embodiment, after the new target virtual interface is established based on step S132, the new target virtual interface may be started, so that the new target virtual interface may be caused to perform an interface job based on the target interface parameters.
It will be appreciated that in this example, to facilitate other devices to which the target virtual interface was connected prior to shutdown and deletion, a connection can be effectively established based on the new target virtual interface, which may have the same interface name as the target virtual interface, e.g., as one possible application example, the interface name may be wlan0.
As another alternative example, in order to ensure that the physical network card 10 has sufficient virtual interfaces to form a standby virtual interface, in conjunction with fig. 5, step S130 may include steps S134, S135 and S136, as described below.
Step S134, establishing a new target virtual interface based on the target interface parameters.
In this embodiment, after the target interface parameter is obtained based on step S120, a new target virtual interface may be established based on the target interface parameter.
Step S135, starting the new target virtual interface, so that the new target virtual interface performs an interface job based on the target interface parameters.
In this implementation, after the new target virtual interface is established based on step S134, the new target virtual interface may be started, so that the new target virtual interface may be caused to perform an interface job based on the target interface parameters.
And step S136, an interface switching instruction generated based on the new target virtual interface is sent to target equipment connected with the target virtual interface, so that the target equipment disconnects the connection with the target virtual interface based on the interface switching instruction and establishes connection with the new target virtual interface.
In this embodiment, after the new target virtual interface is started based on step S135, an interface switching instruction generated based on the new target virtual interface may be then sent to a target device connected to the target virtual interface. In this way, the target device may be enabled to disconnect from the target virtual interface and establish a connection with the new target virtual interface based on the interface switch instruction (which may include the interface name of the new target virtual interface in order to be able to establish a connection with the new target virtual interface).
It will be appreciated that in this example, to facilitate other devices to which the target virtual interface was connected prior to shutdown and deletion, a connection can be effectively established based on the new target virtual interface, which may have a different interface name than the target virtual interface, e.g., as one possible application example, the interface name of the target virtual interface may be wlan0 and the interface name of the new target virtual interface may be wlan1.
On the basis of the above example, since the target interface parameter, that is, the new interface parameter, needs to be acquired when step S120 is performed, in order to enable the new interface parameter to be acquired, in this embodiment, the virtual interface loading method may further include a step of generating the new interface parameter. Based on this, in conjunction with fig. 6, the virtual interface loading method may further include step S140 and step S150, which are described in detail below.
Step S140, obtaining a parameter update instruction.
In this embodiment, the physical network card 10 may obtain a parameter update instruction for generating the new interface parameter, where the parameter update instruction may include virtual interface identification information (the virtual interface identification information is used to identify a target virtual interface that needs to be reloaded).
Step S150, aiming at the interface parameters of the target virtual interface corresponding to the virtual interface identification information, generating new interface parameters based on the parameter updating instruction.
In this embodiment, after the parameter update instruction is obtained based on step S140, the physical network card 10 may generate new interface parameters for the interface parameters of the target virtual interface corresponding to the virtual interface identification information based on the parameter update instruction.
Alternatively, in the above example, the specific manner of obtaining the parameter update instruction based on step S140 is not limited, and may be selected according to actual application requirements.
For example, in an alternative example, the parameter update instruction may be generated in response to a parameter update operation by a user, and thus may be obtained.
As another example, in another alternative example, the parameter update instruction may be triggered to be generated based on a pre-configured condition, such as every certain interval or a certain occurrence (such as that there are too many other devices connected by the virtual interface to ensure the safety and efficiency of communication), so that the parameter update instruction may also be obtained.
Alternatively, in the above example, the specific manner of generating the new interface parameter based on step S150 is not limited, and may be selected according to actual application requirements.
For example, in an alternative example, in order to increase the efficiency of generating the new interface parameters, and thus the efficiency of reloading the virtual interface as a whole, in conjunction with fig. 7, step S150 may include step S151, step S152, and step S153, which are described in detail below.
Step S151, determining a target configuration file based on the virtual interface identification information.
In this embodiment, after the parameter update instruction is obtained based on step S140, a configuration file corresponding to the virtual interface identification information may be determined based on the virtual interface identification information included in the parameter update instruction, so that a target configuration file may be obtained.
The target configuration file has interface parameters of a target virtual interface corresponding to the virtual interface identification information. That is, the interface parameters are located in the target profile.
Step S152, deleting the interface parameters in the target configuration file.
In this embodiment, after the target profile is determined based on step S151, a deletion operation may be performed on the interface parameters in the target profile. That is, the interface parameters of the target virtual interface in the target configuration file may be deleted.
And step 153, writing interface updating parameters included in the parameter updating instruction into the target configuration file.
In this embodiment, after deleting the interface parameters in the target configuration file based on step S152, that is, after deleting the interface parameters of the target virtual interface, the interface update parameters included in the parameter update instruction may be written into the target configuration file.
That is, the parameter update instruction may further include the interface update parameter on the basis of including the virtual interface identification information. And, the interface update parameter may be used as a new interface parameter, so that the interface update parameter may be directly written into the target configuration file.
Based on this, when executing step S120, the reading operation may be directly performed on the parameters in the target configuration file, so as to obtain the new interface parameters, that is, the target interface parameters.
For another example, in another alternative example, in order to reduce the data amount of the interface update parameter, the parameter update operation may be simpler and less difficult for the user when the parameter update instruction is generated based on the parameter update operation of the user, and in conjunction with fig. 8, step S150 may include step S154, step S155, step S156, and step S157, which are described in detail below.
Step S154, determining a target configuration file based on the virtual interface identification information.
In this embodiment, after the parameter update instruction is obtained based on step S140, a configuration file corresponding to the virtual interface identification information may be determined based on the virtual interface identification information included in the parameter update instruction, so that a target configuration file may be obtained.
The target configuration file has interface parameters of a target virtual interface corresponding to the virtual interface identification information. That is, the interface parameters are located in the target profile.
Step S155, reading the interface parameters from the target configuration file.
In this embodiment, after the target configuration file is determined based on step S154, the interface parameters may be read from the target configuration file, so that the interface parameters of the target virtual interface may be obtained.
Step S156, updating the interface parameters based on the interface update parameters included in the parameter update instruction to obtain new interface parameters.
In this embodiment, after the interface parameter is obtained based on step S155, update processing (such as updating one or more of parameters including an interface name, an access password, an access point encryption type, etc.) may be performed on the interface parameter based on the interface update parameter included in the parameter update instruction, so as to obtain a new interface parameter.
That is, the parameter update instruction may further include the interface update parameter on the basis of including the virtual interface identification information.
Step S157, writing the new interface parameters into the target configuration file.
In this embodiment, after the new interface parameter is obtained based on step S156, the new interface parameter may be written into the target configuration file to replace the interface parameter. Thus, when step S120 can be executed, the parameters in the target configuration file can be directly read, so as to obtain the new interface parameters, i.e. the target interface parameters are obtained.
On the basis of the above examples, the application further provides a specific application example for better description of the examples. The application example may be based on a scenario of a drone communication system, which may include a remote control, a mobile phone (or other terminal device as well), and a drone, in conjunction with fig. 9.
In detail, the remote controller may include a virtual interface a that may communicate with (a client of) the mobile phone as a virtual interface in the AP mode, and a virtual interface B that may communicate with the unmanned aerial vehicle as a virtual interface in the MESH mode (MESH mode refers to a MESH topology defined by IEEE802.16-2004 in order to maximize coverage of the wireless network while securing network throughput and providing effective utilization of the network).
In the unmanned aerial vehicle communication system, as a scene that the interface parameters need to be modified (updated), the pairing process of the unmanned aerial vehicle is adopted. When the remote controller is paired with the unmanned aerial vehicle, the remote controller needs to enter a special contracted network, if the mesh id is XAG0000, after both communication parties enter the same mesh id network, pairing information interaction is carried out, and if the mesh id (XAG 1234) enters after pairing, the network is accessed.
That is, in the above example, after pairing the remote controller and the unmanned aerial vehicle, the parameters of the mesh network need to be modified, so, in order to enable the modified parameters to be effectively used, a reloading operation needs to be performed on the virtual interface, and if during the process of performing the reloading, not only the virtual interface B but also the virtual interface a is reloaded, the communication based on the virtual interface a and the mobile phone is disconnected. For the purpose of explaining the above virtual interface loading method, the name of the virtual interface a may be wlan0, and the name of the virtual interface B may be wlan0-1.
1. Obtaining a virtual interface reload instruction, such as network reload wlan0-1;
2. Based on the wlan0-1 in the virtual interface reload instruction, reading new interface parameters corresponding to the wlan0-1 in the corresponding configuration file, such as mode=mesh, mesh id= XAG1234;
3. closing and deleting the virtual interface wlan0-1, wherein the corresponding two operation instructions are IP LINK SET DEV WLAN-1 down and IW DEV WLAN-1 del in a OPENWRT system of the remote controller respectively;
4. Performing interface newly-added operation based on the read new interface parameters to establish a new virtual interface wlan0-1, wherein an instruction corresponding to the operation is iw phy0INTERFACE ADD WLAN0-1 type mp and IW DEV WLAN0-1 mesh join XAG1234 in a OPENWRT system of the remote controller;
5. And executing starting operation on the new virtual interface wlan0-1 to enable the new virtual interface to work under the new interface parameters, wherein an instruction corresponding to the operation is IP LINK SET DEV WLAN-1 up in a OPENWRT system of the remote controller.
Based on this, the purpose of reloading only the virtual interface wlan0-1 can be realized, and the virtual interface wlan0 is not reloaded, so that stable communication between the mobile phone and the remote controller is ensured.
Referring to fig. 10, an embodiment of the present application further provides a virtual interface loading device 100, which is applicable to the above-mentioned physical network card 10. The virtual interface loading device 100 includes a reload instruction obtaining module 110, an interface parameter obtaining module 120, and a virtual interface loading module 130.
The reload instruction obtaining module 110 may be configured to obtain a virtual interface reload instruction, where the virtual interface reload instruction includes virtual interface identification information, where the virtual interface identification information is used to identify a target virtual interface that needs to be reloaded. In this embodiment, the reload instruction obtaining module 110 may be configured to execute step S110 shown in fig. 2, and the description of step S110 may be referred to as to the relevant content of the reload instruction obtaining module 110.
The interface parameter obtaining module 120 may be configured to obtain a target interface parameter based on the virtual interface identification information, where the target interface parameter is a new interface parameter corresponding to the interface parameter of the target virtual interface. In this embodiment, the interface parameter obtaining module 120 may be used to perform step S120 shown in fig. 2, and the description of step S120 may be referred to above with respect to the relevant content of the interface parameter obtaining module 120.
The virtual interface loading module 130 may be configured to reload the target virtual interface based on the target interface parameters. In this embodiment, the virtual interface loading module 130 may be used to execute step S130 shown in fig. 2, and the description of step S130 may be referred to above with respect to the relevant content of the virtual interface loading module 130.
Based on the above examples, the virtual interface loading apparatus 100 may further include other modules having different roles based on different requirements.
For example, in one alternative example, the other modules may be used to:
Obtaining a parameter updating instruction, wherein the parameter updating instruction comprises virtual interface identification information;
and generating new interface parameters according to the interface parameters of the target virtual interface corresponding to the virtual interface identification information and based on the parameter updating instruction.
Wherein the specific function of said other modules may be referred to the relevant description hereinbefore.
In an embodiment of the present application, corresponding to the above-mentioned virtual interface loading method, a computer readable storage medium is further provided, where a computer program is stored in the computer readable storage medium, and the computer program executes each step of the above-mentioned virtual interface loading method when running.
The steps executed when the computer program runs are not described in detail herein, and reference may be made to the explanation of the virtual interface loading method.
In summary, according to the virtual interface loading method and device, the physical network card and the storage medium provided by the application, the virtual interface reload instruction including the virtual interface identification information is obtained, so that the target virtual interface corresponding to the virtual interface identification information can be reloaded in a targeted manner based on the virtual interface identification information. Therefore, the problem that the connection established based on other virtual interfaces is disconnected due to the fact that the other virtual interfaces are reloaded in the process of reloading the target virtual interfaces can be avoided, the stability of the connection established based on the plurality of virtual interfaces is improved as a whole, the problem that the stability of the connection established based on the virtual interfaces in the prior art is poor is further improved, reliable operation of communication service is guaranteed, and high practical value is achieved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus and method embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes. 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A virtual interface loading method, applied to a physical network card configured with a plurality of virtual interfaces, where the plurality of virtual interfaces can operate in different modes, the virtual interface loading method comprising:
Obtaining a virtual interface reload instruction, wherein the virtual interface reload instruction comprises virtual interface identification information, and the virtual interface identification information is used for identifying a target virtual interface needing to be reloaded;
acquiring a target interface parameter based on the virtual interface identification information, wherein the target interface parameter is a new interface parameter corresponding to the interface parameter of the target virtual interface;
reloading the target virtual interface based on the target interface parameters.
2. The virtual interface loading method according to claim 1, wherein the step of reloading the target virtual interface based on the target interface parameters comprises:
closing and deleting the target virtual interface;
establishing a new target virtual interface based on the target interface parameters;
And starting the new target virtual interface so that the new target virtual interface performs interface work based on the target interface parameters.
3. The virtual interface loading method according to claim 1, wherein the step of reloading the target virtual interface based on the target interface parameters comprises:
establishing a new target virtual interface based on the target interface parameters;
Starting the new target virtual interface to enable the new target virtual interface to execute interface work based on the target interface parameters;
and sending an interface switching instruction generated based on the new target virtual interface to target equipment connected with the target virtual interface, so that the target equipment disconnects the connection with the target virtual interface based on the interface switching instruction and establishes connection with the new target virtual interface.
4. The virtual interface loading method according to claim 1, wherein the step of obtaining a virtual interface reload instruction includes:
judging whether new interface parameters are generated for the target virtual interface or not;
And if the new interface parameters are generated for the target virtual interface, generating a virtual interface reload instruction comprising virtual interface identification information of the target virtual interface.
5. The virtual interface loading method according to any one of claims 1 to 4, further comprising:
Obtaining a parameter updating instruction, wherein the parameter updating instruction comprises virtual interface identification information;
and generating new interface parameters according to the interface parameters of the target virtual interface corresponding to the virtual interface identification information and based on the parameter updating instruction.
6. The virtual interface loading method according to claim 5, wherein the step of generating new interface parameters for the interface parameters of the target virtual interface corresponding to the virtual interface identification information based on the parameter update instruction includes:
determining a target configuration file based on the virtual interface identification information, wherein the target configuration file is provided with interface parameters of a target virtual interface corresponding to the virtual interface identification information;
deleting interface parameters in the target configuration file;
And writing interface updating parameters included in the parameter updating instruction into the target configuration file, wherein the interface updating parameters are used as new interface parameters.
7. The virtual interface loading method according to claim 5, wherein the step of generating new interface parameters for the interface parameters of the target virtual interface corresponding to the virtual interface identification information based on the parameter update instruction includes:
determining a target configuration file based on the virtual interface identification information, wherein the target configuration file is provided with interface parameters of a target virtual interface corresponding to the virtual interface identification information;
reading the interface parameters from the target configuration file;
Updating the interface parameters based on the interface updating parameters included in the parameter updating instruction to obtain new interface parameters;
and writing the new interface parameters into the target configuration file.
8. A virtual interface loading apparatus, applied to a physical network card configured with a plurality of virtual interfaces capable of operating in different modes, comprising:
the system comprises a reload instruction acquisition module, a reload instruction processing module and a reload instruction processing module, wherein the reload instruction acquisition module is used for acquiring a reload instruction of a virtual interface, and the reload instruction of the virtual interface comprises virtual interface identification information which is used for identifying a target virtual interface needing reloading;
the interface parameter acquisition module is used for acquiring target interface parameters based on the virtual interface identification information, wherein the target interface parameters are new interface parameters corresponding to the interface parameters of the target virtual interface;
and the virtual interface loading module is used for reloading the target virtual interface based on the target interface parameters.
9. A physical network card, comprising:
A memory for storing a computer program;
a processor coupled to the memory for executing a computer program stored in the memory for implementing the virtual interface loading method of any one of claims 1-7.
10. A computer readable storage medium storing a computer program, wherein the computer program, when executed, implements the virtual interface loading method of any one of claims 1-7.
CN202011455931.2A 2020-12-10 2020-12-10 Virtual interface loading method and device, physical network card and storage medium Active CN112463255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011455931.2A CN112463255B (en) 2020-12-10 2020-12-10 Virtual interface loading method and device, physical network card and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011455931.2A CN112463255B (en) 2020-12-10 2020-12-10 Virtual interface loading method and device, physical network card and storage medium

Publications (2)

Publication Number Publication Date
CN112463255A CN112463255A (en) 2021-03-09
CN112463255B true CN112463255B (en) 2024-06-07

Family

ID=74801479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011455931.2A Active CN112463255B (en) 2020-12-10 2020-12-10 Virtual interface loading method and device, physical network card and storage medium

Country Status (1)

Country Link
CN (1) CN112463255B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360185B (en) * 2021-05-10 2023-06-23 Tcl空调器(中山)有限公司 Processing method and device of micro control unit of air conditioner external unit and micro control unit
CN113656100B (en) * 2021-08-17 2023-07-07 城云科技(中国)有限公司 Interface switching method, device, electronic device and computer program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902542A (en) * 2012-09-27 2013-01-30 Tcl通力电子(惠州)有限公司 virtual interface configuration method and device
CN102932174A (en) * 2012-10-25 2013-02-13 华为技术有限公司 Method, device and physical host for managing physical network card
CN107612702A (en) * 2016-07-12 2018-01-19 中兴通讯股份有限公司 A kind of method for configuring routers and device
CN108092869A (en) * 2017-12-26 2018-05-29 迈普通信技术股份有限公司 Virtual interface collocation method and communication equipment
CN108156009A (en) * 2016-12-06 2018-06-12 北京金山云网络技术有限公司 A kind of service calling method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10728145B2 (en) * 2018-08-30 2020-07-28 Juniper Networks, Inc. Multiple virtual network interface support for virtual execution elements

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902542A (en) * 2012-09-27 2013-01-30 Tcl通力电子(惠州)有限公司 virtual interface configuration method and device
CN102932174A (en) * 2012-10-25 2013-02-13 华为技术有限公司 Method, device and physical host for managing physical network card
CN107612702A (en) * 2016-07-12 2018-01-19 中兴通讯股份有限公司 A kind of method for configuring routers and device
CN108156009A (en) * 2016-12-06 2018-06-12 北京金山云网络技术有限公司 A kind of service calling method and device
CN108092869A (en) * 2017-12-26 2018-05-29 迈普通信技术股份有限公司 Virtual interface collocation method and communication equipment

Also Published As

Publication number Publication date
CN112463255A (en) 2021-03-09

Similar Documents

Publication Publication Date Title
US11064352B2 (en) Embedded universal integrated circuit card (eUICC) file system management with profile switching
CN105897860B (en) Network device and information processing method
KR101665492B1 (en) Management method for embedded universal integrated circuit card, related device and system
CN105471686B (en) Terminal control method, device and system
CN112463255B (en) Virtual interface loading method and device, physical network card and storage medium
CN111522264A (en) Device control method and device, storage medium, and electronic device
CN105376257B (en) Login method, smart home system and the Cloud Server of smart home application program
US20160285703A1 (en) Cpe network configuration systems and methods
CN105916144B (en) Techniques for dynamically supporting different authentication algorithms
CN104902547A (en) WiFi (wireless fidelity) network connection method and WiFi network connection device
CN113691404A (en) Network repairing method and device of intelligent equipment and intelligent gateway
CN111163469A (en) Network distribution method of intelligent household appliance, wireless module and intelligent household appliance
CN113498594A (en) Control method and device of intelligent household system, electronic equipment and storage medium
CN111541579A (en) Industrial gateway control method and device, computer equipment and storage medium
CN111405059B (en) Cloud device data transmission method, electronic device and Internet of things system
CN111585801A (en) ZigBee device upgrading method and related device
CN111654399A (en) Networking method, device and equipment based on SD-WAN and storage medium
EP3197207A1 (en) Method for managing application resources and registered node in m2m
EP3306858B1 (en) Network management system deployment method and device, and network management system
US10432714B2 (en) Data processing method and system based on asymmetric P2P network
CN113596792A (en) Binding method and device of electronic equipment, storage medium and electronic device
CN106169982B (en) Method, device and system for processing expansion port
CN112839372A (en) Network access method and device for user and computer readable storage medium
CN111182536A (en) SIM card state detection method, device, network equipment and storage medium
CN107257586B (en) Mobile network connection method and system when intelligent terminal is connected with WiFi

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510000 Block C, 115 Gaopu Road, Tianhe District, Guangzhou City, Guangdong Province

Applicant after: XAG Co., Ltd.

Address before: 510000 Block C, 115 Gaopu Road, Tianhe District, Guangzhou City, Guangdong Province

Applicant before: Guangzhou Xaircraft Technology Co.,Ltd.

GR01 Patent grant