CN109151784A - Method for connecting network, device and electronic equipment - Google Patents

Method for connecting network, device and electronic equipment Download PDF

Info

Publication number
CN109151784A
CN109151784A CN201810925254.2A CN201810925254A CN109151784A CN 109151784 A CN109151784 A CN 109151784A CN 201810925254 A CN201810925254 A CN 201810925254A CN 109151784 A CN109151784 A CN 109151784A
Authority
CN
China
Prior art keywords
electronic equipment
connection
bluetooth
wifi
mobile data
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
CN201810925254.2A
Other languages
Chinese (zh)
Other versions
CN109151784B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810925254.2A priority Critical patent/CN109151784B/en
Publication of CN109151784A publication Critical patent/CN109151784A/en
Application granted granted Critical
Publication of CN109151784B publication Critical patent/CN109151784B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release

Abstract

The embodiment of the present application discloses a kind of method for connecting network, device and electronic equipment, is related to field of electronic device.Wherein, this method comprises: judging whether the WiFi connection of the electronic equipment opens in the case where the electronic equipment opens bluetooth connection;If the WiFi connection of the electronic equipment is opened, judge whether the mobile data network of the electronic equipment allows to automatically turn on;If allowing, the WiFi connection of the electronic equipment is disconnected, the mobile data network connection for opening the electronic equipment improves user experience on mutual influence in the case where connecting while opening with WiFi to avoid bluetooth connection.

Description

Method for connecting network, device and electronic equipment
Technical field
This application involves technical field of electronic equipment, set more particularly, to a kind of method for connecting network, device and electronics It is standby.
Background technique
For electronic equipments such as mobile phones, usually have the function of bluetooth connection and WiFi linkage function.But bluetooth with When WiFi is connected simultaneously, is carried out data transmission by bluetooth or carry out data transmission will receive influence by WiFi, influence to use The usage experience at family.
Summary of the invention
In view of the above problems, present applicant proposes a kind of method for connecting network, device and electronic equipments, are set with solving electronics Standby when bluetooth and WiFi connect simultaneously, data are transmitted the problem of being affected, raising user experience.
In a first aspect, the embodiment of the present application provides a kind of method for connecting network, it is applied to electronic equipment, the method packet It includes: in the case where the electronic equipment opens bluetooth connection, judging whether the WiFi connection of the electronic equipment opens;If institute The WiFi connection for stating electronic equipment is opened, and judges whether the mobile data network of the electronic equipment allows to automatically turn on;If permitting Perhaps, the mobile data network connection of the electronic equipment is opened in the WiFi connection for disconnecting the electronic equipment.
Second aspect, the embodiment of the present application provide a kind of network connection device, are applied to electronic equipment, described device packet It includes: first judgment module, for judging the WiFi of the electronic equipment in the case where the electronic equipment opens bluetooth connection Whether connection opens;Second judgment module judges the electronic equipment if the WiFi connection for the electronic equipment is opened Whether mobile data network, which allows, automatically turns on;Network connecting module, if the mobile data network for the electronic equipment is permitted Perhaps it automatically turns on, disconnects the WiFi connection of the electronic equipment, open the mobile data network connection of the electronic equipment.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including bluetooth module, WiFi module, memory And processor, the bluetooth module, WiFi module and the memory are couple to the processor, the bluetooth module is used for institute It states electronic equipment and carries out bluetooth connection, the WiFi module carries out WiFi connection for the electronic equipment, and the memory is deposited Storage instruction, the processor executes the above-mentioned method applied to electronic equipment when executed by the processor.
Fourth aspect, the embodiment of the present application provide it is a kind of with processor can be performed program code it is computer-readable Storage medium, said program code make the processor execute above-mentioned method.
Method for connecting network, device and electronic equipment provided by the present application, in the case where opening bluetooth, if electronic equipment WiFi connection also open, if then electronic equipment allows mobile data network to connect automatically, disconnect WiFi connection, open and move Data network connection improves user's body on mutual influence in the case where connecting while opening with WiFi to avoid bluetooth connection It tests.
These aspects or other aspects of the application can more straightforward in the following description.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 shows the interaction schematic diagram of electronic equipment and other equipment in the embodiment of the present application;
Fig. 2 shows the first flow charts for the method for connecting network that the embodiment of the present application proposes;
Fig. 3 shows second of flow chart of the method for connecting network of the embodiment of the present application proposition;
Fig. 4 shows the third flow chart of the method for connecting network of the embodiment of the present application proposition;
Fig. 5 shows the 4th kind of flow chart of the method for connecting network of the embodiment of the present application proposition;
Fig. 6 shows the functional block diagram of the network connection device of the application fourth embodiment proposition;
Fig. 7 shows a kind of structural block diagram of the electronic equipment of the embodiment of the present application proposition.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall in the protection scope of this application.
Current electronic equipment 400 generally has bluetooth (Bluetooth, BT) module and WiFi (Wireless Fidelity, WiFi) module.Wherein, bluetooth module can refer to the chip basic circuit set of integrated Bluetooth function, be used for nothing Line network communication;Wi-Fi module can be the insertion for switching to serial ports or Transistor-Transistor Logic level to meet Wi-Fi wireless network communication standards Formula module, built-in wireless network protocol IEEE802.11b.g.n protocol stack and ICP/IP protocol stack, hardware device are embedded in Wi- Fi module directly can be connected to internet using Wi-Fi.Electronic equipment 400 can be by bluetooth module and other equipment 501 (such as The audio-frequence player devices such as bluetooth headset, Baffle Box of Bluetooth, the video playback apparatus such as projector, television set) carry out bluetooth connection;Electronics Equipment 400 can also carry out WiFi connection by WiFi module, if electronic equipment is connected to WLAN by WiFi module, To carry out data interaction with other equipment 502 (such as server, mobile phone, computer and tablet computer), as shown in Figure 1.
But the WiFi of electronic equipment supports 2.4G frequency range and 5G frequency range, wherein the 2.4G frequency range of WiFi and bluetooth 2.4G frequency range has overlapping, and WiFi and bluetooth share a radio-frequency antenna, therefore, if bluetooth and the WiFi in 2.4G frequency range It is all using, can there are problems that the problem of seizing antenna resources, i.e., BT/WiFi coexists, to cause through Bluetooth transmission number According to when Caton the problem of, as audio data is transmitted to audio data Caton when audio-frequence player device plays out by bluetooth Problem.For example, using same radio-frequency antenna, in the bluetooth and WiFi of 2.4G frequency range, when opening at the same time, use is time-multiplexed Method, within each unit time, portion of time is carried out data transmission by bluetooth by antenna, and portion of time is led to by WiFi It crosses antenna to carry out data transmission, bluetooth and WiFi occupy the part-time used to antenna respectively, exist rob between the two The problem of accounting for antenna resources.
Inventor has found that it is in order to connect WLAN, so that electronics that electronic equipment, which opens WiFi connection, Equipment can carry out the operations such as upload and the downloading of data by network, and be transmitted by the WiFi connection data to be carried out Generally also may be implemented by mobile data network, such as by 2G, 3G or 4G mobile data network and server or other Equipment carries out data transmission.
Also, with advances in technology, the corresponding flow charging of mobile data network is lower and lower, occurs quantity-unlimiting The more sufficient flow package of the flow that flow package or user do not run out usually, therefore, in the feelings that bluetooth connection is opened Under condition, WiFi can be replaced by opening mobile data network, to solve the coexistence problems of bluetooth and WiFi.
Therefore, the embodiment of the present application proposes a kind of method for connecting network, in the case where opening bluetooth connection, if mobile Data network allows to automatically turn on, then replaces the unlatching of WiFi connection by opening mobile data network, avoid WiFi in 2.4G Frequency range seizes the antenna resources of bluetooth, improves the user experience of Bluetooth transmission.
Wherein, electronic equipment 400 can be various types of departments of computer science that are mobile or portable and executing wireless communication Any one of equipment of uniting.Specifically, electronic equipment 400 can be mobile phone or smart phone (for example, being based on iPhone TM, the phone based on Android TM), portable gaming device (such as Nintendo DS TM, PlayStation Portable TM, Gameboy Advance TM, iPhone TM), laptop computer, PDA, portable Internet appliance, sound Happy player and data storage device, other handheld devices and wrist-watch, earphone, pendant, earphone etc., electronic equipment 400 can also be other wearable devices (for example, such as electronic glasses, electronics clothes, electronics bracelet, electronics necklace, electronics It tatoos, the headset equipment (HMD) of electronic equipment or smartwatch).
Electronic equipment 400 can also be that any one of multiple electronic equipments, multiple electronic equipments include but is not limited to Cellular phone, smart phone, other wireless telecom equipments, personal digital assistant, audio player, other media players, sound Happy logger, video recorder, camera, other medium recorders, radio, Medical Devices, vehicle transport instrument, calculator, can Program remote controler, pager, laptop computer, desktop computer, printer, netbook computer, personal digital assistant (PDA), portable media player (PMP), Motion Picture Experts Group's (MPEG-1 or MPEG-2) audio layer 3 (MP3) play Device, portable medical device and digital camera and combinations thereof.
In some cases, electronic equipment 400 can execute multiple functions and (for example, playing music, show video, storage Picture and send and receive call).If desired, electronic equipment 400 can be such as cellular phone, media play The portable device of device, other handheld devices, watch equipment, pendant equipment, receiver device or other compact portable equipment.
Mainly from the client of electronic equipment, in conjunction with attached drawing and specific embodiment will be passed through to the embodiment of the present application below The method for connecting network and device of offer are illustrated.
Referring to Fig. 2, the embodiment of the present application provides a kind of method for connecting network.The method for connecting network is used in electricity In the case where sub- opening of device bluetooth connection, WiFi connection is replaced to carry out data transmission by mobile data network connection.Having In the embodiment of body, the method for connecting network is applied to network connection device as shown in FIG. 6 and is corresponding with network connection The electronic equipment 400 (Fig. 7) of device 300.Above-mentioned method for connecting network can specifically include following steps:
Step S110: in the case where the electronic equipment opens bluetooth connection, judge that the WiFi of the electronic equipment connects It connects and whether opens.
If electronic equipment opens bluetooth, show that electronic equipment may be needed by carrying out data between bluetooth and other equipment Transmission.Bluetooth and WiFi when in use, can there are problems that seizing antenna resources, cause the number of Bluetooth transmission in electronic equipment According to Caton.Therefore, in the case where electronic equipment opens bluetooth connection, it can be determined that whether the WiFi connection of electronic equipment opens It opens.
Wherein, in the electronic device, in having connected, disconnected, connecting and the medium different WiFi state of disconnection is corresponding Different parameter values, when judging whether WiFi connection opens, the corresponding parameter value of WiFi state in available electronic device, Determine whether WiFi connection opens according to the parameter value.For example, in Android (Android) system, by obtaining WiFi management Device wifimanager obtains the corresponding parameter value of current WiFi state.Wherein, WiFi unlatching may include the shape that WiFi has connected State in state and/or WiFi connection.
In this step, it can be, when responding the unlatching bluetooth connection of bluetooth open command, judge the WiFi of electronic equipment Whether connection opens.
As an implementation, when opening bluetooth connection, if the WiFi connection of electronic equipment is not turned on, Ke Yizhou Whether the WiFi connection of phase property detection electronic equipment opens, and wherein the corresponding time span of the detection cycle does not limit.
As an implementation, if the WiFi connection of electronic equipment is not turned on, and bluetooth is connecting or Connection, then monitor whether the WiFi connection of electronic equipment opens.Wherein, monitor whether WiFi connection is opened and can be passed through The monitoring broadcasted accordingly is realized.For example, the different connection status of WiFi, the corresponding different parameter value of broadcast.In Android system In system, when WiFi state changes, system can issue corresponding broadcast, such as WifiManager.WIFI_STATE_ CHANGED_ACTION or android.net.wifi.WIFI_STATE_CHANGED can monitor the broadcast.? When receiving the broadcast, the connection status of WiFi is determined according to the corresponding parameter value of the broadcast.
Step S120: if the WiFi connection of the electronic equipment is opened, judge the mobile data network of the electronic equipment Whether allow to automatically turn on.
In the case where the bluetooth connection of electronic equipment is opened, if WiFi connection is not opened, directly pass through bluetooth module Be attached.
In the case where the bluetooth connection of electronic equipment is opened, if the WiFi connection of electronic equipment is opened, judge that electronics is set Whether standby mobile data network, which allows, automatically turns on.Wherein, in the case where the bluetooth connection of electronic equipment is opened, electronics is set When the case where standby WiFi connection is opened includes: that the bluetooth connection of electronic equipment is opened, the WiFi connection of electronic equipment has been opened It opens;When the bluetooth connection of electronic equipment is opened, the WiFi connection of electronic equipment is not opened, but is being connected in bluetooth or During connection, WiFi connection is opened.
It in addition, the mobile data network of electronic equipment starts automatically, can be, do not receive user to mobile data network In the case where switching on operation, electronic equipment independently starts mobile data network.
As an implementation, electronic equipment can provide the setting options whether mobile data network starts automatically, It include allowing electronic equipment to start mobile data network automatically or refuse electronic device to start movement automatically in the setting options Data network, user can be arranged whether mobile data network can be automatically turned on by electronic equipment by the setting options.Electricity Sub- equipment can determine whether the mobile data network of the electronic equipment allows according to the corresponding user setting of the setting options It automatically turns on.For example, allow electronic equipment to automatically turn on mobile data network if receiving user and being arranged in setting options, it will The corresponding parameter value of the setting options is set as the first numerical value;Refusal electronic equipment is set certainly in setting options if receiving user It is dynamic to open mobile data network, then second value is set by the corresponding parameter value of the setting options.Judging that the electronics sets When whether standby mobile data network allows to automatically turn on, the corresponding parameter value of the setting options is obtained, if the parameter value is the One numerical value then determines that electronic equipment is allowed to automatically turn on mobile data network;If the parameter value is second value, determine not permit Perhaps electronic equipment automatically turns on mobile data network.
It on the basis of the above embodiment, can also include being moved to the automatic starting of permission in the setting options of electronic equipment Specific flow number can be arranged as flow threshold in the flow threshold setting of dynamic data network, user in setting options. When whether the mobile data network for judging the electronic equipment allows to automatically turn on, if the not set permission of setting options is opened automatically Mobile data network is opened, also not set not allow to automatically turn on mobile data network, setting options are corresponding to be set as a stream Threshold value is measured, then judges whether the remaining data traffic of the corresponding account number of the mobile data network of the electronic equipment is greater than the flow threshold Value, if more than then determining that electronic equipment is allowed to automatically turn on mobile data network;If being not more than, determine not allow electronics to set It is standby to automatically turn on mobile data network.It should be understood that the data traffic of account number, can be the communication that account uses operator Equipment when carrying out data transmission/exchanging generated data volume, unit can be KB, MB, GB and TB.
As an implementation, judge whether the mobile data network of the electronic equipment allows to automatically turn on, it can be with It is to judge whether the electronic equipment has unrestricted mobile data flow.Specifically, the shifting of the available electronic equipment The data traffic situation of the dynamic corresponding account number of data network.If the data traffic of account be it is quantity-unlimiting, mobile data network exists Extra-pay will not be caused in flow consumption process to user, then determines that the mobile data network permission of electronic equipment is opened automatically It opens, otherwise determines that the mobile data network of electronic equipment does not allow to automatically turn on.
As an implementation, since operator may be using the time as valuation unit, i.e. the corresponding account of electronic equipment Number how long can not carry out data transmission/exchange using the communication equipment of operator with not limiting flow in range, then sentence When whether the mobile data network of disconnected electronic equipment allows to automatically turn on, the corresponding account number of available electronic equipment can be unlimited Whether within this time range the time range that flow processed carries out data transmission judges current time, if within this time range, Then determine that the mobile data network of electronic equipment allows to automatically turn on;If within this time range, not determining electronic equipment Mobile data network does not allow to automatically turn on.
As an implementation, it when judging whether the mobile data network of the electronic equipment allows to automatically turn on, shows The prompt information for whether allowing to automatically turn on mobile data network shown, includes allowing to automatically turn on mobile data in the prompt information Network or refusal automatically move the option of data network.If receiving choosing of the user to allowing to automatically turn on mobile data network The selection of item, then be determined as that the mobile data network of electronic equipment is to allow to automatically turn on, and otherwise determines the movement of electronic equipment Data network does not allow to automatically turn on.
Above-mentioned various embodiments both can individually be implemented, can also one or more combinations in logical situation Implement, the embodiment of the present application does not limit.
Step S130: if allowing, the WiFi connection of the electronic equipment is disconnected, the mobile data of the electronic equipment is opened Network connection.
If electronic equipment is allowed to automatically turn on mobile data network, the WiFi connection of electronic equipment is disconnected, and open The mobile data network of electronic equipment connects, and joins electronic equipment by the other equipment such as mobile data network and server Network and communication.
In one embodiment, if electronic equipment is not allowed to automatically turn on mobile data network, electronic equipment is disconnected WiFi connection.
In one embodiment, if electronic equipment is not allowed to automatically turn on mobile data network, make electronic equipment WiFi connection is opened simultaneously with bluetooth connection.
In the embodiment of the present application, in the case where the bluetooth of electronic equipment is opened, if the WiFi connection of electronic equipment is opened It opens, then determines whether the mobile data network of electronic equipment allows to automatically turn on.If mobile data network allows to automatically turn on, WiFi connection is disconnected, mobile data network connection is opened, communicates electronic equipment by mobile data network, avoid indigo plant Tooth and WiFi open existing resource problem simultaneously, improve user experience.
In the embodiment of the present application, it can also determine whether to be replaced by mobile data network according to the specific connection of bluetooth WLAN carries out network communication.Specifically, as shown in figure 3, in the embodiment of the present application, may include:
Step S210: in the case where the electronic equipment opens bluetooth connection, detect whether the electronic equipment passes through Bluetooth connection is to other electronic equipments.
Electronic equipment opens bluetooth connection, but may there is no being matched with other electronic equipments, or there is no and The electronic equipment that can be mutually paired is successfully established connection, and therefore, which does not just establish with any electronic equipment blue yet Tooth connection, that is to say, that electronic equipment is not over bluetooth connection to any other electronic equipment.
It, can be with if electronic equipment will not be carried out data transmission not over bluetooth connection to other equipment by bluetooth Less antenna resources are distributed to bluetooth or do not distribute antenna resources, the assignment problem of antenna resources when bluetooth and WiFi coexist Smaller, antenna resources can be used mainly by WiFi, therefore, if WiFi connection is opened, can not be turned off, so as to not Need to judge whether WiFi connection opens.
Therefore, in the case where electronic equipment opens bluetooth connection, it can detecte whether electronic equipment passes through bluetooth connection To other electronic equipments.Wherein, which, which can be, is periodically detected perhaps Monitor detection or other detection modes.If It is periodically detected, then each time cycle detection is primary;If Monitor detection, then the connection status of bluetooth is monitored, when listening to Bluetooth and other electronic equipments establish connection, then determine that electronic equipment passes through bluetooth connection to other equipment.
Optionally, in the embodiment of the present application, can be with other electronic equipments of bluetooth connection audio-frequence player device and/ Or video playback apparatus.Specifically, carrying out music, sound by bluetooth connection audio-frequence player device or video playback apparatus Happy broadcasting code rate is higher, it is, the audio data for needing other equipment to play is carried out the volume of bluetooth coding by electronic equipment Code rate is higher, then needs more antenna resources that the data after coding are transferred to other electronic equipments.If there is WiFi to seize day Line resource, it will cause the music Catons that Bluetooth transmission plays.Therefore, detect whether the electronic equipment passes through bluetooth connection extremely When other electronic equipments, can be the detection electronic equipment whether pass through bluetooth connection to other audio-frequence player devices or Video playback apparatus.
Step S230: if the electronic equipment passes through bluetooth connection to other electronic equipments, judge the electronic equipment Whether WiFi connection opens.
It, can if opening WiFi in the case where bluetooth is opened if electronic equipment is by bluetooth connection to other electronic equipments Bluetooth data transfer can be influenced, therefore, it is possible to judge that whether the WiFi of electronic equipment opens.
As an implementation, in the embodiment of the present application, if electronic equipment is set by bluetooth connection to other electronics It is standby, but effective data transmission is not carried out by bluetooth between the electronic equipment and other electronic equipments, that is, It says, only keeps connection therebetween, do not carry out the transmission of the data such as audio, video, text and alternative document, it can be to bluetooth point Antenna resources are not distributed with less antenna resources or, the assignment problem of antenna resources is smaller when bluetooth coexists with WiFi, day Line resource can be used mainly by WiFi, therefore, if WiFi connection is opened, can not be turned off, so as to not need to sentence Whether disconnected WiFi connection opens.
Therefore, in this embodiment, as described in Figure 4, whether it is opened in the WiFi connection for judging the electronic equipment Before, it may include step S220A: judging whether the electronic equipment passes through bluetooth and carry out data transmission with other electronic equipments. If electronic equipment is carried out data transmission by bluetooth and other electronic equipments, WiFi and bluetooth open simultaneously can exist WiFi with And the coexistence problems of bluetooth, then it can be determined that whether the WiFi connection of electronic equipment opens.
Wherein, judge whether the electronic equipment passes through bluetooth and carry out data transmission with other described electronic equipments, it can be with Real-time judge or periodically judgement, judgement can be current time whether pass through bluetooth and other described electronic equipments into The transmission of row data.Alternatively, it is also possible to being to judge whether carry out within a preset period of time by bluetooth and other described electronic equipments Data transmission, to avoid electronic equipment in the case where being carried out data transmission by bluetooth and other described electronic equipments, just It is the erroneous judgement for not passing through bluetooth at the time of judgement and carrying out data transmission generating with other described electronic equipments.
In addition, this judges whether the electronic equipment passes through bluetooth and carry out data transmission with other described electronic equipments, it can Be it is as shown in Figure 4 detect the electronic equipment by bluetooth connection to other electronic equipment when progress, be also possible to In the case where the electronic equipment opens bluetooth connection, directly detect whether to carry out by bluetooth and other described electronic equipments Data transmission.
The embodiment of the present application also provides a kind of embodiments, in this embodiment, as shown in figure 5, judging the electricity Before whether the WiFi connection of sub- equipment opens, it can also include step S220B: judge whether the electronic equipment passes through bluetooth The data of preset kind are transmitted between other electronic equipments.Electronic equipment is when passing through bluetooth data transmission, if the number of transmission It is low according to bluetooth encoding rate, it is lower to the occupancy of antenna resources, such as the timeslice of bluetooth and WiFi is distributed passing through to be time-multiplexed, Timeslice accounting required for bluetooth is lower, and the probability of bluetooth data transmission Caton is smaller, and bluetooth and WiFi can be made to coexist.Cause This, can just close WiFi when passing through the higher data of Bluetooth transmission encoding rate or data higher to requirement of real-time. Wherein, the higher data of encoding rate or the higher data of requirement of real-time for example can be, the data of voice communication, video Data, data of music of call etc..Can preset the higher data of encoding rate, it is higher to requirement of real-time or In the case where WiFi and bluetooth are opened simultaneously, transmission will receive the data that the data of influence are preset kind.Judging the electricity Before whether the WiFi connection of sub- equipment opens, transmitted between bluetooth and other described electronic equipments to whether electronic equipment passes through The data of preset kind are judged.
In this embodiment, judge whether the electronic equipment passes through to transmit between bluetooth and other described electronic equipments The data of preset kind, which can be, to be carried out data transmission in the judgement electronic equipment by bluetooth and other described electronic equipments When, be also possible to it is as shown in Figure 5 when determining electronic equipment by bluetooth connection to other electronic equipments, or in electronics Directly judge in the case where opening of device bluetooth connection.
In addition, the judgement of step S220B is also possible to real-time, periodic or passes through monitoring in the embodiment System broadcasts are realized.
Step S250: if the WiFi connection of the electronic equipment is opened, judge the mobile data network of the electronic equipment Whether allow to automatically turn on.
Step S270: if allowing, the WiFi connection of the electronic equipment is disconnected, the mobile data of the electronic equipment is opened Network connection.
If the connection of electronic equipment is opened, and the mobile data network of electronic equipment allows to automatically turn on, then disconnects WiFi Mobile data network is opened in connection, avoids WiFi and bluetooth from opening the coexistence problems of generation simultaneously, and meet the net of electronic device Network connection requirement.
Optionally, in the embodiment of the present application, if user opens WiFi connection, show that user may tend to pass through WiFi carries out network communication rather than mobile data network.The WiFi connection of electronic equipment then is disconnected in step S270, and is opened , can be to whether WiFi connection reopened judging in the case where the mobile data network connection of electronic equipment.Specifically , it can be, after the WiFi connection for disconnecting the electronic equipment, further includes: judge whether the electronic equipment passes through indigo plant Tooth carries out data transmission with other described electronic equipments.Wherein, judgement can be current time whether pass through bluetooth with it is described Other electronic equipments carry out data transmission, be also possible in preset time period whether by bluetooth and other described electronic equipments into The transmission of row data.If electronic equipment does not pass through bluetooth and carries out data transmission with other electronic equipments, electronic equipment can be opened WiFi connection;If electronic equipment is carried out data transmission by bluetooth and other electronic equipments, continue to keep WiFi connection It disconnects.
In the case where the connection unlatching bluetooth connection of electronic equipment is also opened, can continue to judge the electronic equipment Whether carried out data transmission by bluetooth and other described electronic equipments.If electronic equipment does not pass through bluetooth and other electronic equipments Carry out data transmission, then the WiFi connection of electronic equipment can be kept to open;If electronic equipment is set by bluetooth and other electronics It is standby to carry out data transmission, then port WiFi connection.
In this embodiment, not especially explain the step of be referred to other same or similar step, not into Row repeated description.
In the embodiment of the present application, in the case where bluetooth connection is opened, the case where according to bluetooth connection, the bluetooth connection Situation include electronic equipment whether pass through bluetooth connection to other electronic equipments, whether with other electronic equipments pass through bluetooth carry out Data transmission and/or the data etc. for whether passing through Bluetooth transmission preset kind between other electronic equipments, it is determined whether close The WiFi of connection, the resource for avoiding WiFi and Bluetooth coexistence from generating seize problem.
The embodiment of the present application also provides a kind of network connection devices 300, are applied to electronic equipment.As shown in fig. 6, described Device 300 includes: first judgment module 310, for judging the electricity in the case where the electronic equipment opens bluetooth connection Whether the WiFi connection of sub- equipment opens.Second judgment module 320 is sentenced if the WiFi connection for the electronic equipment is opened Whether the mobile data network of the electronic equipment of breaking allows to automatically turn on.Network connecting module 330, if being set for the electronics Standby mobile data network allows to automatically turn on, and disconnects the WiFi connection of the electronic equipment, opens the shifting of the electronic equipment Dynamic data network connection.
Optionally, the second judgment module 320 can be used for by judging whether the electronic equipment has unrestricted shifting Dynamic data traffic, to judge whether the mobile data network of the electronic equipment allows to automatically turn on.
Optionally, which can also include connecting detection module, for connecting in the WiFi for judging the electronic equipment It connects before whether opening, detects whether the electronic equipment passes through bluetooth connection to other electronic equipments.
Optionally, which can also include third judgment module, for judging the electronics in first judgment module Before whether the WiFi connection of equipment opens, judge whether the electronic equipment passes through bluetooth and other electronic equipments carry out data Transmission.
Optionally, which may include third judgment module, disconnect the electricity for network connecting module 330 After the WiFi connection of sub- equipment, judge whether the electronic equipment passes through bluetooth and carry out data transmission with other electronic equipments. If the electronic equipment does not pass through bluetooth and carries out data transmission with other electronic equipments, network connecting module 330 can open institute State the WiFi connection of electronic equipment.
Optionally, which can also include the 4th judgment module, for judging whether the electronic equipment passes through indigo plant The data of preset kind are transmitted between tooth and other electronic equipments.
In this application, the description of Installation practice can refer to embodiment of the method, and details are not described herein.
Referring to Fig. 7, based on above-mentioned method for connecting network and device, the embodiment of the present application also provides a kind of electronics Equipment 400.As shown in fig. 7, the electronic equipment 400 includes bluetooth module 401, WiFi module 402, memory 104 and processor 102, the bluetooth module 401, WiFi module 402 and the memory 104 are couple to the processor 102, the bluetooth mould Block carries out bluetooth connection for the electronic equipment, and the WiFi module carries out WiFi connection for the electronic equipment, described 104 store instruction of memory, when described instruction is executed by the processor 102, the processor 102 executes above-described embodiment The method.
The electronic equipment 400 may also include the more perhaps less component than shown in Fig. 7 or have and Fig. 7 institute Show different correspondences.
It will appreciated by the skilled person that every other component belongs to for the processor 102 It is coupled between peripheral hardware, the processor 102 and these peripheral hardwares by multiple Peripheral Interfaces.
The memory 104 can be used for storing software program and module, and the processor 102 is stored in institute by operation The software program and module in memory 104 are stated, thereby executing various function application and data processing.The memory 104 may include high speed random access memory, may also include nonvolatile memory, and such as one or more magnetic storage device dodges It deposits or other non-volatile solid state memories.In some instances, the memory 104 can further comprise relative to institute The remotely located memory of processor 102 is stated, these remote memories can pass through network connection to the processor.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.For arbitrary processing mode described in embodiment of the method, in device reality Apply in example can no longer be repeated in Installation practice by corresponding processing modules implement one by one.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be by the application Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic equipment), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the application can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.In addition, in each embodiment of the application In each functional unit can integrate in a processing module, be also possible to each unit and physically exist alone, can also two A or more than two units are integrated in a module.Above-mentioned integrated module both can take the form of hardware realization, can also It is realized in the form of using software function module.If the integrated module realized in the form of software function module and as Independent product when selling or using, also can store in a computer readable storage medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above Embodiments herein is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the application System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of application Type.
Finally, it should be noted that above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although The application is described in detail with reference to the foregoing embodiments, those skilled in the art are when understanding: it still can be with It modifies the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;And These are modified or replaceed, do not drive corresponding technical solution essence be detached from each embodiment technical solution of the application spirit and Range.

Claims (10)

1. a kind of method for connecting network, which is characterized in that be applied to electronic equipment, which comprises
In the case where the electronic equipment opens bluetooth connection, judge whether the WiFi connection of the electronic equipment opens;
If the WiFi connection of the electronic equipment is opened, judge whether the mobile data network of the electronic equipment allows to open automatically It opens;
If allowing, the WiFi connection of the electronic equipment is disconnected, opens the mobile data network connection of the electronic equipment.
2. the method according to claim 1, wherein whether the WiFi connection for judging the electronic equipment opens Before opening, further includes:
Detect whether the electronic equipment passes through bluetooth connection to other electronic equipments;
If the electronic equipment, by bluetooth connection to other electronic equipments, the WiFi for executing the judgement electronic equipment connects Connect the step of whether opening.
3. method according to claim 1 or 2, which is characterized in that the WiFi connection of the judgement electronic equipment is Before no unlatching, further includes:
Judge whether the electronic equipment passes through bluetooth and carry out data transmission with other electronic equipments, if so, executing the judgement The step of whether the WiFi connection of the electronic equipment opens.
4. according to the method described in claim 3, it is characterized in that, after the WiFi connection for disconnecting the electronic equipment, Further include:
Judge whether the electronic equipment passes through bluetooth and carry out data transmission with other described electronic equipments;
If it is not, opening the WiFi connection of the electronic equipment.
5. method according to claim 1 or 2, which is characterized in that the WiFi connection of the judgement electronic equipment is Before no unlatching, further includes:
Judge whether the electronic equipment passes through the data that preset kind is transmitted between bluetooth and other electronic equipments.
6. according to the method described in claim 2, it is characterized in that, other described electronic equipments include audio-frequence player device or Video playback apparatus.
7. the method according to claim 1, wherein the mobile data network of the judgement electronic equipment is It is no allow automatically turn on include:
Judge whether the electronic equipment has unrestricted mobile data flow.
8. a kind of network connection device, which is characterized in that be applied to electronic equipment, described device includes:
First judgment module, for judging the electronic equipment in the case where the electronic equipment opens bluetooth connection Whether WiFi connection opens;
Second judgment module judges the mobile data of the electronic equipment if the WiFi connection for the electronic equipment is opened Whether network, which allows, automatically turns on;
Network connecting module disconnects the electronics and sets if the mobile data network for the electronic equipment allows to automatically turn on The mobile data network connection of the electronic equipment is opened in standby WiFi connection.
9. a kind of electronic equipment, which is characterized in that including bluetooth module, WiFi module, memory and processor, the bluetooth mould Block, WiFi module and the memory are couple to the processor, and the bluetooth module carries out bluetooth for the electronic equipment Connection, the WiFi module for the electronic equipment carry out WiFi connection, the memory store instruction, when described instruction by The processor 1 to 7 described in any item methods of processor perform claim requirement when executing.
10. a kind of computer readable storage medium for the program code that can be performed with processor, which is characterized in that described program Code makes the processor perform claim require 1 to 7 described in any item methods.
CN201810925254.2A 2018-08-14 2018-08-14 Network connection method and device and electronic equipment Active CN109151784B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810925254.2A CN109151784B (en) 2018-08-14 2018-08-14 Network connection method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810925254.2A CN109151784B (en) 2018-08-14 2018-08-14 Network connection method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109151784A true CN109151784A (en) 2019-01-04
CN109151784B CN109151784B (en) 2021-08-17

Family

ID=64793081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810925254.2A Active CN109151784B (en) 2018-08-14 2018-08-14 Network connection method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109151784B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290278A (en) * 2019-08-02 2019-09-27 惠州Tcl移动通信有限公司 Data transmission method, device, storage medium and terminal based on bluetooth
CN114584930A (en) * 2020-11-30 2022-06-03 华为技术有限公司 Multi-device communication method, electronic device, and computer-readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335669A (en) * 2007-06-27 2008-12-31 联发科技股份有限公司 Method of controlling communication mechanism utilized to arbitrate transmissions of wireless signals and communication apparatus utilizing the same
CN101384089A (en) * 2008-09-24 2009-03-11 中兴通讯股份有限公司 System for eliminating interference between wireless access and Bluetooth radio frequency and implementing method
CN102711164A (en) * 2012-05-15 2012-10-03 上海交通大学无锡研究院 Intelligent management method for data communication link of mobile terminal
CN103702434A (en) * 2013-12-17 2014-04-02 南京熊猫电子制造有限公司 Method for inhibiting Bluetooth interference in WIFI (wireless fidelity) communication
CN104981030A (en) * 2015-07-10 2015-10-14 努比亚技术有限公司 Network connection control method and device
CN105764101A (en) * 2016-04-28 2016-07-13 乐视控股(北京)有限公司 Method for switching network route of mobile terminal and mobile terminal
CN106455085A (en) * 2016-10-20 2017-02-22 珠海格力电器股份有限公司 Method and apparatus for controlling WIFI and Bluetooth BLE data transmission
US20180091929A1 (en) * 2016-09-29 2018-03-29 Intel IP Corporation Coordinated bluetooth - wifi scheduling with bluetooth slot availability mask

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101335669A (en) * 2007-06-27 2008-12-31 联发科技股份有限公司 Method of controlling communication mechanism utilized to arbitrate transmissions of wireless signals and communication apparatus utilizing the same
CN101384089A (en) * 2008-09-24 2009-03-11 中兴通讯股份有限公司 System for eliminating interference between wireless access and Bluetooth radio frequency and implementing method
CN102711164A (en) * 2012-05-15 2012-10-03 上海交通大学无锡研究院 Intelligent management method for data communication link of mobile terminal
CN103702434A (en) * 2013-12-17 2014-04-02 南京熊猫电子制造有限公司 Method for inhibiting Bluetooth interference in WIFI (wireless fidelity) communication
CN104981030A (en) * 2015-07-10 2015-10-14 努比亚技术有限公司 Network connection control method and device
CN105764101A (en) * 2016-04-28 2016-07-13 乐视控股(北京)有限公司 Method for switching network route of mobile terminal and mobile terminal
US20180091929A1 (en) * 2016-09-29 2018-03-29 Intel IP Corporation Coordinated bluetooth - wifi scheduling with bluetooth slot availability mask
CN106455085A (en) * 2016-10-20 2017-02-22 珠海格力电器股份有限公司 Method and apparatus for controlling WIFI and Bluetooth BLE data transmission

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290278A (en) * 2019-08-02 2019-09-27 惠州Tcl移动通信有限公司 Data transmission method, device, storage medium and terminal based on bluetooth
WO2021022720A1 (en) * 2019-08-02 2021-02-11 惠州Tcl移动通信有限公司 Bluetooth-based data transmission method, storage medium and terminal
CN114584930A (en) * 2020-11-30 2022-06-03 华为技术有限公司 Multi-device communication method, electronic device, and computer-readable storage medium

Also Published As

Publication number Publication date
CN109151784B (en) 2021-08-17

Similar Documents

Publication Publication Date Title
CN112313929B (en) Method for automatically switching Bluetooth audio coding modes and electronic equipment
CN110913442B (en) Network switching method and device, electronic equipment and storage medium
CN110519632B (en) Screen projection method and equipment
CN109347581A (en) Bluetooth headset connection method, device, electronic equipment and storage medium
CN108900850B (en) A kind of live broadcasting method, device and intelligent glasses
CN106803978A (en) Mobile terminal and the method that video is played based on suspension windows
CN109413555B (en) Audio output method and device, earphone and electronic equipment
CN109151861A (en) Encoding rate method of adjustment, device and electronic equipment
CN109003618A (en) Coding control method, device, electronic equipment and storage medium
CN113438354B (en) Data transmission method and device, electronic equipment and storage medium
CN109151212A (en) Apparatus control method, device and electronic equipment
WO2020164351A1 (en) Link connection method and related apparatus
CN109413525A (en) Encoding rate method of adjustment, device, electronic equipment and storage medium
CN115002934B (en) Audio service processing system, electronic equipment and Bluetooth headset
CN109107158A (en) Sound effect treatment method, device and electronic equipment
CN109151784A (en) Method for connecting network, device and electronic equipment
CN113038316A (en) Earphone control method and device, Bluetooth earphone and storage medium
CN109257732A (en) Apparatus control method, device and electronic equipment
CN113840269B (en) Multimedia data transmission method and device, electronic equipment and storage medium
CN109151669A (en) Headset control method, device, electronic equipment and storage medium
CN105846863B (en) A kind of operating method and equipment based on bluetooth
CN109963312A (en) A kind of method for switching network, system, link switch equipment and storage medium
CN109298846A (en) Audio frequency transmission method, device, electronic equipment and storage medium
CN106658388A (en) Bluetooth gateway
CN112866965B (en) Intelligent glasses

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