[go: up one dir, main page]

CN116684388A - Network card management method, device, electronic equipment and storage medium - Google Patents

Network card management method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116684388A
CN116684388A CN202310640074.0A CN202310640074A CN116684388A CN 116684388 A CN116684388 A CN 116684388A CN 202310640074 A CN202310640074 A CN 202310640074A CN 116684388 A CN116684388 A CN 116684388A
Authority
CN
China
Prior art keywords
network card
network
electronic device
candidate
target
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.)
Pending
Application number
CN202310640074.0A
Other languages
Chinese (zh)
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.)
Ecoflow Technology Ltd
Original Assignee
Ecoflow Technology 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 Ecoflow Technology Ltd filed Critical Ecoflow Technology Ltd
Priority to CN202310640074.0A priority Critical patent/CN116684388A/en
Publication of CN116684388A publication Critical patent/CN116684388A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/15Interconnection of switching modules
    • 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
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请涉及通信技术领域,提供了一种网卡管理方法、装置、电子设备及存储介质,方法包括:电子设备在每个检测周期,通过获取每个网卡的IP地址确定每个网卡的可用状态,从而确定出当前可用的候选网卡。电子设备基于各候选网卡的优先级从各候选网卡中确定要启用的目标网卡,使用目标网卡进行通信。从而实现了电子设备在配置多网卡的情况下,动态确定可进行通信的目标网卡,保证了电子设备的工作效率。

The present application relates to the field of communication technology, and provides a network card management method, device, electronic equipment, and storage medium. The method includes: the electronic equipment determines the availability status of each network card by obtaining the IP address of each network card in each detection cycle, Thus, the currently available candidate network cards are determined. The electronic device determines a target network card to be activated from among the candidate network cards based on the priority of each candidate network card, and uses the target network card for communication. Therefore, when the electronic device is configured with multiple network cards, it is realized that the target network card that can communicate is dynamically determined, and the working efficiency of the electronic device is ensured.

Description

网卡管理方法、装置、电子设备及存储介质Network card management method, device, electronic equipment and storage medium

技术领域technical field

本申请涉及通信技术领域,尤其涉及一种网卡管理方法、装置、电子设备及存储介质。The present application relates to the technical field of communication, and in particular to a network card management method, device, electronic equipment and storage medium.

背景技术Background technique

随着物联网应用场景的不断增多,如能源管理、工业自动化等,对通信方式的要求也逐渐多样化。为了满足物联网设备在不同应用场景下的使用需求,物联网设备需要具备灵活的通信能力,能够与各种类型的网络进行连接和互操作。例如,储能设备通常需要支持以太网通信,以实现高速数据传输和实时控制,同时也可以支持无线保真(WirelessFidelity,Wi-Fi)与蓝牙等无线通信方案,以方便用户远程监控和控制储能设备。自移动设备通常需要支持Wi-Fi与蓝牙等无线通信,以实现与其他设备或网络的连接。With the increasing number of IoT application scenarios, such as energy management and industrial automation, the requirements for communication methods are gradually diversifying. In order to meet the usage requirements of IoT devices in different application scenarios, IoT devices need to have flexible communication capabilities and be able to connect and interoperate with various types of networks. For example, energy storage devices usually need to support Ethernet communication to achieve high-speed data transmission and real-time control. At the same time, they can also support wireless communication solutions such as Wireless Fidelity (Wi-Fi) and Bluetooth to facilitate remote monitoring and control of storage devices. able equipment. Mobile devices usually need to support wireless communication such as Wi-Fi and Bluetooth to realize connection with other devices or networks.

相应地,物联网设备为了支持不同类型的网络,需要集成多种类型的网卡,例如以太网网卡、Wi-Fi网卡等。而这些网卡的状态可能是动态变化的,且在同一时间只能由一个网卡为物联网设备提供上网服务。若物联网设备启用的网卡不当,可能导致网络中断,从而影响物联网设备的工作效率。Correspondingly, in order to support different types of networks, IoT devices need to integrate multiple types of network cards, such as Ethernet network cards and Wi-Fi network cards. The states of these network cards may change dynamically, and only one network card can provide Internet access services for IoT devices at the same time. If the network card of the IoT device is not properly enabled, the network may be interrupted, thereby affecting the work efficiency of the IoT device.

发明内容Contents of the invention

鉴于此,本申请提供一种网卡管理方法、装置、电子设备及存储介质,以解决物联网设备启用的网卡不当,影响物联网设备的工作效率的问题。In view of this, the present application provides a network card management method, device, electronic equipment, and storage medium to solve the problem that an improperly activated network card of an Internet of Things device affects the working efficiency of the Internet of Things device.

本申请实施例的第一方面提供了一种网卡管理方法,所述网卡管理方法包括:在每个检测周期,将所述电子设备中已分配IP地址的网卡确定为候选网卡;基于各所述候选网卡对应的优先级,从各所述候选网卡中确定目标网卡;使用所述目标网卡进行通信。The first aspect of the embodiments of the present application provides a network card management method. The network card management method includes: in each detection cycle, determining a network card that has been assigned an IP address in the electronic device as a candidate network card; The priority corresponding to the candidate network cards, determining the target network card from each of the candidate network cards; using the target network card for communication.

在本申请实施例提供的一种网卡管理方法中,由于若电子设备读取到网卡的IP地址,则可以确定该网卡与电子设备中对应的网卡接口建立了物理连接,以及确定该网卡与相对应的上级网关设备建立了通信,也即确定网卡被激活,因此电子设备在每个检测周期,通过获取每个网卡的IP地址确定每个网卡的可用状态,从而确定出当前可用的候选网卡。又由于在每个检测周期,电子设备可能确定出的多个候选网卡,而在同一时间只能由一个网卡为电子设备提供上网服务,因此电子设备基于各候选网卡的优先级从各候选网卡中确定一个要启用的目标网卡,使用目标网卡进行通信。从而实现了在配置多网卡的情况下,电子设备周期性动态确定可进行通信的目标网卡,在一定程度上避免了电子设备长时间使用出现异常的网卡而导致网络长时间中断,保证了电子设备的工作效率。In the network card management method provided by the embodiment of the present application, if the electronic device reads the IP address of the network card, it can be determined that the network card has established a physical connection with the corresponding network card interface in the electronic device, and it can be determined that the network card is connected to the corresponding network card. The corresponding upper-level gateway device establishes communication, that is, determines that the network card is activated, so the electronic device determines the availability status of each network card by obtaining the IP address of each network card in each detection cycle, thereby determining the currently available candidate network card. And because in each detection cycle, the electronic device may determine multiple candidate network cards, and only one network card can provide Internet access services for the electronic device at the same time, so the electronic device selects from among the candidate network cards based on the priority of each candidate network card. Determine a target network card to be enabled, and use the target network card for communication. In this way, in the case of configuring multiple network cards, the electronic device periodically and dynamically determines the target network card that can communicate. work efficiency.

本申请实施例的第二方面提供了一种网卡管理装置,所述网卡管理装置包括:候选网卡确定模块,用于在每个检测周期,将所述电子设备中已分配IP地址的网卡确定为候选网卡;目标网卡确定模块,用于基于各所述候选网卡对应的优先级,从各所述候选网卡中确定目标网卡;通信模块,用于使用所述目标网卡进行通信。The second aspect of the embodiment of the present application provides a network card management device, the network card management device includes: a candidate network card determination module, configured to determine the network card that has been assigned an IP address in the electronic device in each detection cycle as A candidate network card; a target network card determining module, configured to determine a target network card from each of the candidate network cards based on the priority corresponding to each of the candidate network cards; a communication module, configured to use the target network card for communication.

本申请实施例的第三方面提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述网卡管理方法。The third aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, and the processor executes the computer The above network card management method is realized when the instruction is readable.

本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述网卡管理方法。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the foregoing network card management method is implemented.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application , for those skilled in the art, other drawings can also be obtained according to these drawings without paying creative labor.

图1是本申请实施例提供的网卡管理方法的应用场景图;FIG. 1 is an application scenario diagram of a network card management method provided in an embodiment of the present application;

图2是本申请实施例提供的网卡管理方法的应用场景示例图;FIG. 2 is an example diagram of an application scenario of a network card management method provided in an embodiment of the present application;

图3是本申请实施例提供的网卡管理方法的实现流程图;Fig. 3 is the implementation flowchart of the network card management method provided by the embodiment of the present application;

图4是本申请实施例提供的目标网卡确定方法的实现流程图;Fig. 4 is the implementation flowchart of the method for determining the target network card provided by the embodiment of the present application;

图5是本申请另一实施例提供的网卡管理方法的实现流程图;Fig. 5 is the implementation flowchart of the network card management method provided by another embodiment of the present application;

图6是本申请又一实施例提供的网卡管理方法的实现流程图;Fig. 6 is the implementation flowchart of the network card management method provided by another embodiment of the present application;

