CN112311625B - Network management method and device, storage medium and electronic device - Google Patents

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

Info

Publication number
CN112311625B
CN112311625B CN202011158959.XA CN202011158959A CN112311625B CN 112311625 B CN112311625 B CN 112311625B CN 202011158959 A CN202011158959 A CN 202011158959A CN 112311625 B CN112311625 B CN 112311625B
Authority
CN
China
Prior art keywords
network
sockets
allocation table
subset
default
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
CN202011158959.XA
Other languages
Chinese (zh)
Other versions
CN112311625A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011158959.XA priority Critical patent/CN112311625B/en
Publication of CN112311625A publication Critical patent/CN112311625A/en
Application granted granted Critical
Publication of CN112311625B publication Critical patent/CN112311625B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • 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

Abstract

The application discloses a network management method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: maintaining a network allocation table and a current default network through a system process, wherein the network allocation table comprises a handle of a socket and a physical network; monitoring whether the application process is abnormally quitted or not through the system process; and under the condition that the application process is abnormally exited, clearing all sockets of the application process which is abnormally exited in the network distribution table, and realizing parallel balanced communication by simultaneously using a plurality of physical networks through the sockets. The method and the device solve the technical problem of poor flexibility of network management in the related art.

Description

Network management method and device, storage medium and electronic device
Technical Field
The present application relates to the field of communications, and in particular, to a network management method and apparatus, a storage medium, and an electronic apparatus.
Background
Currently, a mobile terminal may technically connect to multiple physical networks at the same time, for example, two WIFI devices connect to different access points at the same time; simultaneously connecting two mobile 4G networks; one WIFI connection and one mobile 4G connection at the same time. The mobile terminal generally selects a default network based on the principle that WIFI is preferred over the mobile network, unless the application explicitly specifies the use of the specified network, the application defaults (i.e., the application does not specify the network) to use the default network for communication, and connecting the two networks at the same time only serves the purpose of fast switching the networks, and does not use the two networks for communication at the same time. The Android system uses sockets for network communication based on the LINUX kernel. In 2012, a LINUX kernel introduces a socket option SO _ MARK, where the SO _ MARK function is to set a MARK value of a packet based on a socket level, and the MARK value of the packet is combined with a kernel IP rule to implement routing of multiple network interfaces.
The application sets a socket option SO _ MARK value, and the kernel updates the MARK value of each packet (complex functions such as MARK distinguishing network of advanced routing use packets, IP routing and the like) based on the socket, thereby realizing that the application uses a designated network. For a large number of existing applications, the socket option SO _ MARK is not set for most applications. At present, all applications, especially third-party applications, cannot be required to modify the socket option SO _ MARK to achieve the purpose of simultaneously using multiple physical networks, and load balancing among multiple physical networks cannot be achieved. The mobile terminal system only supports the application process to select and use the designated network at present, if the application does not explicitly select the network, the default network is used for communication, and the network is not transparently allocated to the application process in the system range.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a network management method and device, a storage medium and an electronic device, so as to at least solve the technical problem of poor flexibility of network management in the related art.
According to an aspect of an embodiment of the present application, there is provided a method for managing a network, including: maintaining a network allocation table and a current default network through a system process, wherein the network allocation table comprises handles of sockets and a physical network; monitoring whether the application process is abnormally exited or not through the system process; and under the condition that the application process is abnormally exited, clearing all sockets of the application process which is abnormally exited in the network distribution table, and realizing parallel balanced communication by simultaneously using a plurality of physical networks through the sockets.
Optionally, maintaining the network allocation table and the current default network by the system process includes: reading the network allocation table and a default network; and distributing the application process to use the designated network based on the network distribution table and the number of the sockets in a balanced mode when the sockets are opened.
Optionally, maintaining the network allocation table and the current default network by the system process includes: reading the network allocation table and a default network; and clearing the corresponding socket in the network distribution table when closing the socket.
Optionally, maintaining the network allocation table and the current default network by the system process includes: under the condition that the designated network is normal, the designated network is used for communication; in the event that the specified network does not exist but the default network is valid, communicating using the default network.
Optionally, maintaining the network allocation table and the current default network by the system process includes: in case of a physical network being opened, looking up a first subset from the network allocation table S1, wherein the first subset includes all sockets allocated to the currently opened network; updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network; if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network; the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, maintaining the network allocation table and the current default network by the system process includes: under the condition that the physical network is closed, searching a third subset F from the allocation table, wherein the third subset comprises all sockets allocated to the closed physical network; updating the socket option SO _ MARK in the third subset to cause the application process to communicate using the default network.
Optionally, the network parameters of the socket option SO _ MARK include routing information, IP address, DNS address, and gateway address.
According to another aspect of the embodiments of the present application, there is also provided a management apparatus for a network, including: the system comprises a maintenance unit, a processing unit and a processing unit, wherein the maintenance unit is used for maintaining a network distribution table and a current default network through a system process, and the network distribution table comprises handles of sockets and a physical network; the monitoring unit is used for monitoring whether the application process is abnormally quitted or not through the system process; and the processing unit is used for clearing all sockets of the application process which is abnormally exited in the network distribution table under the condition that the application process is abnormally exited.
Optionally, the maintenance unit may read the network allocation table and the default network when maintaining the network allocation table and the current default network through the system process; and distributing the application process to use the designated network based on the network distribution table and the number of the sockets in a balanced mode when the sockets are opened.
Optionally, the maintenance unit may read the network allocation table and the default network when maintaining the network allocation table and the current default network through the system process; and clearing the corresponding socket in the network distribution table when closing the socket.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, the maintenance unit may use the designated network for communication under the condition that the designated network is normal; in the event that the specified network does not exist but the default network is valid, communicating using the default network.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, in case that the physical network is opened, the maintenance unit may search a first subset S1 from the network allocation table, where the first subset includes all sockets to which the currently opened network is allocated; updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network; if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network; the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, in a case that the physical network is closed, the maintenance unit may search a third subset F from the allocation table, where the third subset includes all sockets to which the closed physical network is allocated; updating the socket option SO _ MARK in the third subset to cause the application process to communicate using the default network.
Optionally, the network parameters of the socket option SO _ MARK include routing information, IP address, DNS address, and gateway address.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the scheme for implementing parallel balanced communication of multiple physical networks based on the socket option SO _ MARK, a system process (generally, the system has only one system process) and an application process (multiple application processes) are provided. The responsibilities of the system process include maintaining the network allocation table socket handle, physical network and selecting the current default network, while the system process monitors for application process abnormal exit and clears all sockets of the application process from the network allocation table. Monitoring open and close socket calls at the system call layer of the operating system, the system call layer responsibilities: reading a network allocation table and a default network from a system process; when the socket is opened, the application process is distributed to use the designated network based on the network distribution table information and the number of the sockets in a balanced manner; and when the socket is closed, the corresponding socket in the network distribution table is cleared, so that the technical problem of poor flexibility of network management in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flow chart of an alternative network management method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative network management scheme according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative network management scheme according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative network management apparatus according to an embodiment of the present application;
and
fig. 5 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In a related scheme, all application processes use default network communication by default, and are connected with a plurality of physical networks simultaneously, so that the problem of idle physical networks exists; application processes choose to use a particular network, but lack system-wide management, and are unable to transparently distribute networks system-wide, nor to achieve load balancing across multiple physical networks. In order to overcome the above problems, according to an aspect of embodiments of the present application, there is provided a method embodiment of a management method of a network. Fig. 1 is a flowchart of an alternative network management method according to an embodiment of the present application, and as shown in fig. 1, the method may include the following steps:
step S1, maintaining, by the system process, a network allocation table and a current default network, where the network allocation table includes handles of sockets and a physical network.
And step S2, monitoring whether the application process is abnormally exited or not through the system process.
Step S3, when the application process exits abnormally, clearing all sockets of the application process that exits abnormally in the network allocation table, and implementing parallel balanced communication using multiple physical networks simultaneously through sockets.
Optionally, maintaining the network allocation table and the current default network by the system process includes: reading the network allocation table and a default network; and distributing the application process to use the designated network based on the network distribution table and the number of the sockets in a balanced mode when the sockets are opened.
Optionally, maintaining the network allocation table and the current default network by the system process includes: reading the network allocation table and a default network; and clearing the corresponding socket in the network distribution table when closing the socket.
Optionally, maintaining the network allocation table and the current default network by the system process includes: under the condition that the designated network is normal, the designated network is used for communication; in the event that the specified network does not exist but the default network is valid, communicating using the default network.
Optionally, maintaining the network allocation table and the current default network by the system process includes: in case of a physical network being opened, looking up a first subset from the network allocation table S1, wherein the first subset includes all sockets allocated to the currently opened network; updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network; if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network; the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, maintaining the network allocation table and the current default network by the system process includes: under the condition that the physical network is closed, searching a third subset F from the allocation table, wherein the third subset comprises all sockets allocated to the closed physical network; updating the socket option SO _ MARK in the third subset to cause the application process to communicate using the default network.
Optionally, the network parameters of the socket option SO _ MARK include routing information, IP address, DNS address, and gateway address.
Through the steps, flexible network management can be realized, and the technical problem of poor flexibility of network management in the related technology can be solved. The invention provides a method for realizing parallel balanced communication of a plurality of physical networks based on a socket option SO _ MARK, which is applied without explicitly setting the socket option SO _ MARK. While implementing socket number based load balancing across multiple physical networks on a system wide basis.
As an alternative example, the technical solution of the present application is further described below with reference to specific embodiments. The flow of applying the explicit specification network is shown in fig. 2, and the flow of implementing parallel balanced communication of multiple physical networks based on the socket option SO _ MARK is shown in fig. 3.
In the scheme for implementing parallel balanced communication of multiple physical networks based on the socket option SO _ MARK, a system process (generally, the system has only one system process) and an application process (multiple application processes) are provided. The responsibilities of the system process include maintaining the network allocation table socket handle, physical network and selecting the current default network, while the system process monitors for abnormal exit of the application process and clears all the sockets of the application process from the network allocation table. Monitoring open and close socket calls at the system call layer of the operating system, the system call layer responsibilities: reading a network allocation table and a default network from a system process; when the socket is opened, the application process is distributed to use the designated network based on the network distribution table information and the number of the sockets in a balanced manner; and clearing the corresponding socket in the network distribution table when closing the socket.
Key network parameters (e.g., routing information, IP address, DNS address, gateway address, etc.) are used to set the value of the socket option SO MARK. The mobile network 4G network parameters are dynamically allocated by the operator network. The network is switched on and off, which results in updated network parameters, SO the value of the socket option SO _ MARK must be updated to ensure that the communication is normal. Socket option update principle: if the designated network is normal, the designated network is used for communication; a default network is used for communication if the designated network is not present but the default network is active. The update consists of two steps. The first step is as follows: and updating the current default network by the system process, and if no network is connected, the default network is invalid and the communication is completely interrupted. The second step is that: the system process distinguishes two situations, namely network opening and network closing, in the first situation, the network opening is successful, if the physical network is opened, the subset S1 is searched from the network allocation table (all sockets of the currently opened network are allocated), and the socket option SO _ MARK in the update set S1 is equal to the currently opened network parameter, SO that the application process uses the opened network for communication. If the open network is selected as the default network by the system process, the subset S2 is looked up from the network allocation table (all sockets that are allocated and physical network invalid), the socket option SO _ MARK in the update set S2 is equal to the network parameter of the default network, and the application process defaults to the default network. In case two, the network is closed, the subset F is looked up from the allocation table { all sockets with closed physical network names are allocated }, the socket option SO _ MARK of the update set F is equal to the network parameter of the default network, and the application process uses the default network for communication. The specific implementation process is as follows:
step 1: the system process creates and initializes a network allocation table [ socket handle, physical network ] accessible system-wide, and a variable is used to save the selected default network. The application process and the system process belong to different processes, so cross-process communication and cross-process copying of file handles are required.
And 2, step: the system process monitors the network opening and the network closing.
And step 3: and selecting a default network by the system process, and if no network exists, the default network is invalid and the communication is interrupted.
And 4, step 4: if the network is opened, looking up a subset S1 from the network allocation table, where { all sockets of the currently opened network are allocated }, and updating the socket option SO _ MARK in the set S1 to be equal to the currently opened network parameter, SO that the application process uses the opened network for communication. If the open network is selected as the default network by the system process, the subset S2 is looked up from the network allocation table (all sockets that are allocated and physical network invalid), the socket option SO _ MARK in the update set S2 is equal to the network parameter of the default network, and the application process defaults to the default network.
And 5: if the network is closed, look up the subset F from the assignment table { all sockets assigned the closed physical network name }. The socket option SO MARK of the update set F is equal to the network parameters of the default network, which is used by the application process for communication.
Step 6: and the system process detects abnormal exit of the application process and clears all sockets of the application process from the network distribution table.
And 7: the operating system's system call layer monitors open and close socket calls.
And 8: the application process is allocated evenly to use the designated network based on the network allocation table information and based on the number of sockets when the socket is opened.
And step 9: and clearing the corresponding socket in the network distribution table when closing the socket.
Step 10: network turn-on and network turn-off may occur at any time during the communication. So go back to step 2 to continue monitoring the network status.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a management apparatus of a network for implementing the management method of the network. Fig. 4 is a schematic diagram of an alternative network management apparatus according to an embodiment of the present application, and as shown in fig. 4, the apparatus may include:
a maintaining unit 41, configured to maintain, through a system process, a network allocation table and a current default network, where the network allocation table includes handles of sockets and a physical network; a monitoring unit 43, configured to monitor whether an application process exits abnormally through the system process; and the processing unit 45 is configured to, in the case that the application process has an abnormal exit, clear all sockets of the application process having the abnormal exit in the network allocation table, and implement parallel balanced communication using multiple physical networks simultaneously through the sockets.
It should be noted that the maintenance unit 41 in this embodiment may be configured to execute step S1 in this embodiment, the monitoring unit 43 in this embodiment may be configured to execute step S2 in this embodiment, the processing unit 45 in this embodiment may be configured to execute step S3 in this embodiment, and the first closing module 78 in this embodiment may be configured to execute step S4 in this embodiment.
Optionally, the maintenance unit may read the network allocation table and the default network when maintaining the network allocation table and the current default network through the system process; and distributing the application process to use the designated network based on the network distribution table and the number balance of the sockets when the sockets are opened.
Optionally, the maintenance unit may read the network allocation table and the default network when maintaining the network allocation table and the current default network through a system process; and clearing the corresponding socket in the network distribution table when closing the socket.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, the maintenance unit may use the designated network for communication under the condition that the designated network is normal; in the event that the specified network does not exist but the default network is valid, communicating using the default network.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, in case that the physical network is opened, the maintenance unit may search a first subset S1 from the network allocation table, where the first subset includes all sockets to which the currently opened network is allocated; updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network; if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network; the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, when the maintenance unit maintains the network allocation table and the current default network through the system process, in a case that the physical network is closed, the maintenance unit may search a third subset F from the allocation table, where the third subset includes all sockets to which the closed physical network is allocated; updating the socket option SO _ MARK in the third subset to cause the application process to communicate using the default network.
Optionally, the network parameters of the socket option SO _ MARK include routing information, IP address, DNS address, and gateway address.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules as a part of the apparatus may run in a corresponding hardware environment, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiments of the present application, there is also provided a server or a terminal for implementing the management method of the network.
Fig. 5 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 5, the terminal may include: one or more processors 201 (only one shown), memory 203, and transmission means 205, as shown in fig. 5, the terminal may further comprise an input-output device 207.
The memory 203 may be configured to store software programs and modules, such as program instructions/modules corresponding to the network management method and apparatus in the embodiment of the present application, and the processor 201 executes various functional applications and data processing by running the software programs and modules stored in the memory 203, that is, implements the network management method. Memory 203 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 203 may further include memory located remotely from the processor 201, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 205 is used for receiving or sending data via a network, and can also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 205 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices so as to communicate with the internet or a local area Network. In one example, the transmission device 205 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Wherein the memory 203 is specifically used for storing application programs.
The processor 201 may call the application stored in the memory 203 via the transmission means 205 to perform the following steps:
maintaining a network allocation table and a current default network through a system process, wherein the network allocation table comprises handles of sockets and a physical network;
monitoring whether the application process is abnormally exited or not through the system process;
and under the condition that the application process is abnormally exited, clearing all sockets of the application process which is abnormally exited in the network distribution table, and realizing parallel balanced communication by simultaneously using a plurality of physical networks through the sockets.
The processor 201 is further configured to perform the following steps:
in case of a physical network being opened, looking up a first subset from the network allocation table S1, wherein the first subset includes all sockets allocated to the currently opened network;
updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network;
if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network;
the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing a management method of a network.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
maintaining a network allocation table and a current default network through a system process, wherein the network allocation table comprises handles of sockets and a physical network;
monitoring whether the application process is abnormally exited or not through the system process;
and under the condition that the application process is abnormally exited, clearing all sockets of the application process which is abnormally exited in the network distribution table, and realizing parallel balanced communication by simultaneously using a plurality of physical networks through the sockets.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
in case of a physical network being opened, looking up a first subset from the network allocation table S1, wherein the first subset includes all sockets allocated to the currently opened network;
updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network;
if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network;
the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (9)

1. A method for managing a network, comprising:
maintaining a network allocation table and a current default network through a system process, wherein the network allocation table comprises handles of sockets and a physical network, and the method comprises the following steps: reading the network allocation table and a default network; evenly distributing application processes to use a specified network based on the network distribution table and the number of sockets when the sockets are opened;
monitoring whether the application process is abnormally quitted or not through the system process;
and under the condition that the application process is abnormally exited, clearing all sockets of the application process which is abnormally exited in the network distribution table, and realizing parallel balanced communication by simultaneously using a plurality of physical networks through the sockets.
2. The method of claim 1, wherein maintaining, by the system process, the network allocation table and the current default network comprises:
reading the network allocation table and a default network;
and clearing the corresponding socket in the network distribution table when closing the socket.
3. The method of claim 1, wherein maintaining, by the system process, the network allocation table and the current default network comprises:
under the condition that the designated network is normal, the designated network is used for communication;
in the event that the specified network does not exist but the default network is valid, communicating using the default network.
4. The method of claim 1, wherein maintaining, by the system process, the network allocation table and the current default network comprises:
in case of a physical network being opened, looking up a first subset from the network allocation table S1, wherein the first subset includes all sockets allocated to the currently opened network;
updating the socket option SO _ MARK in the first subset S1 to enable the application process to communicate using the open network;
if the open network is selected by the system process as the default network, looking up a second subset from the network allocation table S2, wherein the second subset includes all sockets that are invalid for the allocated physical network;
the socket option SO MARK in the second subset S2 is updated to make the application process use the default network.
5. The method of claim 1, wherein maintaining, by the system process, the network allocation table and the current default network comprises:
under the condition that the physical network is closed, searching a third subset F from the allocation table, wherein the third subset comprises all sockets allocated to the closed physical network;
updating the socket option SO _ MARK in the third subset to cause the application process to communicate using the default network.
6. Method according to claim 4 or 5, characterized in that the network parameters of the socket option SO _ MARK comprise routing information, IP address, DNS address and gateway address.
7. An apparatus for managing a network, comprising:
a maintenance unit, configured to maintain a network allocation table and a current default network through a system process, where the network allocation table includes handles of sockets and a physical network, and the maintenance unit includes: reading the network allocation table and a default network; evenly distributing application processes to use a specified network based on the network distribution table and the number of sockets when the sockets are opened;
the monitoring unit is used for monitoring whether the application process is abnormally quitted or not through the system process;
and the processing unit is used for clearing all sockets of the application process which is abnormally exited in the network distribution table under the condition that the application process is abnormally exited, and realizing parallel balanced communication which simultaneously uses a plurality of physical networks through the sockets.
8. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 6.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 6 by means of the computer program.
CN202011158959.XA 2020-10-26 2020-10-26 Network management method and device, storage medium and electronic device Active CN112311625B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011158959.XA CN112311625B (en) 2020-10-26 2020-10-26 Network management method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011158959.XA CN112311625B (en) 2020-10-26 2020-10-26 Network management method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112311625A CN112311625A (en) 2021-02-02
CN112311625B true CN112311625B (en) 2022-05-20

Family

ID=74330650

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011158959.XA Active CN112311625B (en) 2020-10-26 2020-10-26 Network management method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112311625B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114928660B (en) * 2022-05-16 2023-10-31 北京计算机技术及应用研究所 Method for communication between transparent processes of embedded operating system
CN116662045A (en) * 2022-11-18 2023-08-29 荣耀终端有限公司 Process name acquisition method, terminal equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1261890C (en) * 2003-01-23 2006-06-28 英业达股份有限公司 Network card testing method capable of balancing loads
CN103036788A (en) * 2012-12-14 2013-04-10 上海斐讯数据通信技术有限公司 Implementation method of multi-interface gateway equipment data transmitting
CN104579766B (en) * 2014-12-23 2017-12-05 凌云天博光电科技股份有限公司 A kind of more application layer webmaster concurrent access methods and device
US10536357B2 (en) * 2015-06-05 2020-01-14 Cisco Technology, Inc. Late data detection in data center
CN106953795B (en) * 2016-01-07 2020-07-31 南京中兴软件有限责任公司 Method and device for configuring multiple network cards

Also Published As

Publication number Publication date
CN112311625A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN112311625B (en) Network management method and device, storage medium and electronic device
US9820177B2 (en) Portable information terminal, communication system, communication control method, and program
CN105930191B (en) The overloaded method and device of system service
CN106412680B (en) Multi-screen control method and device
CN110808857B (en) Network intercommunication method, device, equipment and storage medium for realizing Kubernetes cluster
CN110166524B (en) Data center switching method, device, equipment and storage medium
RU2568303C2 (en) Authentication, authorisation and accounting server and method for message processing in said server
CN110928637A (en) Load balancing method and system
CN112596768A (en) Device updating method and device, storage medium and electronic device
US10516759B2 (en) System and method for centralized management of software services
CN110851275B (en) Load transfer method and device of routing node
CN113037599A (en) Message processing method, device and storage medium
CN101360291B (en) Multi-standby terminal and firmware updating method and apparatus
CN113824789B (en) Configuration method, device, equipment and storage medium of access descriptor
CN111385110B (en) Network management method and device
CN116028196A (en) Data processing method, device and storage medium
EP2109253A1 (en) A license implementation method, device and system of sharing the exchange node
CN107528714B (en) Script processing method, device and system and router
CN112866223A (en) Routing method and device for homomorphic encryption request
WO2018129957A1 (en) Vbng system multi-virtual machine load sharing method and vbng system device
CN115134216B (en) Method, system and medium for protecting and scheduling different IPSEC tunnel based on SDWAN
US11196668B2 (en) End user premises device controller
CN112153713B (en) Obstacle determination method and apparatus, storage medium, and electronic apparatus
US11924752B2 (en) Device onboarding using cellular data services directory
CN114978660B (en) Out-of-band network construction method and out-of-band processing method based on out-of-band network

Legal Events

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