CN110784404B - Method and device for adjusting multi-network-port equipment application program package sending strategy - Google Patents

Method and device for adjusting multi-network-port equipment application program package sending strategy Download PDF

Info

Publication number
CN110784404B
CN110784404B CN201910951039.4A CN201910951039A CN110784404B CN 110784404 B CN110784404 B CN 110784404B CN 201910951039 A CN201910951039 A CN 201910951039A CN 110784404 B CN110784404 B CN 110784404B
Authority
CN
China
Prior art keywords
application program
port
life cycle
monitored
corresponding relation
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
CN201910951039.4A
Other languages
Chinese (zh)
Other versions
CN110784404A (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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN201910951039.4A priority Critical patent/CN110784404B/en
Publication of CN110784404A publication Critical patent/CN110784404A/en
Application granted granted Critical
Publication of CN110784404B publication Critical patent/CN110784404B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/302Route determination based on requested QoS
    • H04L45/306Route determination based on the nature of the carried application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • 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/5061Pools of addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for adjusting an application program package sending strategy of multi-network-port equipment, relating to the technical field of intelligent operation terminal equipment.A package sending rule address pool table is established, and the corresponding relation among application program package names, life cycle states and network ports is recorded; monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time; when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module; the data forwarding module forwards data according to the corresponding relation among the life cycle state, the IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table, so that different application programs can select different communication network cards of equipment according to the service requirements of the application programs. And the distribution of different data packets can be completed under different states of the application program. Meanwhile, the user is prevented from realizing communication of different network layers in a network switching mode, and modification of an upper layer router is avoided.

Description

Method and device for adjusting multi-network-port equipment application program package sending strategy
Technical Field
The invention relates to the technical field of intelligent operation terminal equipment, in particular to a method and a device for adjusting an application program package sending strategy of multi-network-port equipment.
Background
With the development of broadband construction and telecommunication operator services, the applications borne by the intelligent network set top box are more and more, and networking modes are more and more diverse. The set-top box can be provided with three types of interfaces of a wired network, a wireless network and a virtual network interface, and can be accessed to different networks. For example, a wired network of the set-top box is accessed to an IPTV private network of an operator, a wireless network is accessed to an Internet public network, and a virtual network port is used for system control communication in home equipment. These three types of networks cannot be accessed by each other due to network construction and security requirements. The set-top box can have various applications to bear different services. For example, the IPTV application is used to access an operator IPTV private network to access web pages, videos, and the like. And the OTT video program is used for accessing an Internet public network and watching network videos. Virtual network ports are used for communication between different devices or different systems of the same device. There is also an application, such as multi-screen interaction. Such applications require the use of different networks at different stages. For example, a public network is required to be used in a multi-screen interactive device discovery phase, and an IPTV private network is required to be used in an IPTV video playing phase.
In the prior art, it is common practice to use a routing table to determine which port the traffic uses by recording IP address segments. Such as 10.32.131, the IP address of the network segment goes to the wired network and the other default network segment goes to the wireless network. This has the disadvantage of requiring a full enumeration of all segments of the wired network, and the lack of a wired network makes it impossible to use the inaccessible wireless network. This method is selected according to the destination IP address, and has a disadvantage that different ports cannot be selected according to different applications, or even different ports cannot be selected according to different states of the same application.
Therefore, how to implement a method for adjusting an application package sending policy based on a multi-network-port device so that an application can adjust the package sending policy according to own service needs and own different state needs is a problem which needs to be solved urgently at present.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a method and a device for adjusting a packet sending strategy of an application program of a multi-network-port device, so that the application program can adjust the packet sending strategy according to self service requirements and self different state requirements.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows: a method for adjusting a multi-network-port device application program package sending strategy comprises the following steps:
creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
starting a data forwarding module to acquire the monitored corresponding relation between the IP port in use or monitoring and the application program package name;
when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
and the data forwarding module forwards data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
On the basis of the scheme, the method further comprises the following steps:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
On the basis of the above scheme, the recording of the correspondence among the application package name, the life cycle state, and the portal specifically includes the following steps: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are recorded in the packet sending rule address pool table.
On the basis of the above scheme, the data forwarding module performs data forwarding according to the life cycle state, the monitored correspondence between the currently used or monitored IP port and the application program packet name, and the correspondence recorded in the packet-sending rule address pool table, and specifically includes the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
On the basis of the scheme, the life cycle method comprises Activity onCreate (), onStart (), onResume (), onPause (), onStop (), ontestory () methods and Service onCreate (), onstartCommand (), onBind (), ontestory () methods; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
The invention also provides a device for adjusting the application program package sending strategy of the multi-network-port equipment, which comprises the following components:
a table creation and maintenance module to: creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
a real-time monitoring module for: monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
a period announcement module to: when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
a data forwarding module to: acquiring a monitored corresponding relation between an IP port which is being used or monitored and an application program package name from a real-time monitoring module; and forwarding data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
On the basis of the above scheme, the table creation and maintenance module is further configured to:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
On the basis of the above scheme, the system further comprises an application management module, configured to: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are sent to the form creation and maintenance module for recording.
On the basis of the above scheme, the data forwarding module performs data forwarding according to the life cycle state, the monitored correspondence between the currently used or monitored IP port and the application program packet name, and the correspondence recorded in the packet-sending rule address pool table, and specifically includes the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
On the basis of the scheme, the life cycle method comprises Activity onCreate (), onStart (), onResume (), onPause (), onStop (), ontestory () methods and Service onCreate (), onstartCommand (), onBind (), ontestory () methods; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
Compared with the prior art, the invention has the advantages that:
the invention records the corresponding relation among the application program package name, the life cycle state and the network port by establishing a package sending rule address pool table; monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time; when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module; and the data forwarding module forwards data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table, so that different application programs can select different communication network cards of the equipment according to the self service requirements. And the distribution of different data packets can be completed under different states of the application program. Meanwhile, the user is prevented from realizing communication of different network layers in a network switching mode, and modification of an upper layer router is avoided.
Drawings
Fig. 1 is a schematic flowchart of a method for adjusting a multi-portal device application package sending policy according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a system for adjusting a multi-portal device application package sending policy according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
The embodiment of the invention provides a method for adjusting an application program package sending strategy of multi-network-port equipment, which comprises the following steps:
creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
starting a data forwarding module to acquire the monitored corresponding relation between the IP port in use or monitoring and the application program package name;
when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
and the data forwarding module forwards data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
As a preferred embodiment, the method further comprises the steps of:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
As a preferred embodiment, the recording of the correspondence between the application package name, the life cycle state, and the portal specifically includes the following steps: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are recorded in the packet sending rule address pool table.
As a preferred embodiment, the data forwarding module performs data forwarding according to the life cycle state, the monitored correspondence between the currently used or monitored IP port and the application package name, and the correspondence recorded in the packet-sending rule address pool table, and specifically includes the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
As a preferred embodiment, the lifecycle method includes Activity onCreate (), onStart (), onsemum (), onPause (), onStop (), onsestroy () methods and Service onCreate (), onStartCommand (), onBind (), onsestry () methods; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
The method for adjusting the application program package sending strategy of the multi-network-port device comprises the following two aspects:
on one hand, a packet sending rule address pool table is established for recording the corresponding relation of the application program packet name, the life cycle state, the IP port and the network port. This table may be embodied in the form of a database. The system setup program, the monitoring module as described below, and the authorized application can access and modify this form. An application developer aware of this principle can fill in items of data into a table at the time of application development.
Because the third party developer may not know the table or the developed application program may not modify the table, a real-time monitoring module is established in the system of the embodiment of the invention for the application program development compatible with other third party developers. The module is responsible for acquiring the application program package name by inquiring the states of the network port and the port (the states of all service ports can be inquired through a netstat-a command) and combining with the PID in the inquiry process (the application program package name corresponding to the PID can be acquired through a ps command inquiry process), so that the corresponding relation between the application program package name and the port which is being used is addressed. According to the embodiment of the invention, a 2010 port is used when com.abc is inquired through a busy netstat-input command. The commands and results are as follows:
Busybox netstat-anput
Active Internet connections(servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0:::2010:::*LISTEN 2602/com.abc
all the installed applications can be inquired through the system setting program, and the internet access bound by the application program can be changed. At this time, the corresponding states of the application program package name, the IP port and the network port can be completed. Abc applications are using the 2010 port, for example, wishing to bind to a wired network port.
And establishing a data packet forwarding module. The module is responsible for combining the life cycle state according to the address pool table of the packet sending rule. And forwarding the data packet sent by the application program to the corresponding network card.
On the other hand, in the Android system, the lifecycle of an application is rewritten. Including Activity onCreate (), onStart (), onResume (), onPause (), onSt op (), onDestroy () methods and Service onCreate (), onStartCommand (), o nBind (), onDestroy () methods. When these methods are called by the application, the data forwarding module is informed of the application package name and the lifecycle state. The operation state comprises the following steps: background program running period, foreground program running period, starting period, pause period, etc. The application developer can also combine the function with the class name, and the system can judge the function used by the application program by the way of the class name.
The management class of the installed application in the system is rewritten. And when the application program installation method is called, popping up an operation interface. The user is allowed to select the network card that the different stages of the application (corresponding to different classes of applications, including interfaces and services) wish to send data. And recording information such as the name, class name, internet access and the like of the application program package into the package sending rule address pool table. The purpose of sending data to different network cards is achieved when the application program is installed or when the state of the application program is changed through a setting program.
Referring to fig. 2, an embodiment of the present invention further provides an apparatus for adjusting a packet sending policy of an application program of a multi-portal device, where the apparatus includes:
a table creation and maintenance module to: creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
a real-time monitoring module for: monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
a period announcement module to: when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
a data forwarding module to: acquiring a monitored corresponding relation between an IP port which is being used or monitored and an application program package name from a real-time monitoring module; and forwarding data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
In a preferred embodiment, the table creation and maintenance module is further configured to:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
As a preferred embodiment, the system further comprises an application management module for: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are sent to the form creation and maintenance module for recording.
As a preferred embodiment, the data forwarding module performs data forwarding according to the life cycle state, the monitored correspondence between the currently used or monitored IP port and the application package name, and the correspondence recorded in the packet-sending rule address pool table, specifically including the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
As a preferred embodiment, the lifecycle method includes Activity onCreate (), onStart (), onsemum (), onPause (), onStop (), onsestroy () methods and Service onCreate (), onStartCommand (), onBind (), onsestry () methods; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
Packet rules address pool table: the method is characterized in that the method exists in a terminal system, and can record the corresponding relation of the application package name, the life cycle state and the network port in a text and database mode, wherein the life cycle state and the application class name can be added according to the requirement or not. If the life cycle state does not exist, the application program corresponds to a certain network port at any time. Abc, for example, the application package name com. corresponding to an eth0 port, this application uses the eth0 port at any time.
An application may use the wlan0 in different states corresponding to different portals, e.g., com.bcd, background. Bcd application is represented using wlan0 port in the background (there is an interface, i.e. an Activity-enabled application will call the onPause (), onsop () methods in the background).
A real-time monitoring module: through commands or command combinations such as netstat, ps and the like, the corresponding relation between the IP port in the using state or the monitoring state and the application program packet name in use is inquired and monitored in real time. For example, the com.abc program is using port 8002 and the com.bcd application is using 8005 port in listening state.
A data forwarding module: and acquiring the corresponding relation between the IP port and the application program package name known by the real-time monitoring module. And inquiring IP addresses of different network ports. And forwarding the data packet by using an iptables command according to the corresponding relation recorded by the packet sending rule address pool table. For example, the IP address of eth0 port is 62.129.66.5, the IP address of wlan0 port is 192.168.43.13, the port used by co m.abc is 8002, and the port used by com.bcd is 8005. The message sent by the com.bcd application program can be transferred to the wlan0 network port by using an instruction ipta bles-T nat-A POSTROUTING-i eth0-p tcp-sport 8005-j DNA T-to-destination 192.168.43.13: 8005. The meaning of the command is as follows: -tnat indicates the source address and port in the modified packet, postoutputting indicates the source IP or port to be modified; -i eth0 represents the incoming packets from eth0 portal; -sport represents a source port; -ptcp denotes the matching TCP protocol; -j DNAT represents the destination NAT; -to-destination indicates the destination address and port converted. Since the processing is performed in the postoutputting chain, after the data is sent out, the target address is also wrapped according to the converted address, and the processing is not required to be performed subsequently.
Similarly, the method can be realized by using iptables-t nat-A POSTROUTING-i wlan0-p tcp-sport 8002-j DNAT-to-destination 62.129.66.5:8002, and the message of the com. abc application program is forwarded to the eth0 network port.
When the system is manufactured, a new application program is installed, and a user can modify the packet-sending rule address pool table through program setting operation.
As shown in fig. 1, the software processing flow process of the embodiment of the present invention is as follows:
step 101: establishing a package sending rule address pool table in an Android system for recording the corresponding relation of the package name, the life cycle state and the network port of an application program
Step 102: and starting the system and starting the real-time monitoring module. And monitoring the corresponding relation between the IP port being used or monitored and the application program package name.
Step 103: and starting the data forwarding module to acquire the corresponding relation between the IP port and the application program package name known by the real-time monitoring module.
Step 104: and during the starting or running period of the application program, when the life cycle method is called, the data forwarding module is informed.
Step 105: and the data forwarding module forwards data according to the corresponding relation recorded by the packet sending rule address pool table.
Step 106: when the system is manufactured, a new application program is installed, and a user can modify the packet-sending rule address pool table through program setting operation.
Based on the same inventive concept, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements all or part of method steps of an adjustment method for a multi-portal device application package sending policy.
All or part of the flow in the method for adjusting the multi-portal device application package sending policy may also be completed by instructing related hardware through a computer program, where the computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
Based on the same inventive concept, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program running on the processor, and the processor implements all or part of method steps in the method for adjusting the multi-portal device application package sending policy when executing the computer program.
The processor may be a Central Processing Unit (CP U), or may be other general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the computer device and the various interfaces and lines connecting the various parts of the overall computer device.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, server, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), servers and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for adjusting a multi-network-port device application program package sending strategy is characterized by comprising the following steps:
creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
starting a data forwarding module to acquire the monitored corresponding relation between the IP port in use or monitoring and the application program package name;
when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
and the data forwarding module forwards data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
2. The method of claim 1, further comprising the steps of:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
3. The method according to claim 1, wherein the recording of the correspondence between the application package name, the lifecycle state, and the portal comprises the steps of: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are recorded in the packet sending rule address pool table.
4. The method according to claim 1, wherein the data forwarding module forwards data according to the lifecycle status, the monitored correspondence between the currently used or monitored IP port and the application package name, and the correspondence recorded in the packet-sending rule address pool table, and specifically includes the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
5. The method of claim 1, wherein the lifecycle methods include the onCreate () method of Activity, the onStart (), the onResume (), the onPause (), the onStop (), the onDesstroy () method, and the onCreate () method of Service, the onStartCommand (), the onBind (), the onDesstroy () method; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
6. An apparatus for adjusting a packet sending policy of an application program of a multi-port device, comprising:
a table creation and maintenance module to: creating a package sending rule address pool table, and recording the corresponding relation among the application package name, the life cycle state and the network port;
a real-time monitoring module for: monitoring the corresponding relation between the IP port being used or monitored and the application program package name in real time;
a period announcement module to: when the application program calls the life cycle method, the life cycle state is informed to the data forwarding module;
a data forwarding module to: acquiring a monitored corresponding relation between an IP port which is being used or monitored and an application program package name from a real-time monitoring module; and forwarding data according to the life cycle state, the monitored corresponding relation between the used or monitored IP port and the application program package name and the corresponding relation recorded in the packet sending rule address pool table.
7. The apparatus of claim 6, wherein the table creation and maintenance module is further to:
and when the system is manufactured, a new application program is installed or a user operates through a setting program, the packet sending rule address pool table is accessed and modified according to the requirements of the user.
8. The apparatus of claim 6, wherein the apparatus further comprises an application management module to: when the application program installation method is called, an operation interface is popped up for a user to select the corresponding network ports for sending data at different stages of the application program, and the packet name, the class name, the life cycle state and the corresponding network ports of the application program are sent to the form creation and maintenance module for recording.
9. The apparatus according to claim 6, wherein the data forwarding module forwards data according to the lifecycle status, the monitored correspondence between the currently used or monitored IP port and the application package name, and the correspondence recorded in the address pool table of the packet forwarding rule, specifically comprising the following steps:
and the data forwarding module inquires IP addresses of different network ports, and forwards the data packet to the corresponding network port by using an iptables command according to the life cycle state of the application program, the monitored corresponding relation between the IP port being used or monitored and the packet name of the application program and the corresponding relation recorded in the packet sending regular address pool table.
10. The apparatus of claim 6, wherein the lifecycle methods comprise onCreate () of Activity, onStart (), onResume (), onPause (), onStop (), onDestroy () methods, and onCreate () of Service, onStartCommand (), onBind (), onDestroy () methods; the life cycle state comprises a program background running period, a foreground program running period, a starting period and a pause period.
CN201910951039.4A 2019-10-08 2019-10-08 Method and device for adjusting multi-network-port equipment application program package sending strategy Active CN110784404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910951039.4A CN110784404B (en) 2019-10-08 2019-10-08 Method and device for adjusting multi-network-port equipment application program package sending strategy

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910951039.4A CN110784404B (en) 2019-10-08 2019-10-08 Method and device for adjusting multi-network-port equipment application program package sending strategy

Publications (2)

Publication Number Publication Date
CN110784404A CN110784404A (en) 2020-02-11
CN110784404B true CN110784404B (en) 2022-03-25

Family

ID=69384898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910951039.4A Active CN110784404B (en) 2019-10-08 2019-10-08 Method and device for adjusting multi-network-port equipment application program package sending strategy

Country Status (1)

Country Link
CN (1) CN110784404B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594263A (en) * 2009-01-09 2009-12-02 成都四方信息技术有限公司 System to monitoring network communication data packets
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN106919836A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 The port detecting method and device of application
CN107040540A (en) * 2017-04-20 2017-08-11 北京奇虎科技有限公司 A kind of cloud private data display methods and device, server and mobile terminal
CN108494639A (en) * 2018-02-09 2018-09-04 维沃移动通信有限公司 Network access method and mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902390B (en) * 2014-03-12 2017-04-19 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101594263A (en) * 2009-01-09 2009-12-02 成都四方信息技术有限公司 System to monitoring network communication data packets
CN104268473A (en) * 2014-09-23 2015-01-07 龙芯中科技术有限公司 Method and device for detecting application programs
CN106919836A (en) * 2015-12-28 2017-07-04 阿里巴巴集团控股有限公司 The port detecting method and device of application
CN107040540A (en) * 2017-04-20 2017-08-11 北京奇虎科技有限公司 A kind of cloud private data display methods and device, server and mobile terminal
CN108494639A (en) * 2018-02-09 2018-09-04 维沃移动通信有限公司 Network access method and mobile terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A. A. L"vov ; A. Y. Nikolaenko ; P. A. L"vov.A novel vector network analyzer using combined multi-port reflectometer.《2015 Conference on Microwave Techniques (COMITE)》.2015, *
徐业荣 ; 包明磊 ; 李明.一种基于lwIP协议栈的双网口通信方案设计.《计算机应用与软件》.2016, *

Also Published As

Publication number Publication date
CN110784404A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN104639913A (en) Network video recorder (NVR) and automatic IPC (Internet Protocol Camera) access method thereof
CN105338023A (en) Intelligent equipment control method, apparatus and system
US10205788B2 (en) Run-time actionable information exchange system in a secure environment
CN102265566B (en) Method for configuring parameters for managing data packets pertaining to data flow
CN106412680B (en) Multi-screen control method and device
CN104243627A (en) Domain name resolution method, device and system
CN109842559B (en) Network communication method and system
CN110768889B (en) VXLAN tunnel construction method and system
CN110290044B (en) Method, device and storage medium for shunting VPN (virtual private network) and backbone network
CN103379096A (en) Internet and operator network service sharing method, service side and webpage gateway
CN111629082B (en) Address jump system, method, device, storage medium and processor
CN109150741A (en) File transmitting method, device, electronic equipment and storage medium
WO2021254442A1 (en) Session initiation method, apparatus and system, electronic device, and computer readable storage medium
CN110784404B (en) Method and device for adjusting multi-network-port equipment application program package sending strategy
US20190364425A1 (en) Updating policy for a video flow during transitions
CN113676493A (en) Communication method based on MOBIKE protocol and electronic equipment
CN105515985A (en) Service message transmission control method, device and system
CN110224942A (en) A kind of message processing method, device and storage medium
RU2595526C2 (en) Method, apparatus and system for recording multimedia data
CN108055262A (en) Video conference terminal register method, terminal and gatekeeper
US20110019684A1 (en) Multimedia Content Sharing Via Audio-Video Communication
CN114979098A (en) WebRTC-based communication method and device and electronic equipment
CN113395718B (en) Network performance optimization method and system under condition that main/standby convergence layer equipment transmits back network scene
US11956302B1 (en) Internet protocol version 4-to-version 6 redirect for application function-specific user endpoint identifiers
CN112995065B (en) Internet flow control method and device and electronic equipment

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