CN106507413B - Method for sending message, mobile terminal and playing device - Google Patents

Method for sending message, mobile terminal and playing device Download PDF

Info

Publication number
CN106507413B
CN106507413B CN201611036450.1A CN201611036450A CN106507413B CN 106507413 B CN106507413 B CN 106507413B CN 201611036450 A CN201611036450 A CN 201611036450A CN 106507413 B CN106507413 B CN 106507413B
Authority
CN
China
Prior art keywords
connection
mobile terminal
bluetooth
playing
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611036450.1A
Other languages
Chinese (zh)
Other versions
CN106507413A (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 CN201611036450.1A priority Critical patent/CN106507413B/en
Publication of CN106507413A publication Critical patent/CN106507413A/en
Application granted granted Critical
Publication of CN106507413B publication Critical patent/CN106507413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/08Load balancing or load distribution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/12Wireless traffic scheduling
    • H04W72/1215Wireless traffic scheduling for collaboration of different radio technologies

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The invention belongs to the technical field of communication, and provides a method for sending a message, a mobile terminal and a playing device, wherein the mobile terminal and the playing device respectively establish a first connection and a second connection, and the method comprises the following steps: when the first connection is in an invalid state, detecting whether the second connection is in a valid state; and if so, sending a message to the playing equipment or the mobile terminal in the second connection mode. The method and the device can solve the problem that the WIFI communication between the mobile terminal and the playing device is blocked to cause message transmission failure in the prior art.

Description

Method for sending message, mobile terminal and playing device
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method for sending a message, a mobile terminal and playing equipment.
Background
Currently, most playback devices (e.g., speakers) can view and control songs played through mobile terminals. Under normal conditions, the mobile terminal and the playing device perform message transmission through the WIFI network more smoothly, however, when the WIFI network is interfered by surrounding signals or the signal strength is weak, the WIFI communication between the mobile terminal and the playing device is blocked, and the problem of message transmission failure occurs.
Therefore, a new technical solution is needed to solve the above technical problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method for sending a message, a mobile terminal, and a playing device, so as to solve a problem in the prior art that WIFI communication between the mobile terminal and the playing device is blocked, which causes a failure in message transmission.
In a first aspect of the embodiments of the present invention, a method for sending a message is provided, where the method is applied to a mobile terminal, and the mobile terminal and a playing device respectively establish a first connection and a second connection, where the method includes:
when the first connection is in an invalid state, detecting whether the second connection is in a valid state;
and if so, sending a message to the playing equipment in the second connection mode.
In a second aspect of the embodiments of the present invention, a method for sending a message is provided, where the method is applied to a playback device, and the playback device and a mobile terminal respectively establish a first connection and a second connection, where the method includes:
when the first connection is in an invalid state, detecting whether the second connection is in a valid state;
and if so, sending a message to the mobile terminal in the second connection mode.
In a third aspect of the embodiments of the present invention, a mobile terminal is provided, where the mobile terminal and the playback device respectively establish a first connection and a second connection, and the mobile terminal includes:
the detection module is used for detecting whether the second connection is in an effective state or not when the first connection is in an ineffective state;
and the sending module is used for sending a message to the playing equipment in the second connection mode if the playing equipment is in the second connection mode.
In a fourth aspect of the embodiments of the present invention, there is provided a playing device, where the playing device establishes a first connection and a second connection with a mobile terminal, respectively, and the playing device includes:
the detection module is used for detecting whether the second connection is in an effective state or not when the first connection is in an ineffective state;
and the sending module is used for sending a message to the mobile terminal through the second connection mode if the mobile terminal is in the first connection mode.
In a fifth aspect of the embodiments of the present invention, a mobile terminal is provided, where the mobile terminal and a playing device respectively establish a first connection and a second connection, and the mobile terminal includes:
a processor and an output device;
the processor is configured to detect whether the second connection is in an active state when the first connection is in an inactive state;
and if so, sending a message to the playing device through the output device in the second connection mode.
A sixth aspect of the present invention provides a playback device, where the playback device establishes a first connection and a second connection with a mobile terminal, respectively, and the playback device includes:
a processor and an output device;
the processor is configured to detect whether the second connection is in an active state when the first connection is in an inactive state;
and if so, sending a message to the mobile terminal through the output device in the second connection mode.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: in the embodiment of the invention, when a first connection (for example, a WIFI connection) established between the mobile terminal and the playing device is in a failure state (namely, the WIFI communication is blocked), whether a second connection (for example, a Bluetooth connection) established between the mobile terminal and the playing device is in an effective state is detected, and when the second connection is in the effective state, the mobile terminal sends a message to the playing device in a second connection mode, or the playing device sends a message to the mobile terminal in the second connection mode. According to the embodiment of the invention, when the WIFI communication between the mobile terminal and the playing device is blocked, the Bluetooth is used for transmitting messages, so that the messages can be successfully transmitted, and the message transmission efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a method for sending a message according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for sending a message according to a second embodiment of the present invention;
fig. 3 is a schematic block diagram of a mobile terminal according to a third embodiment of the present invention;
fig. 4 is a schematic block diagram of a playback device provided in the fourth embodiment of the present invention;
fig. 5 is a schematic block diagram of a mobile terminal according to a fifth embodiment of the present invention;
fig. 6 is a schematic block diagram of a playback device according to a sixth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, mobile terminals described in embodiments of the invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a mobile terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the mobile terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The mobile terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the mobile terminal may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Referring to fig. 1, which is a schematic flowchart of a method for sending a message according to an embodiment of the present invention, the method is applied to a mobile terminal, where the mobile terminal and a playing device respectively establish a first connection and a second connection, and as shown in the figure, the method may include the following steps:
step S101, when the first connection is in an invalid state, detecting whether the second connection is in an valid state.
In the embodiment of the present invention, the playing device and the mobile terminal are in the same network and form a playing system, the playing system may include a plurality of playing devices and a plurality of mobile terminals, one master playing device in the plurality of playing devices is used for performing connection communication with the plurality of mobile terminals and other playing devices, and none of the plurality of playing devices except the master playing device can perform connection communication with the plurality of mobile terminals. Wherein the network includes, but is not limited to, a local area network.
In this embodiment of the present invention, the first connection may be a WIFI connection established between the mobile terminal and the playback device, and the second connection may be a bluetooth connection established between the mobile terminal and the playback device.
The establishing of the bluetooth connection between the mobile terminal and the playing device may specifically be: the method comprises the steps of establishing a Bluetooth server in the playing equipment, broadcasting a Universal Unique Identifier (UUID) of the playing equipment to the surrounding to wait for the access of a mobile terminal, establishing a Bluetooth client in the mobile terminal, and establishing Bluetooth connection with the playing equipment after receiving the UUID of the playing equipment.
It should be noted that before sending the message, a WIFI connection and a bluetooth connection are simultaneously established between the mobile terminal and the playback device in advance, so as to ensure that the message is sent to the playback device through the bluetooth after the WIFI communication is blocked, thereby ensuring that the message is successfully sent to the playback device.
In this embodiment of the present invention, that the first connection is in an invalid state means that the WIFI connection established between the mobile terminal and the playback device is unstable, for example, the WIFI network is interfered by surrounding signals or the signal strength is weak), that is, WIFI communication is blocked. The second connection being in an active state means that the bluetooth connection established between the mobile terminal and the playing device is normal, and the second connection being in an inactive state means that the bluetooth connection established between the mobile terminal and the playing device is disconnected, for example, due to a long distance between the mobile terminal and the playing device.
Optionally, the first connection being in an invalid state includes:
when detecting that the mobile terminal sends a message to the playing device, starting to establish a Transmission Control Protocol (TCP) connection;
and if the TCP connection is not finished within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time.
In the embodiment of the present invention, when the mobile terminal sends a message to the playback device through WIFI, a Transmission Control Protocol (TCP) connection needs to be established first, and if the TCP connection is successful, the mobile terminal sends the message to the playback device; and if the TCP connection fails, determining that the WIFI connection established between the mobile terminal and the playing device is in an invalid state, namely that the WIFI communication is blocked.
In the embodiment of the invention, whether the TCP connection is successful is generally judged by adopting the TCP connection overtime time, and if the TCP connection is completed within the TCP connection overtime time, the WIFI connection established between the mobile terminal and the playing equipment is determined to be in an effective state; and if the TCP connection is not finished within the TCP connection timeout time, determining that the WIFI connection established between the mobile terminal and the playing device is in an invalid state.
In the embodiment of the invention, the TCP connection timeout time can be set according to whether the mobile terminal establishes the Bluetooth connection with the playing device, so that the message channel (the message channel refers to a WIFI channel and a Bluetooth channel) can be judged quickly, and the message sending efficiency is improved. Specifically, if the bluetooth connection established between the mobile terminal and the playing device is normal, the TCP timeout time is set to be a first preset time (2 seconds), and when the WIFI communication is blocked, the bluetooth channel is used to send the message, so that the message is guaranteed to be successfully sent to the playing device, and the message sending efficiency is improved.
And step S102, if yes, sending a message to the playing device in the second connection mode.
In the embodiment of the present invention, if the mobile terminal detects that the bluetooth connection established between the mobile terminal and the playback device is normal, a message is sent to the playback device through bluetooth.
Optionally, the embodiment of the present invention further includes:
and if the second connection is detected to be in an invalid state, controlling the mobile terminal and the playing equipment to reestablish the second connection, and after the connection is successful, sending a message to the playing equipment in a second connection mode.
In the embodiment of the invention, when the mobile terminal detects that the Bluetooth connection established between the mobile terminal and the playing device is disconnected, the mobile terminal and the playing device are controlled to reestablish the Bluetooth connection, and after the connection is successful, a message is sent to the playing device in a second connection mode. The controlling the mobile terminal and the playing device to reestablish the bluetooth connection specifically may be: because the mobile terminal establishes the Bluetooth connection with the playing equipment before sending the message and records the UUID of the playing equipment, after the Bluetooth connection is disconnected, the mobile terminal can reestablish the Bluetooth connection with the playing equipment according to the recorded UUID of the playing equipment.
Optionally, after sending the message to the playback device by the second connection, the method further includes:
and if the second connection is detected to be in an invalid state, setting the TCP connection timeout time as second preset time.
In the embodiment of the present invention, after the mobile terminal sends a message to the playback device through bluetooth, if the mobile terminal detects that the bluetooth connection established with the playback device is disconnected, in order to release network resources occupied by the mobile terminal in the process of establishing a TCP connection, the TCP timeout time still needs to be set, and the TCP connection timeout time is set to a second preset time (for example, 15 seconds), where the second preset time is greater than the first preset time.
It should be noted that, in this embodiment, the playing devices in interactive communication with the mobile terminal all refer to master playing devices in the playing system.
According to the embodiment of the invention, when the WIFI communication between the mobile terminal and the playing equipment is blocked, the mobile terminal uses the Bluetooth to send the message to the playing equipment, so that the message is ensured to be successfully sent to the playing equipment, and the message sending efficiency is improved.
Referring to fig. 2, which is a schematic flowchart of a method for sending a message according to a second embodiment of the present invention, where the method is applied to a playback device, and the playback device and a mobile terminal respectively establish a first connection and a second connection, as shown in the figure, the method may include the following steps:
step S201, when the first connection is in an invalid state, detecting whether the second connection is in an valid state.
In the embodiment of the present invention, the playing device and the mobile terminal are in the same network and form a playing system, the playing system may include a plurality of playing devices and a plurality of mobile terminals, one master playing device in the plurality of playing devices is used for performing connection communication with the plurality of mobile terminals and other playing devices, and none of the plurality of playing devices except the master playing device can perform connection communication with the plurality of mobile terminals. Wherein the network includes, but is not limited to, a local area network.
In this embodiment of the present invention, the first connection may be a WIFI connection established between the playback device and the mobile terminal, and the second connection may be a bluetooth connection established between the playback device and the mobile terminal.
The establishing of the bluetooth connection between the playing device and the mobile terminal may specifically be: the method comprises the steps of establishing a Bluetooth server in the playing equipment, broadcasting the UUID of the playing equipment to the surrounding to wait for the access of a mobile terminal, establishing a Bluetooth client in the mobile terminal, and establishing Bluetooth connection with the playing equipment after receiving the UUID of the playing equipment.
It should be noted that before sending the message, a WIFI connection and a bluetooth connection are simultaneously established between the playing device and the mobile terminal in advance, so as to ensure that the message is sent to the mobile terminal through the bluetooth after the WIFI communication is blocked, thereby ensuring that the message is successfully sent to the mobile terminal.
In this embodiment of the present invention, that the first connection is in an invalid state means that the WIFI connection established between the playback device and the mobile terminal is unstable (for example, the WIFI network is interfered by surrounding signals or the signal strength is weak), that is, WIFI communication is blocked. The second connection being in an active state means that the bluetooth connection established between the playback device and the mobile terminal is normal, and the second connection being in an inactive state means that the bluetooth connection established between the playback device and the mobile terminal is disconnected, for example, due to a long distance between the mobile terminal and the playback device.
Optionally, the first connection being in an invalid state includes:
when detecting that the playing equipment sends a message to the mobile terminal, starting to establish a TCP connection;
and if the TCP connection is not finished within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time.
In the embodiment of the invention, when the playing device sends the message to the mobile terminal through WIFI, TCP connection is needed, and if the TCP connection is successful, the playing device sends the message to the mobile terminal; and if the TCP connection fails, determining that the WIFI connection established between the playing equipment and the mobile terminal is in an invalid state, namely that the WIFI communication is blocked.
In the embodiment of the invention, whether the TCP connection is successful is generally judged by adopting the TCP connection overtime time, and if the TCP connection is completed within the TCP connection overtime time, the WIFI connection established between the playing equipment and the mobile terminal is determined to be in an effective state; and if the TCP connection is not finished within the TCP connection timeout time, determining that the WIFI connection established between the playing equipment and the mobile terminal is in an invalid state.
In the embodiment of the invention, the TCP connection timeout time can be set according to whether the playing device establishes the Bluetooth connection with the mobile terminal, so that the message channel (the message channel refers to a WIFI channel and a Bluetooth channel) can be judged quickly, and the message sending efficiency is improved. Specifically, if the bluetooth connection established between the playing device and the mobile terminal is normal, the TCP timeout time is set to be a first preset time (2 seconds), and when the WIFI communication is blocked, the bluetooth channel is used to send the message, so that the message is guaranteed to be successfully sent to the mobile terminal, and the message sending efficiency is improved.
And step S202, if yes, sending a message to the mobile terminal in the second connection mode.
In the embodiment of the present invention, if the playback device detects that the bluetooth connection established between the playback device and the mobile terminal is normal, a message is sent to the mobile terminal through bluetooth.
Optionally, the embodiment of the present invention further includes:
and if the second connection is detected to be in an invalid state, setting the TCP connection timeout time as second preset time.
In the embodiment of the present invention, after the playback device sends a message to the mobile terminal through bluetooth, if the playback device detects that the bluetooth connection established with the mobile terminal is disconnected, in order to release network resources occupied by the playback device in the process of establishing a TCP connection, the TCP timeout time still needs to be set, and the TCP connection timeout time is set to a second preset time (for example, 15 seconds), where the second preset time is greater than the first preset time.
It should be noted that, in this embodiment, the playing devices in interactive communication with the mobile terminal all refer to master playing devices in the playing system.
According to the embodiment of the invention, when the WIFI communication between the mobile terminal and the playing equipment is blocked, the playing equipment uses the Bluetooth to send the message to the mobile terminal, so that the message is ensured to be successfully sent to the mobile terminal, and the message sending efficiency is improved.
It should be understood that, in the above embodiments, the order of execution of the steps is not meant to imply any order, and the order of execution of the steps should be determined by their function and inherent logic, and should not limit the implementation process of the embodiments of the present invention.
Referring to fig. 3, a schematic block diagram of a mobile terminal according to a third embodiment of the present invention, where the mobile terminal and a playing device establish a first connection and a second connection, respectively, and for convenience of description, only a part related to the embodiment of the present invention is shown.
The mobile terminal includes:
a detecting module 31, configured to detect whether the second connection is in an active state when the first connection is in an inactive state;
and a sending module 32, configured to send a message to the playback device in the second connection manner if the connection is positive.
Optionally, the mobile terminal further includes:
the control module 33 is configured to control the mobile terminal and the playback device to reestablish the second connection if it is detected that the second connection is in an invalid state, and send a message to the playback device in the second connection mode after the connection is successful.
Optionally, the mobile terminal further includes:
an establishing module 34, configured to start establishing a TCP connection when detecting that the mobile terminal sends a message to the playback device;
the determining module 35 is configured to determine that the first connection is in an invalid state if the TCP connection is not completed within a first preset time, where the first preset time is a preset TCP connection timeout time.
Optionally, the mobile terminal further includes:
a setting module 36, configured to set the TCP connection timeout time to a second preset time when detecting that the second connection is in an invalid state after sending the message to the playback device in the second connection manner.
Referring to fig. 4, a schematic block diagram of a playing device according to a fourth embodiment of the present invention, where the playing device establishes a first connection and a second connection with a mobile terminal, and for convenience of description, only a part related to the embodiment of the present invention is shown.
The playback apparatus includes:
a detecting module 41, configured to detect whether the second connection is in an active state when the first connection is in an inactive state;
and a sending module 42, configured to send a message to the mobile terminal in the second connection manner if the mobile terminal is a mobile terminal.
Optionally, the playing device further includes:
an establishing module 43, configured to start establishing a TCP connection when detecting that the playing device sends a message to the mobile terminal;
a determining module 44, configured to determine that the first connection is in an invalid state if the TCP connection is not completed within a first preset time, where the first preset time is a preset TCP connection timeout time.
Optional said playback device comprises:
and a setting module 45, configured to set the TCP connection timeout time to a second preset time if it is detected that the second connection is in an invalid state.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structures of the mobile terminal and the playing device are divided into different functional units or modules to perform all or part of the above described functions. Each functional module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional modules are only used for distinguishing one functional module from another, and are not used for limiting the protection scope of the application. For the specific working process of the modules in the mobile terminal and the playing device, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Referring to fig. 5, a schematic block diagram of a mobile terminal according to a fifth embodiment of the present invention is shown, where the mobile terminal and a playing device respectively establish a first connection and a second connection. The mobile terminal as shown in the figure may include: one or more processors 501 (only one shown); one or more input devices 502 (only one shown), one or more output devices 503 (only one shown), and a memory 504. The processor 501, the input device 502, the output device 503, and the memory 504 are connected by a bus 505. The memory 504 is used for storing instructions and the processor 501 is used for executing the instructions stored by the memory 504. Wherein:
the processor 501 is configured to detect whether the second connection is still in an active state when the first connection is in an inactive state; if yes, a message is sent to the playback device through the output device 503 in the second connection manner.
Optionally, the processor 501 is further configured to, if it is detected that the second connection is in an invalid state, control the mobile terminal and the playback device to reestablish the second connection, and send a message to the playback device in the second connection mode after the connection is successful.
Optionally, the processor 501 is specifically configured to start establishing a TCP connection when detecting that the mobile terminal sends a message to the playback device; and if the TCP connection is not finished within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time.
Optionally, after sending the message to the playback device by using the second connection, the processor 501 is further configured to set the TCP connection timeout time to a second preset time if it is detected that the second connection is in an invalid state.
The memory 504 is used for storing software programs and modules. The processor 501 executes various functional applications and data processing by executing software programs and modules stored in the memory 504 to transmit messages to the playback device.
It should be understood that, in the embodiment of the present invention, the Processor 501 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 502 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, a data receiving interface, and the like. The output device 503 may include a display (LCD, etc.), a speaker, a data transmission interface, and the like.
The memory 504 may include a read-only memory and a random access memory, and provides instructions and data to the processor 501. A portion of the memory 504 may also include non-volatile random access memory. For example, the memory 504 may also store device type information.
In a specific implementation, the processor 501, the input device 502, the output device 503, and the memory 504 described in this embodiment of the present invention may execute the implementation described in the embodiment of the method for sending a message provided in this embodiment of the present invention, or may execute the implementation described in the mobile terminal described in the third embodiment of the present invention, which is not described herein again.
Referring to fig. 6, a schematic block diagram of a playback device according to a sixth embodiment of the present invention is shown, where the playback device establishes a first connection and a second connection with a mobile terminal, respectively. The playback device as shown in the figure may include: one or more processors 601 (only one shown); one or more input devices 602 (only one shown), one or more output devices 603 (only one shown), and memory 604. The processor 601, the input device 602, the output device 603, and the memory 604 are connected by a bus 605. The memory 604 is used for storing instructions and the processor 601 is used for executing instructions stored by the memory 604. Wherein:
the processor 601 is configured to detect whether the second connection is in an active state when the first connection is in an inactive state; if yes, a message is sent to the mobile terminal through the output device 603 in the second connection mode.
Optionally, the processor 601 is specifically configured to start establishing a TCP connection when detecting that the playback device sends a message to the mobile terminal; and if the TCP connection is not finished within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time.
Optionally, the processor 601 is further configured to set the TCP connection timeout time to a second preset time if it is detected that the second connection is in an invalid state.
The memory 604 is used for storing software programs and modules. The processor 601 performs various functional applications and data processing by executing software programs and modules stored in the memory 604 to transmit messages to the mobile terminal.
It should be understood that, in the embodiment of the present invention, the Processor 601 may be a Central Processing Unit (CPU), and the Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 602 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, a data receiving interface, and the like. The output device 603 may include a display (LCD, etc.), speakers, a data transmission interface, and the like.
The memory 604 may include both read-only memory and random access memory, and provides instructions and data to the processor 601. A portion of the memory 604 may also include non-volatile random access memory. For example, the memory 604 may also store device type information.
In a specific implementation, the processor 601, the input device 602, the output device 603, and the memory 604 described in this embodiment of the present invention may execute the implementation described in the embodiment of the method for sending a message provided in this embodiment of the present invention, or may execute the implementation described in the playing device described in the fourth embodiment of the present invention, which is not described herein again.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed mobile terminal, playing device and method may be implemented in other ways. For example, the above-described embodiments of the mobile terminal are merely illustrative, and for example, the division of the modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for sending a message is applied to a mobile terminal, and is characterized in that the mobile terminal and a playing device establish a first connection and a second connection at the same time, the first connection is a WIFI connection established between the mobile terminal and the playing device, the second connection is a Bluetooth connection established between the mobile terminal and the playing device, and the method comprises the following steps:
when the first connection is in an invalid state, detecting whether the second connection is in an valid state, wherein the second connection in the valid state means that the Bluetooth connection established between the mobile terminal and the playing device is not disconnected, and the second connection in the invalid state means that the Bluetooth connection established between the mobile terminal and the playing device is disconnected;
if yes, sending a message to the playing device in the second connection mode;
the first connection being in an invalid state comprises:
when detecting that the mobile terminal sends a message to the playing device, starting to establish a Transmission Control Protocol (TCP) connection;
if the TCP connection is not completed within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time;
the mobile terminal and the playing device establish Bluetooth connection, and the Bluetooth connection comprises the following steps: the method comprises the steps that a Bluetooth client is established in the mobile terminal, after receiving a Universal Unique Identifier (UUID) of the playing equipment, the Bluetooth client establishes Bluetooth connection with the playing equipment, and the UUID of the playing equipment is broadcasted to the periphery by a Bluetooth server in the playing equipment;
after sending the message to the playing device by the second connection, the method further includes:
if the second connection is detected to be in an invalid state, setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time, wherein the second preset time is greater than the first preset time.
2. The method of claim 1, further comprising:
and if the second connection is detected to be in an invalid state, controlling the mobile terminal and the playing equipment to reestablish the second connection, and after the connection is successful, sending a message to the playing equipment in a second connection mode.
3. A method for sending a message is applied to a playing device, and is characterized in that the playing device and a mobile terminal simultaneously establish a first connection and a second connection, the first connection is a WIFI connection established between the playing device and the mobile terminal, the second connection is a Bluetooth connection established between the playing device and the mobile terminal, and the method comprises the following steps:
when the first connection is in an invalid state, detecting whether the second connection is in an valid state, wherein the second connection in the valid state means that the Bluetooth connection established between the playing device and the mobile terminal is not disconnected, and the second connection in the invalid state means that the Bluetooth connection established between the playing device and the mobile terminal is disconnected;
if yes, sending a message to the mobile terminal in the second connection mode;
the first connection being in an invalid state comprises:
when detecting that the playing equipment sends a message to the mobile terminal, starting to establish a TCP connection;
if the TCP connection is not completed within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time;
the playing device and the mobile terminal establish Bluetooth connection, which comprises the following steps: the method comprises the steps that a Bluetooth server is established in the playing equipment, the Bluetooth server broadcasts a universal unique identifier UUID of the playing equipment to the surrounding, and the UUID of the playing equipment is used for indicating a Bluetooth client in the mobile terminal to establish Bluetooth connection with the playing equipment;
after sending the message to the playing device by the second connection, the method further includes:
if the second connection is detected to be in an invalid state, setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time, wherein the second preset time is greater than the first preset time.
4. The method of claim 3, further comprising:
and if the second connection is detected to be in an invalid state, setting the TCP connection timeout time as second preset time.
5. The utility model provides a mobile terminal, its characterized in that, mobile terminal and playback device establish first connection and second connection simultaneously, first connection is the mobile terminal with the WIFI connection that playback device established, the second connection is the mobile terminal with the bluetooth connection that playback device established, mobile terminal includes:
the detection module is used for detecting whether the second connection is in an effective state when the first connection is in an ineffective state, wherein the second connection in the effective state means that the Bluetooth connection established between the mobile terminal and the playing equipment is not disconnected, and the second connection in the ineffective state means that the Bluetooth connection established between the mobile terminal and the playing equipment is disconnected;
a sending module, configured to send a message to the playback device in the second connection manner if the connection is positive;
the mobile terminal further includes:
the establishing module is used for starting to establish a Transmission Control Protocol (TCP) connection when detecting that the mobile terminal sends a message to the playing device;
the determining module is configured to determine that the first connection is in an invalid state if the TCP connection is not completed within a first preset time, where the first preset time is a preset TCP connection timeout time;
the Bluetooth client end is used for establishing Bluetooth connection between the mobile terminal and the playing device after receiving the Bluetooth connection, and comprises the following steps: the method comprises the steps that a Bluetooth client is established in the mobile terminal, and after receiving a universal unique identification code UUID of the playing equipment, the Bluetooth client establishes Bluetooth connection with the playing equipment;
after sending the message to the playing device by the second connection, the method further includes:
if the second connection is detected to be in an invalid state, setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time, wherein the second preset time is greater than the first preset time.
6. The mobile terminal of claim 5, wherein the mobile terminal further comprises:
and the control module is used for controlling the mobile terminal and the playing equipment to reestablish the second connection if the second connection is detected to be in an invalid state, and sending a message to the playing equipment in a second connection mode after the connection is successful.
7. The mobile terminal of claim 5, wherein the mobile terminal further comprises:
and the setting module is used for setting the TCP connection timeout time as a second preset time if the second connection is detected to be in an invalid state after the message is sent to the playing device in the second connection mode.
8. The utility model provides a playing device, its characterized in that, playing device and mobile terminal establish first connection and second connection simultaneously, first connection is the playing device with the WIFI connection that mobile terminal established, the second connection is the playing device with the bluetooth connection that mobile terminal established, playing device includes:
the detection module is used for detecting whether the second connection is in an effective state when the first connection is in an ineffective state, wherein the second connection in the effective state means that the Bluetooth connection established between the playing equipment and the mobile terminal is not disconnected, and the second connection in the ineffective state means that the Bluetooth connection established between the playing equipment and the mobile terminal is disconnected;
a sending module, configured to send a message to the mobile terminal in the second connection manner if the mobile terminal is in the first connection;
the playback device further includes:
the establishing module is used for starting to establish TCP connection when detecting that the playing equipment sends a message to the mobile terminal;
the determining module is configured to determine that the first connection is in an invalid state if the TCP connection is not completed within a first preset time, where the first preset time is a preset TCP connection timeout time;
the Bluetooth server is used for broadcasting a Universal Unique Identifier (UUID) of the playing equipment to the surrounding, and the UUID of the playing equipment is used for indicating a Bluetooth client in the mobile terminal to establish Bluetooth connection with the playing equipment;
and the setting module is used for setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time if the second connection is detected to be in the invalid state, wherein the second preset time is greater than the first preset time.
9. The utility model provides a mobile terminal, its characterized in that, mobile terminal and playback device establish first connection and second connection simultaneously, first connection is the mobile terminal with the WIFI connection that playback device established, the second connection is the mobile terminal with the bluetooth connection that playback device established, mobile terminal includes:
the system comprises a processor, a Bluetooth client and an output device;
the processor is configured to detect whether the second connection is in an active state when the first connection is in an inactive state, where the second connection in the active state means that the bluetooth connection established between the mobile terminal and the playback device is not disconnected, and the second connection in the inactive state means that the bluetooth connection established between the mobile terminal and the playback device is disconnected;
the processor is further configured to send a message to the playback device through the output device in the second connection manner if the connection is positive;
the processor is specifically configured to start establishing a Transmission Control Protocol (TCP) connection when it is detected that the mobile terminal sends a message to the playback device; if the TCP connection is not completed within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time;
the bluetooth client, configured to establish a bluetooth connection with the playback device after receiving the request, includes: the method comprises the steps that a Bluetooth client is established in the mobile terminal, and after receiving a universal unique identification code UUID of the playing equipment, the Bluetooth client establishes Bluetooth connection with the playing equipment;
after sending the message to the playing device by the second connection, the method further includes:
if the second connection is detected to be in an invalid state, setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time, wherein the second preset time is greater than the first preset time.
10. The utility model provides a playing device, its characterized in that, playing device and mobile terminal establish first connection and second connection simultaneously, first connection is the playing device with the WIFI connection that mobile terminal established, the second connection is the playing device with the bluetooth connection that mobile terminal established, playing device includes:
the system comprises a processor, a Bluetooth server and an output device;
the processor is configured to detect whether the second connection is in an active state when the first connection is in an inactive state, where the second connection in the active state means that the bluetooth connection established between the playback device and the mobile terminal is not disconnected, and the second connection in the inactive state means that the bluetooth connection established between the playback device and the mobile terminal is disconnected;
the processor is further configured to send a message to the mobile terminal through the output device in the second connection manner if the mobile terminal is in the second connection state;
the processor is specifically configured to start establishing a TCP connection when it is detected that the playback device sends a message to the mobile terminal; if the TCP connection is not completed within a first preset time, determining that the first connection is in an invalid state, wherein the first preset time is a preset TCP connection timeout time;
the Bluetooth server is used for broadcasting a Universal Unique Identifier (UUID) of the playing equipment to the surrounding, and the UUID of the playing equipment is used for indicating a Bluetooth client in the mobile terminal to establish Bluetooth connection with the playing equipment;
after sending the message to the playing device by the second connection, the method further includes:
if the second connection is detected to be in an invalid state, setting the TCP connection timeout time for judging whether the first connection is in the invalid state as second preset time, wherein the second preset time is greater than the first preset time.
CN201611036450.1A 2016-11-18 2016-11-18 Method for sending message, mobile terminal and playing device Active CN106507413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611036450.1A CN106507413B (en) 2016-11-18 2016-11-18 Method for sending message, mobile terminal and playing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611036450.1A CN106507413B (en) 2016-11-18 2016-11-18 Method for sending message, mobile terminal and playing device

Publications (2)

Publication Number Publication Date
CN106507413A CN106507413A (en) 2017-03-15
CN106507413B true CN106507413B (en) 2020-04-10

Family

ID=58327929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611036450.1A Active CN106507413B (en) 2016-11-18 2016-11-18 Method for sending message, mobile terminal and playing device

Country Status (1)

Country Link
CN (1) CN106507413B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023018095A1 (en) * 2021-08-10 2023-02-16 삼성전자 주식회사 Electronic device and method for connecting external device by electronic device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107172609B (en) * 2017-03-29 2020-05-26 联想(北京)有限公司 Control method and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488932A (en) * 2013-10-16 2014-01-01 重庆邮电大学 Desktop security intercommunication system for mobile device and personal computer and implementation method thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101197850A (en) * 2007-12-26 2008-06-11 北京航空航天大学 P2P communication and file transfer method facing wide area network
CN103491655A (en) * 2013-09-30 2014-01-01 深圳前海君浩银通科技发展有限公司 Multi-mode communication system and method between terminal devices
JP5980258B2 (en) * 2014-03-11 2016-08-31 キヤノン株式会社 Information processing apparatus, information processing apparatus control method, and program
CN105025529B (en) * 2015-05-30 2019-04-05 Oppo广东移动通信有限公司 A kind of method and wireless sound box switching access point
CN105848225B (en) * 2016-03-22 2019-05-21 Oppo广东移动通信有限公司 Wireless connection switching method and device in audio frequency broadcast system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488932A (en) * 2013-10-16 2014-01-01 重庆邮电大学 Desktop security intercommunication system for mobile device and personal computer and implementation method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023018095A1 (en) * 2021-08-10 2023-02-16 삼성전자 주식회사 Electronic device and method for connecting external device by electronic device

