CN112929425B - Watch communication connection method and device, electronic equipment and storage medium - Google Patents

Watch communication connection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112929425B
CN112929425B CN202110105775.5A CN202110105775A CN112929425B CN 112929425 B CN112929425 B CN 112929425B CN 202110105775 A CN202110105775 A CN 202110105775A CN 112929425 B CN112929425 B CN 112929425B
Authority
CN
China
Prior art keywords
request
protocol
watch
communication
connection
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
CN202110105775.5A
Other languages
Chinese (zh)
Other versions
CN112929425A (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.)
Umeox Innovations Co ltd
Original Assignee
Umeox Innovations Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Umeox Innovations Co ltd filed Critical Umeox Innovations Co ltd
Priority to CN202110105775.5A priority Critical patent/CN112929425B/en
Publication of CN112929425A publication Critical patent/CN112929425A/en
Application granted granted Critical
Publication of CN112929425B publication Critical patent/CN112929425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The invention discloses a watch communication connection method, a device, electronic equipment and a storage medium, and relates to the technical field of communication, wherein the watch communication connection method comprises the following steps: acquiring a communication request sent by a terminal; determining a preset communication protocol according to the communication request; acquiring the connection state of a watch end; if the connection state is an online state, acquiring a first protocol connection request sent by the watch end according to a preset communication protocol; and establishing communication connection with the watch terminal according to the first protocol connection request. If the connection state is the off-line state, the incoming call number is sent to the watch end; acquiring a protocol confirmation request initiated by a watch terminal according to an incoming call number; sending protocol configuration to the watch end according to the protocol confirmation request; acquiring a second protocol connection request initiated by the watch terminal according to protocol configuration; and establishing communication connection with the watch terminal according to the second protocol connection request. The watch communication connection method can reduce the power consumption of the intelligent watch, prolong the service life and is suitable for various use scenes.

Description

Watch communication connection method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a watch communication connection method and apparatus, an electronic device, and a storage medium.
Background
The intelligent watch is built in with an intelligent system, is provided with a smart phone system and is connected to a network to realize multiple functions, such as call, short message, mail, photo transmission and the like. The intelligent watches are various, including adult intelligent watches, old-man intelligent watches and children telephone watches, wherein the children telephone watches are used as substitutes of children mobile phone use scenes, and along with popularization of wearable equipment, the wearable equipment can rapidly obtain the trust of children and parents due to the advantages of safety and convenience. Parents can utilize a child telephone watch to realize real-time positioning, message interaction, telephone monitoring and the like of children; the child can contact the parent at any time through the child phone watch, and the child can send out an emergency help when encountering danger.
On children's phone wrist-watch, some function uses need to rely on instant messaging ability, for example the head of a family sends voice message to children's wrist-watch through cell-phone APP, or the head of a family looks over children current position etc. from cell-phone APP, these come from order and the message on head of a family's cell-phone APP, all need to transmit immediately to children's wrist-watch. When transmission is achieved, long TCP connection is maintained between the watch and the cloud end, or the long TCP connection is sent to the watch in a short message mode. Because the cost of sending the short message is too high, the instant transmission is usually realized by a long connection mode of TCP. However, the storage space of the child phone watch is limited, the capacity of a built-in battery of the watch is generally small, and in a use scene of the child phone watch, the watch after optimization needs to consume 3-8 mAh for maintaining long connection of the TCP, so that the normal use time of the watch is shortened, and the user experience is influenced.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art. Therefore, the watch communication connection method provided by the embodiment of the invention can reduce the power consumption of the intelligent watch, prolong the service life and is suitable for various use scenes.
The embodiment of the invention also provides a watch communication connecting device.
The embodiment of the invention also provides the electronic equipment.
The embodiment of the invention also provides a computer readable storage medium.
According to a first aspect of the invention, a watch communication connection method includes:
acquiring a communication request sent by a terminal;
determining a preset communication protocol according to the communication request;
acquiring a connection state of a watch end, wherein the connection state comprises an online state;
if the connection state is an online state, acquiring a first protocol connection request sent by the watch end according to the preset communication protocol;
and establishing communication connection with the watch end according to the first protocol connection request.
According to the watch communication connection method provided by the embodiment of the first aspect of the invention, at least the following beneficial effects are achieved: the method comprises the steps of obtaining a communication request sent by a terminal, then determining a preset communication protocol according to the communication request, obtaining a connection state of a watch end, wherein the connection state comprises an online state, obtaining a first protocol connection request sent by the watch end according to the preset communication protocol if the connection state is the online state, and finally establishing communication connection with the watch end according to the first protocol connection request, so that the power consumption of the intelligent watch can be reduced, the service life is prolonged, and the method is suitable for various service scenes.
According to some embodiments of the invention, the connected state comprises an offline state, the method further comprising: if the connection state is an off-line state, sending an incoming call number to the watch end; acquiring a protocol confirmation request initiated by the watch terminal according to the incoming call number; sending protocol configuration to the watch terminal according to the protocol confirmation request; acquiring a second protocol connection request initiated by the watch terminal according to the protocol configuration; and establishing communication connection with the watch terminal according to the second protocol connection request.
According to some embodiments of the invention, after the connection request according to the first protocol establishes the communication connection with the watch end, the method further comprises: acquiring a preset period according to the preset communication protocol; and carrying out communication connection with the watch end according to the preset period.
According to some embodiments of the invention, the communication request comprises: request time and request category; the request categories include: a first category; the determining a preset communication protocol according to the communication request comprises the following steps: if the request type is a first type, comparing the consistency of the request time and preset time; and if the request time is consistent with the preset time, confirming the preset communication protocol as a first protocol.
According to some embodiments of the invention, the communication request comprises: the number of requests; the method further comprises the following steps: if the request time is inconsistent with the preset time, comparing the magnitude relation between the request times and the preset times; and if the request times are equal to the preset times, determining the preset communication protocol as a second protocol.
According to some embodiments of the invention, the request categories comprise: a second category; the determining a preset communication protocol according to the communication request comprises the following steps: if the request type is a second type, comparing the consistency of the request time and the preset time; and if the request time is consistent with the preset time, confirming the preset communication protocol as a third protocol.
According to some embodiments of the invention, further comprising: if the request time is inconsistent with the preset time, comparing the magnitude relation between the request times and the preset times; and if the request times are equal to the preset times, determining the preset communication protocol as a fourth protocol.
A wristwatch communication connection device according to an embodiment of the second aspect of the invention, comprising:
the first acquisition module is used for acquiring a communication request sent by a terminal;
the determining module is used for determining a preset communication protocol according to the communication request;
the second acquisition module is used for acquiring the connection state of the watch end, wherein the connection state comprises an online state;
the request module is used for acquiring a first protocol connection request sent by the watch end according to the preset communication protocol if the connection state is an online state;
and the connection establishing module is used for establishing communication connection with the watch terminal according to the first protocol connection request.
The watch communication connection device according to the embodiment of the second aspect of the invention has at least the following advantages: by executing the watch communication connection method provided by the embodiment of the first aspect of the invention, the power consumption of the intelligent watch can be reduced, the service life can be prolonged, and the watch communication connection method is suitable for various service scenes.
An electronic device according to an embodiment of the third aspect of the invention includes: at least one processor, and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions for execution by the at least one processor to cause the at least one processor, when executing the instructions, to implement the watch communication connection method of the first aspect.
According to the electronic device of the embodiment of the third aspect of the invention, at least the following beneficial effects are achieved: by executing the watch communication connection method provided by the embodiment of the first aspect of the invention, the power consumption of the intelligent watch can be reduced, the service life can be prolonged, and the watch communication connection method is suitable for various service scenes.
A computer-readable storage medium according to an embodiment of the fourth aspect of the present invention, stores computer-executable instructions for causing a computer to perform the watch communication connection method of the first aspect.
The computer-readable storage medium according to the fourth aspect of the present invention has at least the following advantages: by executing the watch communication connection method in the embodiment of the first aspect of the invention, the power consumption of the intelligent watch can be reduced, the service life can be prolonged, and the watch communication connection method is suitable for various service scenes.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a schematic flow chart of a watch communication connection method according to an embodiment of the present invention;
FIG. 2 is a schematic view of a watch communication link according to an embodiment of the present invention;
fig. 3 is a functional block diagram of an electronic device according to an embodiment of the invention.
Reference numerals:
the device comprises a first acquisition module 200, a determination module 210, a second acquisition module 220, a request module 230, a connection establishment module 240, a processor 300, a memory 310, a data transmission module 320, a camera 330 and a display screen 340.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, unless otherwise explicitly limited, terms such as arrangement, installation, connection and the like should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific contents of the technical solutions.
First, several terms referred to in the present application are resolved:
1. MQTT: message Queuing Telemetry Transport, MQTT is a Message protocol based on a publish/subscribe paradigm under the ISO standard (ISO/IEC PRF 20922). It works on the TCP/IP protocol suite, is a publish/subscribe message protocol designed for remote devices with low hardware performance and in case of bad network conditions, and is a protocol for TCP long connection scenarios.
2. And (3) CoAP: the managed Application Protocol is a restricted Application Protocol. The CoAP protocol is specified in RFC 7252 and is a Web transport protocol for constrained nodes or networks, such as WSNs, IoT, M2M, and the like. Therefore, the name is the structured Application Protocol. The protocol is directed to internet of things (IoT) devices with less memory and less power specifications, which is a UDP-based low power short connection protocol.
3. TCP: transmission Control Protocol, Transmission Control Protocol. TCP is a connection-oriented (connection-oriented) reliable Transport layer (Transport layer) communication protocol based on a byte stream, specified by RFC 793 of IETF (specialized). In the simplified OSI-model of computer networks, which performs the functions specified by the transport layer four, UDP is another important transport protocol within the same layer.
On children's phone wrist-watch, some function uses need to rely on instant messaging ability, for example the head of a family sends voice message to children's wrist-watch through cell-phone APP, or the head of a family looks over children current position etc. from cell-phone APP, and these come from order and the message on the head of a family's cell-phone APP, all need to transmit immediately to children's wrist-watch. When transmission is achieved, long TCP connection is maintained between the watch and the cloud end, or the long TCP connection is sent to the watch in a short message mode. Because the cost of sending the short message is too high, the instant transmission is usually realized by a long connection mode of TCP. However, the storage space of the child phone watch is limited, the capacity of a built-in battery of the watch is generally small, and in a use scene of the child phone watch, the watch after optimization needs to consume 3-8 mAh for maintaining long connection of the TCP, so that the normal use time of the watch is shortened, and the user experience is influenced.
Based on this, the embodiment of the invention provides a watch communication connection method, a watch communication connection device, an electronic device and a storage medium, which can reduce the power consumption of a smart watch, prolong the service life and are suitable for various use scenes.
Referring to fig. 1, a wristwatch communication connection method according to an embodiment of the first aspect of the invention includes:
step S100, a communication request sent by the terminal is obtained.
The terminal may be a mobile phone terminal, for example, a parent mobile phone terminal; the communication request can be an instant request sent by the terminal to the cloud. Optionally, the communication request may be divided into an instruction type request and a scenario type request according to different scenarios, where the instruction type request may include: searching a current position of a watch terminal, remote control (photographing, finding a watch, monitoring and the like), synchronizing a contact person and other requests, wherein the watch can be a child watch, namely a request for unidirectionally informing the watch terminal to execute certain actions from a parent mobile phone terminal; the context class request may include: voice chat, text chat, emoticon, and the like, that is, a bidirectional request of the parent's mobile phone terminal and watch terminal depending on the conversation scenario.
Step S110, determining a preset communication protocol according to the communication request.
The preset communication protocol can be a preset connection protocol for communication connection between the cloud end and the watch end. Optionally, the cloud may analyze a request type to which the communication request belongs, and determine a connection protocol for performing communication connection with the watch terminal according to the request type of the communication request. For example, if the communication request is a request for searching the current position of the child watch, the communication request is an instruction type request, and the connection protocol may be determined to be an MQTT (TCP-based) communication protocol according to the instruction type request, that is, the preset communication protocol is the MQTT (TCP-based) communication protocol; assuming that the communication request is a request for voice chat, the communication request type is a scenario type request, and the connection protocol can be determined to be a CoAP (UDP-based) communication protocol according to the scenario type request, that is, the preset communication protocol is a CoAP (UDP-based) communication protocol. MQTT and CoAP protocols become standard protocols for the Internet of things, can be expanded in unreliable network environments, and are suitable for scenes with limited hardware storage space of equipment or limited network bandwidth, so that the child watch is very suitable for being used.
Step S120, judging the connection state of the watch end.
The connection state of the watch end includes an online state. The connection state can be a state of whether the watch end is connected with the cloud end or not; the online state may be a connection state in which the watch end has established a connection with the cloud. Optionally, before the cloud end is connected to the watch end, it may be determined whether the watch end is in an online state, and if the watch end is in the online state, it may be determined that a connection state has been established for the MQTT connection between the cloud end and the watch end; if the watch end is in an offline state, it can be determined that the cloud end and the watch end are not connected.
Step S130, if the connection status is an online status, acquiring a first protocol connection request sent by the watch end according to a preset communication protocol.
The first protocol connection request may be a communication connection request initiated by the watch end to the cloud end according to the MQTT communication protocol. Optionally, when the MQTT long connection between the cloud and the watch end has established a connection state, the watch end may initiate an MQTT protocol request, that is, a first protocol connection request, to the cloud according to the protocol configuration, so as to obtain the instant request data from the cloud.
Step S140, establishing a communication connection with the watch end according to the first protocol connection request.
Optionally, the cloud end may establish a communication connection with the watch end by using an MQTT communication protocol according to the first protocol connection request sent by the watch end. In some specific embodiments, after the communication connection is established between the cloud and the watch end, the watch end and the cloud can perform data interaction, so that instant data can be transmitted in real time.
According to the watch communication connection method, the communication request sent by the terminal is obtained, the preset communication protocol is determined according to the communication request, the connection state of the watch end is obtained, the connection state comprises the online state, if the connection state is the online state, the first protocol connection request sent by the watch end according to the preset communication protocol is obtained, and finally the communication connection with the watch end is established according to the first protocol connection request, so that the power consumption of the intelligent watch can be reduced, the service life is prolonged, and the watch communication connection method is suitable for various use scenes.
With continued reference to fig. 1, in some embodiments of the invention, the connection state includes an offline state, and the method for watch communication connection further includes:
step S150, if the connection status is the offline status, the incoming call number is sent to the watch end.
The offline state can be a connection state in which the connection between the cloud end and the watch end is not established; the incoming call number can be a watch phone number dialed from the cloud to the watch terminal. Optionally, if the watch end is in an off-line state, it can be determined that the cloud end and the watch end are not connected, and therefore communication connection cannot be established between the cloud end and the watch end, the cloud end can call the call center to automatically dial the phone number of the watch end, namely, the call number is sent to the watch end, and the communication connection of the watch end is called by calling the watch end through the phone of the cloud end.
Step S160, acquiring a protocol confirmation request initiated by the watch end according to the incoming call number.
The protocol confirmation request may be a request sent by the watch end to the cloud end to confirm the configuration of the protocol of the cloud end. Optionally, when the watch end receives a phone call sent by the cloud, the watch end may match the incoming number with a preset phone (the preset phone may be obtained by the watch end from the cloud through the CoAP protocol when the watch end is powered on or for a fixed n hours). If the incoming call number sent by the cloud is in the preset number list, the watch end can generate a protocol confirmation request according to the incoming call number, and sends a CoAP protocol request to the cloud once to confirm the protocol configuration of the cloud. In some specific embodiments, after confirming that the incoming call number is in the preset number list, the watch end can automatically hang up the incoming call and shield an incoming call interface, a ring tone and incoming call records, and the whole incoming call process makes a user feel no sense. If the incoming call number sent by the cloud is not in the preset number list, the watch terminal can pop up an incoming call interface, normal incoming call logic is entered, and the watch communication connection process is ended.
And step S170, sending protocol configuration to the watch end according to the protocol confirmation request.
Optionally, the cloud may confirm the request according to a protocol sent by the watch end, perform CoAP protocol processing on the cloud, and send the protocol configuration of the cloud to the watch end by using a CoAP protocol response.
And step S180, acquiring a second protocol connection request initiated by the watch end according to the protocol configuration.
The second protocol connection request may be a communication connection request initiated by the watch end to the cloud end according to an MQTT communication protocol or a CoAP communication protocol. Optionally, when the watch end receives the cloud current protocol configuration, the watch end may analyze the protocol configuration and select a communication protocol according to the protocol configuration. If the MQTT communication protocol is used, a communication connection request can be generated according to the MQTT communication protocol, so that a second protocol connection request can be initiated to the cloud end to obtain instant request data from the cloud end; if the CoAP communication protocol is used, a communication connection request can be generated according to the CoAP communication protocol, and therefore a second protocol connection request can be sent to the cloud.
And step S190, establishing communication connection with the watch end according to the second protocol connection request.
Optionally, if the second protocol connection request initiated by the watch end is a request for using an MQTT communication protocol, the cloud end may perform MQTT protocol processing according to the second protocol connection request, and establish communication connection with the watch end using the MQTT communication protocol; if the second protocol connection request initiated by the watch end is a request using a CoAP communication protocol, the cloud end can perform CoAP protocol processing according to the second protocol connection request, and establish communication connection with the watch end by using CoAP protocol response. In some specific embodiments, after the communication connection is established between the cloud and the watch end, the watch end and the cloud can perform data interaction, so that instant data can be transmitted in real time. If the connection state is the off-line state, the communication connection of the watch end is called by calling the watch end through the cloud telephone, so that the problem of power consumption caused by long connection maintenance of instant messaging is solved, the power consumption of the child telephone watch is reduced, and the service life of the watch is prolonged.
In some embodiments of the present invention, after establishing the communication connection with the watch end according to the first protocol connection request, the method further includes:
and acquiring a preset period according to a preset communication protocol. The preset period may be a long heartbeat period corresponding to a preset communication protocol. Optionally, the unit duration of the preset period may be set to be Y according to the requirement, and Y may be fixed to be 5 minutes. Taking MQTT long connection as an example, when the communication request is an instruction type request, determining that the preset communication protocol is an MQTT communication protocol, and the MQTT communication protocol corresponds to different preset periods according to different scenes, for example, assuming that the communication request is a request for searching the current position of a child watch, and assuming that the request time for the terminal to send the communication request to the cloud is T 0 Let T be 0 If the time is the care time (namely the time range of the parents paying attention to the children), the preset period corresponding to the MQTT communication protocol can be determined to be 3Y periods; if T 0 If the time is not in the caring time range, T can be obtained 1 =T 0 +5 minutes, T 2 =T 1 +5 minutes, X 1 =T 0 To T 1 The number of instant requests to resend in the same time window within 7 days of history, X 2 =T 1 To T 2 While the time window history is again sent the number of instant requests within 7 days. Can judge X 2 If X is greater than 0 2 If the maximum transmission time is more than 0, the preset period corresponding to the MQTT communication protocol can be determined to be 3Y periods; if X 2 Equal to 0 and X 1 If the maximum transmission time is more than 0, the preset period corresponding to the MQTT communication protocol can be determined to be 2Y periods.
And carrying out communication connection with the watch end according to a preset period. Optionally, after communication connection is established between the cloud end and the watch end, the watch end and the cloud end can perform interactive data, if the selection is an MQTT protocol, the watch end needs to be connected with the cloud end in a specified period according to protocol configuration, and the cloud end performs communication connection with the watch end in a preset period. For example, assuming that the preset period corresponding to the MQTT communication protocol is 3Y periods, after the communication connection is established between the cloud and the watch end, the watch end and the cloud need to maintain 3Y periods to realize data interaction and reduce power consumption caused by the long-term MQTT connection established between the cloud and the watch end.
In some embodiments of the invention, the communication request comprises: request time and request category; the request categories include: the method comprises the steps that a first category is provided, wherein the request time can be the time when the terminal sends a communication request to the cloud end; the request categories may include: an instruction class request and a scenario class request; the first class may be instruction class requests, including: the method comprises the steps of finding the current position of the child watch, remotely controlling (photographing, finding the watch, monitoring and the like), synchronizing contacts and the like, namely, one-way informing a watch end of a request for executing certain actions from a terminal.
Determining a preset communication protocol according to the communication request, wherein the preset communication protocol comprises the following steps:
and if the request type is the first type, comparing the consistency of the request time and the preset time. Wherein the preset time may be a care time. Optionally, the first category is assumed to be an instruction request, and the request time for the terminal to send the communication request to the cloud is assumed to be T 0 . When the request type of the communication request is an instruction type request, the request time T can be judged 0 Whether the time is the care time (i.e. the preset time) or not, i.e. comparing the consistency of the request time and the preset time, can obtain: the request time is consistent with the preset time or the request time is inconsistent with the preset time.
And if the request time is consistent with the preset time, confirming the preset communication protocol as the first protocol. The first protocol may be an MQTT communication protocol, and the preset period of the MQTT protocol is 3Y periods. Optionally, if the request time is consistent with the preset time, T 0 The communication protocol between the cloud end and the watch end can be determined to be the first protocol within the caring time range, namely the preset communication protocol is determined to be the MQTT communication protocol which is the MQTT communication protocolThe preset period corresponding to the communication protocol is 3Y periods, and the cloud end and the watch end can maintain 3Y period connection. The preset communication protocol is determined to be the first protocol through the request time and the request type, the preset communication protocol can be intelligently configured according to the scene by the cloud, and the standard connection protocol is used, so that the development difficulty is reduced.
In some embodiments of the invention, the communication request comprises: the number of requests. The number of requests may be the number of times the communication request is sent again within 7 days of the history of a certain time window. The method for determining the preset communication protocol according to the communication request further comprises the following steps:
and if the request time is not consistent with the preset time, comparing the magnitude relation between the request times and the preset times. The preset number of times may be a critical value corresponding to the number of requests. Optionally, when the request time of the instruction request is inconsistent with the preset time, T 0 The moment is not in the caring time range, and the preset communication protocol can be determined by the request times. Thus, the magnitude relationship between the number of requests and the preset number may be compared, assuming T 1 =T 0 +5 minutes, T 2 =T 1 +5 minutes, assuming X number of requests respectively 1 And X 2 ,X 1 =T 0 To T 1 The number of instant requests to resend in the same time window within 7 days of history, X 2 =T 1 To T 2 And simultaneously, sending the instant request times again within 7 days of the history of the time window, and if the preset times are 0, comparing the size relation of the request times and the preset times to obtain X 2 Greater than 0, X 2 Is equal to 0 and X 1 Greater than 0 and X 1 And X 2 Three size relationships equal to 0.
And if the request times are equal to the preset times, determining the preset communication protocol as a second protocol. Wherein the second protocol may be a CoAP protocol. Optionally, if the number of requests is equal to the preset number, i.e. X 1 And X 2 Equal to 0, when the communication request is an instruction type request, and T 0 When the time is not in the caring time range, the communication protocol between the cloud end and the watch end can be determined to be the CoAP communication protocol, namely the second protocol, the cloud end and the watch endKeep CoAP short between them. Optionally, if the number of requests is greater than a preset number, for example, X 2 If the current time is more than 0, determining that the communication protocol between the cloud end and the watch end is an MQTT communication protocol, wherein the preset period of the MQTT communication protocol is 3Y periods, and the cloud end and the watch end can be connected in 3Y periods; and as X 2 Is equal to 0 and X 1 If the current time is more than 0, the communication protocol between the cloud end and the watch end is determined to be the MQTT communication protocol, and the preset period of the MQTT communication protocol is 2Y periods. The preset communication protocol is determined to be the second protocol through the request time, the request type and the request times, the preset communication protocol can be intelligently configured according to a scene by the cloud, a standard connection protocol is used, and the development difficulty is reduced.
In some embodiments of the invention, the request categories include: and (c) a second category. Wherein the second category may be a scenario category request, including: voice chat, text chat, emoticon, etc., i.e., a two-way request between the terminal and the watch terminal depending on the dialog scenario.
Determining a preset communication protocol according to the communication request, wherein the preset communication protocol comprises the following steps:
and if the request type is the second type, comparing the consistency of the request time and the preset time. Wherein the preset time may be a care time. Optionally, the second category is assumed to be a scenario request, and the request time for the terminal to send the communication request to the cloud is assumed to be T 0 . When the request type of the communication request is a scene type request, the request time T can be judged 0 Whether the time is the care time (i.e. the preset time) or not, i.e. comparing the consistency of the request time and the preset time, can obtain: the request time is consistent with the preset time or the request time is inconsistent with the preset time.
And if the request time is consistent with the preset time, determining the preset communication protocol as a third protocol. The third protocol may be an MQTT communication protocol, and the preset period of the MQTT communication protocol is 6Y periods. Optionally, if the request time is consistent with the preset time, T 0 The communication protocol between the cloud end and the watch end can be determined to be the third protocol within the caring time range, namely the preset communication protocol is determined to be MQTT communicationThe protocol is characterized in that a preset period corresponding to the MQTT communication protocol is 6Y periods, and the cloud end and the watch end can be connected in 6Y periods. The preset communication protocol is determined to be the third protocol through the request time, the request type and the request times, and the cloud can be intelligently configured according to the scene.
In some embodiments of the present invention, the method for determining the preset communication protocol according to the communication request further includes:
and if the request time is not consistent with the preset time, comparing the size relationship between the request times and the preset times. Optionally, when the request time of the scenario request is not consistent with the preset time, T 0 The moment is not in the caring time range, and the preset communication protocol can be determined by the request times. Thus, the magnitude relationship between the number of requests and the preset number may be compared, assuming T 1 =T 0 +5 minutes, T 2 =T 1 +5 minutes, assuming X number of requests respectively 1 And X 2 ,X 1 =T 0 To T 1 The number of instant requests to resend in the same time window within 7 days of history, X 2 =T 1 To T 2 And simultaneously, sending the instant request times again within 7 days of the history of the time window, and comparing the size relationship between the request times and the preset times to obtain X if the preset times are 0 2 Greater than 0, X 2 Equal to 0 and X 1 Greater than 0 and X 1 And X 2 Three size relationships equal to 0.
And if the request times are equal to the preset times, determining the preset communication protocol as a fourth protocol. Wherein the fourth protocol may be a CoAP protocol. Optionally, if the number of requests is equal to the preset number, i.e. X 1 And X 2 Equal to 0, when the communication request is a scene type request, and T 0 When the time is not in the caring time range, the communication protocol between the cloud end and the watch end can be determined to be the CoAP communication protocol, namely the fourth protocol, and CoAP connection is kept between the cloud end and the watch end. Optionally, if the number of requests is greater than a preset number, for example, X 2 If the current time is more than 0, the communication protocol between the cloud end and the watch end is determined to be MQTT communication protocol, and the preset period of the MQTT communication protocol is MQTT communication protocol6Y periods, the cloud end and the watch end can maintain 6Y period connections; and as X 2 Is equal to 0 and X 1 If the current time is more than 0, the fact that the communication protocol between the cloud end and the watch end is the MQTT communication protocol can be determined, and the preset period of the MQTT communication protocol is 3Y periods. The preset communication protocol is determined to be the fourth protocol through the request time, the request type and the request times, the preset communication protocol can be intelligently configured according to a scene by the cloud, a standard connection protocol is used, and the development difficulty is reduced.
The following describes the procedure of the wristwatch communication connection method according to the embodiment of the present invention in detail with a specific embodiment. It is to be understood that the following description is only exemplary, and not a specific limitation of the invention.
The watch communication connection method comprises the following steps:
firstly, an instant request is sent from a parent mobile phone terminal to a cloud terminal, and the instant request can be divided into an instruction class and a scenario class.
The instruction class request may include: finding the current position of the child watch, remote control (taking a picture, finding the watch, monitoring, etc.), synchronizing contacts, etc., which is a request to notify the watch to perform some action in one way from the parent's handset terminal. The context class request may include: voice chat, text chat, emoticons, etc., which rely on a two-way request for a conversation scenario by the parent's cell phone terminal and watch.
And secondly, the cloud configures a connection protocol between the cloud and the watch according to the scene conditions (such as request type and whether the time is concerned) of the instant request and the historical request times of the user.
Let T be 0 Time T for parent's mobile phone terminal to send instant request to cloud 1 =T 0 +5 minutes, T 2 =T 1 +5 minutes, X 1 =T 0 To T 1 The number of instant requests to resend in the same time window within 7 days of history, X 2 =T 1 To T 2 While the time window history is again sent the number of instant requests within 7 days.
The connection protocol configuration table may refer to table 1 below:
request classes Whether or not to care for time Number of user's historical requests Protocol configuration
Instruction class Is that MQTT is long-connected and maintains 3Y periods
Instruction class Whether or not X 2 Greater than 0 MQTT is long and continuous, and maintains 3Y periods
Instruction class Whether or not X 2 Is equal to 0, X 1 Greater than 0 MQTT is long-connected and maintains 2Y periods
Instruction class Whether or not X 1 And X 2 Is equal to 0 CoAP short-circuit
Scene class Is that MQTT is long-connected and maintains 6Y periods
Situation class Whether or not X 2 Greater than 0 MQTT is long-connected and maintains 6Y periods
Situation class Whether or not X 2 Is equal to 0, X 1 Greater than 0 MQTT is long-connected and maintains 3Y periods
Situation class Whether or not X 1 And X 2 Is equal to 0 CoAP
TABLE 1
Therefore, the communication connection protocols of the cloud terminal and the watch terminal can be configured according to different scene conditions of the instant request.
And thirdly, judging the connection state of the watch end.
After the communication connection protocol of the cloud end and the watch end is configured, the connection state of the watch end can be judged by the cloud end. If the current connection state of the watch end is an online state, namely the MQTT long link established state, the established MQTT long link can be used for sending instant request data corresponding to the instant request to the watch end, namely the communication connection between the watch end and the cloud end is established. After the communication connection is established, the watch end and the cloud end can exchange data, and the watch end needs to be connected with the cloud end according to the corresponding period shown in the table 1 according to the protocol configuration because the MQTT protocol is selected for connection; and if the connection state of the watch is the off-line state, entering the fourth step.
And fourthly, calling the watch end by the cloud telephone to call the communication connection of the watch end.
The cloud calls the call center to automatically dial the telephone number of the watch end, and when the watch end receives a telephone call, the watch end can match the incoming call number with the preset telephone number and judge whether the incoming call number is the preset telephone number. The default telephone can be obtained from the cloud end through the CoAP protocol when the watch end is started or in fixed n hours. If the incoming call number is in the preset telephone number list, the watch end can hang up the incoming call automatically and shield an incoming call interface, a ring and incoming call records, the whole incoming call process causes no sense of the user, and the fifth step is carried out; if the incoming call number is not in the preset telephone number list, the watch end can pop up the incoming call interface, enter normal incoming call logic and end the communication connection process of the watch.
And fifthly, the watch terminal initiates a request for obtaining the cloud current protocol configuration, and the cloud terminal responds and sends the cloud current protocol configuration to the watch terminal.
The watch terminal initiates a CoAP protocol request to the cloud terminal once, namely, the CoAP protocol is used for initiating a request for acquiring protocol configuration to the cloud terminal. And then the cloud end carries out CoAP protocol processing, and the protocol configuration uses the CoAP protocol to respond to the watch end.
And sixthly, the watch terminal analyzes the protocol configuration sent by the cloud terminal, and initiates a CoAP or MQTT protocol request to the cloud terminal according to the protocol configuration to obtain instant request data.
And the watch terminal analyzes the protocol configuration and selects a communication protocol according to the protocol configuration. If the watch end uses the MQTT communication protocol, the watch end initiates an MQTT protocol request to the cloud end to acquire instant request data. The cloud side carries out MQTT protocol processing and sends instant request data to the watch side, namely communication connection is established between the watch side and the cloud side. After the communication connection is established, the watch end and the cloud end can exchange data, and the watch end needs to be connected with the cloud end according to the corresponding period shown in the table 1 according to the protocol configuration because the MQTT protocol is selected for connection; if the watch terminal uses the CoAP communication protocol, the watch terminal initiates a CoAP protocol request to the cloud terminal to obtain instant request data. The cloud terminal carries out CoAP protocol processing, uses CoAP protocol response and sends instant request data to the watch terminal, namely communication connection is established between the watch terminal and the cloud terminal. After the communication connection is established, the watch end and the cloud end can exchange data.
The watch communication connection method can reduce the power consumption of the intelligent watch, prolong the service life and is suitable for various use scenes.
Referring to fig. 2, a wristwatch communication connection device according to an embodiment of the second aspect of the invention comprises:
a first obtaining module 200, configured to obtain a communication request sent by a terminal;
a determining module 210, configured to determine a preset communication protocol according to the communication request;
a second obtaining module 220, configured to obtain a connection state of the watch end, where the connection state includes an online state;
the request module 230 is configured to, if the connection state is an online state, obtain a first protocol connection request sent by the watch end according to a preset communication protocol;
and a connection establishing module 240, configured to establish a communication connection with the watch end according to the first protocol connection request.
By implementing the watch communication connection method of the embodiment of the first aspect of the invention, the watch communication connection device can reduce the power consumption of the smart watch, prolong the service life, and is suitable for various use scenes.
Referring to fig. 3, an embodiment of the third aspect of the present invention further provides a functional module diagram of an electronic device, including: at least one processor 300, and a memory 310 communicatively coupled to the at least one processor 300; the system also comprises a data transmission module 320, a camera 330 and a display screen 340.
Wherein the processor 300 is adapted to perform the watch communication connection method of the first aspect embodiment by invoking a computer program stored in the memory 310.
The memory, as a non-transitory storage medium, may be used to store non-transitory software programs as well as non-transitory computer-executable programs, such as the watch communication connection method in the embodiment of the first aspect of the present invention. The processor implements the watch communication connection method in the above-described first embodiment by executing a non-transitory software program and instructions stored in the memory.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the stored data area may store data for performing the watch communication connection method in the embodiment of the first aspect described above. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the watch communication connection method in the first aspect embodiment described above are stored in a memory and, when executed by one or more processors, perform the watch communication connection method in the first aspect embodiment described above.
Embodiments of the fourth aspect of the present invention also provide a computer-readable storage medium storing computer-executable instructions for: the watch communication connection method in the first aspect embodiment is performed.
In some embodiments, the storage medium stores computer-executable instructions, which when executed by one or more control processors, for example, by one of the processors in the electronic device of the embodiment of the third aspect, may cause the one or more processors to perform the watch communication connection method of the embodiment of the first aspect.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of those skilled in the art without departing from the gist of the present invention.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example," or "some examples" or the like mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (7)

