Movatterモバイル変換


[0]ホーム

URL:


CN111510911A - Dual-card data network switching method and device, storage medium and terminal equipment - Google Patents

Dual-card data network switching method and device, storage medium and terminal equipment
Download PDF

Info

Publication number
CN111510911A
CN111510911ACN202010608327.2ACN202010608327ACN111510911ACN 111510911 ACN111510911 ACN 111510911ACN 202010608327 ACN202010608327 ACN 202010608327ACN 111510911 ACN111510911 ACN 111510911A
Authority
CN
China
Prior art keywords
address
frequency
network
delay time
addresses
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.)
Granted
Application number
CN202010608327.2A
Other languages
Chinese (zh)
Other versions
CN111510911B (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.)
Nanchang Black Shark Technology Co Ltd
Original Assignee
Nanchang Black Shark Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanchang Black Shark Technology Co LtdfiledCriticalNanchang Black Shark Technology Co Ltd
Priority to CN202010608327.2ApriorityCriticalpatent/CN111510911B/en
Publication of CN111510911ApublicationCriticalpatent/CN111510911A/en
Application grantedgrantedCritical
Publication of CN111510911BpublicationCriticalpatent/CN111510911B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The invention provides a method, a device, a storage medium and a terminal device for switching a dual-card data network, wherein the method comprises the following steps: acquiring a network data packet of a first SIM card used currently, and extracting a plurality of high-frequency IP addresses corresponding to an application program from the network data packet; sequentially polling and judging whether network delay exists in each high-frequency IP address according to a first preset period; if the accumulated network delay times are larger than the preset times, simultaneously measuring the delay time of all the high-frequency IP addresses and calculating the average delay time; and if the average delay time is longer than the first preset time, switching to a second SIM card for connecting the data network. According to the invention, only when the accumulated network delay times are greater than the preset times, the delay time of all high-frequency IP addresses is triggered and evaluated, so that the waste of resources can be avoided, the SIM card is automatically switched according to the average delay time, the automatic switching of the use of a data network is realized, and the user experience is improved.

Description

Dual-card data network switching method and device, storage medium and terminal equipment
Technical Field
The invention relates to the technical field of intelligent terminal control, in particular to a method and a device for switching a dual-card data network, a storage medium and terminal equipment.
Background
With the development of technology, most of current mobile phones are dual-card mobile phones, which can be inserted with SIM cards of two different operators, and one SIM card may be used for office work and the other SIM card may be used for life. At the same time, the dual-card mobile phone can only use one SIM card to use the data network, and the currently used SIM card must be closed when the data network of the other SIM card is used.
When a user uses a data service, especially when the user is in a mobile process, a currently used SIM card network signal is weak, the capability of the mobile phone for data service transmission will be seriously reduced, poor user experience such as video card pause and slow software downloading often occurs, the user is required to manually switch to another SIM card for data network connection, and certain network delay exists in the switching process, which results in poor user experience.
Disclosure of Invention
The invention aims to provide a method and a device for switching a dual-card data network, a storage medium and terminal equipment, and solves the problems of network delay and poor user experience caused by manual switching of the data network at present.
The invention provides a double-card data network switching method, which comprises the following steps:
acquiring a network data packet of a first SIM card used currently, and extracting a plurality of high-frequency IP addresses corresponding to an application program from the network data packet;
sequentially polling and judging whether each high-frequency IP address has network delay according to a first preset period, and accumulating the times of the high-frequency IP addresses judged to have the network delay;
judging whether the accumulated network delay times are greater than preset times or not;
if the accumulated network delay times are larger than the preset times, simultaneously measuring the delay time of all the high-frequency IP addresses, and calculating the average delay time according to the delay time of all the high-frequency IP addresses;
judging whether the average delay time is greater than a first preset time or not;
and if the average delay time is greater than a first preset time, switching to a second SIM card for connecting a data network.
The double-card data network switching method provided by the invention has the following beneficial effects: the network delay of each high-frequency IP address is monitored in real time by sequentially polling in a first preset period, a plurality of high-frequency IP addresses are singly detected according to a certain time period, the resource consumption is low, and the delay time of all the high-frequency IP addresses can be triggered and completely evaluated only when the accumulated network delay times are greater than the preset times, so that the resource waste can be avoided; and automatically switching the SIM card according to the average delay time, and realizing automatic switching to use a data network, thereby improving the user experience.
In addition, the dual-card data network switching method provided by the invention can also have the following additional technical characteristics:
further, extracting a target IP address from the network data packet, and judging whether the target IP address is in a first IP address queue;
if the target IP address is not in the first IP address queue, adding the target IP address to the first IP address queue;
if the target IP address is in the first IP address queue, removing the target IP address from the first IP address queue, and judging whether the target IP address is in a second IP address queue;
and if the target IP address is not in the second IP address queue, adding the target IP address into the second IP address queue, and determining the target IP address as a newly-added high-frequency IP address.
Further, the first IP address queue is a fixed length queue.
Further, the second IP address queue is a fixed length queue.
Further, the high-frequency IP address is a destination IP address that appears at least twice in the network packet.
Further, the step of calculating the average delay time according to the delay times of all the high-frequency IP addresses specifically includes:
and removing the delay time of the high-frequency IP address positioned at the highest delay time and the delay time of the high-frequency IP address positioned at the lowest delay time, and averaging the delay times of the rest high-frequency IP addresses.
Further, the step of sequentially polling and monitoring the network delay of each high-frequency IP address in the first preset period specifically includes:
if the network delay of the high-frequency IP address is monitored for the first time, the first preset period is subjected to period shortening processing to obtain a second preset period, and whether the network delay exists in the remaining high-frequency IP addresses or not is judged according to the second preset period through polling in sequence.
The invention also provides a double-card data network switching device, which comprises:
the address extraction module is used for acquiring a network data packet of a first SIM card used currently and extracting a plurality of high-frequency IP addresses from the network data packet;
the frequency accumulation module is used for sequentially polling and judging whether network delay exists in each high-frequency IP address according to a first preset period and accumulating the frequency of the high-frequency IP address judged as the network delay;
the first judgment module is used for judging whether the accumulated network delay times are greater than preset times or not;
the first processing module is used for measuring the delay time of all the high-frequency IP addresses simultaneously when the accumulated network delay times are larger than the preset times, and calculating the average delay time according to the delay time of all the high-frequency IP addresses;
the second judgment module is used for judging whether the average delay time is greater than a first preset time or not;
and the second processing module is used for switching to the second SIM card for connecting the data network when the average delay time is greater than the first preset time.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described dual-card data network switching method.
The invention also provides a terminal device, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the program to realize the double-card data network switching method.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a dual card data network switching method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a high-frequency IP address acquisition method according to a first embodiment of the present invention;
FIG. 3 is a block diagram of a dual-card data network switching device according to a second embodiment of the present invention;
fig. 4 is a block diagram of an address extraction module according to a second embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
The embodiment of the invention provides a double-card data network switching method which can be applied to a mobile phone terminal, wherein the mobile phone terminal comprises a first SIM card and a second SIM card which belong to different operators, the mobile phone terminal is loaded with an application program, and when a user uses the application program, the application program is interacted with a server through a data network connected with the first SIM card or the second SIM card.
Fig. 1 is a flowchart of a dual-card data network switching method according to a first embodiment of the present invention, which includes the following steps:
step S101, obtaining a network data packet of a first SIM card used currently, and extracting a plurality of high-frequency IP addresses corresponding to an application program from the network data packet;
the mobile phone terminal uses a first SIM card at present, an application program interacts with a server through a data network connected with the first SIM card, the application program is Baidu APP, a microblog APP, a WeChat APP and the like, a high-frequency IP address is an IP address corresponding to the application program frequently used by a user recently, a plurality of high-frequency IP addresses are sent to the server through a data network connected with the first SIM card to form a network data packet of the first SIM card, the mobile terminal obtains the network data packet of the first SIM card sent by the server and extracts a plurality of high-frequency IP addresses from the network data packet, and in the first embodiment, 8 high-frequency IP addresses are stored in the network data packet of the first SIM card.
Step S102, sequentially polling and judging whether each high-frequency IP address has network delay according to a first preset period, and accumulating the times of the high-frequency IP addresses judged to have the network delay;
step S103, judging whether the accumulated network delay times are greater than preset times;
in a first embodiment of the present invention, a first preset period is set to about 2S, that is, each high-frequency IP address is sequentially monitored every 2S, each detection consumes less resources, and whether a network delay exists is monitored, for example, when the network delay time of the high-frequency IP address is greater than 600ms, which is recorded as 1 network delay, the number of network delays in a certain time is counted, for example, when 3 network delays are accumulated within 3600ms, the starting step S103 is triggered.
Step S104, if the accumulated network delay times are larger than the preset times, simultaneously measuring all the delay time of the high-frequency IP addresses, and calculating the average delay time according to all the delay time of the high-frequency IP addresses;
in specific implementation, when the accumulated network delay times are greater than the preset times, high-strength network quality evaluation is started, that is, 8 high-frequency IP addresses are detected simultaneously, 10 detections are performed on each high-frequency IP address, and finally, 80 delay time data are calculated to calculate the average delay time.
Step S105, judging whether the average delay time is greater than a first preset time;
the first preset time may be 600ms, if the average delay time is greater than 600ms, the operation of switching to the second SIM card in step S105 is performed, and if the average delay time is not greater than 600ms, the operation of switching the data card is not performed, and step S102 is performed.
And step S106, if the average delay time is greater than a first preset time, switching to a second SIM card to connect a data network.
Only when the accumulated network delay times are greater than the preset times, the delay time for completely evaluating all the high-frequency IP addresses is triggered, so that the waste of resources can be avoided; and automatically switching the SIM card according to the average delay time, and realizing automatic switching to use a data network, thereby improving the user experience.
Fig. 2 is a method for acquiring a high-frequency IP address in a first embodiment of the present invention, which specifically includes the following sub-steps:
step 1011, extracting a target IP address from the network data packet, and judging whether the target IP address is in a first IP address queue;
step 1012, if the target IP address is not in the first IP address queue, adding the target IP address to the first IP address queue;
step 1013, if the target IP address is in the first IP address queue, removing the target IP address from the first IP address queue, and determining whether the target IP address is in a second IP address queue;
step 1014, if the target IP address is not in the second IP address queue, adding the target IP address into the second IP address queue, and determining the target IP address as a newly added high-frequency IP address.
In specific implementation, the IP addresses of the application program used by the user in the near term are stored in the first IP address queue, where the first IP address queue is preferably a fixed-length queue, that is, only a fixed number of IP addresses can be arranged in the first IP address queue according to the time sequence, for example, when the fixed length is 8, a maximum of 8 target IP addresses are arranged in the first IP address queue. In step 1013, after the IP address is removed from the first IP address queue, the queue position occupied by the target IP address in the first IP address queue will be marked as a vacancy, and a subsequent IP address (the target IP address obtained instep 1011 again) may be added to the vacancy in the first IP address queue, when there is no vacancy in the first IP address queue, the target IP address may be added to the tail of the first IP address queue, and when the first IP address queue is a fixed-length queue, after the target IP address is added to the tail of the first IP address queue, the queue length of the first IP address queue will exceed the fixed length, and at this time, the target IP address at the head of the first IP address queue may be removed, that is, the target IP address of the first IP address queue is dynamically changed.
In specific implementation, the second IP address queue is preferably a queue with a fixed length, for example, the fixed length is 8, a target IP address can only appear in the first IP address queue at least twice and can enter the second IP address queue, at this time, the IP address is a newly added high-frequency IP address, which is also called a high-frequency IP address, and the high-frequency IP address is an application program frequently visited by a user, so that network quality monitoring and network quality evaluation are performed on the high-frequency IP address, and the experience of the user can be improved.
In specific implementation, the method for calculating the average delay time in the first embodiment of the present invention specifically includes:
step S1041, removing the delay time of the high frequency IP address located at the highest delay time and the delay time of the high frequency IP address located at the lowest delay time, and averaging the delay times of the remaining high frequency IP addresses.
Specifically, for example, a total of 8 high-frequency IP addresses are provided, each high-frequency IP address is subjected to 10 delay time measurements, there are totally 80 delay time data, the delay times of all the high-frequency IP addresses are sorted from small to large, one highest delay time and one lowest delay time are removed, and the remaining 78 delay times are averaged, so that the accuracy of the average delay time is ensured.
In specific implementation, the step of sequentially polling and monitoring the network delay of each high-frequency IP address in the first preset period in the first embodiment of the present invention specifically includes:
step S1021, if the network delay of the high-frequency IP address is monitored for the first time, cycle shortening is carried out on the first preset cycle to obtain a second preset cycle, and whether the network delay exists in the remaining high-frequency IP addresses or not is judged by polling in sequence according to the second preset cycle.
Specifically, for example, the first preset period is 2s, when the network delay of the high-frequency IP address is monitored for the first time, the first preset period is shortened, for example, the second preset period is set to 1s, and whether the network delay exists in each remaining high-frequency IP address is sequentially polled according to the second preset period. And then accelerate the monitoring efficiency of the network quality, thus raise the efficiency of switching over the data card.
Fig. 3 is a block diagram of a dual-card data network switching apparatus according to a second embodiment of the present invention, the apparatus includes:
theaddress extraction module 10 is configured to acquire a network data packet of a currently used first SIM card, and extract a plurality of high-frequency IP addresses corresponding to an application program from the network data packet;
thenumber accumulation module 20 is configured to sequentially poll and judge whether each high-frequency IP address has a network delay according to a first preset period, and perform number accumulation on the high-frequency IP addresses judged to have the network delay;
a first determiningmodule 30, configured to determine whether the accumulated network delay times are greater than a preset time;
afirst processing module 40, configured to measure delay times of all the high-frequency IP addresses simultaneously when the accumulated network delay times are greater than the preset times, and calculate an average delay time according to the delay times of all the high-frequency IP addresses;
a second determiningmodule 50, configured to determine whether the average delay time is greater than a first preset time;
thesecond processing module 60 is configured to switch to the second SIM card connection data network when the average delay time is greater than a first preset time.
Referring to fig. 4, specifically, the address extracting module includes:
a third determiningmodule 11, configured to extract a target IP address from the network data packet, and determine whether the target IP address is in the first IP address queue;
athird processing module 12, configured to add the target IP address to the first IP address queue if the target IP address is not in the first IP address queue;
a fourth determiningmodule 13, configured to remove the target IP address from the first IP address queue when the target IP address is in the first IP address queue, and determine whether the target IP address is in a second IP address queue;
and afourth processing module 14, configured to add the target IP address to the second IP address queue if the target IP address is not in the second IP address queue, and determine the target IP address as a newly added high-frequency IP address.
Specifically, the apparatus further comprises:
and the delay calculation module is used for removing the delay time of the high-frequency IP address positioned at the highest delay time and the delay time of the high-frequency IP address positioned at the lowest delay time, and averaging the delay times of the rest high-frequency IP addresses.
Specifically, the apparatus further comprises:
and the period processing module is used for shortening the period of the first preset period to obtain a second preset period when the network delay of the high-frequency IP address is monitored for the first time, and polling and judging whether the network delay exists in the rest high-frequency IP addresses according to the second preset period.
In summary, the dual-card data network switching method provided by the present invention has the following beneficial effects: the network delay of each high-frequency IP address is monitored in real time by sequentially polling in a first preset period, the single detection resource consumption of a plurality of high-frequency IP addresses is low according to a certain time period, and the delay time of all the high-frequency IP addresses can be triggered and completely evaluated only when the accumulated network delay times are greater than the preset times, so that the waste of resources can be avoided; and automatically switching the SIM card according to the average delay time, and realizing automatic switching to use a data network, thereby improving the user experience.
Embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the dual-card data network switching method as described above.
Embodiments of the present invention also provide a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, the dual-card data network switching method is implemented.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

CN202010608327.2A2020-06-302020-06-30Dual-card data network switching method and device, storage medium and terminal equipmentActiveCN111510911B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010608327.2ACN111510911B (en)2020-06-302020-06-30Dual-card data network switching method and device, storage medium and terminal equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010608327.2ACN111510911B (en)2020-06-302020-06-30Dual-card data network switching method and device, storage medium and terminal equipment

Publications (2)

Publication NumberPublication Date
CN111510911Atrue CN111510911A (en)2020-08-07
CN111510911B CN111510911B (en)2020-09-25

Family

ID=71873814

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010608327.2AActiveCN111510911B (en)2020-06-302020-06-30Dual-card data network switching method and device, storage medium and terminal equipment

Country Status (1)

CountryLink
CN (1)CN111510911B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113055962A (en)*2021-03-052021-06-29南昌黑鲨科技有限公司Multi-network switching method and system of intelligent terminal and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110099293A1 (en)*2009-10-222011-04-28Verizon Patent And Licensing, Inc.Internet protocol (ip) address pool management and allocation
US20150312726A1 (en)*2014-04-232015-10-29Samsung Electronics Co., Ltd.Method and apparatus for receiving broadcast data in wireless communication system
CN107277880A (en)*2017-07-262017-10-20奇酷互联网络科技(深圳)有限公司The method, device and mobile terminal of data network switching
CN110267315A (en)*2019-06-282019-09-20南昌黑鲨科技有限公司Network connection control method, system, intelligent terminal and computer readable storage medium
CN110300404A (en)*2019-06-272019-10-01维沃移动通信有限公司A kind of network control method and mobile terminal
CN210864358U (en)*2019-07-252020-06-26南京三航信息工程有限公司Miniature digital precise position control system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110099293A1 (en)*2009-10-222011-04-28Verizon Patent And Licensing, Inc.Internet protocol (ip) address pool management and allocation
US20150312726A1 (en)*2014-04-232015-10-29Samsung Electronics Co., Ltd.Method and apparatus for receiving broadcast data in wireless communication system
CN107277880A (en)*2017-07-262017-10-20奇酷互联网络科技(深圳)有限公司The method, device and mobile terminal of data network switching
CN110300404A (en)*2019-06-272019-10-01维沃移动通信有限公司A kind of network control method and mobile terminal
CN110267315A (en)*2019-06-282019-09-20南昌黑鲨科技有限公司Network connection control method, system, intelligent terminal and computer readable storage medium
CN210864358U (en)*2019-07-252020-06-26南京三航信息工程有限公司Miniature digital precise position control system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113055962A (en)*2021-03-052021-06-29南昌黑鲨科技有限公司Multi-network switching method and system of intelligent terminal and computer readable storage medium
CN113055962B (en)*2021-03-052022-07-26南昌黑鲨科技有限公司Multi-network switching method and system of intelligent terminal and computer readable storage medium