图7是本申请实施例提供的网卡管理装置的结构示意图;FIG. 7 is a schematic structural diagram of a network card management device provided in an embodiment of the present application;

图8是本申请实施例提供的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

需要说明的是,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”是用于区别类似的对象,而不是用于描述特定的顺序或先后次序。It should be noted that the terms "first" and "second" in the specification, claims and drawings of the present application are used to distinguish similar objects, rather than to describe a specific sequence or sequence.

另外需要说明的是,本申请实施例中公开的方法或流程图所示出的方法,包括用于实现方法的一个或多个步骤,在不脱离权利要求的范围的情况下,多个步骤的执行顺序可以彼此互换,其中某些步骤也可以被删除。In addition, it should be noted that the method disclosed in the embodiment of the application or the method shown in the flow chart includes one or more steps for realizing the method. Without departing from the scope of the claims, the multiple steps The order of execution can be interchanged with each other, and some of the steps can also be deleted.

下面将结合附图对一些实施例做出说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Some embodiments will be described below with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.

请参阅图1所示,为本申请实施例提供的网卡管理方法的一应用场景图,如图1所示,电子设备100与服务器200通信连接。电子设备100周期性检测网卡的可用状态(或激活状态),并将每个检测周期中可用(已激活)的网卡确定为候选网卡。Please refer to FIG. 1 , which is an application scenario diagram of the network card management method provided by the embodiment of the present application. As shown in FIG. 1 , an electronic device 100 is connected to a server 200 through communication. The electronic device 100 periodically detects the available state (or activated state) of the network card, and determines the available (activated) network card in each detection cycle as a candidate network card.

在本申请的一些实施例中,电子设备100在每个检测周期,通过获取电子设备100中各网卡的IP地址确定出可用的网卡,从而将已分配IP地址的网卡确定为候选网卡。In some embodiments of the present application, the electronic device 100 determines available network cards by obtaining the IP addresses of the network cards in the electronic device 100 in each detection cycle, so as to determine the network cards with assigned IP addresses as candidate network cards.

在确定出两个及以上的候选网卡时,电子设备100能够基于各候选网卡的优先级,从各候选网卡中确定出目标网卡,并启用目标网卡与服务器200建立通信连接,进行通信。When two or more candidate network cards are determined, the electronic device 100 can determine a target network card from each candidate network card based on the priority of each candidate network card, and enable the target network card to establish a communication connection with the server 200 for communication.

通过网卡优先级设置及动态切换目标网卡,在一定程度上避免了电子设备100长时间使用出现异常的网卡导致网络长时间中断,从而影响电子设备100的工作效率。By setting the priority of the network card and dynamically switching the target network card, it is avoided to a certain extent that the electronic device 100 uses an abnormal network card for a long time to cause a long-term interruption of the network, thereby affecting the working efficiency of the electronic device 100 .

在本申请的一些实施例中,通信连接包括但不限于有线通信连接或无线通信连接的任意一种。In some embodiments of the present application, the communication connection includes but is not limited to any one of a wired communication connection or a wireless communication connection.

电子设备100包括但不限于物联网设备、储能设备、自移动设备、发电设备、智能家居设备、智能穿戴设备、工业自动化设备等中的任意一种。The electronic device 100 includes, but is not limited to, any one of Internet of Things devices, energy storage devices, autonomous mobile devices, power generation devices, smart home devices, smart wearable devices, and industrial automation devices.

服务器200包括独立的服务器或多个服务器组成的服务器集群。The server 200 includes an independent server or a server cluster composed of multiple servers.

在本申请的其他实施例中,电子设备100启用目标网卡还可以与其他网络设备进行通信。其中,网络设备包括但不限于智能手机、平板、电脑等设备中的任一种或多种。In other embodiments of the present application, the electronic device 100 may enable the target network card to communicate with other network devices. Wherein, the network device includes but is not limited to any one or more of smart phones, tablets, computers and other devices.

请参阅图2所示,为本申请实施例提供的网卡管理方法的应用场景示例图。如图2所示,物联网模块10集成于电子设备100,电子设备100通过物联网模块10连接到互联网,并与服务器200进行通信和交互,实现信息共享与控制。其中,物联网模块10包括网卡管理单元11、数据采集单元12以及多个网卡,多个网卡可以包括Wi-Fi网卡、局域网(LocalAreaNetwork,LAN)网卡以及4G网卡等类型的网卡中的至少两种。其中,网卡管理单元11用于对电子设备100中的网卡进行管理与控制。如图2所示,电子设备100通过物联网模块10的网卡管理单元11控制Wi-Fi网卡与服务器200建立通信连接。数据采集单元12用于采集和处理传感器等获取的数据,如温度数据、光照数据、位置数据等。在一些实施例中,数据采集单元12可以将采集的数据通过物联网模块10传输至服务器200。在一些实施例中,服务器200包括数据库20,服务器200可以将与电子设备100的交互数据存储于数据库20中。其中,服务器200可以是消息传输协议(Message Queuing Telemetry Transport,MQTT)服务器等。数据库20包括但不限于关系型数据库、非关系型数据库、内存数据库等的任意一种。Please refer to FIG. 2 , which is an example diagram of an application scenario of the network card management method provided by the embodiment of the present application. As shown in FIG. 2 , the Internet of Things module 10 is integrated into the electronic device 100 , and the electronic device 100 is connected to the Internet through the Internet of Things module 10 , and communicates and interacts with the server 200 to realize information sharing and control. Wherein, the Internet of Things module 10 includes a network card management unit 11, a data acquisition unit 12, and a plurality of network cards, and the plurality of network cards may include at least two types of network cards such as Wi-Fi network cards, local area network (LocalAreaNetwork, LAN) network cards and 4G network cards. . Wherein, the network card management unit 11 is used for managing and controlling the network card in the electronic device 100 . As shown in FIG. 2 , the electronic device 100 controls the Wi-Fi network card to establish a communication connection with the server 200 through the network card management unit 11 of the IoT module 10 . The data collection unit 12 is used to collect and process data obtained by sensors, such as temperature data, illumination data, position data and the like. In some embodiments, the data collection unit 12 can transmit the collected data to the server 200 through the IoT module 10 . In some embodiments, the server 200 includes a database 20 , and the server 200 can store interaction data with the electronic device 100 in the database 20 . Wherein, the server 200 may be a Message Queuing Telemetry Transport (MQTT) server or the like. The database 20 includes but is not limited to any one of a relational database, a non-relational database, and an in-memory database.

请参阅图3所示,为本申请实施例提供的网卡管理方法的实现流程图,以该方法应用在图1中的电子设备为例进行说明,包括如下步骤。Please refer to FIG. 3 , which is an implementation flowchart of the network card management method provided by the embodiment of the present application. Taking the electronic device in FIG. 1 as an example for illustration, the method includes the following steps.

S11:在每个检测周期,将电子设备中已分配IP地址的网卡确定为候选网卡。S11: In each detection cycle, determine a network card that has been assigned an IP address in the electronic device as a candidate network card.

在一些实施例中,网卡为配置于电子设备中的网卡。网卡包括但不限于以太网卡、无线网卡、蓝牙网卡等的任意一种或多种。In some embodiments, the network card is a network card configured in an electronic device. The network card includes but is not limited to any one or more of an Ethernet card, a wireless network card, a Bluetooth network card, and the like.

在一些实施例中,电子设备的主板上配置有网卡插槽,将网卡插入网卡插槽即可实现对电子设备的网卡配置。其中,网卡可以是遵循不同通信协议的网卡,例如,用于连接电子设备至局域网的有线LAN网卡、用于连接无线热点的Wi-Fi网卡以及基于移动通信网络进行通信的移动通信网卡,如4G网卡等。In some embodiments, a network card slot is configured on the motherboard of the electronic device, and the network card configuration of the electronic device can be realized by inserting the network card into the network card slot. Wherein, the network card may be a network card following different communication protocols, for example, a wired LAN network card used to connect electronic devices to a local area network, a Wi-Fi network card used to connect to a wireless hotspot, and a mobile communication network card for communication based on a mobile communication network, such as 4G Network card, etc.

在一些相关的方案中,电子设备通过指示各网卡向服务器发送网络报探测器(Packet Internet Groper,ping)命令,以检测各网卡的激活状态,也即检测各网卡的可用状态。其中,ping命令为用于测试网络连接状况的命令。ping命令是工作在TCP/IP网络体系结构中应用层的一个服务命令,用于向特定的目标服务器发送ICMP(Internet ControlMessage Protocol,因特网报文控制协议)请求报文,以测试是否可以对服务器进行访问等操作。然而,由于存在一些电子设备的主板配置为较简单的操作系统,例如单片机裸机系统等,无法提供检测多网卡的激活状态的操作环境,因此通过指示各网卡向服务器发送ping命令,以检测各网卡的激活状态的技术方案无法适用于这类操作系统较为简单的电子设备。In some related solutions, the electronic device instructs each network card to send a Packet Internet Groper (ping) command to the server to detect the activation state of each network card, that is, to detect the availability state of each network card. Wherein, the ping command is a command for testing the network connection status. The ping command is a service command working in the application layer of the TCP/IP network architecture, and is used to send an ICMP (Internet ControlMessage Protocol, Internet Message Control Protocol) request message to a specific target server to test whether the server can be pinged. Access etc. However, since the main boards of some electronic devices are configured with relatively simple operating systems, such as single-chip bare-metal systems, etc., it is impossible to provide an operating environment for detecting the activation status of multiple network cards. Therefore, each network card is detected by instructing each network card to send a ping command to the server. The technical scheme of the activated state cannot be applied to electronic devices with relatively simple operating systems of this type.

基于上述问题,本方案中电子设备通过读取每个网卡的IP地址,确定各网卡的激活状态。电子设备中各网卡的IP地址是由各网卡对应的上级网关设备配置的。电子设备可以预先配置各网卡的驱动程序,在电子设备开机后,通过执行各网卡的驱动程序控制各网卡访问对应的上级网关设备,以获得对应的上级网关设备为各网卡配置的IP地址。例如,路由器为LAN网卡或Wi-Fi网卡的上级网关设备,可以为LAN网卡或Wi-Fi网卡分配IP地址;基站为移动通信网卡的上级网关设备,可以为移动通信网卡分配IP地址。Based on the above problems, in this solution, the electronic device determines the activation status of each network card by reading the IP address of each network card. The IP address of each network card in the electronic device is configured by the upper-level gateway device corresponding to each network card. The electronic device can pre-configure the driver program of each network card. After the electronic device is turned on, the driver program of each network card is executed to control each network card to access the corresponding upper-level gateway device, so as to obtain the IP address configured by the corresponding upper-level gateway device for each network card. For example, a router is an upper-level gateway device of a LAN network card or a Wi-Fi network card, and can assign an IP address to a LAN network card or a Wi-Fi network card; a base station is an upper-level gateway device of a mobile communication network card, and can assign an IP address to a mobile communication network card.

若电子设备读取到网卡的IP地址,则确定该网卡与电子设备中对应的网卡接口建立了物理连接,以及确定该网卡与相对应的上级网关设备建立了通信,也即确定网卡被激活。此时,电子设备将已激活的网卡确定为候选网卡。If the electronic device reads the IP address of the network card, it is determined that the network card has established a physical connection with the corresponding network card interface in the electronic device, and it is determined that the network card has established communication with the corresponding upper-level gateway device, that is, it is determined that the network card is activated. At this point, the electronic device determines the activated network card as a candidate network card.

在其他实施例中,若电子设备未读取到网卡的IP地址,则确定网卡未被激活。其中,当网卡未与电子设备中对应的网卡接口建立物理连接,或网卡未与该网卡对应的网关建立通信连接时,电子设备均无法获取到该网卡的IP地址,也即该网卡未被激活,处于不可用状态。In other embodiments, if the electronic device does not read the IP address of the network card, it is determined that the network card is not activated. Among them, when the network card has not established a physical connection with the corresponding network card interface in the electronic device, or the network card has not established a communication connection with the gateway corresponding to the network card, the electronic device cannot obtain the IP address of the network card, that is, the network card has not been activated. , is in an unavailable state.

为保证电子设备与服务器正常通信,电子设备选用已激活的网卡作为候选网卡,对未激活的网卡不作处理。In order to ensure normal communication between the electronic device and the server, the electronic device selects an activated network card as a candidate network card, and does not process an inactive network card.

在本申请的一些实施例中,将电子设备中已分配IP地址的网卡确定为候选网卡,包括:根据各网卡的网卡接口地址读取各网卡的IP地址,将读取到的IP地址对应的网卡确定为候选网卡。In some embodiments of the present application, determining the network card that has been assigned an IP address in the electronic device as a candidate network card includes: reading the IP address of each network card according to the network card interface address of each network card, and corresponding to the read IP address The network card is determined as a candidate network card.

在一些实施例中,网卡接口地址包括网卡的硬件地址或物理地址,也即媒体访问控制(Media Access Control,MAC)地址。网卡接口地址用于唯一标识网卡。In some embodiments, the interface address of the network card includes a hardware address or a physical address of the network card, that is, a Media Access Control (Media Access Control, MAC) address. The network card interface address is used to uniquely identify the network card.

在一些实施例中,电子设备中各网卡的IP地址是由各网卡对应的上级网关设备配置的。因此,电子设备可以控制网卡访问相应的上级网关设备以请求该上级网关设备为该网卡分配IP地址。In some embodiments, the IP address of each network card in the electronic device is configured by the upper-level gateway device corresponding to each network card. Therefore, the electronic device can control the network card to access the corresponding upper-level gateway device to request the upper-level gateway device to allocate an IP address for the network card.

在获取各网卡的IP地址的过程中,电子设备可以通过将用于唯一标识网卡的网卡接口地址打包成数据包发送至上级网关设备。上级网关设备接收到该数据包,对该数据包进行解析获取到网卡的网卡接口地址,为该网卡分配IP地址,并根据该网卡的网卡接口地址将为该网卡分配的IP地址返回至网卡。当接收到上级网关设备返回的IP地址时,该网卡为激活状态。In the process of obtaining the IP address of each network card, the electronic device may send the data packet to the upper-level gateway device by packaging the interface address of the network card for uniquely identifying the network card. The upper-level gateway device receives the data packet, analyzes the data packet to obtain the network interface address of the network card, allocates an IP address for the network card, and returns the IP address assigned to the network card to the network card according to the network interface address of the network card. When receiving the IP address returned by the upper-level gateway device, the network card is activated.

然而,若网卡与电子设备中对应的网卡接口的物理连接断开,或网卡与对应的上级网关设备的通信连接断开,则网卡无法获取到对应的IP地址。此时,该网卡为未激活状态。However, if the physical connection between the network card and the corresponding network card interface in the electronic device is broken, or the communication connection between the network card and the corresponding upper-level gateway device is broken, the network card cannot obtain the corresponding IP address. At this time, the network card is not activated.

在一些实施例中,由于只有网卡被激活,电子设备才可以启用网卡进行通信,因此,为确保最终启用的网卡为可用状态的网卡,电子设备仅将已激活状态的网卡确定为候选网卡。In some embodiments, the electronic device can enable the network card for communication only when the network card is activated. Therefore, in order to ensure that the finally enabled network card is an available network card, the electronic device only determines the activated network card as a candidate network card.

S12:基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡。S12: Based on the priorities corresponding to each candidate network card, determine a target network card from each candidate network card.

在一些实施例中,优先级用于表征各候选网卡的启用顺序。优先级越高的候选网卡,越优先启用。目标网卡是指候选网卡中优先级最高的网卡。In some embodiments, the priority is used to characterize the activation order of each candidate network card. The candidate NIC with higher priority will be enabled first. The target network card refers to the network card with the highest priority among the candidate network cards.

在一些实施例中,在每一检测周期中,电子设备可能确定出多个候选网卡。每个候选网卡均与电子设备中对应的网卡接口建立了物理连接,且与候选网卡对应的上级网关设备建立通信,也即每个候选网卡均是已激活,处于可用状态的网卡。In some embodiments, in each detection cycle, the electronic device may determine multiple candidate network cards. Each candidate network card has established a physical connection with the corresponding network card interface in the electronic device, and establishes communication with the upper-level gateway device corresponding to the candidate network card, that is, each candidate network card is an activated and available network card.

然而,由于电子设备在同一时间只能使用一个候选网卡与其他网络设备或服务器进行通信,因此,电子设备需要从多个候选网卡中确定出一个目标网卡。However, since the electronic device can only use one candidate network card to communicate with other network devices or servers at the same time, the electronic device needs to determine a target network card from the multiple candidate network cards.

基于此,电子设备中可以预先设置各候选网卡的优先级。当电子设备确定出多个候选网卡时,可以基于各候选网卡的优先级,从多个候选网卡中确定出目标网卡。Based on this, the priority of each candidate network card can be preset in the electronic device. When the electronic device determines multiple candidate network cards, it may determine a target network card from the multiple candidate network cards based on the priority of each candidate network card.

在一些实施例中,用户可以根据候选网卡的通信稳定性和通信成本确定电子设备中的各候选网卡的优先级,其中,通信越稳定且通信成本越低的候选网卡,优先级越高。In some embodiments, the user can determine the priority of each candidate network card in the electronic device according to the communication stability and communication cost of the candidate network cards, wherein the candidate network card with more stable communication and lower communication cost has a higher priority.

在本申请的一些实施例中,若电子设备未检测到已分配IP地址的网卡,则将第一预设网卡确定为目标网卡。In some embodiments of the present application, if the electronic device does not detect a network card that has been assigned an IP address, then determine the first preset network card as the target network card.