1. A watch communication connection method, comprising:
the method comprises the steps of obtaining a communication request sent by a terminal, wherein the communication request comprises a request type, request time and request times, and the request type comprises a first type;
determining a preset communication protocol according to the communication request: if the request type is the first type, comparing the consistency of the request time and preset time, if the request time is consistent with the preset time, determining the preset communication protocol as a first protocol, if the request time is inconsistent with the preset time, comparing the magnitude relation of the request times and the preset times, and if the request times is equal to the preset times, determining the preset communication protocol as a second protocol;
acquiring a connection state of a watch end, wherein the connection state comprises an online state and an offline state;
if the connection state is an online state, acquiring a first protocol connection request sent by the watch end according to the preset communication protocol;
establishing communication connection with the watch terminal according to the first protocol connection request;
if the connection state is an off-line state, sending an incoming call number to the watch end;
acquiring a protocol confirmation request initiated by the watch terminal according to the incoming call number;
sending protocol configuration to the watch terminal according to the protocol confirmation request;
acquiring a second protocol connection request initiated by the watch terminal according to the protocol configuration;
and establishing communication connection with the watch end according to the second protocol connection request.
2. The method of claim 1, further comprising, after said establishing a communication connection with said watch end in accordance with said first protocol connection request:
acquiring a preset period according to the preset communication protocol;
and carrying out communication connection with the watch end according to the preset period.
3. The method of claim 1, wherein the request categories further comprise: a second category;
the determining a preset communication protocol according to the communication request comprises the following steps:
if the request type is a second type, comparing the consistency of the request time and the preset time;
and if the request time is consistent with the preset time, confirming the preset communication protocol as a third protocol.
4. The method of claim 3, further comprising:
if the request time is inconsistent with the preset time, comparing the magnitude relation between the request times and the preset times;
and if the request times are equal to the preset times, determining the preset communication protocol as a fourth protocol.
5. Watch communication connection means, characterized in that it comprises:
the terminal comprises a first acquisition module, a second acquisition module and a communication module, wherein the first acquisition module is used for acquiring a communication request sent by a terminal, the communication request comprises a request type, request time and request times, and the request type comprises a first type and a second type;
a determining module, configured to determine a preset communication protocol according to the communication request: if the request type is the first type, comparing the consistency of the request time and preset time, if the request time is consistent with the preset time, determining the preset communication protocol as a first protocol, if the request time is inconsistent with the preset time, comparing the magnitude relation of the request times and the preset times, and if the request times is equal to the preset times, determining the preset communication protocol as a second protocol;
the second acquisition module is used for acquiring the connection state of the watch end, wherein the connection state comprises an online state and an offline state;
the request module is used for acquiring a first protocol connection request sent by the watch end according to the preset communication protocol if the connection state is an online state, sending a call number to the watch end if the connection state is an offline state, acquiring a protocol confirmation request initiated by the watch end according to the call number, sending protocol configuration to the watch end according to the protocol confirmation request, and acquiring a second protocol connection request initiated by the watch end according to the protocol configuration;
and the connection establishing module is used for establishing communication connection with the watch end according to the first protocol connection request or establishing communication connection with the watch end according to the second protocol connection request.
6. An electronic device, comprising:
at least one processor, and,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions for execution by the at least one processor to cause the at least one processor, when executing the instructions, to implement the watch communication connection method of any of claims 1 to 4.
7. Computer-readable storage medium, characterized in that it stores computer-executable instructions for causing a computer to execute the watch communication connection method according to any one of claims 1 to 4.
CN202110105775.5A 2021-01-26 2021-01-26 Watch communication connection method and device, electronic equipment and storage medium Active CN112929425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110105775.5A CN112929425B (en) 2021-01-26 2021-01-26 Watch communication connection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110105775.5A CN112929425B (en) 2021-01-26 2021-01-26 Watch communication connection method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112929425A CN112929425A (en) 2021-06-08
CN112929425B true CN112929425B (en) 2022-09-13

Family

ID=76166503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110105775.5A Active CN112929425B (en) 2021-01-26 2021-01-26 Watch communication connection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112929425B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015062309A1 (en) * 2013-11-04 2015-05-07 Tencent Technology (Shenzhen) Company Limited Protocol request processing method and device using the same
CN110035064A (en) * 2019-03-11 2019-07-19 平安科技(深圳)有限公司 Communication means, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016111914A1 (en) * 2015-01-05 2016-07-14 Convida Wireless, Llc Machine-to-machine protocol indication and negotiation
US11032219B2 (en) * 2015-12-22 2021-06-08 Intel Corporation Network aware application dependent adaptive protocol selection for IoT communications
CN105786154A (en) * 2016-02-22 2016-07-20 广东小天才科技有限公司 Power saving method and system of wearable terminal
CN109068355B (en) * 2018-10-09 2022-09-30 广东小天才科技有限公司 Method for saving data traffic, telephone watch, server and mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015062309A1 (en) * 2013-11-04 2015-05-07 Tencent Technology (Shenzhen) Company Limited Protocol request processing method and device using the same
CN110035064A (en) * 2019-03-11 2019-07-19 平安科技(深圳)有限公司 Communication means, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112929425A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
US7711782B2 (en) Event notification method in wireless communications system
CN103338308B (en) The method of calling of mobile terminal, the method controlling mobile terminal and relevant device
WO2022094809A1 (en) Relay ue reselection method, apparatus, communication device, and storage medium
CN108989179B (en) Message processing method and device and storage medium
US9654945B2 (en) Electronic device with message handling functions
CN111937325B (en) Data transmission method and device based on satellite communication and storage medium
CN111357239A (en) Communication processing method, device and computer storage medium
CN105871561B (en) Wireless wake-up device for cell module
US20110130113A1 (en) Communication device
CN110771222A (en) Paging configuration method, device, communication equipment and storage medium
US20160157206A1 (en) Information notification method and instant notification device
CN111356159B (en) Network-resident mode adjusting method, device and storage medium
CN112968935B (en) Data transmission method, device, terminal and storage medium
CN112929425B (en) Watch communication connection method and device, electronic equipment and storage medium
US20230337114A1 (en) Access control method, and communication device and storage medium
CN111683401B (en) Method and device for adjusting paging cycle and terminal equipment
CN109756972A (en) A kind of method, network side equipment and terminal waking up application program
CN112702718A (en) Communication method, device, equipment and storage medium
EP4199491A1 (en) Methods and apparatuses of call implementation and storage medium
CN114679215B (en) Communication method, device and satellite convergence gateway
WO2023098055A1 (en) Low-power-consumption mode starting method and apparatus, storage medium, and electronic apparatus
CN110650259B (en) Call request response method, device, server, terminal and storage medium
WO2022000203A1 (en) Access control method and apparatus, and storage medium
CN111279778A (en) Communication processing method, device and computer storage medium
CN112422750A (en) Method, terminal, system and computer readable storage medium for acquiring terminal state

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