Also Published As

Publication number Publication date
CN106507413A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
JP6426262B2 (en) Touch event model programming interface
US20200366516A1 (en) Electronic device and method for registering smart home device in smart home system
JP6228676B2 (en) Connection state prompting method and apparatus
JP6742465B2 (en) Method, device and bluetooth speaker for continuous wakeup delay reduction in bluetooth speaker
CN107181858B (en) Method and terminal for displaying notification message
CN110286768B (en) Virtual object display method, terminal device and computer-readable storage medium
EP3531290A1 (en) Data backup method, apparatus, electronic device, storage medium, and system
EP4220402A2 (en) Augmenting capabilities of a host device
CN107423064B (en) Message processing method and device, terminal equipment and storage medium
CN111416867A (en) Method for processing messages between different devices, server and computer storage medium
WO2018209555A1 (en) Bluetooth device connection method and terminal device
JP7467644B2 (en) Message processing method, device and electronic device
CN106507413B (en) Method for sending message, mobile terminal and playing device
CN110086941B (en) Voice playing method and device and terminal equipment
CN104572007A (en) Method for adjusting sound volume of terminal
WO2019179068A1 (en) Risk detection method and device, and mobile terminal and storage medium
CN106775835B (en) Method, server and terminal for acquiring upgrade file
CN104571856A (en) Terminal
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN107015874B (en) Data transmission control method, device and terminal
US11108709B2 (en) Provide status message associated with work status
CN106793173B (en) The method and mobile terminal of information processing
WO2019071380A1 (en) Sleep control method, terminal, and computer readable medium
CN110245016B (en) Data processing method, system, device and terminal equipment
CN106558326B (en) Method, playback equipment and the mobile terminal that multimedia file plays

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant