WO2024020986A1 - 确定设备的连接状态的方法、装置、芯片和存储介质 - Google Patents

确定设备的连接状态的方法、装置、芯片和存储介质 Download PDF

Info

Publication number
WO2024020986A1
WO2024020986A1 PCT/CN2022/108837 CN2022108837W WO2024020986A1 WO 2024020986 A1 WO2024020986 A1 WO 2024020986A1 CN 2022108837 W CN2022108837 W CN 2022108837W WO 2024020986 A1 WO2024020986 A1 WO 2024020986A1
Authority
WO
WIPO (PCT)
Prior art keywords
time interval
message
connection
timer
response message
Prior art date
Application number
PCT/CN2022/108837
Other languages
English (en)
French (fr)
Inventor
吕小强
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/108837 priority Critical patent/WO2024020986A1/zh
Publication of WO2024020986A1 publication Critical patent/WO2024020986A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections

Definitions

  • the present application relates to the field of communication technology, and more specifically, to a method, device, chip and storage medium for determining the connection status of a device.
  • Communication devices may transmit data based on connections established between each other (eg, Bluetooth connections). Afterwards, if neither communicating party has data to send, the communicating parties can let the connection between the communication devices enter the idle connection state. In the idle connection state, the communicating parties can send keep-alive messages to each other to maintain the connection. However, how the communicating parties determine that the connection between the communication devices enters the idle connection state is a problem that needs to be solved.
  • This application provides a method, device, chip and storage medium for determining the connection status of a device.
  • Each aspect involved in this application is introduced below.
  • a first aspect provides a method for determining the connection status of a device, including: when a first device establishes a connection with a second device, the first device sends a first data packet to the second device; When a first condition is met, the first device configures the connection between the first device and the second device to an idle connection state, and the first condition is associated with one or more of the following information : the identification of the first data packet; the status of the message queue of the first device; and the message type of the first response message, the first response message is used to instruct the second device to confirm receipt of the first data pack.
  • a method for determining the connection status of a device including: when a first device establishes a connection with a second device, the second device receives a first data packet sent by the first device. ; When the first condition is met, the second device configures the connection between the first device and the second device to an idle connection state, and the first condition is combined with one or more of the following information: Association: the identification of the first data packet; the status of the message queue of the second device; and the message type of the first response message, the first response message is used to instruct the second device to confirm receipt of the third One data packet.
  • a device for determining the connection status of a device is provided.
  • the device is configured on a first device.
  • the device includes: a first sending module, configured to establish a connection between the first device and the second device. and sending a first data packet to the second device; a configuration module configured to configure the connection between the first device and the second device to an idle connection state when the first condition is met, the The first condition is associated with one or more of the following information: the identification of the first data packet; the status of the message queue of the first device; and the message type of the first response message, the first response message Used to instruct the second device to confirm receipt of the first data packet.
  • a device for determining the connection status of a device is provided.
  • the device is configured on a second device.
  • the device includes: a first receiving module for establishing a connection between the first device and the second device. Receive the first data packet sent by the first device; a configuration module configured to configure the connection between the first device and the second device to an idle connection state when the first condition is met, so The first condition is associated with one or more of the following information: the identification of the first data packet; the status of the message queue of the second device; and the message type of the first response message, the first response
  • the message is used to instruct the second device to confirm receipt of the first data packet.
  • a communication device including a processor, a memory, and a communication interface.
  • the memory is used to store one or more computer programs.
  • the processor is used to call the computer program in the memory to enable the communication.
  • the device performs some or all of the steps in the methods of the first aspect to the second aspect.
  • embodiments of the present application provide a communication system, which includes the above-mentioned first device and/or second device.
  • the system may also include other devices that interact with the first device or the second device in the solution provided by the embodiments of the present application.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program, and the computer program causes the communication device to execute some or all of the steps in the methods of the above aspects.
  • embodiments of the present application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause the communication device to execute the above-mentioned Some or all of the steps in various aspects of the method.
  • the computer program product can be a software installation package.
  • embodiments of the present application provide a chip, which includes a memory and a processor.
  • the processor can call and run a computer program from the memory to implement some or all of the steps described in the methods of the above aspects.
  • both the first device and the second device can configure the connection between the communicating parties (ie, the first device and the second device) to an idle connection state according to the first condition, so that the first device and the second device determine The results are consistent, which is beneficial to reducing communication failures caused by inconsistent results determined by the first device and the second device.
  • FIG. 1 is an example system architecture diagram of a wireless communication system to which embodiments of the present application can be applied.
  • Figure 2 is an example diagram of the BLE protocol stack.
  • Figure 3 is an example diagram of the message structure of a PDU.
  • Figure 4 is an example diagram of communication between the GATT client and the GATT server based on the receiving window.
  • FIG. 5 is a schematic flowchart of a method for determining the connection status of a device provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for determining the connection status of a device provided by another embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a method for determining the connection status of a device provided by yet another embodiment of the present application.
  • FIG. 8 is a schematic flowchart of a method for determining the connection status of a device provided by yet another embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a device for determining the connection status of a device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of a device for determining the connection status of a device provided by another embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • the technical solutions provided by the embodiments of this application can be applied to various communication systems, such as: fifth generation (5th generation, 5G) system or new radio (new radio, NR) system, long term evolution (long term evolution, LTE) system, LTE frequency division duplex (FDD) system, LTE time division duplex (TDD) system, LTE (LTE-based access to unlicensed spectrum, LTE-U) system on unlicensed spectrum, unlicensed NR (NR-based access to unlicensed spectrum, NR-U) system on the spectrum, non-terrestrial networks (NTN) system, universal mobile telecommunication system (UMTS), wireless LAN (wireless) local area networks, WLAN) system, Bluetooth system, wireless fidelity (wireless fidelity, Wi-Fi) system, etc.
  • NTN non-terrestrial networks
  • UMTS universal mobile telecommunication system
  • WLAN wireless LAN
  • Bluetooth wireless fidelity (wireless fidelity, Wi-Fi) system, etc.
  • the technical solution provided by this application can also be applied to future communication systems
  • FIG. 1 is an architectural example diagram of a wireless communication system 100 applicable to embodiments of the present application.
  • the wireless communication system 100 may include a first device 110 and a second device 120 . Both the first device 110 and the second device 120 have wireless connection functions.
  • the wireless connection can be, for example, a low-power Bluetooth (Bluetooth low energy, BLE) connection, a classic Bluetooth connection, a Wi-Fi connection, a point-to-point (P2P) connection, a Thread connection, etc.
  • the technical solution provided by the embodiment of the present application can be applied to the scenario of establishing a wireless communication connection between the first device 110 and the second device 120 .
  • Figure 1 exemplarily shows a first device 110 and a second device 120, but the embodiment of the present application is not limited thereto.
  • the wireless communication system 100 may include multiple first devices and/or second devices.
  • the first device may maintain connections with multiple second devices at the same time to communicate with multiple second devices at the same time.
  • a first device transmits data with multiple second devices at the same time.
  • the first device 110 and the second device 120 may be logically functionally divided into a client and a server (or service node).
  • the client can control the server through its connection with the server, or exchange data with the server through its connection with the server.
  • the first device 110 may be a client or a server.
  • the second device 120 may be a server or a client, which is not limited in the embodiment of the present application.
  • the first device and the second device in the embodiments of the present application may be referred to as the first terminal device and the second terminal device respectively.
  • the terminal equipment can also be called user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), mobile terminal (mobile terminal, MT), remote station , remote terminal, mobile device, user terminal, terminal, wireless communications device, user agent or user device.
  • the first device and the second device in the embodiment of the present application may be devices that provide voice and/or data connectivity to users, and may be used to connect people, things, and machines, such as handheld devices and vehicle-mounted devices with wireless connection functions. wait.
  • the first device and the second device in the embodiments of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a notebook computer, a handheld computer, a mobile internet device (mobile internet device, MID), or a mobile Internet device (MID).
  • Wearable devices Internet of Things devices, virtual reality (VR) devices, augmented reality (AR) devices, etc.
  • the first device and/or the second device may be a wearable device.
  • Wearable devices can also be called wearable smart devices. It is a general term for applying wearable technology to intelligently design daily wear and develop wearable devices, such as glasses, gloves, watches, clothing and shoes, etc.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction.
  • wearable smart devices include full-featured, large-sized devices that can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, and those that only focus on a certain type of application function and need to cooperate with other devices such as smartphones. Use, such as various smart bracelets, smart jewelry, etc. for physical sign monitoring.
  • the first device and/or the second device may be an Internet of Things device.
  • IoT devices may be smart home devices.
  • IoT devices may include smart air conditioners, smart refrigerators, washing machines, rice cookers, sweeping robots, and other devices.
  • the IoT device may be an intelligent monitoring device.
  • the IoT device may include a surveillance camera, a temperature sensor, a sound sensor, etc., which are not specifically limited in the embodiments of this application.
  • the scene in which the first device and the second device are located is not limited.
  • the first device and the second device may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted.
  • the protocol stack can be understood as a unit or module that processes data through protocols.
  • the data generated by the protocol stack is processed by the lower layer and then sent.
  • the data of the application layer can be sent after being processed by the transport layer.
  • a protocol stack can also be simply understood as a unit or module in a communication device that can process data using a protocol.
  • FIG. 2 is a schematic diagram of the BLE protocol stack.
  • the BLE protocol stack at least includes: application layer, BLE message transport protocol layer (BLE message transport protocol, BMTP) and general attribute profile (GATT) layer.
  • BLE message transport protocol BLE message transport protocol
  • GATT general attribute profile
  • the BMTP layer can be understood as a reliable, connection-oriented data transmission layer similar to TCP provided by the Bluetooth transport protocol (BTP) on top of the GATT layer.
  • This BMTP layer can be called the middle layer between the application layer and the GATT layer.
  • the application layer message needs to be passed to the lower GATT layer for sending, that is, the service data unit (SDU) of the application layer needs to be passed through the protocol data unit (protocol data unit) of the GATT layer. , PDU) to send.
  • SDU service data unit
  • PDU protocol data unit
  • the application layer SDU when application layer data needs to be transmitted by the GATT layer, since the size of the SDU data packet may be greater than or equal to the size of the PDU data packet, the application layer SDU needs to be decomposed into one or more GATT PDUs for transmission. .
  • BMTP can decompose (or split) a single SDU data packet into multiple PDU data packets.
  • each PDU data packet can be understood as a segment of the SDU data packet.
  • Figure 3 gives an example of the message structure (format) of a PDU.
  • the PDU message consists of an 8-bit header and one or more optional fields. The following is an exemplary description of each field in the PDU message.
  • H bit represents the handshake bit, which can be set to "0" for normal PDU data packets. When this bit is set, it can indicate the BTP handshake message used to establish the session.
  • BTP handshake messages used to establish a session may have different message formats.
  • M represents the management message bit, which can be used to indicate whether the Management Opcode field exists. For example, when the M bit is 1, it can indicate that the Management Opcode field exists, and when the M bit is 0, it can indicate that the Management Opcode field does not exist. It should be understood that for multiple PDU data packets corresponding to one SDU data packet (that is, multiple PDU data packets decomposed from one SDU data packet), this bit should be set to the same value for each PDU data packet. In other words, all segments of an SDU packet should set this bit to the same value.
  • a bit: A represents the acknowledgment bit, which can be used to indicate whether the PDU data packet is a response message. In some embodiments, to ensure reliable transmission of messages, this bit may be always set to true, or always set to 1 to indicate that a reply message is required.
  • B bit B represents the beginning segment (beginning segment) bit. In some embodiments, when this bit is set to 1, it indicates that the PDU data packet is the first segment (starting segment) of the SDU data packet. When set to 0, it indicates that the PDU data packet is the first segment of the SDU data packet except for the first segment. Other segments, for example, middle segments such as the second segment, last segment, etc. In other words, in the case where the SDU data packet is decomposed into multiple PDU data packets, this bit being 1 can indicate that the PDU data packet is the first of multiple PDU data packets.
  • E bit represents the ending segment bit. In some embodiments, when this bit is set to 1, it means that the PDU data packet is the last segment (end segment) of the SDU data packet. When it is set to 0, it means that the PDU data packet is the other segments of the SDU data packet except the last segment. , for example, the first paragraph, the second paragraph and other middle paragraphs. In other words, in the case where the SDU data packet is decomposed into multiple PDU data packets, this bit being 1 can indicate that the PDU data packet is the last of the multiple PDU data packets.
  • Packet sequence number can be used to identify different data packets. All PDU data packets (BTP messages) should be sent carrying the packet sequence number, regardless of whether it contains an SDU segment (for example, the acknowledgment packet may not have an additional segment payload).
  • the packet sequence number may be defined as an unsigned 8-bit integer value that monotonically increases by one with each packet sent by the packet sender. After exceeding 255, it wraps to 0.
  • the data packet sequence number of the first data packet sent by the data packet sender starts from 0.
  • packet sequence numbers should be defined separately for both communicating parties. For example, the packet sequence number of the first PDU data packet sent by the client device (for example, the first device) after completing the BTP session handshake is 0, and the data packet sequence number of subsequent PDU data packets sent by the client device increases by 1 in sequence. The data packet sequence number of the PDU data packet corresponding to the handshake response sent by the server device (for example, the second device) is 0, and the data packet sequence number of subsequent PDU data packets sent by the server device is incremented by 1 in sequence.
  • the acknowledgment sequence number can be used to indicate whether the data packet associated with the packet sequence number has been received. For example, in the PDU data packet sent by the client device to the server device, the value of the confirmation sequence number field indicates 1, which means that the client device confirms receipt of the data packet with the sequence number 1 sent by the server device.
  • data packet sequence number and confirmation sequence number is to support the receiving window of both communicating parties.
  • the following introduces the receiving windows of both communicating parties.
  • a receiving window can be defined for both communicating parties in units of PDU.
  • the purpose of this receive window is to enable session-level flow control for both communicating parties.
  • the size of the receiving window can represent the number of PDU data packets that the communication device can reliably receive and store without session layer acknowledgment. For example, when the size of the receiving window corresponding to the first device is 4, it means that the first device can receive up to 4 PDU data packets without performing session layer confirmation.
  • the size of the receiving window can be represented by slots. For example, the size of the receiving window corresponding to the first device is 4 slots, then the first device can receive up to 4 PDU data packets.
  • the slot of the receiving window may use a data packet sequence number to indicate that the communication device has received the data packet associated with the data packet sequence number.
  • both communicating parties may use a counter to reflect the current receive window size. This counter is decremented when the communications device writes a packet and is incremented when a packet sent by the communications device is acknowledged.
  • the following takes the establishment of a BLE connection between the first device and the second device (that is, the first device and the second device are the GATT client and the GATT server respectively) as an example to introduce the receiving window.
  • Figure 4 is an example diagram of communication between the GATT client and the GATT server based on the receiving window. As shown in Figure 4, when a BLE connection is established between the GATT client and the GATT server, the GATT client and the GATT server can communicate.
  • the GATT client may send the first message to the GATT server, and the data packet sequence number of the first message is 0.
  • the GATT server updates the corresponding receiving window of the GATT server and places the identifier with the data packet sequence number 0 into the receiving window.
  • the GATT client can send a second message, and the packet sequence number of the second message is 1. After receiving the second message, the GATT server places the corresponding identifier with the data packet sequence number 1 into the receiving window.
  • the GATT server finds that there are only 2 slots left in the current receiving window, so the GATT server can send a stand-alone ack message to the GATT client.
  • the confirmation sequence number in the stand-alone ack message is the latest received message. Packet sequence number. For example, the most recent message received by the GATT server is the second message, and its corresponding data packet sequence number is 1, then the confirmation sequence number in the independent response message should be 1. As a specific example, the data packet sequence number corresponding to the independent response message is 1, and the confirmation sequence number is 1.
  • the GATT server While the GATT server sends an independent response message to the GATT client, the GATT server clears the receiving window on the GATT server side. After receiving the independent response message, the GATT client updates the receiving window on the GATT client side.
  • the GATT client sends the last PDU data packet among the multiple PDU data packets obtained by decomposing the SDU data packet.
  • the data packet sequence number of this data packet is 2, and the confirmation sequence number is 1, where the confirmation sequence number is
  • the packet sequence number of the independent response message sent by the GATT server to the GATT client in the previous step indicates that the independent response message sent by the previous GATT server has been received.
  • the GATT server updates its corresponding receiving window after receiving the message. After the GATT server determines that it is the last PDU data packet, it reassembles the data packet and sends it to the application layer.
  • the communicating parties can let the connection between the communication devices enter the idle connection state.
  • the communicating parties can also send keep-alive messages (for example, independent response messages) to each other to maintain the connection.
  • keep-alive messages for example, independent response messages
  • embodiments of the present application provide a method, device, chip and storage medium for determining the connection status of a device.
  • the method for determining the connection status of a device provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
  • FIG. 5 is a schematic flowchart of a method for determining the connection status of a device provided by an embodiment of the present application. The method shown in FIG. 5 is described from the perspective of interaction between a first device and a second device.
  • the first device and the second device may be, for example, the first device 110 and the second device 120 shown in FIG. 1 respectively.
  • the method in Figure 5 may include step S510 and step S520, and these steps will be introduced in detail below.
  • step S510 when a connection is established between the first device and the second device, the first device sends the first data packet to the second device.
  • the embodiment of the present application does not specifically limit the type of connection between the first device and the second device.
  • the communication between the first device and the second device may be short-range communication, and the connection therebetween may be a connection method supported by short-range communication.
  • the connection type between the first device and the second device may be a Bluetooth connection (eg, BLE connection, classic Bluetooth connection), Wi-Fi connection, Thread connection, etc.
  • the first device is the sending end of the first data packet
  • the second device is the receiving end of the first data packet.
  • the first device can be a client or a server; correspondingly, the second device can be a server or a client. That is to say, if the first device is a client, then the second device is a server; if the first device is a server, then the second device is a client.
  • the connection between the first device and the second device as a BLE connection as an example, the first device can be understood as a GATT client, and the second device can be understood as a GATT server; or, the first device can also be understood as a GATT server. , the second device can be understood as a GATT client.
  • the first data packet refers to a PDU data packet.
  • the first data packet may be one of multiple PDU data packets obtained by decomposing the SDU data packet, for example, it may be the first (first) data packet among the multiple PDU data packets obtained by decomposing the SDU data packet, or It may be the second, third, etc. intermediate data packet among multiple PDU data packets, or it may be the last data packet among multiple PDU data packets. This is not limited in the embodiment of the present application.
  • the multiple PDU data packets obtained by decomposing the SDU data packet may also be called a packetization sequence, and the first data packet may be any data packet in the packetization sequence.
  • step S520 if the first condition is met, the first device configures the connection between the first device and the second device to an idle connection state.
  • the idle connection state can be understood as a connection between the first device and the second device.
  • the connection is currently idle, that is, the first device and the second device will not have a large amount of data in the idle connection state.
  • Transmission may only transmit keepalive signaling to maintain the connection between the first device and the second device.
  • the idle connection state can be understood as when both communicating parties (the first device and the second device) have no data to send, keep-alive messages will still be exchanged in each sending confirmation interval.
  • BLE connection between the first device and the second device as an example, when either party in the BTP session has no data to send, BTP messages will still be exchanged in each transmission confirmation interval.
  • the first device can determine whether the connection between the first device and the second device enters the idle connection state according to the first condition. If it is determined that the connection between the first device and the second device enters the idle connection state, then The connection between the first device and the second device can be configured (or called setting, setting, etc.) as an idle connection state; otherwise, the connection between the first device and the second device can be considered as a connected state. In some embodiments, when the connection between the first device and the second device is in the connected state, it can be considered that there are still PDU data packets obtained by SDU decomposition to be transmitted between the first device and the second device.
  • the first device determines whether the connection between the first device and the second device enters the idle connection state according to the first condition. This may mean that the first device can determine whether the first condition is met. When the first condition is met, the first device may configure the connection between the first device and the second device to be in an idle connection state.
  • the first condition may be associated with one or more types of information, which is not limited by the embodiments of the present application.
  • the first condition may be associated with one or more of the following information.
  • the identifier of the first data packet may be used to indicate the position of the first data packet in the packetization sequence (ie, multiple PDU data packets obtained by decomposing one SDU data packet). For example, the identifier of the first data packet may be used to indicate that the first data packet is the first, second, last, etc. among multiple PDU data packets.
  • the identification of the first data packet may refer to the ending segment bit of the first data packet, which is used to identify whether the first data packet is the last of multiple PDU data packets.
  • the identifier of the first data packet may refer to the E bit. When this bit is set to 1, it may indicate that the first data packet is one of multiple PDU data packets. The last one. When this bit is set to 0, it can indicate that the first data packet is the first or one of the middle among multiple PDU data packets.
  • the identifier of the first data packet may also include other identifiers, such as the packet sequence number of the first data packet and other identifiers.
  • message queues can be used to communicate between tasks in some embedded devices.
  • the first device and the second device may communicate using message queues.
  • response messages can be used to ensure the reliability of message transmission and ensure that the receiving window is available during message transmission. Based on this, after the first device sends the first data packet to the second device, the second device can send a first response message to the first device. The first response message is used to instruct the second device to confirm receipt of the first data packet.
  • the first response message may include multiple message types.
  • the message type of the first response message may include a stand-alone ack message and a piggyback ack message.
  • the independent response message means that the response message can only contain the ack data packet and does not contain other data and payloads.
  • the BTP packet between the first device and the second device only contains the ack data packet and does not contain other data and payloads (a stand-alone ack-that is, a BTP packet that contains a packet receipt acknowledgment value but no buffer segment payload).
  • the second device may send an independent response message to the first device to indicate that the second device has received the first data packet.
  • the independent response message can also be understood as a PDU data packet.
  • the message structure of the PDU corresponding to the independent response message may only include an 8-bit header, an optional field [data packet sequence number] and an optional field. Select the field [Confirm Serial Number] without including the payload.
  • the piggyback response message can be understood as merging the ack data packet into other data packets and sending them together.
  • the ack data packet can be merged into This other data packet is sent to the other party of the communication.
  • the second device can merge the ack data packet corresponding to the first response message into the second device. After the data packet is sent, it is jointly sent to the first device.
  • the second device may also determine whether the connection between the first device and the second device enters the idle connection state according to the first condition.
  • the first condition may include one or more of the following information: the identifier of the first data packet, the The status of the message queue, and the message type of the first response message. This information is similar to the information that the first device determines to refer to. For a specific description of this information, please refer to the previous description of information 1 to information 3, which will not be described again here.
  • both the first device and the second device can determine that the connection between the communicating parties (ie, the first device and the second device) enters the idle connection state according to the first condition, so that the result determined by the first device and the second device Consistency is beneficial to reducing communication failures caused by inconsistent results determined by the first device and the second device.
  • the first condition may include one or more of the following conditions.
  • the identifier of the first data packet indicates that the first data packet is the last one among multiple PDU data packets, or in other words, the identifier of the first data packet indicates that the first data packet is the last one in the packetization sequence.
  • Each PDU data packet or packet sequence is obtained by decomposing the first SDU data packet.
  • the first SDU data packet can be understood as any SDU data packet corresponding to the application layer of the first device. The first device needs to send the first SDU data packet to the second device after being processed by the lower layer.
  • the first data packet is the last of multiple PDU data packets, it means that after the first data packet is sent, the first SDU data packet is sent, and the first device may not transmit a large amount of data to the second device within a short period of time. .
  • the connection between the first device and the second device may be set to an idle connection state.
  • Condition 2 There is no message to be sent in the message queue of the first device. There is no message to be sent in the message queue of the first device, which means that the first device has no data that needs to be sent to the second device within the current time. In this case, in order to save energy, the connection between the first device and the second device may be set to an idle connection state.
  • Condition 3 The message type of the first response message is an independent response message. If the message type of the first response message is an independent response message, it means that the second device currently has no data that needs to be sent to the first device. In this case, in order to save energy, the connection between the first device and the second device may be set to an idle connection state.
  • the first condition may include any one or more of the above conditions.
  • the first condition may only include condition 1, that is, as long as the first device determines that the first data packet is the last of multiple PDU data packets, the first device may configure the connection between the first device and the second device as idle. Connection Status.
  • the first condition may include condition 1 and condition 2, that is, the first device determines that the first data packet is the last of multiple PDU data packets, and the first device itself has no other messages that need to be sent to the second device, Then the first device can configure the connection between the first device and the second device to be in an idle connection state.
  • the first condition may include condition 1, condition 2 and condition 3, that is, when the first device itself has no message that needs to be sent to the second device, and the second device does not need to send a message to the first device,
  • the first device may configure the connection between the first device and the second device to be in an idle connection state.
  • the first device side may correspond to a timer for sending a response message and a timer for receiving a response message, respectively, to indicate the time interval at which the first device expects to send a response message and the time interval at which it expects to receive a response message.
  • the first device after the first device sends a message, it can start a timer for receiving a response message to indicate that the first device expects to receive a response message for the message within a time interval corresponding to the timer. After receiving a message, the first device can start a timer for sending a response message to indicate that the first device expects to send a response message for the message within a time interval corresponding to the timer.
  • the second device side may also have a timer for sending the response message and a timer for receiving the response message respectively.
  • the time interval of the timer for sending the response message corresponding to the response message sender may be equal to the time interval of the timer for receiving the response message corresponding to the response message receiver, so as to ensure that the response message receiver can receive the response message at the desired time. The response message was received within the time.
  • the embodiments of the present application are not limited to this.
  • the time interval of the timer for sending the response message corresponding to the response message sender may be smaller than the time interval of the timer for receiving the response message corresponding to the response message receiver. This also ensures that the recipient of the response message can receive the response message within the expected time.
  • the first device and the second device may send keep-alive signaling to each other in sequence.
  • the keep-alive signaling is used between the first device and the second device. Keep-alive of the connection between two devices.
  • the keepalive signaling may be a response message, such as an independent response message.
  • the timers corresponding to the first device and the second device correspond to The time interval can be set larger to reduce power consumption.
  • the time interval of the first device's timer for receiving the response message is set. is the first time interval
  • the time interval of the first device's timer for receiving the response message can be set to the second time interval, where the second time interval is greater than
  • the first time interval for example, the second time interval may be N (N ⁇ 2) times the first time interval. In some embodiments, N may be a positive integer.
  • the timer for sending the response message of the second device can also be set to a larger value, for example, set to the second time interval.
  • the implementation of setting the time interval between the first device's timer for sending a response message and the second device's timer for receiving a response message please refer to the first device's timer for receiving a response message and the second device's timer for sending a response message.
  • the implementation of the time interval of the timer will not be described again here.
  • the second device may respond to the multiple PDU data packets. Perform re-assembly to reassemble the multiple PDU data packets into SDU data packets and send them to the application layer of the second device.
  • FIG. 6 is a schematic flowchart of a method for determining the connection status of a device provided by another embodiment of the present application. As shown in Figure 6, the method may include steps S610 to S680. These steps are described below.
  • step S610 the first device sends a first data packet to the second device, where the first data packet is the last one of multiple PDU data packets obtained by decomposing the SDU data packet.
  • step S620 the first device starts a first timer, and the first timer is used to indicate the time interval during which the first device expects to receive the first response message.
  • the timing length of the first timer is equal to the first time interval, that is, the first device expects to receive the first response message within the first time interval.
  • step S630 after the second device receives the first data packet sent by the first device, and determines that the first data packet is the last one of multiple PDU data packets, the second device performs data reassembly on the multiple data packets and combines them. Reported to the application layer of the second device.
  • step S640 the second device starts a first timer, which is used to indicate a time interval during which the second device expects to send the first response message.
  • the timing duration of the first timer is equal to the first time interval. In some embodiments, the timing duration of the first timer may be less than the first time interval.
  • step S650 the second device sends a first response message to the first device.
  • the first response message is sent within the first time interval.
  • the first response message may be a stand-alone response message.
  • the first response message is an independent response message, it can be considered that the second device side has no other data that needs to be sent to the first device, that is, there is no other message in the message queue of the second device.
  • the second device if there are no other messages in the message queue of the second device and the first timer corresponding to the second device expires, the second device sends an independent response message to the first device when the first timer expires.
  • step S660 when the second device determines that there is no message to be sent in the message queue of the second device, the second device configures the connection between the first device and the second device to an idle connection state.
  • the second device can also start a second timer.
  • the second timer is used to indicate the time interval at which the second device expects to receive a keep-alive message.
  • the keep-alive message may be used to maintain the connection between the first device and the second device.
  • the keep-alive message may be an independent response message.
  • the keep-alive message may also be called keep-alive signaling. That is to say, after the second device sends the first response message to the first device, the second device can start a second timer to limit receipt of the keep-alive message sent by the first device within a time interval corresponding to the second timer.
  • the keep-alive message may refer to a second response message sent by the first device to the second device, and the second response message is used to indicate that the first device has received the first response message.
  • the timing duration of the second timer is equal to the second time interval, and the second time interval is greater than the first time interval.
  • the second time interval may be N times (such as 2 times, 2.5 times, etc.).
  • the second time interval refers to the duration of the timer set by the second device after configuring the connection between the first device and the second device to an idle connection state
  • the first time interval refers to the duration of the timer set by the second device after configuring the connection between the first device and the second device to an idle connection state.
  • the duration of the timer set before the connection of the second device is configured as an idle connection state.
  • the second timer may be the same timer as the first timer, which is not limited in the embodiments of the present application. It should be understood that when the second timer and the first timer are the same timer, the set value of the time interval (i.e. the second timer) after the connection between the first device and the second device is configured as an idle connection state The time interval) may be greater than the set value of the time interval before being configured as the idle connection state (ie, the first time interval).
  • step S670 after the first device receives the first response message sent by the second device, if it confirms that the first response message is an independent response message and there is no message to be sent in the message queue of the first device, the first device
  • the connection between the first device and the second device may be configured as an idle connection state.
  • step S680 the first device starts a second timer, which is used to indicate the time interval at which the first device expects to send a keep-alive message, for example, the time interval at which the second response message is sent.
  • the timing duration of the second timer is equal to the second time interval, and the second time interval is greater than the first time interval.
  • the second time interval may be twice the first time interval.
  • the connection between the first device and the second device enters the idle connection state.
  • the first device and the second device can send keep-alive messages to each other according to the time interval corresponding to the timer after entering the idle connection state to keep the connection alive.
  • Embodiment 2 uses two rounds of response messages (for example, two rounds of independent response messages) to determine that the connection between the first device and the second device has entered the idle connection state, and has higher reliability.
  • FIG. 7 is a schematic flowchart of a method for determining the connection status of a device provided by yet another embodiment of the present application. As shown in Figure 7, the method may include steps S701 to S711. These steps are described below.
  • step S701 the first device sends a first data packet to the second device.
  • the first data packet is the last one of multiple PDU data packets obtained by decomposing the SDU data packet.
  • step S702 the first device starts a first timer, and the first timer is used to indicate the time interval during which the first device expects to receive the first response message.
  • the timing length of the first timer is equal to the first time interval, that is, the first device expects to receive the first response message within the first time interval.
  • step S703 after the second device receives the first data packet sent by the first device, and determines that the first data packet is the last one of multiple PDU data packets, it performs data reassembly on the multiple data packets and combines them. Reported to the application layer of the second device.
  • step S704 the second device starts a first timer, which is used to indicate a time interval during which the second device expects to send the first response message.
  • the timing duration of the first timer is equal to the first time interval. In some embodiments, the timing duration of the first timer may be less than the first time interval.
  • step S705 the second device sends a first response message to the first device.
  • the first response message is sent within the first time interval.
  • the first response message may be a stand-alone response message. In some embodiments, the first response message is sent by the second device to the first device when the first timer expires.
  • the first device after receiving the first response message, can start a timer for sending the response message.
  • the timer is used to indicate the time interval at which the first device expects to send the second response message.
  • the second response message is used to Instruct the first device to confirm receipt of the first response message.
  • the time interval corresponding to the timer for sending the response message may be the first time interval.
  • step S706 when the second device determines that there is no message to be sent in the message queue of the second device, the second device starts a second timer.
  • the second timer is used to indicate the time interval at which the second device expects to receive the second response message.
  • the timing duration of the second timer is equal to the first time interval.
  • the first time interval refers to the duration of the timer set before the second device configures the connection between the first device and the second device to the idle connection state. Timing duration.
  • step S707 the first device sends a second response message to the second device.
  • the first response message is sent within the first time interval.
  • the second response message may be an independent response message.
  • the second response message is sent by the first device to the second device when a timer for sending the second response message expires.
  • step S708 when the first device determines that there is no message to be sent in the message queue of the first device, the first device configures the connection between the first device and the second device to an idle connection state.
  • step S709 the first device starts a third timer.
  • the third timer is used to indicate the time interval at which the first device expects to receive a keep-alive message.
  • the keep-alive message is used to maintain the connection between the first device and the second device. That is to say, after the first device sends the second response message to the second device, the first device can start a third timer to limit receipt of the keep-alive message sent by the second device within a time interval corresponding to the third timer.
  • the keep-alive message may be a third response message, and the third response message is used to indicate that the second device has received the second response message.
  • the timing duration of the third timer is equal to the third time interval, and the third time interval is greater than the first time interval.
  • the third time interval may be N times the first time interval.
  • the third time interval refers to the timing length of the timer set after the first device configures the connection between the first device and the second device to an idle connection state
  • the first time interval refers to the time period when the first device configures the connection between the first device and the second device to be in an idle connection state.
  • the duration of the timer set before the connection of the second device is configured as an idle connection state.
  • the third timer may be the same timer as the first timer, which is not limited in the embodiments of the present application. It should be understood that when the third timer and the first timer are the same timer, the set value of the time interval (i.e. the third timer) after the connection between the first device and the second device is configured as an idle connection state The time interval) may be greater than the set value of the time interval before being configured as the idle connection state (ie, the first time interval).
  • the third time interval may be equal to the second time interval, indicating that for the first device or the second device, the time interval at which the response message is expected to be sent is consistent with the time interval at which the response message is expected to be received.
  • step S710 when the second device determines that there is no message to be sent in the message queue of the second device, the second device configures the connection between the first device and the second device to an idle connection state.
  • step S711 the second device starts a third timer, which is used to indicate a time interval during which the second device expects to send a keep-alive message.
  • the timing duration of the third timer is equal to the third time interval, and the third time interval is greater than the first time interval.
  • the third time interval may be twice the first time interval.
  • the connection between the first device and the second device enters the idle connection state.
  • the first device and the second device can send keep-alive messages to each other according to the time interval corresponding to the timer after entering the idle connection state to keep the connection alive.
  • FIG. 8 is a schematic flowchart of a method for determining the connection status of a device provided by yet another embodiment of the present application. As shown in Figure 8, the method may include steps S810 to S870. These steps are described below.
  • step S810 the first device sends a first data packet to the second device, where the first data packet is the last one of multiple PDU data packets obtained by decomposing the SDU data packet.
  • step S820 the first device checks whether there is a message to be sent in the message queue of the first device.
  • step S830 when there is no message to be sent in the message queue of the first device, the first device configures the connection between the first device and the second device as an idle connection state.
  • step S840 the first device starts a fourth timer, and the fourth timer is used to indicate a time interval during which the first device expects to receive a keep-alive message.
  • the keep-alive message may be a first response message.
  • the timing duration of the fourth timer is equal to the fourth time interval.
  • the fourth time interval is greater than the fifth time interval.
  • the fourth time interval may be N times the fifth time interval.
  • the fourth time interval refers to the duration of the timer set after the first device configures the connection between the first device and the second device to an idle connection state
  • the fifth time interval refers to the time period when the first device configures the connection between the first device and the second device to be in an idle connection state.
  • the duration of the timer set before the connection of the second device is configured as an idle connection state.
  • the fourth timer and the fifth timer may be the same timer, which is not limited in the embodiments of the present application. It should be understood that when the fourth timer and the fifth timer are the same timer, the set value of the time interval (i.e. the fourth timer) after the connection between the first device and the second device is configured as an idle connection state The time interval) may be greater than the set value of the time interval before being configured as the idle connection state (ie, the fifth time interval).
  • step S850 after the second device receives the first data packet sent by the first device, and determines that the first data packet is the last one of multiple PDU data packets, it performs data reassembly on the multiple data packets and combines them. Reported to the application layer of the second device.
  • step S860 the second device sends a first response message to the first device.
  • the first response message is sent within the fourth time interval.
  • the first response message may be a stand-alone response message. In some embodiments, the first response message is sent by the second device to the first device when a timer for sending the first response message expires.
  • step S870 when it is determined that there is no message to be sent in the message queue of the second device, the second device configures the connection between the first device and the second device to an idle connection state.
  • the second device may also start a fourth timer.
  • the fourth timer is used to indicate a time interval during which the second device expects to receive a keep-alive message.
  • the keep-alive message may be a second response message, and the second response message is used to instruct the first device to confirm receipt of the first response message.
  • the timing duration of the fourth timer is equal to the fourth time interval, and the fourth time interval is greater than the fifth time interval.
  • the fourth time interval may be twice the fifth time interval.
  • the fourth time interval refers to the duration of the timer set by the second device after configuring the connection between the first device and the second device to an idle connection state
  • the fifth time interval refers to the duration of the timer set by the second device after configuring the connection between the first device and the second device to an idle connection state.
  • the duration of the timer set before the connection of the second device is configured as an idle connection state.
  • the connection between the first device and the second device enters the idle connection state.
  • the first device and the second device can send keep-alive messages to each other according to the time interval corresponding to the timer after entering the idle connection state to keep the connection alive.
  • FIG. 9 is a schematic structural diagram of a device for determining the connection status of a device according to an embodiment of the present application.
  • the device 900 shown in FIG. 9 may include a first sending module 910 and a configuration module 920.
  • the first sending module 910 may be configured to send the first data packet to the second device when a connection is established between the first device and the second device.
  • the configuration module 920 may be configured to configure the connection between the first device and the second device to an idle connection state when a first condition is met, and the first condition is associated with one or more of the following information: Association: the identification of the first data packet; the status of the message queue of the first device; and the message type of the first response message, the first response message is used to instruct the second device to confirm receipt of the first response message.
  • Association the identification of the first data packet; the status of the message queue of the first device; and the message type of the first response message, the first response message is used to instruct the second device to confirm receipt of the first response message.
  • One data packet One data packet.
  • the first condition includes one or more of the following conditions: the identifier of the first data packet indicates that the first data packet is the last of multiple protocol data unit PDU data packets, wherein the The plurality of PDU data packets are multiple PDU data packets obtained by decomposing the SDU data packet of the first service data unit; there is no message to be sent in the message queue of the first device; and the message type of the first response message is Independent response message.
  • the first data packet is the last one of the plurality of PDU data packets
  • the device further includes: a first starting module for starting a first timer, the first timer being used to indicate the first The time interval at which the device expects to receive the first response message, the timing length of the first timer is equal to the first time interval; the receiving module is configured to receive the first response message sent by the second device, the The first response message is received within said first time interval.
  • the configuration module is further configured to: when the first response message is an independent response message and there is no message to be sent in the message queue of the first device, connect the first device to the message queue.
  • the connection configuration of the second device is an idle connection state.
  • the apparatus 900 further includes: a second starting module, configured to start a second timer, the second timer being used to indicate the time interval at which the first device expects to send a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the second timer is equal to a second time interval, and the second time interval is greater than the first time interval.
  • a second starting module configured to start a second timer, the second timer being used to indicate the time interval at which the first device expects to send a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the second timer is equal to a second time interval, and the second time interval is greater than the first time interval.
  • the second time interval is N times the first time interval, where N ⁇ 2.
  • the apparatus 900 further includes: a second sending module, configured to send a second response message to the second device, where the second response message is used to instruct the first device to confirm receipt of the first response message. .
  • the configuration module is further configured to: configure the connection between the first device and the second device to an idle connection state when there is no message to be sent in the message queue of the first device.
  • the apparatus 900 further includes: a third starting module, configured to start a third timer, the third timer being used to indicate the time interval during which the first device expects to receive a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the third timer is equal to a third time interval, and the third time interval is greater than the first time interval.
  • a third starting module configured to start a third timer, the third timer being used to indicate the time interval during which the first device expects to receive a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the third timer is equal to a third time interval, and the third time interval is greater than the first time interval.
  • the third time interval is N times the first time interval, where N ⁇ 2.
  • the first data packet is the last one of multiple PDU data packets
  • the configuration module is further configured to: when the first device determines that there is no message to be sent in the message queue of the first device. Next, configure the connection between the first device and the second device to an idle connection state.
  • the apparatus 900 further includes: a fourth starting module, configured to start a fourth timer, the fourth timer being used to indicate the time interval at which the first device expects to receive a keep-alive message, the keep-alive message being To maintain the connection between the first device and the second device; wherein the timing duration of the fourth timer is equal to a fourth time interval, the fourth time interval is greater than the fifth time interval, and the fourth time interval is greater than the fifth time interval.
  • the five time interval is a time interval during which the first device expects to receive a response message before configuring the connection between the first device and the second device to an idle connection state.
  • the fourth time interval is N times the fifth time interval, where N ⁇ 2.
  • connection between the first device and the second device is a Bluetooth Low Energy BLE connection.
  • Figure 10 is a schematic structural diagram of a device for determining the connection status of a device provided by another embodiment of the present application.
  • the device 1000 shown in FIG. 10 may include a first receiving module 1010 and a configuration module 1020.
  • the first receiving module 1010 may be configured to receive the first data packet sent by the first device when a connection is established between the first device and the second device.
  • the configuration module 1020 may be configured to configure the connection between the first device and the second device to an idle connection state when a first condition is satisfied, and the first condition is associated with one or more of the following information: Association: the identification of the first data packet; the status of the message queue of the second device; and the message type of the first response message, the first response message is used to instruct the second device to confirm receipt of the third One data packet.
  • the first condition includes one or more of the following conditions: the identifier of the first data packet indicates that the first data packet is the last of multiple protocol data unit PDU data packets, wherein the The plurality of PDU data packets are multiple PDU data packets obtained by decomposing the SDU data packet of the first service data unit; there is no message to be sent in the message queue of the second device; and the message type of the first response message is Independent response message.
  • the first data packet is the last one of the plurality of PDU data packets.
  • the apparatus 1000 further includes: a first starting module for starting a first timer, the first timer being used to instruct the second device The time interval at which the first response message is expected to be sent, the timing length of the first timer is equal to the first time interval; the second device sends the first response message to the first device, the first The response message is sent within the first time interval.
  • the configuration module is further configured to: when the first response message is an independent response message and there is no message to be sent in the message queue of the second device, connect the first device to the message queue of the second device.
  • the connection configuration of the second device is an idle connection state.
  • the apparatus 1000 further includes: a second starting module, configured to start a second timer, the second timer being used to indicate the time interval during which the second device expects to receive a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the second timer is equal to a second time interval, and the second time interval is greater than the first time interval.
  • a second starting module configured to start a second timer, the second timer being used to indicate the time interval during which the second device expects to receive a keep-alive message; wherein the keep-alive message The message is used to maintain the connection between the first device and the second device, the timing duration of the second timer is equal to a second time interval, and the second time interval is greater than the first time interval.
  • the second time interval is N times the first time interval, where N ⁇ 2.
  • the apparatus 1000 further includes: a second receiving module, configured to receive a second response message sent by the first device, where the second response message is used to instruct the first device to confirm receipt of the first response. information.
  • a second receiving module configured to receive a second response message sent by the first device, where the second response message is used to instruct the first device to confirm receipt of the first response. information.
  • the configuration module is further configured to: configure the connection between the first device and the second device to an idle connection state when there is no message to be sent in the message queue of the second device.
  • the apparatus 1000 further includes: a third starting module, configured to start a third timer, the third timer being used to indicate the time interval at which the second device expects to send a keep-alive message; wherein, the keep-alive The message is used to maintain the connection between the first device and the second device, the timing duration of the third timer is equal to a third time interval, and the third time interval is greater than the first time interval.
  • a third starting module configured to start a third timer, the third timer being used to indicate the time interval at which the second device expects to send a keep-alive message; wherein, the keep-alive The message is used to maintain the connection between the first device and the second device, the timing duration of the third timer is equal to a third time interval, and the third time interval is greater than the first time interval.
  • the third time interval is N times the first time interval, where N ⁇ 2.
  • the first data packet is the last one of multiple PDU data packets
  • the configuration module is further configured to: when the second device determines that there is no message to be sent in the message queue of the second device. Next, configure the connection between the first device and the second device to an idle connection state.
  • the apparatus 1000 further includes: a fourth starting module, configured to start a fourth timer, the fourth timer being used to indicate the time interval at which the second device expects to receive a keep-alive message, the keep-alive message being To maintain the connection between the first device and the second device; wherein the timing duration of the fourth timer is equal to a fourth time interval, the fourth time interval is greater than the fifth time interval, and the fourth time interval is greater than the fifth time interval.
  • the five time interval is a time interval during which the second device expects to receive a response message before configuring the connection between the first device and the second device to an idle connection state.
  • the fourth time interval is N times the fifth time interval, where N ⁇ 2.
  • connection between the first device and the second device is a Bluetooth Low Energy BLE connection.
  • Figure 11 is a schematic structural diagram of a communication device according to an embodiment of the present application.
  • the dashed line in Figure 11 indicates that the unit or module is optional.
  • the device 1100 can be used to implement the method described in the above method embodiment.
  • Device 1100 may be a chip, terminal device or network device.
  • Apparatus 1100 may include one or more processors 1110.
  • the processor 1110 can support the device 1100 to implement the method described in the foregoing method embodiments.
  • the processor 1110 may be a general-purpose processor or a special-purpose processor.
  • the processor may be a central processing unit (CPU).
  • the processor can also be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • Apparatus 1100 may also include one or more memories 1120.
  • the memory 1120 stores a program, which can be executed by the processor 1110, so that the processor 1110 executes the method described in the foregoing method embodiment.
  • the memory 1120 may be independent of the processor 1110 or integrated in the processor 1110 .
  • Device 1100 may also include a transceiver 1130.
  • Processor 1110 may communicate with other devices or chips through transceiver 1130.
  • the processor 1110 can transmit and receive data with other devices or chips through the transceiver 1130 .
  • An embodiment of the present application also provides a computer-readable storage medium for storing a program.
  • the computer-readable storage medium can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product includes a program.
  • the computer program product can be applied in the terminal or network device provided by the embodiments of the present application, and the program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • An embodiment of the present application also provides a computer program.
  • the computer program can be applied to the terminal or network device provided by the embodiments of the present application, and the computer program causes the computer to execute the methods performed by the terminal or network device in various embodiments of the present application.
  • the "instruction" mentioned may be a direct instruction, an indirect instruction, or an association relationship.
  • a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association between A and B. relation.
  • B corresponding to A means that B is associated with A, and B can be determined based on A.
  • determining B based on A does not mean determining B only based on A.
  • B can also be determined based on A and/or other information.
  • the term "correspondence” can mean that there is a direct correspondence or indirect correspondence between the two, or it can also mean that there is an association between the two, or it can also mean indicating and being instructed, configuring and being configured, etc. relation.
  • predefinition or “preconfiguration” can be achieved by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including terminal devices and network devices).
  • devices for example, including terminal devices and network devices.
  • predefined can refer to what is defined in the protocol.
  • the "protocol” may refer to a standard protocol in the communication field, which may include, for example, LTE protocol, NR protocol, and related protocols applied in future communication systems. This application does not limit this.
  • the size of the sequence numbers of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its functions and internal logic, and should not be determined by the implementation process of the embodiments of the present application. constitute any limitation.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another, e.g., the computer instructions may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be any available medium that can be read by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVD)) or semiconductor media (e.g., solid state disks (SSD) )wait.
  • magnetic media e.g., floppy disks, hard disks, magnetic tapes
  • optical media e.g., digital video discs (DVD)
  • semiconductor media e.g., solid state disks (SSD)

Landscapes

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

Abstract

本发明提供了一种确定设备的连接状态的方法、装置、芯片和存储介质。该方法包括:在第一设备与第二设备建立有连接的情况下,第一设备向第二设备发送第一数据包(S510);在满足第一条件的情况下,第一设备将第一设备与第二设备的连接配置为空闲连接状态(S520),第一条件与以下信息中的一种或多种关联:第一数据包的标识;第一设备的消息队列的情况;以及第一应答消息的消息类型,第一应答消息用于指示第二设备确认接收第一数据包。本申请实施例中,第一设备和第二设备均可以根据第一条件将通信双方的连接配置为空闲连接状态,使得第一设备和第二设备确定的结果一致,有利于减少因第一设备和第二设备确定的结果不一致而导致的通信失败。

Description

确定设备的连接状态的方法、装置、芯片和存储介质 技术领域
本申请涉及通信技术领域,并且更为具体地,涉及一种确定设备的连接状态的方法、装置、芯片和存储介质。
背景技术
通信设备可以基于彼此之间建立的连接(例如,蓝牙连接)进行数据传输。之后,如果通信双方都没有数据发送,通信双方可以让通信设备之间的连接进入空闲连接状态(idle connection state)。在空闲连接状态下,通信双方可以互相发送保活(keep-alive)消息用于保持连接。然而,通信双方要如何确定通信设备之间的连接进入空闲连接状态,是需要解决的问题。
发明内容
本申请提供一种确定设备的连接状态的方法、装置、芯片和存储介质。下面对本申请涉及的各个方面进行介绍。
第一方面,提供了一种确定设备的连接状态的方法,包括:在第一设备与第二设备建立有连接的情况下,所述第一设备向所述第二设备发送第一数据包;在满足第一条件的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第一设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
第二方面,提供了一种确定设备的连接状态的方法,包括:在第一设备与第二设备建立有连接的情况下,所述第二设备接收所述第一设备发送的第一数据包;在满足第一条件的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第二设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
第三方面,提供了一种确定设备的连接状态的装置,所述装置配置于第一设备,所述装置包括:第一发送模块,用于在第一设备与第二设备建立有连接的情况下,向所述第二设备发送第一数据包;配置模块,用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第一设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
第四方面,提供了一种确定设备的连接状态的装置,所述装置配置于第二设备,所述装置包括:第一接收模块,用于在第一设备与第二设备建立有连接的情况下,接收所述第一设备发送的第一数据包;配置模块,用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第二设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
第五方面,提供了一种通信装置,包括处理器、存储器以及通信接口,所述存储器用于存储一个或多个计算机程序,所述处理器用于调用所述存储器中的计算机程序使得所述通信装置执行第一方面至第二方面的方法中的部分或全部步骤。
第六方面,本申请实施例提供了一种通信系统,该系统包括上述的第一设备和/或第二设备。在另一种可能的设计中,该系统还可以包括本申请实施例提供的方案中与该第一设备或第二设备进行交互的其他设备。
第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序使得通信装置执行上述各个方面的方法中的部分或全部步骤。
第八方面,本申请实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序可操作来使通信装置执行上述各个方面的方法中的部分或全部步骤。在一些实现方式中,该计算机程序产品可以为一个软件安装包。
第九方面,本申请实施例提供了一种芯片,该芯片包括存储器和处理器,处理器可以从存储器中调用并运行计算机程序,以实现上述各个方面的方法中所描述的部分或全部步骤。
本申请实施例中,第一设备和第二设备均可以根据第一条件将通信双方(即第一设备和第二设备)的连接配置为空闲连接状态,使得第一设备和第二设备确定的结果一致,有利于减少因第一设备和第二设备确定的结果不一致而导致的通信失败。
附图说明
图1为可应用本申请实施例的无线通信系统的系统架构示例图。
图2为BLE的协议栈的示例图。
图3为PDU的消息结构的示例图。
图4为GATT客户端和GATT服务端基于接收窗口进行通信的示例图。
图5为本申请一实施例提供的确定设备的连接状态的方法的流程示意图。
图6为本申请另一实施例提供的确定设备的连接状态的方法的流程示意图。
图7为本申请又一实施例提供的确定设备的连接状态的方法的流程示意图。
图8为本申请又一实施例提供的确定设备的连接状态的方法的流程示意图。
图9为本申请一实施例提供的确定设备的连接状态的装置的结构示意图。
图10为本申请另一实施例提供的确定设备的连接状态的装置的结构示意图。
图11为本申请实施例提供的通信装置的示意性结构图。
具体实施方式
通信系统架构
本申请实施例提供的技术方案可以应用于各种通信系统,例如:第五代(5th generation,5G)系统或新无线(new radio,NR)系统、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)系统、非授权频谱上的LTE(LTE-based access to unlicensed spectrum,LTE-U)系统、非授权频谱上的NR(NR-based access to unlicensed spectrum,NR-U)系统、非地面通信网络(non-terrestrial networks,NTN)系统、通用移动通信系统(universal mobile telecommunication system,UMTS)、无线局域网(wireless local area networks,WLAN)系统、蓝牙系统、无线保真(wireless fidelity,Wi-Fi)系统等。本申请提供的技术方案还可以应用于未来的通信系统,如第六代移动通信系统,又如卫星通信系统,等等。下面结合图1,对本申请实施例可应用的无线通信系统进行示例性说明。
图1为可应用于本申请实施例的无线通信系统100的架构示例图。如图1所示,该无线通信系统100可以包括第一设备110和第二设备120。第一设备110和第二设备120均具备无线连接功能。其中,无线连接例如可以为低功耗蓝牙(Bluetooth low energy,BLE)连接、经典蓝牙连接、Wi-Fi连接、点对点(point to point,P2P)连接、Thread连接等。
本申请实施例提供的技术方案可以应用于第一设备110和第二设备120之间建立无线通信连接的场景。
图1示例性地示出了一个第一设备110和一个第二设备120,但本申请实施例对此并不限定。可选地,该无线通信系统100可以包括多个第一设备和/或第二设备,例如,第一设备可以和多个第二设备同时保持连接,以和多个第二设备同时进行通信,例如,第一设备同时和多个第二设备进行数据传输。
在一些实施例中,第一设备110和第二设备120可以从逻辑功能上分为客户端和服务端(或称,服务节点)。客户端例如可以通过其与服务端之间的连接对服务端进行控制,或者,通过其与服务端之间的连接与服务端进行数据交互等。在本申请实施例中,第一设备110可以是客户端,也可以是服务端,对应地,第二设备120可以是服务端,也可以是客户端,本申请实施例对此并不限定。
在一些实施例中,本申请实施例中的第一设备和第二设备可以分别称为第一终端设备和第二终端设备。其中,终端设备也可以称为用户设备(user equipment,UE)、接入终端、用户单元、用户站、移动站、移动台(mobile station,MS)、移动终端(mobile terminal,MT)、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。
本申请实施例中的第一设备和第二设备可以是指向用户提供语音和/或数据连通性的设备,可以用于连接人、物和机,例如具有无线连接功能的手持式设备、车载设备等。示例性地,本申请的实施例中的第一设备和第二设备可以是手机(mobile phone)、平板电脑(Pad)、笔记本电脑、掌上电脑、移动互联网设备(mobile internet device,MID)、可穿戴设备,物联网设备、虚拟现实(virtual reality,VR)设备、增强现实(augmented reality,AR)设备等。
作为示例而非限定,在本申请实施例中,第一设备和/或第二设备可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功 能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。
作为示例而非限定,在本申请实施例中,第一设备和/或第二设备可以是物联网设备。在一些实施例中,物联网设备可以是智能家居设备,例如,物联网设备可以包括智能空调、智能冰箱、洗衣机、电饭煲、扫地机器人等设备。在一些实施例中,物联网设备可以是智能监控设备,例如,物联网设备可以包括监控摄像头、温度传感器、声音传感器等,本申请实施例对此不作具体限定。
本申请实施例中对第一设备和第二设备所处的场景不做限定。示例性地,第一设备和第二设备可以部署在陆地上,包括室内或室外、手持或车载。
应理解,本申请中的通信设备的全部或部分功能也可以通过在硬件上运行的软件功能来实现,或者通过平台(例如云平台)上实例化的虚拟化功能来实现。
为了便于理解,先对本申请实施例涉及的一些相关技术知识进行介绍。以下相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。本申请实施例包括以下内容中的至少部分内容。
协议栈
协议栈可以理解为通过协议对数据进行处理的单元或者模块。协议栈产生的数据经过下层处理后发送,例如应用层的数据可以经过传输层处理后发送。在一些实施例中,协议栈也可以简单理解为通信装置中能使用协议对数据进行处理的单元或模块。
以BLE的协议栈为例,图2为BLE的协议栈的示意图。如图2所示,BLE的协议栈至少包括:应用层,BLE消息传输协议层(BLE message transport protocol,BMTP)和通用属性配置文件(generic attribute profile,GATT)层。
在一些实施例中,BMTP层可以理解为是蓝牙传输协议(Bluetooth transport protocol,BTP)在GATT层之上提供的一个类似TCP的可靠的、面向连接的数据传输层。该BMTP层可以称为应用层和GATT层的中间层。
对于消息的发送方而言,应用层的消息需要传递至下层的GATT层来进行发送,即需要将应用层的服务数据单元(service data unit,SDU)通过GATT层的协议数据单元(protocol data unit,PDU)来进行发送。
在一些实施例中,当应用层的数据需要GATT层传输时,由于SDU数据包的尺寸可能大于或等于PDU数据包的尺寸,需要将应用层的SDU分解为一个或多个GATT PDU来进行发送。这种情况下,BMTP可以将单个SDU数据包分解(或称,拆分)为多个PDU数据包。
在一些实施例中,SDU数据包分解为多个PDU数据包后,每个PDU数据包可以理解为是SDU数据包的一段(segment)。
PDU的消息结构
图3给出了PDU的消息结构(format)的一个示例。如图3所示,PDU消息由一个8位(bit)报头和一个或多个可选字段组成。下面对PDU消息中的各字段进行示例性说明。
H位:H表示握手(handshake)位,对于正常的PDU数据包可以设置为“0”。当设置此位时,可以表示用于建立会话的BTP握手报文。在一些实施例中,用于建立会话的BTP握手报文可以具有不同的报文格式。
M位:M表示管理消息(management message)位,可以用于指示管理操作码(Management Opcode)字段是否存在。例如,M位为1时可以表示Management Opcode字段存在,M位为0时可以表示Management Opcode字段不存在。应该理解,对于一个SDU数据包对应的多个PDU数据包(即,一个SDU数据包分解得到的多个PDU数据包)而言,每个PDU数据包应该将该位设置为相同的值。或者说,一个SDU数据包的所有segment应该将此位设置为相同的值。
A位:A表示确认(acknowledgement)位,可以用于指示该PDU数据包是否是一个应答消息。在一些实施例中,为保证消息的可靠性传输,该位可以始终设置为true,或者始终设置为1,以指示需要一个应答消息。
B位:B表示开始段(beginning segment)位。在一些实施例中,该位设置为1时表示该PDU数据包为SDU数据包的第一段(开始段),设置为0时表示该PDU数据包为SDU数据包除第一段之外的其他段,例如,第二段等中间段、最后一段等。换句话说,在SDU数据包被分解为多个PDU数据包的情况下,该位为1可以表示该PDU数据包为多个PDU数据包中的第一个。
E位:E表示结束段(ending segment)位。在一些实施例中,该位设置为1时表示该PDU数据包为SDU数据包的最后一段(结束段),设置为0时表示该PDU数据包为SDU数据包除最后一段之外的其他段,例如,第一段、第二段等中间段。换句话说,在SDU数据包被分解为多个PDU数据包的情 况下,该位为1可以表示该PDU数据包为多个PDU数据包中的最后一个。
数据包序列号(sequence number):数据包序列号可以用于标识不同的数据包。所有的PDU数据包(BTP报文)都应该携带数据包序列号发送,无论是否包含SDU segment(例如,确认数据包可能没有附加段载荷)。
在一些实施例中,数据包序列号可以定义为一个无符号的8位整数值,该值随数据包发送方发送的每个数据包单调递增1。超过255后进行回绕到0。
在一些实施例中,通信设备之间通过握手建立连接后,数据包发送方发送的第一个数据包的数据包序列号从0开始。
在一些实施例中,对于通信双方而言,数据包序列号应该分别定义。例如,客户端设备(比如,第一设备)完成BTP会话握手后发送的第一个PDU数据包的数据包序列号为0,后续客户端发送的PDU数据包的数据包序列号依次递增1。服务端设备(比如,第二设备)发送的握手响应对应的PDU数据包的数据包序列号为0,后续服务端发送的PDU数据包的数据包序列号依次递增1。
确认序列号(Ack number):确认序列号可以用于指示是否收到了数据包序列号关联的数据包。例如,客户端设备向服务端设备发送的PDU数据包中,确认序列号字段的值指示为1,则表示客户端设备确认接收到了服务端设备发送的数据包序列号为1的数据包。
需要说明的是,数据包序列号和确认序列号的目的均是为了支持通信双方的接收窗口。下面对通信双方的接收窗口进行介绍。
接收窗口(receive window)
由于芯片对设计的限制,处理器的处理能力有限,因此在一些场景(例如,BLE传输的场景)下,可以以PDU为单位,为通信双方分别定义一个接收窗口。该接收窗口的目的是为通信双方启用会话层的流控制。该接收窗口的大小可以表示通信设备可以在没有会话层确认的情况下,能够可靠地接收和存储PDU数据包的数量。例如,第一设备对应的接收窗口的大小为4时,表示第一设备在不进行会话层确认的情况下,能够最多接收4个PDU数据包。在一些实施例中,接收窗口的大小可以用槽位(slot)来表示,例如第一设备对应的接收窗口的大小为4个slot,则第一设备能够最多接收4个PDU数据包。
在一些实施例中,接收窗口的slot可以使用数据包序列号来表示通信设备接收了该数据包序列号所关联的数据包。
在一些实施例中,通信双方都可以使用一个计数器来反映当前接收窗口的大小。当通信设备写入一个数据包时,该计数器减少,当通信设备发送的包被确认时,该计数器增加。
下面以第一设备和第二设备之间建立BLE连接(即,第一设备和第二设备分别为GATT客户端和GATT服务端)为例,对接收窗口进行介绍。
图4为GATT客户端和GATT服务端基于接收窗口进行通信的示例图。如图4所示,在GATT客户端和GATT服务端之间建立有BLE连接的情况下,GATT客户端和GATT服务端可以进行通信。
具体地,GATT客户端可以向GATT服务端发送第一消息,第一消息的数据包序列号为0。GATT服务端收到第一消息后,更新GATT服务端对应的接收窗口,将数据包序列号为0的标识放置入接收窗口。
GATT客户端可以发送第二消息,第二消息的数据包序列号为1。GATT服务端接收第二消息后将对应的数据包序列号为1的标识放置入接收窗口。
GATT服务端发现当前接收窗口仅余2个slot,因此GATT服务端可以向GATT客户端发送一个独立应答(stand-alone ack)消息,该独立应答消息中的确认序列号为最近收到的消息的数据包序列号。例如,目前GATT服务端最近收到的消息为第二消息,其对应的数据包序列号为1,则该独立应答消息中的确认序列号应该为1。作为一个具体示例,该独立应答消息对应的数据包序列号为1,确认序列号为1。
GATT服务端向GATT客户端发送独立应答消息的同时,GATT服务端清空GATT服务端侧的接收窗口。GATT客户端收到独立应答消息之后,更新GATT客户端侧的接收窗口。
之后,GATT客户端发送SDU数据包分解得到的多个PDU数据包中的最后一个PDU数据包,该数据包的数据包序列号为2,且确认序列号为1,其中,该确认序列号为上一步骤中GATT服务端向GATT客户端发送的独立应答消息的数据包序列号,表示收到了上一个GATT服务端发送的独立应答消息。同理GATT服务端收到消息后更新其对应的接收窗口。GATT服务端确定是最后一个PDU数据包后,重组数据包并发送给应用层。
当GATT服务端的发送应答消息的定时器(send-acknowledgement timer)到期后,向GATT客户端发送一个独立应答消息。GATT客户端收到该独立应答消息后同样处理其接收窗口。
之后,如果通信双方都没有数据发送,通信双方可以让通信设备之间的连接进入空闲连接状态。在 空闲连接状态下,通信双方还可以互相发送保活消息(例如,独立应答消息)用于保持连接,该保活消息依然需要符合接收窗口的上述要求。
然而,通信双方要如何确定通信设备之间的连接进入空闲连接状态,是需要解决的问题。如果通信双方对进入空闲连接状态的确定结果不一致,则可能导致通信双方通信失败。
为了解决上述问题,本申请实施例提供一种确定设备的连接状态的方法、装置、芯片和存储介质。下面结合附图,对本申请实施例提供的确定设备的连接状态的方法进行详细描述。
图5为本申请实施例提供的确定设备的连接状态的方法的流程示意图。图5所示的方法是站在第一设备和第二设备交互的角度进行描述的,该第一设备和第二设备例如可以分别是图1所示的第一设备110和第二设备120。
图5的方法可以包括步骤S510和步骤S520,下面对这些步骤进行详细介绍。
在步骤S510,在第一设备与第二设备建立有连接的情况下,第一设备向第二设备发送第一数据包。
本申请实施例对第一设备与第二设备之间的连接的类型不作具体限定。示例性地,第一设备与第二设备之间的通信可以为近距离通信,其之间的连接可以为近距离通信所支持的连接方式。例如,第一设备与第二设备之间的连接类型可以是蓝牙连接(比如,BLE连接、经典蓝牙连接)、Wi-Fi连接、Thread连接等。
本申请实施例中,第一设备为第一数据包的发送端,第二设备为第一数据包的接收端。从逻辑功能划分而言,第一设备可以是客户端,也可以是服务端;对应地,第二设备可以是服务端,也可以是客户端。也就是说,如果第一设备为客户端,则第二设备为服务端;如果第一设备为服务端,则第二设备为客户端。以第一设备与第二设备之间的连接为BLE连接为例,第一设备可以理解为GATT客户端,第二设备可以理解为GATT服务端;或者,第一设备也可以理解为GATT服务端,第二设备可以理解为GATT客户端。
在一些实施例中,第一数据包是指PDU数据包。该第一数据包可以是SDU数据包分解得到的多个PDU数据包中的一个,例如,可以是SDU数据包分解得到的多个PDU数据包中的首个(第一个)数据包,或者可以是多个PDU数据包中的第二个、第三个等中间数据包,又或者可以是多个PDU数据包中的最后一个数据包,本申请实施例对此并不限定。
在一些实施例中,SDU数据包分解得到的多个PDU数据包也可以称为分包序列,第一数据包可以是分包序列中的任意一个数据包。
在步骤S520,在满足第一条件的情况下,第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
空闲连接状态(idle connection state)可以理解为第一设备与第二设备之间保持有连接,该连接目前为空闲状态,即第一设备和第二设备在空闲连接状态下不会有大量数据的传输,可能仅会传输保活信令用于保持第一设备与第二设备之间的连接。或者说,空闲连接状态可以理解为当通信双方(第一设备和第二设备)都没有数据要发送时,保活消息仍然会在每个发送确认间隔中进行交换。以第一设备和第二设备之间为BLE连接为例,BTP会话的任何一方都没有数据要发送时,BTP报文仍然会在每个发送确认间隔中进行交换。
第一设备每次发送一个PDU数据包后,可以根据第一条件确定第一设备与第二设备的连接是否进入空闲连接状态,如果确定第一设备与第二设备的连接进入空闲连接状态,则可以将第一设备与第二设备的连接配置(或称设定,设置等)为空闲连接状态;否则,可以认为第一设备与第二设备的连接为连接状态(connected state)。在一些实施例中,第一设备和第二设备的连接为connected state时,可以认为,第一设备和第二设备之间还有SDU分解得到的PDU数据包待传输。
作为一种实现方式,第一设备根据第一条件确定第一设备与第二设备的连接是否进入空闲连接状态可以是指,第一设备可以判断是否满足第一条件,在满足第一条件的情况下,第一设备可以将第一设备与第二设备的连接配置为空闲连接状态。
第一条件可以与一种或多种信息相关联,本申请实施例对此并不限定。示例性地,第一条件可以与以下信息中的一种或多种关联。
信息1:第一数据包的标识
在一些实施例中,第一数据包的标识可以用于指示第一数据包在分包序列(即,一个SDU数据包分解得到的多个PDU数据包)中的位置。例如,第一数据包的标识可以用于指示第一数据包为多个PDU数据包中的首个、第二个、最后一个等等。
在一些实施例中,第一数据包的标识可以是指第一数据包的结束段(ending segment)位,用于标识第一数据包是否为多个PDU数据包中的最后一个。以图2所示的PDU的消息结构为例,参见图2,第一数据包的标识可以是指E位,当该位设置为1时,可以表示第一数据包为多个PDU数据包中的最 后一个。当该位设置为0时,可以表示第一数据包为多个PDU数据包中的第一个或者中间的某一个。
不过本申请实施例并不限定于此,第一数据包的标识例如还可以包括其他标识,比如第一数据包的数据包序列号等其他标识。
信息2:第一设备的消息队列的情况
考虑到消息队列具有传递不同长度的消息、且消息边界可以不用用户管理的特点,在一些嵌入式设备的任务间可以采用消息队列的方式进行通信。在本申请实施例中,第一设备和第二设备便可以采用消息队列的方式进行通信。
在一些实施例中,第一设备的消息队列中可以有一个或多个待发送的消息。在一些实施例中,第一设备的消息队列中无(没有)待发送的消息。
信息3:第一应答消息的消息类型
一方面考虑到消息传输的可靠性,另一方面考虑到接收窗口的限制,某些通信系统中,消息传输时可以通过应答消息来保证消息传输的可靠性且保证接收窗口可用。基于此,第一设备向第二设备发送第一数据包后,第二设备可以向第一设备发送第一应答消息,该第一应答消息用于指示第二设备确认接收了第一数据包。
第一应答消息的消息类型可以包括多种。示例性地,第一应答消息的消息类型可以包括独立应答(stand-alone ack)消息和捎带应答(piggyback ack)消息。
独立应答消息是指该应答消息中可以仅包含ack数据包,不包含其他数据和载荷,例如第一设备和第二设备之间的BTP包仅包含ack数据包,不包含其他数据和载荷(a stand-alone ack-that is,a BTP packet that contains a packet receipt acknowledgement value but no buffer segment payload)。在一些实施例中,第一设备向第二设备发送第一数据包后,第二设备可以向第一设备发送独立应答消息以指示第二设备收到了第一数据包。
在一些实施例中,独立应答消息也可以理解为是一个PDU数据包,该独立应答消息对应的PDU的消息结构中,可以仅包含8位的报头、可选字段[数据包序列号]和可选字段[确认序列号],而不包含载荷。
捎带应答消息可以理解为是将ack数据包合并至其他数据包中共同发送,换句话说,在发送ack数据包的一方有其他目的需要发送其他数据包的情况下,可以将ack数据包合并进该其他数据包,发送至通信的另一方。例如,第一设备向第二设备发送第一数据包后,第二设备本身还需要向第一设备发送第二数据包,第二设备可以将第一应答消息对应的ack数据包合并至第二数据包后,共同发给第一设备。
对应地,第二设备接收到第一数据包后,也可以根据第一条件确定第一设备与第二设备的连接是否进入空闲连接状态。第二设备根据第一条件确定第一设备与第二设备的连接是否进入空闲连接状态时,第一条件可以包括以下信息中的一种或多种:第一数据包的标识,第二设备的消息队列的情况,以及第一应答消息的消息类型。这些信息与第一设备确定参考的信息类似,关于这些信息的具体描述,可以参见前文对信息1至信息3的描述,此处不再赘述。
本申请实施例中,第一设备和第二设备均可以根据第一条件确定通信双方(即第一设备和第二设备)的连接进入空闲连接状态,使得第一设备和第二设备确定的结果一致,有利于减少因第一设备和第二设备确定的结果不一致而导致的通信失败。
在一些实施例中,第一条件可以包括以下条件中的一种或多种。
条件1:第一数据包的标识指示第一数据包为多个PDU数据包中的最后一个,或者说,第一数据包的标识指示第一数据包为分包序列中的最后一个,该多个PDU数据包或分包序列是第一SDU数据包分解得到的。第一SDU数据包可以理解为是第一设备的应用层对应的任意一个SDU数据包,第一设备需要将该第一SDU数据包经过下层处理后发送给第二设备。
如果第一数据包为多个PDU数据包中的最后一个,则意味着第一数据包发送之后,第一SDU数据包发送完毕,可能短暂时间内第一设备不会向第二设备传输大量数据了。这种情况下,为了节能,可以将第一设备和第二设备之间的连接设定为空闲连接状态。
条件2:第一设备的消息队列中无待发送的消息。第一设备的消息队列中无待发送的消息,则意味着当前时间内第一设备没有需要向第二设备发送的数据。这种情况下,为了节能,可以将第一设备和第二设备之间的连接设定为空闲连接状态。
条件3:第一应答消息的消息类型为独立应答消息。如果第一应答消息的消息类型为独立应答消息,则意味着第二设备当前没有需要向第一设备发送的数据。这种情况下,为了节能,可以将第一设备和第二设备之间的连接设定为空闲连接状态。
应该理解,本申请实施例中,第一条件可以包括上述条件中的任意一个或多个条件。例如,第一条件可以仅包括条件1,即只要第一设备确定第一数据包为多个PDU数据包中的最后一个,则第一设备 可以将第一设备与第二设备的连接配置为空闲连接状态。或者,第一条件可以包括条件1和条件2,即第一设备确定第一数据包为多个PDU数据包中的最后一个,且第一设备本身没有需要向第二设备发送的其他消息了,则第一设备可以将第一设备与第二设备的连接配置为空闲连接状态。又或者,第一条件可以包括条件1、条件2和条件3,即第一设备本身没有需要向第二设备发送的消息了,且第二设备也没有需要向第一设备发送消息的情况下,第一设备可以将第一设备与第二设备的连接配置为空闲连接状态。关于更详细的描述,可以参见后文的实施例1至实施例3。
在一些实施例中,第一设备侧可以分别对应有发送应答消息的定时器以及接收应答消息的定时器,以指示第一设备期望发送应答消息的时间间隔以及期望接收应答消息的时间间隔。
具体地,第一设备发送一条消息后,可以启动接收应答消息的定时器,以指示第一设备期望在该定时器对应的时间间隔内接收到该消息的应答消息。第一设备接收一条消息后,可以启动发送应答消息的定时器,以指示第一设备期望在该定时器对应的时间间隔内发送该消息的应答消息。
对应地,第二设备侧也可以分别对应有发送应答消息的定时器以及接收应答消息的定时器。
在一些实施例中,应答消息发送方对应的发送应答消息的定时器的时间间隔可以与应答消息接收方对应的接收应答消息的定时器的时间间隔相等,以保证应答消息接收方可以在期望的时间内接收到应答消息。不过本申请实施例并不限定于此,在一些实施例中,应答消息发送方对应的发送应答消息的定时器的时间间隔可以小于应答消息接收方对应的接收应答消息的定时器的时间间隔,这样同样可以保证应答消息接收方可以在期望的时间内接收到应答消息。
在一些实施例中,第一设备与第二设备的连接进入空闲连接状态之后,第一设备和第二设备可以相互按照顺序发送保活信令,该保活信令用于第一设备与第二设备之间的连接的保活。可选地,该保活信令可以为应答消息,例如独立应答消息。
在一些实施例中,第一设备与第二设备的连接进入空闲连接状态之后,第一设备与第二设备对应的定时器(包括发送应答消息的定时器和接收应答消息的定时器)对应的时间间隔可以设置的大一些,以降低功耗。
作为一种实现方式,以第一设备的接收应答消息的定时器为例,假设第一设备与第二设备的连接进入空闲连接状态之前,第一设备的接收应答消息的定时器的时间间隔设置为第一时间间隔,那么第一设备与第二设备的连接进入空闲连接状态之后,第一设备的接收应答消息的定时器的时间间隔可以设置为第二时间间隔,其中,第二时间间隔大于第一时间间隔,比如,第二时间间隔可以为第一时间间隔的N(N≥2)倍,在一些实施例中,N可以为正整数。对应地,第二设备的发送应答消息的定时器也可以对应设置的大一些,例如,设置为第二时间间隔。
关于第一设备的发送应答消息的定时器和第二设备的接收应答消息的定时器的时间间隔设置的实现方式,可以参见第一设备的接收应答消息的定时器和第二设备的发送应答消息的定时器的时间间隔的实现方式,此处不再赘述。
在一些实施例中,如果第二设备接收到第一设备发送的第一数据包后,确定第一数据包为多个PDU数据包中的最后一个,第二设备可以对该多个PDU数据包进行重组(re-assemble),将该多个PDU数据包重组为SDU数据包,并发送给第二设备的应用层。
下面结合几个具体实施例对本申请的技术方案的实现流程进行介绍。应该理解,下面实施例中所列举的步骤,仅用于示例,并不用于限定所有步骤必须按照顺序依次执行。也就是说,下面实施例中所列举的步骤,有些步骤是可以不用执行的;或者,有些步骤之间的执行顺序是可以调换的,或者有些步骤可以是同时执行的,本申请对此并不限定。
实施例1:
图6为本申请另一实施例提供的确定设备的连接状态的方法的流程示意图。如图6所示,该方法可以包括步骤S610至步骤S680。下面对这些步骤进行介绍。
在步骤S610,第一设备向第二设备发送第一数据包,该第一数据包为SDU数据包分解得到的多个PDU数据包中的最后一个。
在步骤S620,第一设备启动第一定时器,第一定时器用于指示第一设备期望接收第一应答消息的时间间隔。
第一定时器的定时时长等于第一时间间隔,即第一设备期望在第一时间间隔内接收到第一应答消息。
在步骤S630,第二设备接收到第一设备发送的第一数据包后,在确定第一数据包为多个PDU数据包中的最后一个的情况下,对该多个数据包进行数据重组并上报给第二设备的应用层。
在步骤S640,第二设备启动第一定时器,该第一定时器用于指示第二设备期望发送第一应答消息的时间间隔。在一些实施例中,该第一定时器的定时时长等于第一时间间隔。在一些实施例中,该第一 定时器的定时时长可以小于第一时间间隔。
在步骤S650,第二设备向第一设备发送第一应答消息。该第一应答消息是在第一时间间隔内发送的。
在一些实施例中,第一应答消息可以是独立应答消息。第一应答消息为独立应答消息的情况下,可以认为,第二设备侧暂时没有需要向第一设备发送的其他数据,即第二设备的消息队列中没有其他消息。
在一些实施例中,第二设备的消息队列中没有其他消息,且第二设备对应的第一定时器到期,则第二设备在第一定时器到期时向第一设备发送独立应答消息。
在步骤S660,在第二设备确定第二设备的消息队列中无待发送的消息的情况下,第二设备将第一设备与第二设备的连接配置为空闲连接状态。
进一步地,第二设备将第一设备与第二设备的连接配置为空闲连接状态之后,第二设备还可以启动第二定时器。第二定时器用于指示第二设备期望接收保活消息的时间间隔。
保活消息可以用于保持所述第一设备与所述第二设备之间的连接,例如保活消息可以是独立应答消息。在一些实施例中,保活消息也可以称为保活信令。也就是说,第二设备向第一设备发送第一应答消息后,第二设备可以启动第二定时器来限定在第二定时器对应的时间间隔内接收到第一设备发送的保活消息。在一些实施例中,保活消息可以是指第一设备向第二设备发送的第二应答消息,该第二应答消息用于指示第一设备接收了第一应答消息。在一些实施例中,第二定时器的定时时长等于第二时间间隔,该第二时间间隔大于第一时间间隔,例如,第二时间间隔可以为第一时间间隔的N倍(如2倍、2.5倍等)。其中,第二时间间隔是指第二设备将第一设备与第二设备的连接配置为空闲连接状态后设置的定时器的定时时长,而第一时间间隔是指第二设备将第一设备与第二设备的连接配置为空闲连接状态之前设置的定时器的定时时长。
在一些实施例中,第二定时器可以与第一定时器为同一个定时器,本申请实施例对此并不限定。应该理解,第二定时器和第一定时器为同一个定时器时,该定时器在第一设备与第二设备的连接被配置为空闲连接状态之后,时间间隔的设定值(即第二时间间隔)可以大于被配置为空闲连接状态之前的时间间隔的设定值(即第一时间间隔)。
在步骤S670,第一设备接收到第二设备发送的第一应答消息后,如果确认该第一应答消息为独立应答消息,且第一设备的消息队列中无待发送的消息,则第一设备可以将第一设备与第二设备的连接配置为空闲连接状态。
在步骤S680,第一设备启动第二定时器,该第二定时器用于指示第一设备期望发送保活消息的时间间隔,例如,发送第二应答消息的时间间隔。
在一些实施例中,第二定时器的定时时长等于第二时间间隔,该第二时间间隔大于第一时间间隔,例如,第二时间间隔可以为第一时间间隔的2倍。
至此,第一设备和第二设备的连接进入空闲连接状态,第一设备和第二设备可以按照进入空闲连接状态后的定时器对应的时间间隔,互相发送保活消息用于连接的保活。
实施例2:
与实施例1相比,实施例2提供的技术方案通过两轮应答消息(例如,两轮独立应答消息)来确定第一设备与第二设备的连接进入空闲连接状态,可靠性更高。
图7为本申请又一实施例提供的确定设备的连接状态的方法的流程示意图。如图7所示,该方法可以包括步骤S701至步骤S711。下面对这些步骤进行介绍。
在步骤S701,第一设备向第二设备发送第一数据包,该第一数据包为SDU数据包分解得到的多个PDU数据包中的最后一个。
在步骤S702,第一设备启动第一定时器,第一定时器用于指示第一设备期望接收第一应答消息的时间间隔。
第一定时器的定时时长等于第一时间间隔,即第一设备期望在第一时间间隔内接收到第一应答消息。
在步骤S703,第二设备接收到第一设备发送的第一数据包后,在确定第一数据包为多个PDU数据包中的最后一个的情况下,对该多个数据包进行数据重组并上报给第二设备的应用层。
在步骤S704,第二设备启动第一定时器,该第一定时器用于指示第二设备期望发送第一应答消息的时间间隔。在一些实施例中,该第一定时器的定时时长等于第一时间间隔。在一些实施例中,该第一定时器的定时时长可以小于第一时间间隔。
在步骤S705,第二设备向第一设备发送第一应答消息。该第一应答消息是在第一时间间隔内发送的。
在一些实施例中,第一应答消息可以是独立应答消息。在一些实施例中,第一应答消息是第二设备 在第一定时器到期时向第一设备发送的。
在一些实施例中,第一设备接收到第一应答消息后,可以启动发送应答消息的定时器,该定时器用于指示第一设备期望发送第二应答消息的时间间隔,第二应答消息用于指示第一设备确认接收第一应答消息。
在一些实施例中,该发送应答消息的定时器对应时间间隔可以为第一时间间隔。
在步骤S706,在第二设备确定第二设备的消息队列中无待发送的消息的情况下,第二设备启动第二定时器。第二定时器用于指示第二设备期望接收第二应答消息的时间间隔。
在一些实施例中,第二定时器的定时时长等于第一时间间隔,该第一时间间隔是指第二设备将第一设备与第二设备的连接配置为空闲连接状态之前设置的定时器的定时时长。
在步骤S707,第一设备向第二设备发送第二应答消息。该第一应答消息是在第一时间间隔内发送的。
在一些实施例中,第二应答消息可以是独立应答消息。在一些实施例中,第二应答消息是第一设备在发送第二应答消息的定时器到期时向第二设备发送的。
在步骤S708,在第一设备确定第一设备的消息队列中无待发送的消息的情况下,第一设备将第一设备与第二设备的连接配置为空闲连接状态。
在步骤S709,第一设备启动第三定时器。第三定时器用于指示第一设备期望接收保活消息的时间间隔。
该保活消息用于保持第一设备与第二设备之间的连接。也就是说,第一设备向第二设备发送第二应答消息后,第一设备可以启动第三定时器来限定在第三定时器对应的时间间隔内接收到第二设备发送的保活消息。例如,该保活消息可以为第三应答消息,该第三应答消息用于指示第二设备接收了第二应答消息。
在一些实施例中,第三定时器的定时时长等于第三时间间隔,该第三时间间隔大于第一时间间隔,例如,第三时间间隔可以为第一时间间隔的N倍。其中,第三时间间隔是指第一设备将第一设备与第二设备的连接配置为空闲连接状态后设置的定时器的定时时长,而第一时间间隔是指第一设备将第一设备与第二设备的连接配置为空闲连接状态之前设置的定时器的定时时长。
在一些实施例中,第三定时器可以与第一定时器为同一个定时器,本申请实施例对此并不限定。应该理解,第三定时器和第一定时器为同一个定时器时,该定时器在第一设备与第二设备的连接被配置为空闲连接状态之后,时间间隔的设定值(即第三时间间隔)可以大于被配置为空闲连接状态之前的时间间隔的设定值(即第一时间间隔)。
在一些实施例中,第三时间间隔可以等于第二时间间隔,表示对于第一设备或者第二设备而言,其期望发送应答消息的时间间隔和期望接收应答消息的时间间隔是一致的。
在步骤S710,第二设备在确定第二设备的消息队列中无待发送的消息的情况下,第二设备将第一设备与第二设备的连接配置为空闲连接状态。
在步骤S711,第二设备启动第三定时器,该第三定时器用于指示第二设备期望发送保活消息的时间间隔。
在一些实施例中,第三定时器的定时时长等于第三时间间隔,该第三时间间隔大于第一时间间隔,例如,第三时间间隔可以为第一时间间隔的2倍。
至此,第一设备和第二设备的连接进入空闲连接状态,第一设备和第二设备可以按照进入空闲连接状态后的定时器对应的时间间隔,互相发送保活消息用于连接的保活。
实施例3:
图8为本申请又一实施例提供的确定设备的连接状态的方法的流程示意图。如图8所示,该方法可以包括步骤S810至步骤S870。下面对这些步骤进行介绍。
在步骤S810,第一设备向第二设备发送第一数据包,该第一数据包为SDU数据包分解得到的多个PDU数据包中的最后一个。
在步骤S820,第一设备检查第一设备的消息队列中是否有待发送的消息。
在步骤S830,在第一设备的消息队列中无待发送的消息的情况下,第一设备将第一设备与第二设备的连接配置为空闲连接状态。
在步骤S840,第一设备启动第四定时器,第四定时器用于指示第一设备期望接收保活消息的时间间隔。例如,该保活消息可以为第一应答消息。
在一些实施例中,第四定时器的定时时长等于第四时间间隔。第四时间间隔大于第五时间间隔,例如,第四时间间隔可以为第五时间间隔的N倍。其中,第四时间间隔是指第一设备将第一设备与第二设备的连接配置为空闲连接状态后设置的定时器的定时时长,而第五时间间隔是指第一设备将第一设 备与第二设备的连接配置为空闲连接状态之前设置的定时器的定时时长。
在一些实施例中,第四定时器可以与第五定时器为同一个定时器,本申请实施例对此并不限定。应该理解,第四定时器和第五定时器为同一个定时器时,该定时器在第一设备与第二设备的连接被配置为空闲连接状态之后,时间间隔的设定值(即第四时间间隔)可以大于被配置为空闲连接状态之前的时间间隔的设定值(即第五时间间隔)。
在步骤S850,第二设备接收到第一设备发送的第一数据包后,在确定第一数据包为多个PDU数据包中的最后一个的情况下,对该多个数据包进行数据重组并上报给第二设备的应用层。
在步骤S860,第二设备向第一设备发送第一应答消息。该第一应答消息是在第四时间间隔内发送的。
在一些实施例中,第一应答消息可以是独立应答消息。在一些实施例中,第一应答消息是第二设备在发送第一应答消息的定时器到期时向第一设备发送的。
在步骤S870,在确定第二设备的消息队列中无待发送的消息的情况下,第二设备将第一设备与第二设备的连接配置为空闲连接状态。
进一步地,第二设备将第一设备与第二设备的连接配置为空闲连接状态之后,第二设备还可以启动第四定时器。第四定时器用于指示第二设备期望接收保活消息的时间间隔。例如,该保活消息可以为第二应答消息,第二应答消息用于指示第一设备确认接收第一应答消息。
在一些实施例中,第四定时器的定时时长等于第四时间间隔,该第四时间间隔大于第五时间间隔,例如,第四时间间隔可以为第五时间间隔的2倍。其中,第四时间间隔是指第二设备将第一设备与第二设备的连接配置为空闲连接状态后设置的定时器的定时时长,而第五时间间隔是指第二设备将第一设备与第二设备的连接配置为空闲连接状态之前设置的定时器的定时时长。
至此,第一设备和第二设备的连接进入空闲连接状态,第一设备和第二设备可以按照进入空闲连接状态后的定时器对应的时间间隔,互相发送保活消息用于连接的保活。
上文结合图1至图8,详细描述了本申请的方法实施例,下面结合图9至图11,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。
图9为本申请一实施例提供的确定设备的连接状态的装置结构示意图。图9所示的装置900可以包括第一发送模块910和配置模块920。
第一发送模块910可以用于在第一设备与第二设备建立有连接的情况下,向所述第二设备发送第一数据包。
配置模块920可以用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第一设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
可选地,第一条件包括以下条件中的一种或多种:所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;所述第一设备的消息队列中无待发送的消息;以及所述第一应答消息的消息类型为独立应答消息。
可选地,第一数据包为多个PDU数据包中的最后一个,所述装置还包括:第一启动模块,用于启动第一定时器,所述第一定时器用于指示所述第一设备期望接收所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;接收模块,用于接收所述第二设备发送的所述第一应答消息,所述第一应答消息是在所述第一时间间隔内接收的。
可选地,配置模块进一步用于:在所述第一应答消息为独立应答消息,且所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置900还包括:第二启动模块,用于启动第二定时器,所述第二定时器用于指示所述第一设备期望发送保活消息的时间间隔;其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
可选地,第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
可选地,装置900还包括:第二发送模块,用于向所述第二设备发送第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
可选地,配置模块进一步用于:在所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置900还包括:第三启动模块,用于启动第三定时器,所述第三定时器用于指示所述第 一设备期望接收保活消息的时间间隔;其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
可选地,第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
可选地,第一数据包为多个PDU数据包中的最后一个,所述配置模块进一步用于:在所述第一设备确定所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置900还包括:第四启动模块,用于启动第四定时器,所述第四定时器用于指示所述第一设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
可选地,第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
可选地,第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
图10为本申请另一实施例提供的确定设备的连接状态的装置的结构示意图。图10所示的装置1000可以包括第一接收模块1010和配置模块1020。
第一接收模块1010可以用于在第一设备与第二设备建立有连接的情况下,接收所述第一设备发送的第一数据包。
配置模块1020可以用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:所述第一数据包的标识;所述第二设备的消息队列的情况;以及第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
可选地,第一条件包括以下条件中的一种或多种:所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;所述第二设备的消息队列中无待发送的消息;以及所述第一应答消息的消息类型为独立应答消息。
可选地,第一数据包为多个PDU数据包中的最后一个,装置1000还包括:第一启动模块,用于启动第一定时器,所述第一定时器用于指示所述第二设备期望发送所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;所述第二设备向所述第一设备发送所述第一应答消息,所述第一应答消息是在所述第一时间间隔内发送的。
可选地,配置模块进一步用于:在所述第一应答消息为独立应答消息,且所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置1000还包括:第二启动模块,用于启动第二定时器,所述第二定时器用于指示所述第二设备期望接收保活消息的时间间隔;其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
可选地,第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
可选地,装置1000还包括:第二接收模块,用于接收所述第一设备发送的第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
可选地,配置模块进一步用于:在所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置1000还包括:第三启动模块,用于启动第三定时器,所述第三定时器用于指示所述第二设备期望发送保活消息的时间间隔;其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
可选地,第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
可选地,第一数据包为多个PDU数据包中的最后一个,所述配置模块进一步用于:在所述第二设备确定所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
可选地,装置1000还包括:第四启动模块,用于启动第四定时器,所述第四定时器用于指示所述第二设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
可选地,第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
可选地,第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
图11是本申请实施例的通信装置的示意性结构图。图11中的虚线表示该单元或模块为可选的。该装置1100可用于实现上述方法实施例中描述的方法。装置1100可以是芯片、终端设备或网络设备。
装置1100可以包括一个或多个处理器1110。该处理器1110可支持装置1100实现前文方法实施例所描述的方法。该处理器1110可以是通用处理器或者专用处理器。例如,该处理器可以为中央处理单元(central processing unit,CPU)。或者,该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
装置1100还可以包括一个或多个存储器1120。存储器1120上存储有程序,该程序可以被处理器1110执行,使得处理器1110执行前文方法实施例所描述的方法。存储器1120可以独立于处理器1110也可以集成在处理器1110中。
装置1100还可以包括收发器1130。处理器1110可以通过收发器1130与其他设备或芯片进行通信。例如,处理器1110可以通过收发器1130与其他设备或芯片进行数据收发。
本申请实施例还提供一种计算机可读存储介质,用于存储程序。该计算机可读存储介质可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
本申请实施例还提供一种计算机程序产品。该计算机程序产品包括程序。该计算机程序产品可应用于本申请实施例提供的终端或网络设备中,并且该程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
本申请实施例还提供一种计算机程序。该计算机程序可应用于本申请实施例提供的终端或网络设备中,并且该计算机程序使得计算机执行本申请各个实施例中的由终端或网络设备执行的方法。
应理解,本申请中术语“系统”和“网络”可以被可互换使用。另外,本申请使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。
在本申请的实施例中,提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。
在本申请实施例中,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。
在本申请实施例中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。
本申请实施例中,“预定义”或“预配置”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。
本申请实施例中,所述“协议”可以指通信领域的标准协议,例如可以包括LTE协议、NR协议以及应用于未来的通信系统中的相关协议,本申请对此不做限定。
本申请实施例中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物 理存在,也可以两个或两个以上单元集成在一个单元中。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够读取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(digital video disc,DVD))或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (63)

  1. 一种确定设备的连接状态的方法,其特征在于,包括:
    在第一设备与第二设备建立有连接的情况下,所述第一设备向所述第二设备发送第一数据包;
    在满足第一条件的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:
    所述第一数据包的标识;
    所述第一设备的消息队列的情况;以及
    第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
  2. 根据权利要求1所述的方法,其特征在于,所述第一条件包括以下条件中的一种或多种:
    所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;
    所述第一设备的消息队列中无待发送的消息;以及
    所述第一应答消息的消息类型为独立应答消息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,在所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前,所述方法还包括:
    所述第一设备启动第一定时器,所述第一定时器用于指示所述第一设备期望接收所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;
    所述第一设备接收所述第二设备发送的所述第一应答消息,所述第一应答消息是在所述第一时间间隔内接收的。
  4. 根据权利要求3所述的方法,其特征在于,所述在满足第一条件的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第一应答消息为独立应答消息,且所述第一设备的消息队列中无待发送的消息的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  5. 根据权利要求3或4所述的方法,其特征在于,在所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第一设备启动第二定时器,所述第二定时器用于指示所述第一设备期望发送保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
  6. 根据权利要求5所述的方法,其特征在于,所述第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  7. 根据权利要求3所述的方法,其特征在于,在所述第一设备接收所述第二设备发送的所述第一应答消息之后,所述方法还包括:
    所述第一设备向所述第二设备发送第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
  8. 根据权利要求7所述的方法,其特征在于,所述在满足第一条件的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第一设备的消息队列中无待发送的消息的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  9. 根据权利要求7或8所述的方法,其特征在于,在所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第一设备启动第三定时器,所述第三定时器用于指示所述第一设备期望接收保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
  10. 根据权利要求9所述的方法,其特征在于,所述第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  11. 根据权利要求1或2所述的方法,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述在满足第一条件的情况下,所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第一设备确定所述第一设备的消息队列中无待发送的消息的情况下,所述第一设备将所述 第一设备与所述第二设备的连接配置为空闲连接状态。
  12. 根据权利要求11所述的方法,其特征在于,在所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第一设备启动第四定时器,所述第四定时器用于指示所述第一设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;
    其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
  13. 根据权利要求12所述的方法,其特征在于,所述第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
  14. 根据权利要求1-13中任一项所述的方法,其特征在于,所述第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
  15. 一种确定设备的连接状态的方法,其特征在于,包括:
    在第一设备与第二设备建立有连接的情况下,所述第二设备接收所述第一设备发送的第一数据包;
    在满足第一条件的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:
    所述第一数据包的标识;
    所述第二设备的消息队列的情况;以及
    第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
  16. 根据权利要求15所述的方法,其特征在于,所述第一条件包括以下条件中的一种或多种:
    所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;
    所述第二设备的消息队列中无待发送的消息;以及
    所述第一应答消息的消息类型为独立应答消息。
  17. 根据权利要求15或16所述的方法,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,在所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前,所述方法还包括:
    所述第二设备启动第一定时器,所述第一定时器用于指示所述第二设备期望发送所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;
    所述第二设备向所述第一设备发送所述第一应答消息,所述第一应答消息是在所述第一时间间隔内发送的。
  18. 根据权利要求17所述的方法,其特征在于,在满足第一条件的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第一应答消息为独立应答消息,且所述第二设备的消息队列中无待发送的消息的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  19. 根据权利要求17或18所述的方法,其特征在于,在所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第二设备启动第二定时器,所述第二定时器用于指示所述第二设备期望接收保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
  20. 根据权利要求19所述的方法,其特征在于,所述第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  21. 根据权利要求17所述的方法,其特征在于,在所述第二设备向所述第一设备发送所述第一应答消息之后,所述方法还包括:
    所述第二设备接收所述第一设备发送的第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
  22. 根据权利要求21所述的方法,其特征在于,在满足第一条件的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第二设备的消息队列中无待发送的消息的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  23. 根据权利要求21或22所述的方法,其特征在于,在所述第二设备将所述第一设备与所述第二 设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第一设备启动第三定时器,所述第三定时器用于指示所述第二设备期望发送保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
  24. 根据权利要求23所述的方法,其特征在于,所述第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  25. 根据权利要求15或16所述的方法,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述在满足第一条件的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态,包括:
    在所述第二设备确定所述第二设备的消息队列中无待发送的消息的情况下,所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  26. 根据权利要求25所述的方法,其特征在于,在所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之后,所述方法还包括:
    所述第二设备启动第四定时器,所述第四定时器用于指示所述第二设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;
    其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
  27. 根据权利要求26所述的方法,其特征在于,所述第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
  28. 根据权利要求15-27中任一项所述的方法,其特征在于,所述第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
  29. 一种确定设备的连接状态的装置,其特征在于,所述装置配置于第一设备,所述装置包括:
    第一发送模块,用于在第一设备与第二设备建立有连接的情况下,向所述第二设备发送第一数据包;
    配置模块,用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:
    所述第一数据包的标识;
    所述第一设备的消息队列的情况;以及
    第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
  30. 根据权利要求29所述的装置,其特征在于,所述第一条件包括以下条件中的一种或多种:
    所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;
    所述第一设备的消息队列中无待发送的消息;以及
    所述第一应答消息的消息类型为独立应答消息。
  31. 根据权利要求29或30所述的装置,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述装置还包括:
    第一启动模块,用于启动第一定时器,所述第一定时器用于指示所述第一设备期望接收所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;
    接收模块,用于接收所述第二设备发送的所述第一应答消息,所述第一应答消息是在所述第一时间间隔内接收的。
  32. 根据权利要求31所述的装置,其特征在于,所述配置模块进一步用于:
    在所述第一应答消息为独立应答消息,且所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  33. 根据权利要求31或32所述的装置,其特征在于,所述装置还包括:
    第二启动模块,用于启动第二定时器,所述第二定时器用于指示所述第一设备期望发送保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
  34. 根据权利要求33所述的装置,其特征在于,所述第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  35. 根据权利要求31所述的装置,其特征在于,所述装置还包括:
    第二发送模块,用于向所述第二设备发送第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
  36. 根据权利要求35所述的装置,其特征在于,所述配置模块进一步用于:
    在所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  37. 根据权利要求35或36所述的装置,其特征在于,所述装置还包括:
    第三启动模块,用于启动第三定时器,所述第三定时器用于指示所述第一设备期望接收保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
  38. 根据权利要求37所述的装置,其特征在于,所述第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  39. 根据权利要求29或30所述的装置,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述配置模块进一步用于:
    在所述第一设备确定所述第一设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  40. 根据权利要求39所述的装置,其特征在于,所述装置还包括:
    第四启动模块,用于启动第四定时器,所述第四定时器用于指示所述第一设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;
    其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第一设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
  41. 根据权利要求40所述的装置,其特征在于,所述第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
  42. 根据权利要求29-41中任一项所述的装置,其特征在于,所述第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
  43. 一种确定设备的连接状态的装置,其特征在于,所述装置配置于第二设备,所述装置包括:
    第一接收模块,用于在第一设备与第二设备建立有连接的情况下,接收所述第一设备发送的第一数据包;
    配置模块,用于在满足第一条件的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态,所述第一条件与以下信息中的一种或多种关联:
    所述第一数据包的标识;
    所述第二设备的消息队列的情况;以及
    第一应答消息的消息类型,所述第一应答消息用于指示所述第二设备确认接收所述第一数据包。
  44. 根据权利要求43所述的装置,其特征在于,所述第一条件包括以下条件中的一种或多种:
    所述第一数据包的标识指示所述第一数据包为多个协议数据单元PDU数据包中的最后一个,其中,所述多个PDU数据包为第一服务数据单元SDU数据包分解得到的多个PDU数据包;
    所述第二设备的消息队列中无待发送的消息;以及
    所述第一应答消息的消息类型为独立应答消息。
  45. 根据权利要求43或44所述的装置,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述装置还包括:
    第一启动模块,用于启动第一定时器,所述第一定时器用于指示所述第二设备期望发送所述第一应答消息的时间间隔,所述第一定时器的定时时长等于第一时间间隔;
    所述第二设备向所述第一设备发送所述第一应答消息,所述第一应答消息是在所述第一时间间隔内发送的。
  46. 根据权利要求45所述的装置,其特征在于,所述配置模块进一步用于:
    在所述第一应答消息为独立应答消息,且所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  47. 根据权利要求45或46所述的装置,其特征在于,所述装置还包括:
    第二启动模块,用于启动第二定时器,所述第二定时器用于指示所述第二设备期望接收保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第二定时器的定时时 长等于第二时间间隔,所述第二时间间隔大于所述第一时间间隔。
  48. 根据权利要求47所述的装置,其特征在于,所述第二时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  49. 根据权利要求45所述的装置,其特征在于,所述装置还包括:
    第二接收模块,用于接收所述第一设备发送的第二应答消息,所述第二应答消息用于指示所述第一设备确认接收所述第一应答消息。
  50. 根据权利要求49所述的装置,其特征在于,所述配置模块进一步用于:
    在所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  51. 根据权利要求49或50所述的装置,其特征在于,所述装置还包括:
    第三启动模块,用于启动第三定时器,所述第三定时器用于指示所述第二设备期望发送保活消息的时间间隔;
    其中,所述保活消息用于保持所述第一设备与所述第二设备之间的连接,所述第三定时器的定时时长等于第三时间间隔,所述第三时间间隔大于所述第一时间间隔。
  52. 根据权利要求51所述的装置,其特征在于,所述第三时间间隔为所述第一时间间隔的N倍,其中,N≥2。
  53. 根据权利要求43或44所述的装置,其特征在于,所述第一数据包为多个PDU数据包中的最后一个,所述配置模块进一步用于:
    在所述第二设备确定所述第二设备的消息队列中无待发送的消息的情况下,将所述第一设备与所述第二设备的连接配置为空闲连接状态。
  54. 根据权利要求53所述的装置,其特征在于,所述装置还包括:
    第四启动模块,用于启动第四定时器,所述第四定时器用于指示所述第二设备期望接收保活消息的时间间隔,所述保活消息用于保持所述第一设备与所述第二设备之间的连接;
    其中,所述第四定时器的定时时长等于第四时间间隔,所述第四时间间隔大于第五时间间隔,所述第五时间间隔为所述第二设备将所述第一设备与所述第二设备的连接配置为空闲连接状态之前期望接收应答消息的时间间隔。
  55. 根据权利要求54所述的装置,其特征在于,所述第四时间间隔为所述第五时间间隔的N倍,其中,N≥2。
  56. 根据权利要求43-55中任一项所述的装置,其特征在于,所述第一设备与所述第二设备的连接为低功耗蓝牙BLE连接。
  57. 一种通信装置,其特征在于,所述通信装置配置于第一设备,所述第一设备包括存储器和处理器,所述存储器用于存储程序,所述处理器用于调用所述存储器中的程序,以使所述第一设备执行如权利要求1-14中任一项所述的方法。
  58. 一种通信装置,其特征在于,所述通信装置配置于第二设备,所述第二设备包括存储器和处理器,所述存储器用于存储程序,所述处理器用于调用所述存储器中的程序,以使所述第二设备执行如权利要求15-28中任一项所述的方法。
  59. 一种装置,其特征在于,包括处理器,用于从存储器中调用程序,以使所述装置执行如权利要求1-28中任一项所述的方法。
  60. 一种芯片,其特征在于,包括处理器,用于从存储器调用程序,使得安装有所述芯片的设备执行如权利要求1-28中任一项所述的方法。
  61. 一种计算机可读存储介质,其特征在于,其上存储有程序,所述程序使得计算机执行如权利要求1-28中任一项所述的方法。
  62. 一种计算机程序产品,其特征在于,包括程序,所述程序使得计算机执行如权利要求1-28中任一项所述的方法。
  63. 一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求1-28中任一项所述的方法。
PCT/CN2022/108837 2022-07-29 2022-07-29 确定设备的连接状态的方法、装置、芯片和存储介质 WO2024020986A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/108837 WO2024020986A1 (zh) 2022-07-29 2022-07-29 确定设备的连接状态的方法、装置、芯片和存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/108837 WO2024020986A1 (zh) 2022-07-29 2022-07-29 确定设备的连接状态的方法、装置、芯片和存储介质

Publications (1)

Publication Number Publication Date
WO2024020986A1 true WO2024020986A1 (zh) 2024-02-01

Family

ID=89705022

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/108837 WO2024020986A1 (zh) 2022-07-29 2022-07-29 确定设备的连接状态的方法、装置、芯片和存储介质

Country Status (1)

Country Link
WO (1) WO2024020986A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312368A (zh) * 2019-08-01 2021-02-02 阿里巴巴集团控股有限公司 数据处理方法、装置、设备和存储介质
CN113133095A (zh) * 2020-01-15 2021-07-16 华为技术有限公司 一种降低移动终端功耗的方法及移动终端
WO2022022394A1 (zh) * 2020-07-29 2022-02-03 华为技术有限公司 一种终端设备的状态指示方法及通信装置
CN114040368A (zh) * 2021-10-25 2022-02-11 中通服中睿科技有限公司 一种基于ble蓝牙的数据传输方法、系统及蓝牙模块
WO2022061778A1 (zh) * 2020-09-25 2022-03-31 北京小米移动软件有限公司 状态控制方法、装置、电子设备和计算机可读存储介质
CN114585059A (zh) * 2020-11-30 2022-06-03 中国移动通信有限公司研究院 终端空闲态处理方法、装置、终端及设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112312368A (zh) * 2019-08-01 2021-02-02 阿里巴巴集团控股有限公司 数据处理方法、装置、设备和存储介质
CN113133095A (zh) * 2020-01-15 2021-07-16 华为技术有限公司 一种降低移动终端功耗的方法及移动终端
WO2022022394A1 (zh) * 2020-07-29 2022-02-03 华为技术有限公司 一种终端设备的状态指示方法及通信装置
WO2022061778A1 (zh) * 2020-09-25 2022-03-31 北京小米移动软件有限公司 状态控制方法、装置、电子设备和计算机可读存储介质
CN114585059A (zh) * 2020-11-30 2022-06-03 中国移动通信有限公司研究院 终端空闲态处理方法、装置、终端及设备
CN114040368A (zh) * 2021-10-25 2022-02-11 中通服中睿科技有限公司 一种基于ble蓝牙的数据传输方法、系统及蓝牙模块

Similar Documents

Publication Publication Date Title
US10681773B2 (en) Real-time relay of wireless communications
EP2803244B1 (en) Methods and apparatus for establishing a tunneled direct link setup (tdls) session between devices in a wireless network
US8537762B2 (en) System and method for optimally transferring data traffic on networks
WO2020134720A1 (zh) 数据传输控制方法及相关产品
WO2020132922A1 (zh) 一种连接蓝牙设备方法及设备
WO2021232568A1 (zh) 无线局域网收发数据的方法、终端和系统及网络接入设备
US20080016248A1 (en) Method and apparatus for time synchronization of parameters
CN110545265B (zh) 一种依赖于att和指示进行适配的数据通信系统及方法
US8848676B1 (en) Apparatus and method for coexistent wireless and bluetooth communication employing interruption of arbitration requests to allocate use of a shared antenna
EP4258710A1 (en) Method for transmitting data in near field, device and system
WO2022205234A1 (zh) 一种通信方法及装置
EP3982611B1 (en) Data processing method and device, and terminal
WO2021036910A1 (zh) 数据传输方法及装置
JP6880719B2 (ja) 通信装置、通信方法、電子時計及びプログラム
WO2024020986A1 (zh) 确定设备的连接状态的方法、装置、芯片和存储介质
US20230269791A1 (en) Networking Method, Networking System, and Electronic Device
WO2023024119A1 (zh) 一种应用于短距无线通信的数据传输方法及通信装置
CN112398943B (zh) 信息互通方法、装置、存储介质及电子设备
WO2022267739A1 (zh) 一种连接探测方法、客户端与服务器
WO2023150997A1 (zh) 通信方法及通信装置
CN114630368B (zh) 控制在多链路上进行数据传输的方法、装置、设备及介质
WO2023020281A1 (zh) 一种通信方法及装置
WO2022027311A1 (zh) 一种通信方法及装置
WO2023030329A1 (zh) 数据传输方法和设备
WO2024067172A1 (zh) 一种数据传输的方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22952441

Country of ref document: EP

Kind code of ref document: A1