在一些实施例中,由于可能存在电子设备的所有网卡均为未激活状态的网卡的情况。此时为保证电子设备的正常工作,电子设备启用第一预设网卡作为目标网卡,进行通信。其中,第一预设网卡为配置于电子设备中的网卡,包括但不限于Wi-Fi网卡、蓝牙网卡等。In some embodiments, there may be a situation that all network cards of the electronic device are network cards in an inactive state. At this time, in order to ensure the normal operation of the electronic device, the electronic device uses the first preset network card as the target network card for communication. Wherein, the first preset network card is a network card configured in an electronic device, including but not limited to a Wi-Fi network card, a Bluetooth network card, and the like.

在一些实施例中,为保证电子设备的通信稳定性,第一预设网卡可以为电子设备中具有最高优先级的网卡。例如,假设电子设备中设置以太网卡的优先级最高,则电子设备在未检测到已分配IP地址的网卡时,可以将以太网卡确定为目标网卡。In some embodiments, in order to ensure the communication stability of the electronic device, the first preset network card may be the network card with the highest priority in the electronic device. For example, assuming that the priority of setting the Ethernet card in the electronic device is the highest, the electronic device may determine the Ethernet card as the target network card when no network card with an IP address is detected.

S13:使用目标网卡进行通信。S13: use the target network card to communicate.

在一些实施例中,目标网卡为电子设备从候选网卡中确定出的优先级最高的网卡。In some embodiments, the target network card is the network card with the highest priority determined by the electronic device from the candidate network cards.

在一些实施例中,电子设备确定出目标网卡后,启用该目标网卡与其他网络设备或服务器建立通信连接,实现通信与数据交互。当需要向其他网络设备或服务器发送数据时,电子设备将待发送的数据封装为网络数据包,并将网络数据包通过目标网卡发送至其他网络设备或服务器。In some embodiments, after the electronic device determines the target network card, it enables the target network card to establish a communication connection with other network devices or servers to realize communication and data interaction. When data needs to be sent to other network devices or servers, the electronic device encapsulates the data to be sent into network data packets, and sends the network data packets to other network devices or servers through the target network card.

在本申请实施例提供的一种网卡管理方法中,由于若电子设备读取到网卡的IP地址,则可以确定该网卡与电子设备中对应的网卡接口建立了物理连接,以及确定该网卡与相对应的上级网关设备建立了通信,也即确定网卡被激活,因此电子设备在每个检测周期,通过获取每个网卡的IP地址确定每个网卡的可用状态,从而确定出当前可用的候选网卡。由于在每个检测周期,电子设备可能确定出的多个候选网卡,而在同一时间只能由一个网卡为电子设备提供上网服务,因此电子设备基于各候选网卡的优先级从各候选网卡中确定一个要启用的目标网卡,使用目标网卡进行通信。从而实现了在配置多网卡的情况下,电子设备周期性动态确定可进行通信的目标网卡,在一定程度上避免了电子设备长时间使用出现异常的网卡而导致网络长时间中断,保证了电子设备的工作效率。In the network card management method provided by the embodiment of the present application, if the electronic device reads the IP address of the network card, it can be determined that the network card has established a physical connection with the corresponding network card interface in the electronic device, and it can be determined that the network card is connected to the corresponding network card. The corresponding upper-level gateway device establishes communication, that is, determines that the network card is activated, so the electronic device determines the availability status of each network card by obtaining the IP address of each network card in each detection cycle, thereby determining the currently available candidate network card. Since in each detection cycle, the electronic device may determine multiple candidate network cards, but only one network card can provide Internet access services for the electronic device at the same time, so the electronic device determines the candidate network card based on the priority of each candidate network card. A target NIC to enable, use the target NIC for communication. In this way, in the case of configuring multiple network cards, the electronic device periodically and dynamically determines the target network card that can communicate. work efficiency.

请参阅图4所示,为本申请实施例提供的目标网卡确定方法的实现流程图。如图4所示,基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡,包括如下步骤。Please refer to FIG. 4 , which is an implementation flowchart of the method for determining a target network card provided by the embodiment of the present application. As shown in FIG. 4 , based on the priority corresponding to each candidate network card, determining a target network card from each candidate network card includes the following steps.

S21:基于各候选网卡确定网卡状态数字序列。S21: Determine a network card status digital sequence based on each candidate network card.

在一些实施例中,网卡状态数字序列包括不同的网卡对应的标志位,各候选网卡对应的标志位的值为第一预设值,其他标志位的值为第二预设值。由于候选网卡为电子设备中已激活的网卡,因此第一预设值用于表征已激活的网卡,第二预设值用于表征未激活的网卡。例如,第一预设值可以用1表示,第二可以用0表示。In some embodiments, the network card status number sequence includes flag bits corresponding to different network cards, the value of the flag bit corresponding to each candidate network card is a first preset value, and the values of other flag bits are a second preset value. Since the candidate network card is an activated network card in the electronic device, the first preset value is used to represent an activated network card, and the second preset value is used to represent an inactive network card. For example, the first preset value can be represented by 1, and the second preset value can be represented by 0.

在一些实施例中,电子设备通过网卡状态位图配合网卡优先级序列对电子设备中所有网卡进行管理。其中,网卡状态位图是指网卡状态数字序列的集合,用于表征电子设备所有网卡的所有状态。电子设备中网卡的数量、类型不同,对应的网卡状态位图也不同。In some embodiments, the electronic device manages all the network cards in the electronic device through the network card status bitmap and the priority sequence of the network cards. Wherein, the network card state bitmap refers to a collection of network card state digital sequences, which is used to represent all states of all network cards of the electronic device. The number and type of network cards in the electronic device are different, and the corresponding network card status bitmaps are also different.

以电子设备中配置有3个网卡分别为:Wi-Fi网卡、LAN网卡、4G网卡为例,该电子设备的网卡状态位图如下表1所示。Taking an electronic device configured with three network cards: a Wi-Fi network card, a LAN network card, and a 4G network card as an example, the network card status bitmap of the electronic device is shown in Table 1 below.

表1网卡状态位图Table 1 NIC status bitmap

Wi-Fi网卡Wi-Fi card 4G网卡4G network card LAN网卡LAN card 00 00 00 11 00 00 00 11 00 00 00 11 11 11 00 11 00 11 00 11 11 11 11 11

如表1所示,Wi-Fi网卡、LAN网卡、4G网卡分别对应一个标志位,其中,第一标志位表征Wi-Fi网卡的激活状态,第二标志位表征4G网卡的激活状态、第三标志位表征LAN网卡的激活状态。由于每个网卡只有已激活和未激活两种状态,如表1所示,电子设备以0表示网卡未激活的状态,以1表示网卡已激活的状态,因此若电子设备中配置有三种网卡,则电子设备网卡状态位图包括2*2*2种状态,也即包括8种网卡状态数字序列。如表1所示,该网卡状态位图包括的8种网卡状态数字序列分别为000、100、010、001、110、101、011、111。其中,若网卡状态数字序列为000,则表明所有网卡未被激活。As shown in Table 1, the Wi-Fi network card, the LAN network card, and the 4G network card correspond to a flag respectively, wherein the first flag represents the activation state of the Wi-Fi network card, the second flag represents the activation state of the 4G network card, and the third flag represents the activation state of the 4G network card. The flag bit represents the activation state of the LAN network card. Since each network card has only two states of activated and inactive, as shown in Table 1, the electronic device uses 0 to represent the state of the network card not activated, and 1 to represent the state of the network card activated. Therefore, if the electronic device is configured with three network cards, Then the network card state bitmap of the electronic device includes 2*2*2 states, that is, includes 8 network card state digital sequences. As shown in Table 1, the network card status bitmap includes 8 network card status digital sequences, which are 000, 100, 010, 001, 110, 101, 011, and 111, respectively. Wherein, if the number sequence of the network card status is 000, it indicates that all network cards are not activated.

在一些实施例中,由于所有候选网卡为电子设备确定出的已激活的所有网卡,因此电子设备基于各候选网卡可以确定出电子设备中所有网卡的激活状态。又由于网卡状态位图是指网卡状态数字序列的集合,用于表征电子设备所有网卡的所有状态,因此电子设备根据所有网卡的激活状态可以从网卡状态位图中匹配得到各候选网卡对应的网卡状态数字序列。以上表1所示为例,若电子设备确定出候选网卡包括Wi-Fi网卡和4G网卡,则各候选网卡对应的网卡状态数字序列为110。若电子设备未检测到已分配IP地址的网卡,也即确定所有网卡均未被激活,则电子设备的网卡状态数字序列为000。In some embodiments, since all candidate network cards are all activated network cards determined by the electronic device, the electronic device can determine the activation status of all network cards in the electronic device based on each candidate network card. And because the network card status bitmap refers to the collection of network card status digital sequences, which is used to represent all the states of all network cards of the electronic device, so the electronic device can match the network card corresponding to each candidate network card according to the activation status of all network cards from the network card status bitmap State number sequence. As shown in Table 1 above as an example, if the electronic device determines that the candidate network cards include a Wi-Fi network card and a 4G network card, then the network card status number sequence corresponding to each candidate network card is 110. If the electronic device does not detect a network card that has been assigned an IP address, that is, it is determined that all network cards are not activated, the digital sequence of the network card status of the electronic device is 000.

在一些实施例中,电子设备通过启动定时器,定时检测各网卡的激活状态,每次检测到的各网卡的激活状态必然将对应到网卡状态位图中的某一项。电子设备将网卡状态位图与网卡优先级列表绑定,便可实现对所有网卡进行管理。In some embodiments, the electronic device regularly detects the activation status of each network card by starting a timer, and each detected activation status of each network card must correspond to an item in the network card status bitmap. The electronic device binds the network card status bitmap with the network card priority list, so that all network cards can be managed.

S22:获取网卡状态数字序列对应的网卡优先级序列,并根据网卡优先级序列确定目标网卡。S22: Obtain a network card priority sequence corresponding to the network card status number sequence, and determine a target network card according to the network card priority sequence.

在一些实施例中,每一网卡状态数字序列对应一网卡优先级序列。网卡优先级序列用于表征对应的网卡状态数字序列中各已激活网卡的优先级。由于在不同检测周期,候选网卡可能是不同的,因此不同检测周期中的各候选网卡对应的网卡状态数字数列也可能是不同的,从而对应的网卡优先级序列也可能是不同的。也即,电子设备的网卡优先级序列随着候选网卡的变化而动态更新。In some embodiments, each NIC status number sequence corresponds to a NIC priority sequence. The network card priority sequence is used to represent the priority of each activated network card in the corresponding network card status number sequence. Since the candidate network cards may be different in different detection cycles, the sequence of network card status numbers corresponding to each candidate network card in different detection cycles may also be different, and thus the corresponding network card priority sequences may also be different. That is, the network card priority sequence of the electronic device is dynamically updated as the candidate network cards change.

在一些实施例中,网卡优先级序列的确定规则遵循各候选网卡的通信稳定性与通信成本,通信越稳定且通信成本越低的候选网卡,优先级越高。In some embodiments, the determination rule of the network card priority sequence follows the communication stability and communication cost of each candidate network card, and the candidate network card with more stable communication and lower communication cost has a higher priority.

在一些实施例中,电子设备确定出各候选网卡对应的网卡状态数字序列后,根据网卡状态数字序列与网卡优先级序列的对应关系,确定出各候选网卡对应的网卡优先级序列。电子设备根据各候选网卡对应的网卡优先级序列能够确定出各候选网卡的优先级,并根据各候选网卡的优先级确定出目标网卡。In some embodiments, after the electronic device determines the network card status number sequence corresponding to each candidate network card, it determines the network card priority sequence corresponding to each candidate network card according to the corresponding relationship between the network card status number sequence and the network card priority sequence. The electronic device can determine the priority of each candidate network card according to the network card priority sequence corresponding to each candidate network card, and determine the target network card according to the priority of each candidate network card.

以上表1示例为基础,下表2所示为网卡状态位图与网卡优先级列表的对应关系图表。其中,网卡优先级列表包括8种网卡优先级序列,各网卡优先级序列与表1中的各网卡状态数字序列一一对应。表2中还包括网卡优先级声明,该网卡优先级声明用于对每一网卡优先级序列进行说明。Based on the example in Table 1 above, Table 2 below is a chart showing the correspondence between the network card status bitmap and the network card priority list. Wherein, the network card priority list includes 8 network card priority sequences, and each network card priority sequence corresponds to each network card status number sequence in Table 1 one by one. Table 2 also includes a network card priority statement, which is used to describe the priority sequence of each network card.

表2网卡状态位图与网卡优先级列表的对应关系图表Table 2 Correspondence between network card status bitmap and network card priority list

如表2所示,每一网卡状态数字序列对应一网卡优先级序列及对应网卡优先级声明。其中,网卡优先级序列包括对应的网卡状态数字序列中各已激活网卡的优先级,数字越小优先级越高。例如表2所示,当确定网卡状态数字序列为111时,电子设备确定对应的网卡优先级序列为1.LAN网卡,2.Wi-Fi网卡,3.4G网卡,根据网卡优先级声明可知,此时,LAN网卡优先级最高,Wi-Fi网卡次之,4G网卡的优先级最低。As shown in Table 2, each network card status number sequence corresponds to a network card priority sequence and a corresponding network card priority statement. Wherein, the network card priority sequence includes the priority of each activated network card in the corresponding network card status number sequence, and the smaller the number, the higher the priority. For example, as shown in Table 2, when the number sequence of the network card status is determined to be 111, the electronic device determines that the corresponding network card priority sequence is 1. LAN network card, 2. Wi-Fi network card, and 3.4G network card. According to the network card priority declaration, this , the LAN network card has the highest priority, followed by the Wi-Fi network card, and the 4G network card has the lowest priority.

根据表2可知,电子设备确定出各候选网卡对应的网卡优先级序列后,便确定出各候选网卡的优先级,从而根据各候选网卡的优先级确定出用于进行通信的目标网卡。According to Table 2, after the electronic device determines the network card priority sequence corresponding to each candidate network card, it determines the priority of each candidate network card, and then determines the target network card for communication according to the priority of each candidate network card.

在本申请的一些实施例中,根据网卡优先级序列确定目标网卡,包括:将网卡优先级序列中第一优先级对应的候选网卡作为目标网卡。In some embodiments of the present application, determining the target network card according to the network card priority sequence includes: using the candidate network card corresponding to the first priority in the network card priority sequence as the target network card.

在一些实施例中,第一优先级的候选网卡即优先级最高的候选网卡。In some embodiments, the candidate network card with the first priority is the candidate network card with the highest priority.

在一些实施例中,电子设备确定出各候选网卡对应的网卡优先级序列后,便确定出各候选网卡的优先级,为了保证电子设备的高速数据传输,优先第一优先级的候选网卡作为目标网卡进行通信。如上表2所示,当确定网卡状态数字序列为111时,电子设备根据对应的网卡优先级序列优先选用第一优先级的LAN网卡作为目标网卡进行通信。In some embodiments, after the electronic device determines the network card priority sequence corresponding to each candidate network card, it determines the priority of each candidate network card. In order to ensure high-speed data transmission of the electronic device, the candidate network card with the first priority is given priority as the target network card to communicate. As shown in Table 2 above, when it is determined that the number sequence of the network card status is 111, the electronic device preferentially selects the LAN network card with the first priority as the target network card for communication according to the corresponding network card priority sequence.

在一些实施例中,若电子设备仅检测到一个已分配IP地址的网卡,也即确定出一个候选网卡,则该候选网卡即为第一优先级的网卡,也即目标网卡,电子设备启用该候选网卡进行通信。如上表2所示,当确定网卡状态数字序列为100时,由于只有Wi-Fi网卡被激活,此时,对应的网卡优先级序列中Wi-Fi网卡为第一优先级,电子设备启用该Wi-Fi网卡进行通信。In some embodiments, if the electronic device only detects a network card that has been assigned an IP address, that is, determines a candidate network card, then the candidate network card is the network card with the first priority, that is, the target network card, and the electronic device enables the network card. Candidate NICs for communication. As shown in Table 2 above, when it is determined that the number sequence of the network card status is 100, since only the Wi-Fi network card is activated, at this time, the Wi-Fi network card is the first priority in the corresponding network card priority sequence, and the electronic device enables the Wi-Fi network card. -Fi network card for communication.

在一些实施例中,电子设备中还设置有默认网卡(即上述第一预设网卡)。该默认网卡为电子设备中配置的网卡。当电子设备未检测到已分配IP地址的网卡,也即确定所有网卡均未被激活时,电子设备将该默认网卡作为对应网卡优先级序列中第一优先级的网卡,启用该目标网卡进行通信。如上表2所示,电子设备将Wi-Fi网卡确定为默认网卡。当电子设备未获取到候选网卡,即确定所有网卡均未被激活时,则确定电子设备的网卡状态数字序列为000。此时,该网卡状态数字序列对应的网卡优先级序列的第一优先级的网卡为Wi-Fi网卡,电子设备启用Wi-Fi网卡进行通信。In some embodiments, a default network card (ie, the above-mentioned first preset network card) is also set in the electronic device. The default network card is a network card configured in the electronic device. When the electronic device does not detect a network card with an assigned IP address, that is, when it is determined that all network cards are not activated, the electronic device takes the default network card as the first priority network card in the priority sequence of the corresponding network card, and enables the target network card to communicate . As shown in Table 2 above, the electronic device determines the Wi-Fi network card as the default network card. When the electronic device does not obtain candidate network cards, that is, when it is determined that all network cards are not activated, it is determined that the digital sequence of the network card status of the electronic device is 000. At this time, the network card with the first priority in the network card priority sequence corresponding to the network card status number sequence is a Wi-Fi network card, and the electronic device enables the Wi-Fi network card to communicate.

在一些实施例中,电子设备中各网卡可以对应特定的优先级。电子设备在确定候选网卡之后,可以直接查询各候选网卡对应的优先级,选择优先级最高的候选网卡作为目标网卡。In some embodiments, each network card in the electronic device may correspond to a specific priority. After determining the candidate network cards, the electronic device may directly query the priorities corresponding to each candidate network card, and select the candidate network card with the highest priority as the target network card.

请参阅图5所示,为本申请另一实施例提供的网卡管理方法的实现流程图。如图5所示,本实施例提供的网卡管理方法包括如下步骤。Please refer to FIG. 5 , which is an implementation flowchart of a network card management method provided by another embodiment of the present application. As shown in FIG. 5 , the network card management method provided by this embodiment includes the following steps.

S31:在每个检测周期,将电子设备中已分配IP地址的网卡确定为候选网卡。S31: In each detection cycle, determine a network card that has been assigned an IP address in the electronic device as a candidate network card.

S32:基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡。S32: Based on the priority corresponding to each candidate network card, determine a target network card from each candidate network card.

S33:使用目标网卡进行通信。S33: use the target network card to communicate.

其中,步骤S31至步骤S33的具体实现方式可参照图3中步骤S11至步骤S13的具体实施例的内容。Wherein, the specific implementation manner of step S31 to step S33 can refer to the content of the specific embodiment of step S11 to step S13 in FIG. 3 .

S34:若检测到目标网卡通信异常,则将网卡优先级序列中目标网卡的下一优先级对应的候选网卡作为新的目标网卡。S34: If it is detected that the communication of the target network card is abnormal, the candidate network card corresponding to the next priority of the target network card in the network card priority sequence is used as a new target network card.

在一些实施例中,网卡优先级序列包括各候选网卡的优先级。如上表2所示,当确定网卡状态数字序列为111时,电子设备则确定对应的网卡优先级序列为1.LAN网卡,2.Wi-Fi网卡,3.4G网卡,根据网卡优先级声明可知,此时,LAN网卡优先级最高,Wi-Fi网卡次之,4G网卡的优先级最低。In some embodiments, the NIC priority sequence includes the priority of each candidate NIC. As shown in Table 2 above, when it is determined that the number sequence of the network card status is 111, the electronic device determines that the corresponding network card priority sequence is 1. LAN network card, 2. Wi-Fi network card, and 3.4G network card. According to the network card priority declaration, At this time, the LAN network card has the highest priority, followed by the Wi-Fi network card, and the 4G network card has the lowest priority.

然而,由于第一优先级的候选网卡可能由于网络故障或硬件故障等原因,无法正常进行通信。此时,为了确保电子设备工作的稳定性,电子设备启用网卡状态数字序列中下一优先级的候选网卡作为新的目标网卡。However, the candidate network card with the first priority may not be able to communicate normally due to reasons such as network failure or hardware failure. At this time, in order to ensure the stability of the electronic device, the electronic device uses the candidate network card with the next priority in the network card status number sequence as the new target network card.

以上述示例为基础,在确定网卡状态数字序列为111时,根据对应的网卡优先级序列,电子设备优先启用第一优先级的LAN网卡作为目标网卡进行通信。当检测到第一优先级的LAN网卡出现故障而无法正常通信时,电子设备启用下一优先级的Wi-Fi网卡作为新的目标网卡,进行通信。在一些实施例中,在同一个检测周期中,若下一优先级的Wi-Fi网卡也无法正常通信,电子设备可切换到更低优先级的4G网卡进行通信。Based on the above example, when the number sequence of the network card status is determined to be 111, according to the corresponding network card priority sequence, the electronic device preferentially enables the LAN network card with the first priority as the target network card for communication. When it is detected that the LAN network card of the first priority fails to communicate normally, the electronic device enables the Wi-Fi network card of the next priority as a new target network card for communication. In some embodiments, in the same detection period, if the Wi-Fi network card with the next priority cannot communicate normally, the electronic device may switch to a 4G network card with a lower priority for communication.

在本申请的其他实施例中,若检测到目标网卡通信异常,且网卡优先级序列中无下一优先级对应的候选网卡,电子设备可以触发报警,以提示用户通信异常。In other embodiments of the present application, if it is detected that the target network card is abnormal in communication and there is no candidate network card corresponding to the next priority in the network card priority sequence, the electronic device may trigger an alarm to prompt the user that the communication is abnormal.

S35:使用新的目标网卡进行通信。S35: Use the new target network card for communication.

在一些实施例中,若电子设备确定出新的目标网卡,则控制新的目标网卡建立与其他网络设备或服务器的通信连接,与其他网络设备或服务器进行通信。In some embodiments, if the electronic device determines a new target network card, the new target network card is controlled to establish a communication connection with other network devices or servers to communicate with other network devices or servers.

请参阅图6所示,为本申请又一实施例提供的网卡管理方法的实现流程图。如图6所示,本实施例提供的网卡管理方法包括如下步骤。Please refer to FIG. 6 , which is an implementation flowchart of a network card management method provided in another embodiment of the present application. As shown in FIG. 6 , the network card management method provided in this embodiment includes the following steps.

S41:在每个检测周期,将电子设备中已分配IP地址的网卡确定为候选网卡。S41: In each detection cycle, determine a network card that has been assigned an IP address in the electronic device as a candidate network card.

S42:基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡。S42: Based on the priority corresponding to each candidate network card, determine a target network card from each candidate network card.

S43:使用目标网卡进行通信。S43: Use the target network card to communicate.

其中,步骤S41至步骤S43的具体实现方式可参照图3中步骤S11至步骤S13的具体实施例的内容。Wherein, the specific implementation manner of step S41 to step S43 can refer to the content of the specific embodiment of step S11 to step S13 in FIG. 3 .

S44:判断目标网卡是否为第二预设网卡。S44: Determine whether the target network card is the second default network card.

在一些实施例中,第二预设网卡为移动通信网络对应的网卡,如4G网卡。当电子设备中配置有移动通信网络对应的网卡时,由于移动通信网络的资费较高,通常将该网卡配置为最低优先级的网卡。In some embodiments, the second preset network card is a network card corresponding to a mobile communication network, such as a 4G network card. When the network card corresponding to the mobile communication network is configured in the electronic device, the network card is usually configured as the network card with the lowest priority because the tariff of the mobile communication network is relatively high.

在一些实施例中,由于通常使用移动通信网络的网卡相较于Wi-Fi网卡、LAN网卡进行通信的通信成本较高,因此为了节约通信成本,电子设备在确定出目标网卡后,进一步判断目标网卡是否为移动通信网络的网卡。In some embodiments, since the communication cost of using a network card of a mobile communication network is higher than that of a Wi-Fi network card or a LAN network card, in order to save communication costs, the electronic device further determines the target network card after determining the target network card. Whether the network card is a network card of a mobile communication network.

在一些实施例中,若检测出目标网卡为移动通信网络的网卡,且确定出其他网卡未被激活,电子设备则通过加快网卡检测频率,以尽快地确定非移动通信网络的网卡是否被激活,从而及时地切换到其他非移动通信网络的网卡进行免费通信,以实现通信成本的控制。In some embodiments, if it is detected that the target network card is a network card of a mobile communication network, and it is determined that other network cards are not activated, the electronic device will speed up the detection frequency of the network card to determine whether the network card of the non-mobile communication network is activated as soon as possible, Thereby switching to network cards of other non-mobile communication networks for free communication in time, so as to realize the control of communication cost.

S45:当目标网卡为第二预设网卡时,将检测周期调整为第一时长。S45: When the target network card is the second preset network card, adjust the detection period to the first duration.

在一些实施例中,当目标网卡为移动通信网络的网卡时,电子设备可以通过调小检测周期的时长至第一时长,加快网卡检测频率。其中,第一时长由用户自定义设置,本申请对第一时长的值不做限定。In some embodiments, when the target network card is a network card of a mobile communication network, the electronic device may speed up the detection frequency of the network card by reducing the duration of the detection cycle to the first duration. Wherein, the first duration is defined by the user, and this application does not limit the value of the first duration.

S46:当目标网卡不为第二预设网卡时,将检测周期调整为第二时长。S46: When the target network card is not the second preset network card, adjust the detection period to the second duration.

在一些实施例中,当确定出目标网卡为非移动通信网络的网卡时,例如Wi-Fi网卡、LAN网卡等,电子设备则将检测周期调整为第二时长。由于目标网卡为非移动通信网络的网卡时,使用目标网卡进行通信的成本较低,因此,电子设备无需加快网卡检测频率,可以将检测周期的时长恢复成第二时长,第二时长大于第一时长。其中,第二时长由用户自定义设置,本申请对第二时长的具体值不做限定。In some embodiments, when it is determined that the target network card is a network card of a non-mobile communication network, such as a Wi-Fi network card, a LAN network card, etc., the electronic device adjusts the detection period to the second duration. Since the target network card is a network card of a non-mobile communication network, the cost of using the target network card for communication is relatively low. Therefore, the electronic device does not need to speed up the detection frequency of the network card, and can restore the detection period to the second period, which is longer than the first period. duration. Wherein, the second duration is set by the user, and this application does not limit the specific value of the second duration.

在一些实施例中,若在判断目标网卡是否为第二预设网卡前,预先配置了固定的检测周期,则当确定出目标网卡为非移动通信网络的网卡时,电子设备保持预设的检测周期,不对其进行调整。In some embodiments, if a fixed detection period is pre-configured before judging whether the target network card is the second preset network card, then when it is determined that the target network card is a network card of a non-mobile communication network, the electronic device maintains the preset detection cycle period, it is not adjusted.

在一些实施例中,电子设备可以在基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡之后执行步骤S44至步骤S46。In some embodiments, the electronic device may perform step S44 to step S46 after determining the target network card from each candidate network card based on the priority corresponding to each candidate network card.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.

在本申请的一个实施例中,提供一种网卡管理装置700,该网卡管理装置700能够实现的功能与上述实施例中网卡管理方法一一对应。如图7所示,该网卡管理装置700包括候选网卡确定模块701、目标网卡确定模块702及通信模块703。各功能模块详细说明如下:In one embodiment of the present application, a network card management device 700 is provided, and the functions that the network card management device 700 can implement correspond one-to-one to the network card management method in the foregoing embodiments. As shown in FIG. 7 , the network card management device 700 includes a candidate network card determining module 701 , a target network card determining module 702 and a communication module 703 . The detailed description of each functional module is as follows:

候选网卡确定模块701,用于在每个检测周期,将电子设备中已分配IP地址的网卡确定为候选网卡;A candidate network card determination module 701, configured to determine a network card with an IP address assigned in the electronic device as a candidate network card in each detection cycle;

目标网卡确定模块702,用于基于各候选网卡对应的优先级,从各候选网卡中确定目标网卡;Target network card determination module 702, for determining the target network card from each candidate network card based on the priority corresponding to each candidate network card;

通信模块703,用于使用目标网卡进行通信。A communication module 703, configured to use the target network card for communication.

关于网卡管理装置700的具体限定可以参见上文中对于网卡管理方法的限定,在此不再赘述。上述网卡管理装置700中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于电子设备中的处理器中,也可以以软件形式存储于电子设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations of the network card management apparatus 700, reference may be made to the above-mentioned limitations of the network card management method, which will not be repeated here. Each module in the above-mentioned network card management device 700 may be realized in whole or in part by software, hardware or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in the form of hardware, and can also be stored in the memory of the electronic device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.

请参阅图8所示,为本申请实施例提供的一种电子设备的结构示意图。该电子设备800包括但不限于物联网储能设备、自移动设备、发电设备、智能家居设备、智能穿戴设备、工业自动化设备等中的任意一种。电子设备800所处的网络包括但不限于互联网、广域网、城域网、局域网、虚拟专用网络(Virtual Private Network,VPN)等。Please refer to FIG. 8 , which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 800 includes, but is not limited to, any one of Internet of Things energy storage devices, autonomous mobile devices, power generation devices, smart home devices, smart wearable devices, industrial automation devices, and the like. The network where the electronic device 800 is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN) and the like.

如图8所示,该电子设备800包括通过通信模块801、存储器802、处理器803、输入/输出(Input/Output,I/O)接口804及总线805。处理器803通过总线805分别耦合于通信模块801、存储器802、I/O接口804。As shown in FIG. 8 , the electronic device 800 includes a communication module 801 , a memory 802 , a processor 803 , an input/output (Input/Output, I/O) interface 804 and a bus 805 . The processor 803 is respectively coupled to the communication module 801 , the memory 802 and the I/O interface 804 through the bus 805 .

通信模块801可以是无线通信模块或者移动通信模块。无线通信模块可以提供应用在电子设备800上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(globalnavigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。移动通信模块可以提供应用在电子设备800上的包括2G/3G/4G/5G等无线通信的解决方案。The communication module 801 may be a wireless communication module or a mobile communication module. The wireless communication module can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. applied on the electronic device 800. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The mobile communication module can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 800 .

存储器802可以包括一个或多个随机存取存储器(random access memory,RAM)和一个或多个非易失性存储器(non-volatile memory,NVM)。随机存取存储器可以由处理器803直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用的数据等。随机存取存储器可以包括静态随机存储器(static random-access memory,SRAM)、动态随机存储器(dynamic random accessmemory,DRAM)、同步动态随机存储器(synchronous dynamic random access memory,SDRAM)、双倍资料率同步动态随机存取存储器(double data rate synchronous dynamicrandom access memory,DDR SDRAM,例如第五代DDR SDRAM一般称为DDR5 SDRAM)等。The memory 802 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (non-volatile memory, NVM). The random access memory can be directly read and written by the processor 803, and can be used to store executable programs (such as machine instructions) of an operating system or other running programs, and can also be used to store user and application data. Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous dynamic random access memory, SDRAM), double data rate synchronous dynamic Random access memory (double data rate synchronous dynamic random access memory, DDR SDRAM, for example, the fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.

非易失性存储器也可以存储可执行程序和存储用户及应用的数据等,可以提前加载到随机存取存储器中,用于处理器803直接进行读写。非易失性存储器可以包括磁盘存储器件、快闪存储器(flash memory)。The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for the processor 803 to directly read and write. Non-volatile memory may include magnetic disk storage devices, flash memory (flash memory).

存储器802用于存储一个或多个计算机程序。一个或多个计算机程序被配置为被处理器803执行。该一个或多个计算机程序包括多个指令,多个指令被处理器803执行时,可实现在电子设备800上执行的网卡管理方法。The memory 802 is used to store one or more computer programs. One or more computer programs are configured to be executed by the processor 803 . The one or more computer programs include multiple instructions, and when the multiple instructions are executed by the processor 803 , the network card management method executed on the electronic device 800 can be realized.

在其他实施例中,所述电子设备800还包括外部存储器接口,用于连接外部的存储器,实现扩展电子设备800的存储能力。In other embodiments, the electronic device 800 further includes an external memory interface for connecting to an external memory, so as to expand the storage capacity of the electronic device 800 .

处理器803可以包括一个或多个处理单元,例如:处理器803可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 803 may include one or more processing units. For example, the processor 803 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor ( image signal processor (ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

处理器803提供计算和控制能力,例如,处理器803用于执行存储器802内存储的计算机程序,以实现上述的网卡管理方法。The processor 803 provides calculation and control capabilities, for example, the processor 803 is used to execute the computer program stored in the memory 802, so as to realize the above-mentioned network card management method.

I/O接口804用于提供用户输入或输出的通道,例如I/O接口804可用于连接各种输入输出设备,例如,鼠标、键盘、触控装置、显示屏等,使得用户可以录入信息,或者使信息可视化。The I/O interface 804 is used to provide a channel for user input or output. For example, the I/O interface 804 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information, Or visualize information.

总线805至少用于提供电子设备800中的通信模块801、存储器802、处理器803、I/O接口804之间相互通信的通道。The bus 805 is at least used to provide communication channels among the communication module 801 , the memory 802 , the processor 803 and the I/O interface 804 in the electronic device 800 .

可以理解的是,本申请实施例示意的结构并不构成对电子设备800的具体限定。在本申请另一些实施例中,电子设备800可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 800 . In other embodiments of the present application, the electronic device 800 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序中包括程序指令,所述程序指令被执行时所实现的方法可参照本申请上述各个实施例中的网卡管理方法。The embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, the computer program includes program instructions, and the method implemented when the program instructions are executed can refer to this Apply for the network card management method in each of the above embodiments.

其中,所述计算机可读存储介质可以是上述实施例所述的电子设备的内部存储器,例如所述电子设备的硬盘或内存。所述计算机可读存储介质也可以是所述电子设备的外接存储设备,例如所述电子设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。Wherein, the computer-readable storage medium may be an internal memory of the electronic device described in the above embodiments, such as a hard disk or a memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD ) card, flash memory card (Flash Card), etc.

进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据电子设备的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function, etc.; Use the created data etc.

最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application without limitation. Although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solutions of the present application.

Claims (10)

1.一种网卡管理方法,应用于电子设备,其特征在于,所述网卡管理方法包括:1. A network card management method, which is applied to electronic equipment, is characterized in that, the network card management method comprises: 在每个检测周期,将所述电子设备中已分配IP地址的网卡确定为候选网卡;In each detection cycle, determine the network card that has been assigned an IP address in the electronic device as a candidate network card; 基于各所述候选网卡对应的优先级,从各所述候选网卡中确定目标网卡;Based on the priority corresponding to each of the candidate network cards, determine the target network card from each of the candidate network cards; 使用所述目标网卡进行通信。Use the target NIC for communication. 2.如权利要求1所述的网卡管理方法,其特征在于,所述网卡管理方法还包括:2. The network card management method according to claim 1, wherein the network card management method further comprises: 若未检测到已分配所述IP地址的网卡,则将第一预设网卡确定为目标网卡。If no network card assigned the IP address is detected, the first preset network card is determined as the target network card. 3.如权利要求1所述的网卡管理方法,其特征在于,所述基于各所述候选网卡对应的优先级,从各所述候选网卡中确定目标网卡,包括:3. The network card management method according to claim 1, wherein said determining the target network card from each of the candidate network cards based on the priority corresponding to each of the candidate network cards comprises: 基于各所述候选网卡确定网卡状态数字序列;所述网卡状态数字序列包括不同的网卡对应的标志位,各所述候选网卡对应的标志位的值为第一预设值,其他标志位的值为第二预设值;Determine the network card state digital sequence based on each of the candidate network cards; the network card state digital sequence includes flags corresponding to different network cards, the value of the flag corresponding to each of the candidate network cards is the first preset value, and the value of other flags is the second preset value; 获取所述网卡状态数字序列对应的网卡优先级序列,并根据所述网卡优先级序列确定目标网卡。Obtaining a network card priority sequence corresponding to the network card status number sequence, and determining a target network card according to the network card priority sequence. 4.如权利要求3所述的网卡管理方法,其特征在于,所述根据所述网卡优先级序列确定目标网卡,包括:4. The network card management method according to claim 3, wherein said determining the target network card according to said network card priority sequence comprises: 将所述网卡优先级序列中第一优先级对应的候选网卡作为所述目标网卡。The candidate network card corresponding to the first priority in the network card priority sequence is used as the target network card. 5.如权利要求4所述的网卡管理方法,其特征在于,所述使用所述目标网卡进行通信之后,所述网卡管理方法还包括:5. The network card management method according to claim 4, characterized in that, after using the target network card to communicate, the network card management method further comprises: 若检测到所述目标网卡通信异常,则将所述网卡优先级序列中所述目标网卡的下一优先级对应的候选网卡作为新的目标网卡;If it is detected that the target network card is abnormal in communication, the candidate network card corresponding to the next priority of the target network card in the network card priority sequence is used as a new target network card; 使用所述新的目标网卡进行通信。Use the new target NIC for communication. 6.如权利要求1所述的网卡管理方法,其特征在于,所述将所述电子设备中已分配IP地址的网卡确定为候选网卡,包括:6. The network card management method according to claim 1, wherein the determining the network card with an IP address assigned in the electronic device as a candidate network card comprises: 根据各网卡的网卡接口地址读取各所述网卡的IP地址,将读取到的IP地址对应的网卡确定为所述候选网卡。Read the IP address of each network card according to the network card interface address of each network card, and determine the network card corresponding to the read IP address as the candidate network card. 7.如权利要求1所述的网卡管理方法,其特征在于,所述网卡管理方法还包括:7. The network card management method according to claim 1, wherein the network card management method further comprises: 当所述目标网卡为第二预设网卡时,将所述检测周期调整为第一时长;When the target network card is the second preset network card, adjusting the detection period to the first duration; 当所述目标网卡不为第二预设网卡时,将所述检测周期调整为第二时长,所述第二预设网卡为移动通信网络对应的网卡,所述第一时长小于所述第二时长。When the target network card is not the second preset network card, the detection cycle is adjusted to a second duration, the second preset network card is a network card corresponding to a mobile communication network, and the first duration is shorter than the second duration duration. 8.一种网卡管理装置,应用于电子设备,其特征在于,所述网卡管理装置包括:8. A network card management device applied to electronic equipment, characterized in that the network card management device comprises: 候选网卡确定模块,用于在每个检测周期,将所述电子设备中已分配IP地址的网卡确定为候选网卡;A candidate network card determination module, configured to determine a network card in the electronic device that has been assigned an IP address as a candidate network card in each detection cycle; 目标网卡确定模块,用于基于各所述候选网卡对应的优先级,从各所述候选网卡中确定目标网卡;A target network card determining module, configured to determine a target network card from each of the candidate network cards based on the priority corresponding to each of the candidate network cards; 通信模块,用于使用所述目标网卡进行通信。A communication module, configured to use the target network card for communication. 9.一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时以实现权利要求1至7任意一项所述的网卡管理方法。9. An electronic device, comprising a memory, a processor, and computer-readable instructions stored in the memory and operable on the processor, wherein when the computer-readable instructions are executed by the processor, Realizing the network card management method described in any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如权利要求1至7任意一项所述的网卡管理方法。10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the computer-readable instructions according to any one of claims 1 to 7 are implemented. The network card management method described above.
CN202310640074.0A 2023-05-31 2023-05-31 Network card management method, device, electronic equipment and storage medium Pending CN116684388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310640074.0A CN116684388A (en) 2023-05-31 2023-05-31 Network card management method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310640074.0A CN116684388A (en) 2023-05-31 2023-05-31 Network card management method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116684388A true CN116684388A (en) 2023-09-01

Family

ID=87778532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310640074.0A Pending CN116684388A (en) 2023-05-31 2023-05-31 Network card management method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116684388A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118646716A (en) * 2024-08-13 2024-09-13 苏州元脑智能科技有限公司 Transmission control method, network card, device, equipment and storage medium
CN119521261A (en) * 2024-11-14 2025-02-25 苏州元脑智能科技有限公司 Network scheduling method, system, device and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111343731A (en) * 2020-02-19 2020-06-26 北京小米移动软件有限公司 Information processing method, device and storage medium
CN113098722A (en) * 2021-04-09 2021-07-09 山东有人物联网股份有限公司 Multi-network card management method, device and computer readable storage medium
CN113747525A (en) * 2019-03-26 2021-12-03 华为技术有限公司 Method for switching internet access card and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113747525A (en) * 2019-03-26 2021-12-03 华为技术有限公司 Method for switching internet access card and electronic equipment
CN111343731A (en) * 2020-02-19 2020-06-26 北京小米移动软件有限公司 Information processing method, device and storage medium
CN113098722A (en) * 2021-04-09 2021-07-09 山东有人物联网股份有限公司 Multi-network card management method, device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118646716A (en) * 2024-08-13 2024-09-13 苏州元脑智能科技有限公司 Transmission control method, network card, device, equipment and storage medium
CN119521261A (en) * 2024-11-14 2025-02-25 苏州元脑智能科技有限公司 Network scheduling method, system, device and medium

Similar Documents

Publication Publication Date Title
US10602383B1 (en) Application of machine learning for building predictive models enabling smart fail over between different network media types
US20240031309A1 (en) Data Processing Method, Apparatus, Device and Storage Medium
JP6463814B2 (en) System and method for dynamically optimizing boot hardware frequency
EP3239984B1 (en) Methods and systems for analyzing record and usage in post package repair
US9094483B2 (en) System and method for collecting and evaluating statistics to establish network connections
TW202211035A (en) System, device and method for resource allocation
WO2019024828A1 (en) Resource configuration method, mobile terminal and storage medium
CN116684388A (en) Network card management method, device, electronic equipment and storage medium
CN108924274A (en) domain name system DNS processing method, device, storage medium and electronic equipment
TWI712876B (en) Computer system and computer-implemented method for managing power consumption of storage subsystem
WO2022171083A1 (en) Information processing method based on internet-of-things device, and related device and storage medium
US9489281B2 (en) Access point group controller failure notification system
US12216923B2 (en) Computer system, memory expansion device and method for use in computer system
CN116599871A (en) Network time delay determining method and related device
CN113840313B (en) Network mode control method, device and computer equipment for mobile terminal
CN115550418A (en) Troubleshooting method and device
CN107807619A (en) Intelligent home control system and its method of work based on virtual server module
CN116781765A (en) Distributed network connection methods, devices, computer equipment and storage media
US12494979B2 (en) Authentication systems and methods using an existence confirmation result
CN118316746B (en) Equipment remote wake-up method, device, equipment and storage medium
CN112367187A (en) Control method and device of frame type equipment, frame type equipment and storage medium
US11811596B1 (en) System and method for automating the remote provisioning of data processing systems
WO2021134252A1 (en) Inter-device communication method and apparatus, and storage medium
EP3379423A1 (en) Technologies for fine-grained completion tracking of memory buffer accesses
US20250233774A1 (en) Cloud Computing Technology-Based Internet of Things Device Management Method and Platform

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