Disclosure of Invention
The technical problem to be solved by the present invention is to provide a network connection processing method of a mobile terminal, a storage device and a mobile terminal, aiming at solving the problem that the mobile terminal in the prior art cannot actively perform network connection communication according to the actual needs of a user, which results in energy consumption.
The technical scheme adopted by the invention for solving the technical problem is as follows:
the network connection processing method of the mobile terminal comprises the following steps:
when the mobile terminal is in a preset active network connection mode, detecting whether a networking trigger event exists or not;
if the network name exists, acquiring the network name corresponding to the name of the networking trigger event according to the corresponding relation between the preset networking trigger event name and the network name connected with the network, and enabling the network;
and when no networking trigger event is detected within the preset time and the network is used for data transmission, disabling the network.
According to the network connection processing method of the mobile terminal, when the mobile terminal is in a preset active network connection mode, all network connections are forbidden.
The network connection processing method of the mobile terminal, wherein the corresponding relationship between the networking trigger event name and the network name of the connected network is as follows: one network name corresponds to one or more networking trigger events, and the networking trigger event corresponding to any one network name is not repeated with the networking trigger events corresponding to other network names.
The network connection processing method of the mobile terminal, wherein when no networking trigger event is detected within the preset time and the network is used for data transmission, disabling the network specifically includes:
pre-establishing a registration table corresponding to the network names one by one;
recording the name of the detected networking trigger event into a corresponding registration table according to the corresponding relation between the networking trigger event name and the network name connected with the network;
and when all the networking trigger events in the registration table corresponding to the network name are not subjected to data transmission within the preset time, disabling the network.
The network connection processing method of the mobile terminal is characterized in that the preset time is 5 s.
The method for processing network connection of the mobile terminal, wherein when no networking trigger event is detected within the preset time and the network is used for data transmission, the method further comprises the following steps of:
and deleting the name of the networking trigger event in the registry.
The network connection processing method of the mobile terminal, wherein when the mobile terminal is in a preset active network connection mode, before detecting whether a networking trigger event exists, the method further comprises:
a setting menu for turning on and off the active network connection mode is preset.
The network connection processing method of the mobile terminal, wherein when the mobile terminal is in a preset active network connection mode, before detecting whether a networking trigger event exists, the method further comprises:
and presetting a time period, and automatically starting the active network connection mode when the current time is in the time period.
A storage device, wherein the storage device stores a computer program executable to implement a network connection processing method of a mobile terminal as described in any one of the above.
A mobile terminal, comprising: the mobile terminal comprises a central processing unit and a storage device connected with the central processing unit, wherein the storage device stores a computer program, and the computer program realizes the network connection processing method of the mobile terminal when being executed by the central processing unit;
the central processing unit is configured to call a computer program in the storage device to execute any one of the above network connection processing methods of the mobile terminal.
Has the advantages that: in the invention, when the mobile terminal is in a preset active network connection mode, whether a networking trigger event exists is detected; if the network name exists, acquiring the network name corresponding to the name of the networking trigger event according to the corresponding relation between the preset networking trigger event name and the network name connected with the network, and enabling the network; when no networking trigger event is detected within the preset time and the network is used for data transmission, the network is forbidden, the mobile terminal actively starts the corresponding network when the network is required to be used, the network data can be monitored, and the corresponding network is forbidden when the preset condition is reached, so that the energy consumed by the network is reduced, and a new function is added to the mobile terminal.
Detailed Description
In order to make the objects, technical solutions, and advantages of the present invention clearer and clearer, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention will be further explained by the description of the embodiments with reference to the drawings.
The invention provides a network connection processing method of a mobile terminal, a storage device and the mobile terminal. As shown in fig. 1, the network connection processing method of the mobile terminal includes the following steps:
s100, when the mobile terminal is in a preset active network connection mode, detecting whether a networking trigger event exists.
The network connection processing method of the mobile terminal can be applied to any mobile terminal with storage and communication functions, such as a tablet Computer, a mobile phone, an electronic reader, a remote controller, a Personal Computer (PC), a notebook Computer, a vehicle-mounted device, a network television, a wearable device and the like.
When the active network connection mode is detected to be started, the mobile terminal enters the active network connection mode, whether a networking trigger event exists in the mobile terminal is detected in real time, the networking trigger event refers to an application program needing to use a network for data communication, when the networking trigger event is detected to exist, a user is indicated to actively start a certain application program needing network connection for data communication, and at the moment, the network connection needs to be started.
Furthermore, when the mobile terminal is in a preset active network connection mode, all network connections are disabled, and therefore when a user actively triggers a networking trigger event, the mobile terminal is connected with the network again, the mobile terminal can actively use the network, the network connection is opened according to the actual needs of the user, and the network connection of the mobile terminal can only be actively awakened by the user.
S200, if the network name exists, acquiring the network name corresponding to the name of the networking trigger event according to the corresponding relation between the preset networking trigger event name and the network name connected with the network, and enabling the network.
Presetting a corresponding relation between a networking trigger event name and a network name of a connection network, wherein the connection network name is the name of a network which needs to be used by a triggered networking trigger event; when a networking trigger event is detected to be triggered, according to the name of the networking trigger event, the network name corresponding to the name of the networking trigger event can be obtained from the corresponding relation between the preset networking trigger event name and the network name connected with the network, so that the network is enabled, and the networking trigger event can carry out data communication through the network.
The corresponding relation between the networking trigger event name and the network name of the connected network is as follows: one network name corresponds to one or more networking trigger events, and the networking trigger event corresponding to any one network name is not repeated with the networking trigger events corresponding to other network names.
Preferably, the corresponding relationship between the network trigger event name and the network name of the connected network is stored in a list form, wherein the network name is a column, the network trigger event name is a column, and each row includes the network name and all the network trigger event names corresponding to the network name. In a preferred embodiment, the network names include a mobile data network, a WIFI network, bluetooth, and NFC (near field communication), the network names are arranged in columns, and the networking trigger event names corresponding to the mobile data network include chat tools, and the chat tools and the mobile data network are arranged in rows; the networking trigger event names corresponding to the WIFI network comprise video APPs and microblogs, and the video APPs, the microblogs and the WIFI network are arranged in a row; there may be multiple networking trigger events using the same network or one networking trigger event using only a unique corresponding network. In the column where the networking trigger event is located, the networking trigger events stored in all rows are not repeated, that is, one networking trigger event does not exist, and a plurality of networks are used for data communication at the same time.
S300, when no networking trigger event is detected within the preset time and the network is used for data transmission, the network is forbidden.
When no networking trigger event is detected within the preset time and the network is used for data transmission, disabling the network specifically comprises:
pre-establishing a registration table corresponding to the network names one by one;
recording the name of the detected networking trigger event into a corresponding registration table according to the corresponding relation between the networking trigger event name and the network name connected with the network;
and when all the networking trigger events in the registration table corresponding to the network name are not subjected to data transmission within the preset time, disabling the network.
The registry is used for recording the names of the networking trigger events actively triggered by the user in the active network connection mode, and the registry corresponds to the network names required to be connected by the networking trigger events, namely, each network name corresponds to one registry. When a networking trigger event is detected, finding a network name corresponding to the networking trigger event according to the corresponding relation between the networking trigger event name and the network name connected with the network, starting the corresponding network, and simultaneously recording the name of the networking trigger event into a registry corresponding to the network name. And accessing the registry to know which networking trigger events are triggered currently and using the network corresponding to the registry to perform data communication.
When the networking triggering event actively triggered by the user continues to transmit network data for a preset time after networking, which indicates that the user does not use the networking triggering event at the preset time, the network can be disabled, to reduce the energy consumption of the mobile terminal when using the network, but since the user may trigger more than one networking trigger event, that is, there may be a plurality of networking triggers using the same network connection, and therefore, when no networking trigger is detected within a preset time for data transmission, detecting whether only the name of the networking trigger event is recorded in a registry corresponding to the network corresponding to the networking trigger event, if the name of other networking trigger events does not exist, the network can be directly forbidden if only the networking trigger event uses the network; if the names of other networking trigger events exist, which indicates that the network is also used by other networking trigger events, the network cannot be disabled even if the networking trigger events are not detected within the preset time for data transmission. And when all the networking trigger events in the registration table corresponding to the network name do not use the network for data transmission communication within the preset time, disabling the network.
Preferably, the preset time is 5 s.
Further, a priority ranking table is preset, the priority ranking table is used for storing names of all networks and ranking all the network names according to priorities, wherein the highest priority ranking is arranged at the top, and the lowest priority ranking is arranged at the bottom; if a plurality of networks need to be disabled simultaneously, the priority list is searched first, each network is disabled in sequence according to the arrangement sequence of the corresponding network names in the priority list, and the network with the earlier arrangement is disabled earlier. Preferably, the priority ranking of each network is ranked according to the number of times that the user uses the networking trigger event counted in advance, if the number of times that the user uses the chat tool is more frequent than the number of times that the user uses the video APP, the name of the network corresponding to the chat tool is ranked behind the name of the network corresponding to the video APP in the priority ranking table, when the network corresponding to the chat tool and the network corresponding to the video APP need to be disabled, the network corresponding to the video APP is disabled first, and the network corresponding to the chat tool is disabled later.
When all the networking trigger events in the registry corresponding to the network name within the preset time are not subjected to data transmission, the method further comprises the following steps of after disabling the network:
and deleting the name of the networking trigger event in the registry.
Because the registration table is internally provided with the networking trigger event which is already actively triggered by the user in the active network connection mode, when the networking trigger event is not detected within the preset time for data transmission and only the name of the networking trigger event is recorded in the registration table, the name of the networking trigger event needs to be deleted from the corresponding registration table after the network is disabled.
When the mobile terminal is in a preset active network connection mode, before detecting whether a networking trigger event exists, the method further includes:
a setting menu for turning on and off the active network connection mode is preset.
And when the user selects to start the active network connection mode in the setting menu, the active network connection mode is started, and all network connections are closed.
When the mobile terminal is in a preset active network connection mode, before detecting whether a networking trigger event exists, the method further includes:
and presetting a time period, and automatically starting the active network connection mode when the current time is in the time period.
A time period is preset, in a preferred embodiment, the time period is from 7 am to 5 pm, when it is detected that the current time is between 7 am and 5 pm, the active network connection mode is automatically opened, all network connections are closed, and it is detected whether the user actively triggers a networking trigger event. When a networking trigger event is detected, step S200 and its subsequent steps are executed.
The present invention also provides a mobile terminal, as shown in fig. 2, which includes: a central processing unit 10, a storage device 20 connected to the central processing unit 10, a communication Interface (Communications Interface)30 and a communication bus 40, wherein the central processing unit 10, the storage device 20 and the communication Interface 30 complete communication with each other through the communication bus 40; the communication interface 30 is used for information transmission between communication devices of the mobile terminal; the storage device 20 stores a computer program, and the computer program realizes the network connection processing method of the mobile terminal as described above when executed by the central processing unit 10;
the central processing unit 10 is configured to call a computer program in the storage device 20 to execute any one of the above network connection processing methods of the mobile terminal.
In summary, according to the network connection processing method of the mobile terminal, the storage device and the mobile terminal provided by the present invention, when the mobile terminal is in the preset active network connection mode, whether a networking trigger event exists is detected; if the network name exists, acquiring the network name corresponding to the name of the networking trigger event according to the corresponding relation between the preset networking trigger event name and the network name connected with the network, and enabling the network; when no networking trigger event is detected within the preset time and the network is used for data transmission, the network is forbidden, the mobile terminal actively starts the corresponding network when the network is required to be used, the network data can be monitored, and the corresponding network is forbidden when the preset condition is reached, so that the energy consumed by the network is reduced, and a new function is added to the mobile terminal.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.