Also Published As

Publication numberPublication date
CN111510911B (en)2020-09-25

Similar Documents

PublicationPublication DateTitle
CN111431772B (en)Network delay measuring method, system, readable storage medium and terminal equipment
CN106102143B (en)Application processing method and device
CN105979092B (en)Abnormity monitoring method and device
CN111884879A (en)Network detection method, device and related equipment
CN110635959A (en)Distribution network environment detection method and device and control terminal for distribution network environment detection
CN111431758A (en)Cloud network equipment testing method and device, storage medium and computer equipment
CN107294797B (en)Network topology identification method and system
CN109921925B (en)Dial testing method and device
WO2019052897A1 (en)Obtaining local area network diagnostic test results
CN104980472A (en)Network traffic control method and device
CN111510911B (en)Dual-card data network switching method and device, storage medium and terminal equipment
CN103699208B (en)Hardware setting method, mobile terminal and the server of a kind of mobile terminal
CN114025377A (en) Quality difference identification method, device and storage medium for home broadband network
CN108990092B (en)Communication abnormity positioning method and device
CN111262864B (en)Method, device and system for sending live broadcast state data and storage medium
CN112235780B (en)Data service switching method, equipment, device and storage medium
CN105050123A (en)Load control method for wireless network and terminal
CN103530233A (en)Automation testing method, testing server and system of mobile browser
CN110598797B (en)Fault detection method and device, storage medium and electronic device
CN108024222B (en)Traffic ticket generating method and device
CN110475244B (en) Terminal management method, system, device, terminal and storage medium
CN111093238A (en) Wireless network control method, device, storage medium and electronic device
CN111866921A (en)Method, device and equipment for searching service fault of 5G base station and storage medium
CN106792882B (en)Network evaluation method and device
CN110611600B (en)Network state information acquisition method and system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp