WO2021232681A1 - 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质 - Google Patents

耳机与充电盒的通信方法、充电盒、耳机及可读存储介质 Download PDF

Info

Publication number
WO2021232681A1
WO2021232681A1 PCT/CN2020/124861 CN2020124861W WO2021232681A1 WO 2021232681 A1 WO2021232681 A1 WO 2021232681A1 CN 2020124861 W CN2020124861 W CN 2020124861W WO 2021232681 A1 WO2021232681 A1 WO 2021232681A1
Authority
WO
WIPO (PCT)
Prior art keywords
charging box
earphone
headset
data packet
sent
Prior art date
Application number
PCT/CN2020/124861
Other languages
English (en)
French (fr)
Inventor
李涛
Original Assignee
歌尔股份有限公司
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 歌尔股份有限公司 filed Critical 歌尔股份有限公司
Priority to US17/997,304 priority Critical patent/US11889255B2/en
Publication of WO2021232681A1 publication Critical patent/WO2021232681A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1041Mechanical or electronic switches, or control elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1016Earpieces of the intra-aural type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1025Accumulators or arrangements for charging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1008Earpieces of the supra-aural or circum-aural type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/07Applications of wireless loudspeakers or wireless microphones

Definitions

  • This application relates to the field of communication technology, and in particular to a communication method between a headset and a charging box, a charging box, a headset, and a readable storage medium.
  • TWS Truste Wireless Stereo
  • Bluetooth headsets are favored by users due to their compact size and portability.
  • TWS headset products include two parts: a headset and a charging box, and there is a situation where the headset and the charging box communicate.
  • the charging box when communicating between the headset and the charging box, the charging box sends all the data packets that need to be sent to the headset in turn, and the headset receives the data transmission completion signal sent by the charging box, and the headset will send the data packets in sequence. All are sent to the charging box to realize the communication between the headset and the charging box.
  • a notification message must be sent to the receiver in advance so that the receiver is in the state of receiving data.
  • the communication method requires the master-slave relationship between the headset and the charging box to be switched, and since a notification message needs to be sent to the receiver each time a data packet is sent, the communication burden is increased.
  • the main purpose of this application is to provide a communication method for earphones and charging boxes, charging boxes, earphones, and readable storage media, aiming to solve the problem of switching the master-slave relationship between the earphones and the charging box when the earphones communicate with the charging box, and Each time a data packet is sent, a notification message needs to be sent to the receiver, which increases the communication burden.
  • the present application provides a communication method between a headset and a charging box.
  • the communication method between the headset and the charging box includes:
  • the charging box obtains the data packet to be sent from the sending queue
  • the communication method between the headset and the charging box further includes:
  • the sending queue When the sending queue is empty, the data request information is sent to the headset until the reply message that does not contain the data packet is continuously received from the headset.
  • the step of sending data request information to the headset includes:
  • the data request information is sent to the headset after a delay of a preset time.
  • the communication method between the headset and the charging box further includes:
  • the reply message When receiving the reply message of the headset, the reply message is verified, so that when the verification is successful, the step of obtaining the data packet to be sent from the sending queue is executed; when the verification fails, the retransmission contains the The data request information of the data packet to be sent.
  • the communication method between the headset and the charging box includes:
  • the present application also provides a communication method between the headset and the charging box, and the communication method between the headset and the charging box includes:
  • the headset When the headset receives the data request information sent by the charging box, it obtains the data packet from the sending queue;
  • the communication method between the headset and the charging box further includes:
  • the communication method between the headset and the charging box includes:
  • the data request information sent by the charging box is received, the data request information is verified, so that when the verification is successful, the next data packet is obtained from the sending queue, and when the verification fails, the data containing the data is resent The reply message of the package.
  • the communication method between the headset and the charging box further includes:
  • the present application also provides a charging box, the charging box comprising: a memory, a processor, and a communication program between the headset and the charging box stored in the memory and running on the processor When the communication program between the headset and the charging box is executed by the processor, each step of the communication method between the headset and the charging box is implemented.
  • the charging box communicates through a single bus at the bottom of the package.
  • the present application also provides a headset
  • the headset includes: a memory, a processor, and a communication program between the headset and the charging box that is stored in the memory and can run on the processor.
  • the communication program between the earphone and the charging box is executed by the processor, each step of the communication method between the earphone and the charging box as described above is realized.
  • the present application also provides a readable storage medium, characterized in that a communication program between the earphone and the charging box is stored on the computer-readable storage medium, and the communication program between the earphone and the charging box is When the processor is executed, each step of the communication method between the earphone and the charging box as described above is realized.
  • the charging box when data is transmitted between the charging box and the headset, the charging box is always used as the active sender, that is, actively sending data request information to the headset, and the headset is always used as the passive receiver.
  • the reply message After receiving the data request information, the reply message is returned to the charging box, and the communication between the charging box and the earphone is realized through the form of "one question and one answer" between the charging box and the earphone, and there is no need to switch the master-slave of the charging box and the earphone.
  • the relationship can realize the data transmission between the charging box and the earphone, which is simple to realize and reduces the additional communication burden.
  • FIG. 1 is a structural block diagram of a charging box or a headset involved in various embodiments of the communication method between a headset and a charging box of this application;
  • FIG. 2 is a schematic flowchart of a first embodiment of a communication method between a headset and a charging box according to this application;
  • FIG. 3 is a schematic flowchart of a second embodiment of a communication method between a headset and a charging box according to this application;
  • FIG. 4 is a schematic diagram of a flow executed when the sending queue of the charging box is empty in the communication method between the headset and the charging box of this application;
  • FIG. 5 is a schematic flowchart of a third embodiment of a communication method between a headset and a charging box according to this application.
  • module means, “component” or “unit” used to indicate elements is only for the description of the present application, and has no specific meaning in itself. Therefore, “module”, “part” or “unit” can be used in a mixed manner.
  • FIG. 1 is a structural block diagram of a headset or a charging box involved in various embodiments of the communication method between a headset and a charging box of this application.
  • the headset or the charging box may include: a memory 101, a processor 102, and a communication module 3 .
  • the structural block diagram of the charging box or earphones shown in FIG. 1 does not constitute a limitation on the charging box or earphones.
  • the charging box or earphones may include more or less components than those shown in the figure, or a combination of certain components. Some components, or different component arrangements.
  • the memory 101 stores a central control system and a communication program between the headset and the charging box.
  • the processor 102 is the control center of the charging box or the earphone.
  • the processor 102 executes the communication program between the earphone and the charging box stored in the memory 101 to implement the steps of the embodiments of the method for communicating between the earphone and the charging box of the present application.
  • the communication module 3 establishes data communication with the headset through the network protocol (the data communication can be IP communication or Bluetooth channel), so that the charging box sends data request information to the headset, and receives the reply information returned by the headset, thereby realizing charging Data transmission between the box and the headset.
  • the network protocol the data communication can be IP communication or Bluetooth channel
  • the charging box or the headset communicates through a single bus at the bottom of the package.
  • the single-bus technology uses a single data signal line, which transmits both clock and data, and the data transmission is bidirectional. It has the advantages of saving I/O port line resources, simple structure, low cost, and convenient for bus expansion and maintenance. Many advantages.
  • the charging box and the earphone are connected through a data bus.
  • the serial data transmission line (TX) and the serial data receiving line (RX) share a data bus.
  • the charging box and the earphone are sent and received through asynchronous transmission.
  • the transmitter Universal Asynchronous Receiver/Transmitter, UART
  • UART Universal Asynchronous Receiver/Transmitter
  • the charging box obtains the data packet to be sent from the sending queue
  • the headset When the headset receives the data request information sent by the charging box, it obtains the data packet to be sent from the sending queue;
  • the charging box is always the active sender, and the headset is always the passive receiver.
  • the headset is always the passive receiver.
  • the data request information can be actively sent to the headset to obtain the data packet to be sent in the headset.
  • the headset can be actively sent to the headset at a preset time interval. Send data request.
  • the application scenarios for data transmission between the charging box and the headset include at least one of the following: the computer transmits data through the charging box and the headset to upgrade the headset; the computer transmits data through the charging box and the headset to obtain the headset during the production process
  • the left earphone and the right earphone cannot be matched, send the pairing command to the earphone through the charging box to realize the re-pairing of the left earphone and the right earphone; when the earphone malfunctions, you can Send a factory reset command to the headset through the charging box to restart the headset.
  • FIG. 2 is a schematic flowchart of a first embodiment of a communication method between a headset and a charging box in this application.
  • the communication method between the headset and the charging box includes the following steps:
  • Step S10 the charging box obtains the data packet to be sent from the sending queue
  • Step S20 sending data request information including the data packet to be sent to the headset
  • Step S30 When receiving the reply message from the headset, continue to perform step S10 until the sending queue is empty.
  • the sending queue is used to store the data packets to be sent in the charging box, and the charging box obtains the data packets to be sent through the sending queue and sends the data packets to the headset that establishes data communication with the charging box.
  • the data packet to be sent is the data to be sent in the charging box, wherein a data packet to be sent corresponds to a data identification number, and the data identification number can be used to uniquely determine the data packet to be sent corresponding to the data identification number.
  • multiple data to be sent can be divided into one or more data packets to be sent, and data to be sent with the same data identification number can be divided into the same data to be sent by setting a data identification number for the data to be sent Data packet, and use the data identification number as the unique identification of the data packet to be sent.
  • the data identification number can be set for each data packet to be sent according to the sending order, and the data identification number It can be indicated by numbers 1, 2, 3... and n. By setting the data identification number, it can prevent the charging box and the headset from receiving the same data repeatedly due to timeout or data transmission errors due to timeout or data transmission errors. Packet data.
  • the data request information includes but is not limited to the data packet to be sent and verification information.
  • the check information is used to check whether there is a data transmission error in the process of sending the data packet to be sent from the charging box to the earphone.
  • the check information is a cyclic redundancy check code (that is, CRC code).
  • the data request information further includes data verification information, and the data verification information is used to notify the headset whether the data packet needs to be retransmitted, that is, after receiving the reply information containing the data packet sent back by the headset, the data request information
  • the headset can use the data check information in the data request information to determine whether to retransmit the data packet that has been sent last time.
  • the data packet check information contains a check mark, which can be used by the check mark. To determine whether the headset needs to resend the data packet.
  • the charging box when the charging box receives the reply message containing the data packet sent by the headset, the charging box verifies the verification information in the reply message, and the obtained verification result meets the preset verification information, that is, the data packet transmission
  • the headset can be notified to send the data packet to be sent obtained from the sending queue, where the check mark can be marked as "1" to indicate that the data packet is received correctly; similarly, the obtained verification result does not meet the preset Check information, that is, when the data packet is transmitted incorrectly, the headset can be notified to resend the last data packet that has been sent.
  • the check mark can be marked as "0" to indicate that the data packet is received incorrectly. There is no specific limitation on this .
  • the earphone receives the data request information returned by the charging box, and judges to retransmit the last data sent by the data verification information in the data request message.
  • the headset When packing, if the data identification number corresponding to the data packet returned by the headset is 8, when the data verification information indicates that the data packet is received correctly, the headset is notified to send a reply message containing the data packet corresponding to the data identification number 9; When the data verification information indicates that the data packet is received incorrectly, the headset is notified to resend the reply message containing the data packet corresponding to the data identification number 8.
  • the reply information includes but is not limited to data packet confirmation information, data packet and verification information.
  • the data packet confirmation information is used to determine whether the charging box needs to resend the data packet.
  • the data packet confirmation information includes a check mark. The check mark can be used to determine whether the charging box needs to resend the data packet, that is, When the check mark is marked as a data packet reception error, the last data packet that has been sent can be re-sent to the headset. When the check mark is marked as the data packet is received correctly, the data to be sent from the sending queue can be directly sent to the headset. Bag.
  • the setting of the check mark mark adopts a preset check method to verify the check information in the data request information, and the obtained verification result is consistent with Preset check information, that is, when the data packet is transmitted accurately, the check mark can be marked as "1" to indicate that the data packet is received correctly; similarly, when the obtained verification result does not meet the preset check information, that is, When the data packet is transmitted incorrectly, the check mark can be marked as "0" to indicate that the data packet is received incorrectly, and there is no specific limitation on this.
  • a data packet is a data packet to be sent obtained from the transmission queue in the earphone. One data packet corresponds to a data identification number that can uniquely identify the data packet.
  • the concept of the data identification number is the same as the data request information sent by the charging box
  • the data identification number corresponding to the data packet to be sent is similar, and will not be repeated here.
  • the verification information is used to verify whether there is a data transmission error in the process of the headset sending a data packet to the charging box.
  • step S30 when receiving the reply message from the headset, continue to perform the step of obtaining the data packet to be sent from the sending queue.
  • the data packet to be sent can be the data packet that has been sent last time, or according to The sending order obtains the data packets to be sent after the last data packet has been sent.
  • the reply information is verified, so that when the verification is successful, the step of obtaining the data packet to be sent from the sending queue is executed, that is, the data packet to be sent is obtained from the sending queue according to the sending order.
  • step S10 may be executed when the reply message of the earphone is not received within a preset time period.
  • the charging box when data is transmitted between the charging box and the headset, the charging box is always used as the active sender, that is, actively sending data request information to the headset, and the headset is always used as the passive receiver, that is, receiving data.
  • the reply message is returned to the charging box, and the communication between the charging box and the earphone is realized through the form of "one question and one answer" between the charging box and the earphone.
  • the data transmission between the charging box and the earphone can be realized, which is simple to realize and reduces the additional communication burden.
  • the communication between the charging box and the earphone is realized through the form of "one question and one answer" between the charging box and the earphone, which can facilitate the fault-tolerant processing of the data packets with transmission errors during the data transmission process, and obtain accurate data packets in time , That is, when the headset receives the data request message containing the data packet to be sent from the charging box, it verifies the verification information in the data request message. When the verification result is that the data transmission error occurs, it sends a reply message to the charging box to notify The charging box resends the data packet to be sent; in the same way, when the charging box receives the reply message that contains the data packet returned by the headset, it verifies the verification information in the reply. When the verification result is that the data transmission error occurs, you can Immediately send a data request message to the headset to notify the headset to resend the data packet.
  • FIG. 3 is a schematic flowchart of the second embodiment of the communication method between the earphone and the charging box of the present application.
  • the communication method between the headset and the charging box further includes:
  • Step S40 When the sending queue is empty, send data request information to the headset until the headset continues to receive reply information that does not contain the data packet.
  • the charging box When the sending queue is empty, that is, the charging box has no data packets to be sent. Based on the charging box as the active sender and the earphone as the passive receiver, the charging box obtains the data packet to be sent in the earphone by sending data request information to the earphone. , When the headset continues to receive the reply message that does not contain the data packet, it indicates that there is no data packet to be sent in the headset, which prevents the data packet to be sent in the headset from being unable to be sent from the application layer to the chain due to delay The transmission queue of the road layer, resulting in failure to obtain the data packets to be sent in the headset in time.
  • the way to send the data request information to the headset can be to send the data request information directly to the headset, or it can be to send the data request information to the headset at a preset time interval, so as to obtain the headset in time.
  • the continuous reception of the reply message that does not contain the data packet returned by the headset may be the reply message that does not contain the data packet returned by the headset for a preset number of times, or it may be the return message that the headset has not been received continuously for a preset time.
  • the reply message that does not contain the data packet may also be the reply message that does not contain the data packet returned by the headset for a preset number of times within the preset time period, which is not limited.
  • the switching to the charging state is performed. Based on the fact that the sending queue in the charging box is empty, that is, when there is no data packet to be sent in the charging box, when the reply message of the headset does not contain a data packet, that is, there is no data packet to be sent in the sending queue of the headset, indicating charging There is no data packet to be sent between the box and the earphone, and the data transmission communication between the charging box and the earphone can be ended, and then the charging box can be switched to the charging state to charge the earphone.
  • FIG. 4 is a schematic diagram of the process performed when the sending queue of the charging box is empty in the communication method between the headset and the charging box of this application, and step S40 includes:
  • Step S41 When the sending queue is empty, it is judged whether the last reply message of the headset includes a data packet;
  • Step S42 When the last reply message of the headset includes a data packet, directly send data request information to the headset; or,
  • Step S43 When the last reply message of the headset does not contain a data packet, after a preset time delay, the data request message is sent to the headset.
  • the sending queue is empty, that is, there is no data packet to be sent in the charging box, it is further judged whether there is a data packet to be sent in the earphone by judging whether the last reply message of the earphone contains a data packet.
  • a reply message contains a data packet
  • the data request information is sent to the headset.
  • step S43 includes: when the last reply message of the headset does not contain a data packet, after a preset time delay, the data request information is sent to the headset again at a preset time interval, and the data to be sent in the headset is obtained in a timely manner Bag.
  • the charging box since the charging box is always used as the active sender to send data request information to the earphone when data is transmitted between the charging box and the earphone, the earphone is always used as the passive receiver when receiving the data. After the data request information, the reply message is returned to the charging box.
  • the charging box When the sending queue of the charging box is empty, that is, when there are no data packets to be sent in the charging box, in order to obtain the data packets to be sent in the earphones, the charging box actively sends to the earphones Data request information, such as actively sending data request information to the headset at a preset time interval, and data transmission between the charging box and the headset can be realized without switching the master-slave relationship between the charging box and the headset, which is simple to implement and reduces extra The burden of communication.
  • the present application also provides a communication method between the earphone and the charging box.
  • FIG. 5 is a schematic flowchart of the third embodiment of the communication method between the earphone and the charging box in this application.
  • the communication method between the headset and the charging box includes the following steps:
  • Step S50 when the earphone receives the data request information sent by the charging box, it obtains the data packet from the sending queue;
  • Step S60 Send a reply message including the data packet to the charging box.
  • the charging box when used as the active sender, sending data request information containing the data packet to be sent to the earphone.
  • the earphone serves as a passive receiver to receive the data request information sent by the charging box.
  • the data request information sent by the charging box includes but is not limited to data packets to be sent and verification information.
  • the sending queue is used to store the data packets to be sent in the earphones. Based on the data request information sent by the charging box, the earphones obtain the data packets to be sent from the sending queue and send the data packets containing the data packets to the charging box that establishes data communication with the earphones.
  • Reply message includes but is not limited to data packet confirmation information, data packet and verification information.
  • the data packet confirmation information is used to notify the charging box whether the data packet needs to be retransmitted.
  • the data packet confirmation information includes a check mark
  • the check mark can be used to determine whether the charging box needs to retransmit the data packet. For example, when the headset receives the data request information containing the data packet to be sent from the charging box, the headset verifies the verification information in the data request information, and the obtained verification result meets the preset verification information, that is, When the data packet transmission is accurate, the charging box can be notified to send the data packet to be sent obtained from the sending queue, and the check mark can be marked as "1" to indicate that the data packet is received correctly; similarly, when the obtained verification result does not meet the expected Set the check information, that is, when the data packet transmission error, the charging box can be notified to resend the last data packet that has been sent, and the check mark can be marked as "0" to indicate that the data packet is received incorrectly.
  • the data packet is a data packet to be sent obtained from the transmission queue in the earphone, wherein a data packet corresponds to a data identification number that can uniquely identify the data packet.
  • the verification information is used to verify whether there is a data transmission error in the process of the headset sending a data packet to the charging box.
  • the data packet may be damaged or lost, or the data received by the charging box may be damaged or lost.
  • the data packet is not the currently required data packet. Therefore, based on the reply information sent by the headset containing the data packet, the charging box sends the data request information to the headset, and the headset obtains the data packet verification information in the data request information to determine Whether to resend the data packet that has been sent last time.
  • step S50 before obtaining the data packet from the sending queue in step S50, it includes: when the data request information sent by the charging box is received, verifying the data request information, so that when the verification succeeds, the data request information from the sending queue Get the next data packet, that is, get the data packet to be sent after the last data packet has been sent from the sending queue according to the sending order. If the verification fails, resending the reply message containing the data packet is the last time The sent reply message containing the data packet.
  • the verification of the data request information is essentially to obtain the check mark of the data packet verification information in the data request information. When it is marked as a packet receiving error, it means that the verification has failed.
  • the reply message is directly sent to the charging box.
  • the sending queue is empty, that is, there is no data packet to be sent in the earphone, you can send a reply message directly to the charging box.
  • the data confirmation information in the reply message can be used to feed back to the charging box whether the correct data packet is received, which is easy to understand
  • the charging box is notified to resend the last data packet that has been sent.
  • the charging box is notified to send the next data packet to Earphones, where the next data packet is a data packet to be sent after the data packet that has been sent last time is obtained from the sending queue according to the sending order. For example, when the data identification number corresponding to the previous data packet that has been sent is 8, the data identification number corresponding to the next data packet is 9.
  • the data request information does not include the number of data packets to be sent that meets the preset number of switching times.
  • the sending queue in the headset is empty, that is, when there is no data packet to be sent in the headset
  • the data request information of the charging box does not contain the data packet to be sent, that is, there is no data to be sent in the sending queue of the charging box Package indicates that there is no data packet to be sent between the charging box and the earphone, and the communication between the charging box and the earphone can be ended, and the earphone can be switched to the charging state to charge the earphone through the charging box.
  • the charging box when data is transmitted between the charging box and the headset, the charging box is always used as the active sender, that is, actively sending data request information to the headset, and the headset is always As a passive receiver, it returns reply information to the charging box after receiving the data request information.
  • the communication between the charging box and the earphone is realized through the form of "one question and one answer" between the charging box and the earphone, because there is no need to switch
  • the master-slave relationship between the charging box and the headset can realize data transmission between the charging box and the headset, which is simple to implement and reduces additional communication burdens.
  • the communication between the charging box and the earphone is realized through the form of "one question and one answer" between the charging box and the earphone, which can facilitate the fault-tolerant processing of the data packets with transmission errors during the data transmission process, and obtain accurate data packets in time , That is, when the headset receives the data request message containing the data packet to be sent from the charging box, it verifies the verification information in the data request message. When the verification result is that the data transmission error occurs, it sends a reply message to the charging box to notify The charging box resends the data packet to be sent; in the same way, when the charging box receives the reply message that contains the data packet returned by the headset, it verifies the verification information in the reply. When the verification result is that the data transmission error occurs, you can Immediately send a data request message to the headset to notify the headset to resend the data packet.
  • the present application also provides a charging box.
  • the charging box includes a memory, a processor, and a communication program between the headset and the charging box stored in the memory and running on the processor.
  • the communication program between the headset and the charging box is processed.
  • the steps of the communication method between the headset and the charging box in the first embodiment or the second embodiment described above are implemented when the device is executed.
  • the present application also provides a headset.
  • the headset includes a memory, a processor, and a communication program between the headset and the charging box stored in the memory and running on the processor.
  • the communication program between the headset and the charging box is executed by the processor to implement the foregoing The steps of the communication method between the earphone and the charging box in one embodiment or the second embodiment.
  • This application also provides a readable storage medium.
  • the communication program between the earphone and the charging box is stored on the readable storage medium.
  • the communication program between the earphone and the charging box is executed by the processor, the earphone and the charging box in any of the above embodiments are implemented The steps of the communication method.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium such as ROM/RAM, magnetic Disk, optical disk) includes several instructions to make a mobile terminal (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) execute the method of each embodiment of the present application.
  • a mobile terminal which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.

Landscapes

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

Abstract

本申请一些实施例公开了一种耳机与充电盒的通信方法,该方法包括:从发送队列中获取待发送数据包;向耳机发送包含有待发送数据包的数据请求信息;接收到耳机的回复信息时,继续执行从发送队列中获取待发送数据包的步骤,直到发送队列中为空。本申请还提供一种充电盒、耳机及可读存储介质。本申请的耳机与充电盒的通信方法在充电盒与耳机之间进行数据传输时,将充电盒总是作为主动发送方即主动向耳机发送数据请求信息,而耳机总是作为被动接收方即在接收到数据请求信息后向充电盒返回回复信息,通过"一问一答"形式以实现充电盒与耳机通信,不需要切换充电盒和耳机的主从关系就能实现充电盒与耳机之间进行数据传输,实现简单且减少额外通信负担。

Description

耳机与充电盒的通信方法、充电盒、耳机及可读存储介质
本申请要求于2020年05月19日提交中国专利局、申请号为202010428657.3、发明名称为“耳机与充电盒的通信方法、充电盒、耳机及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种耳机与充电盒的通信方法、充电盒、耳机及可读存储介质。
背景技术
随着无线通信技术的发展,TWS(True Wireless Stereo,真正无线立体声)蓝牙耳机因其体积小巧以及便于携带等特点,受到用户的青睐。一般情况下,TWS耳机产品包含耳机和充电盒两个部分,存在耳机和充电盒进行通信的情况。
目前,在耳机与充电盒之间进行通信时,充电盒将需要发送的数据包依次全部发送给耳机后,耳机接收到充电盒发送的数据发送完毕信号时,耳机才将需要发送的数据包依次全部发送至充电盒,以实现耳机与充电盒之间通信,然而无论是耳机发送数据包还是充电盒发送数据包均需提前向接收方发送通知消息,以使接收方处于接收数据状态,该种通信方式需要耳机与充电盒之间的主从关系进行切换,并且由于每次发送数据包前均需要向接收方发送通知消息而导致增加了通信负担。
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。
发明内容
本申请的主要目的在于提供一种耳机与充电盒的通信方法、充电盒、耳机及可读存储介质,旨在解决耳机与充电盒进行通信时,耳机与充电盒的主从关系进行切换,且每次发送数据包前均需要向接收方发送通知消息而导致 增加通信负担。
为实现上述目的,本申请提供一种耳机与充电盒的通信方法,所述耳机与充电盒的通信方法包括:
充电盒从发送队列中获取待发送数据包;
向耳机发送包含有所述待发送数据包的数据请求信息;
接收到耳机的回复信息时,继续执行从发送队列中获取待发送数据包的步骤,直到所述发送队列中为空。
可选地,耳机与充电盒的通信方法还包括:
当所述发送队列为空时,向耳机发送数据请求信息,直到持续收到耳机返回的未包含数据包的回复信息。
可选地,当所述发送队列中为空时,向耳机发送数据请求信息的步骤包括:
当所述发送队列为空时,判断所述耳机上一次的回复信息中是否包含数据包;
当所述耳机上一次的回复信息中包含数据包时,直接向耳机发送数据请求信息;或,
当所述耳机上一次的回复中信息未包含数据包时,延迟预设时间后,再向耳机发送数据请求信息。
可选地,耳机与充电盒的通信方法还包括:
接收到所述耳机的回复信息时,对所述回复信息进行校验,以在校验成功时,执行从发送队列中获取待发送数据包的步骤,校验失败时,重新发送包含有所述待发送数据包的数据请求信息。
可选地,耳机与充电盒的通信方法包括:
在所述回复信息中不包含数据包的次数满足预设切换次数时,切换至充电状态。
为实现上述目的,本申请还提供一种耳机与充电盒的通信方法,所述耳机与充电盒的通信方法包括:
耳机接收到充电盒发送的数据请求信息时,从发送队列中获取数据包;
向所述充电盒发送包含有所述数据包的回复信息。
可选地,耳机与充电盒的通信方法还包括:
当所述发送队列中为空时,直接向所述充电盒发送回复信息。
可选地,从发送队列中获取待发送数据包的步骤之前,所述耳机与充电盒的通信方法包括:
接收到充电盒发送的数据请求信息时,对所述数据请求信息进行校验,以在校验成功时,从发送队列中获取下一数据包,校验失败时,重新发送包含有所述数据包的回复信息。
可选地,耳机与充电盒的通信方法还包括:
在所述数据请求信息中不包含数据包的次数满足预设切换次数时,切换至充电状态。
此外,为实现上述目的,本申请还提供一种充电盒,所述充电盒包括:存储器、处理器以及存储在所述存储器里并可在所述处理器上运行的耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如以上所述耳机与充电盒的通信方法的各个步骤。
可选地,充电盒通过封装底层单总线进行通信。
此外,为实现上述目的,本申请还提供一种耳机,所述耳机包括:存储器、处理器以及存储在所述存储器里并可在所述处理器上运行的耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如以上所述耳机与充电盒的通信方法的各个步骤。
此外,为实现上述目的,本申请还提供一种可读存储介质,其特征在于,所述计算机可读存储介质上存储有耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如以上所述耳机与充电盒的通信方法的各个步骤。
本申请提出的耳机与充电盒的通信方法,充电盒与耳机之间进行数据传输时,将充电盒总是作为主动发送方即主动向耳机发送数据请求信息,而耳机总是作为被动接收方即在接收到数据请求信息后向充电盒返回回复信息, 在充电盒与耳机之间通过“一问一答”形式以实现充电盒与耳机之间通信,并不需要切换充电盒和耳机的主从关系就能实现充电盒与耳机之间进行数据传输,实现简单且减少额外的通信负担。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一部分附图,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请的耳机与充电盒的通信方法各个实施例涉及的充电盒或者耳机的结构框图;
图2为本申请的耳机与充电盒的通信方法第一实施例的流程示意图;
图3为本申请的耳机与充电盒的通信方法第二实施例的流程示意图;
图4为本申请的耳机与充电盒的通信方法中在充电盒的发送队列为空时执行的流程示意图;
图5为本申请的耳机与充电盒的通信方法第三实施例的流程示意图。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或者“单元”的后缀仅为了有利于本申请的说明,其本身没有特定的意义。因此,“模块”、“部件”或者“单元”可以混合地使用。
请参考图1,图1为本申请的耳机与充电盒的通信方法各个实施例涉及的耳机或者充电盒的结构框图,该耳机或者充电盒可以包括:存储器101、处理器102、以及通信模块3。本领域技术人员可以理解,图1示出的充电盒或者耳机的结构框图并不构成对充电盒或者耳机的限定,充电盒或者耳机可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中,存储器101中存储有中控系统以及耳机与充电盒的通信程序。处理器102是充电盒或者耳机的控制中心,处理器102执行存储在存储器101内的耳机与充电盒的通信程序,以实现本申请的耳机与充电盒的通信方法各实施 例的步骤。对于充电盒,通信模块3通过网络协议与耳机建立数据通信(该数据通信可为IP通信或者蓝牙通道),以实现充电盒向耳机发送数据请求信息,并接收耳机返回的回复信息,进而实现充电盒与耳机之间的数据传输。
可选地,充电盒或者耳机通过封装底层单总线进行通信。需要说明的是,单总线技术采用单根数据信号线,既传输时钟又传输数据,且数据传输是双向的,具有节省I/O口线资源、结构简单、成本低廉、便于总线扩展和维护等诸多优点。举例来说,充电盒与耳机之间通过一根数据总线实现连接,其中,串口数据传输线(TX)与串口数据接收线(RX)共用一根数据总线,具体地,充电盒与耳机通过异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)进行通信,在实际应用过程中,当充电盒与耳机进行通信时,实质上是充电盒与耳机基于单总线通信,以实现充电盒与耳机在应用层上的双向通信。
需要说明的是,充电盒的存储器101中的耳机与充电盒的通信程序被处理器102执行时实现以下步骤:
充电盒从发送队列中获取待发送数据包;
向耳机发送包含有所述待发送数据包的数据请求信息;
接收到耳机的回复信息时,继续执行从发送队列中获取待发送数据包的步骤,直到所述发送队列中为空。或者,
耳机的存储器101中的耳机与充电盒的通信程序被处理器102执行时实现以下步骤:
耳机接收到充电盒发送的数据请求信息时,从发送队列中获取待发送数据包;
向所述充电盒发送包含有所述待发送数据包的回复信息。
需要说明的是,在充电盒与耳机进行数据传输过程中,充电盒总是作为主动发送方,而耳机总是作为被动接收方,只要充电盒内的发送队列中存在待发送数据包,则立即获取待发送数据包并将待发送数据包发送至耳机。而在充电盒内的发送队列中不存在待发送数据包时,可主动向耳机发送数据请求信息,以获取耳机内的待发送的数据包,可选地,可通过预设时间间隔主动向耳机发送数据请求。其中,充电盒与耳机进行数据传输的应用场景包括以下至少一种:电脑端通过充电盒与耳机进行数据传输以实现对耳机升级; 电脑端通过充电盒与耳机进行数据传输以获取耳机在生产过程中的信息,如运行参数以及运行日志;在左耳机与右耳机无法进行匹配时,通过充电盒向耳机发送配对命令以实现左耳机与右耳机重新配对;在耳机使用过程中发生故障时,可通过充电盒向耳机发送恢复出厂设置命令以重启耳机。
基于上述充电盒的结构框图,提出本申请的耳机与充电盒的通信方法的第一实施例或者第二实施例。
本申请提供一种耳机与充电盒的通信方法,请参考图2,图2为本申请的耳机与充电盒的通信方法第一实施例的流程示意图。在该实施例中,耳机与充电盒的通信方法包括以下步骤:
步骤S10,充电盒从发送队列中获取待发送数据包;
步骤S20,向耳机发送包含有所述待发送数据包的数据请求信息;
步骤S30,接收到耳机的回复信息时,继续执行步骤S10,直到所述发送队列中为空。
发送队列为用于存储充电盒内的待发送数据包,充电盒通过发送队列获取得到的待发送数据包向与充电盒建立数据通信的耳机发送数据包。待发送数据包为充电盒内待发送的数据,其中,一待发送数据包对应一数据标识号,通过数据标识号可用于唯一确定与该数据标识号对应的待发送数据包。举例来说,可将多个待发送的数据分割为一个或者多个待发送数据包,通过对待发送的数据设置数据标识号,将具有相同数据标识号的待发送的数据划分为同一个待发送数据包,并将该数据标识号作为该待发送数据包的唯一标识,容易理解的是,可对多个待发送数据包按照发送顺序对每一待发送数据包设置数据标识号,数据标识号可通过数字1、2、3……以及n表示,通过设置数据标识号可避免充电盒与耳机在进行数据传输时,因超时或者数据传输出错导致数据接收方如充电盒或者耳机重复收到同一包数据。数据请求信息包括但不限于待发送数据包以及校验信息。校验信息为用于检验在充电盒向耳机发送待发送数据包过程中是否存在数据传输出错,举例来说,校验信息为循环冗余校验码(即CRC码),通过将校验信息添加至待发送数据包后边形成数据请求信息,进而充电盒向耳机发送数据请求信息后,在耳机接收到数据请求信息时,根据预设的校验方法对数据请求信息中的校验信息进行验证, 以确定充电盒与耳机进行数据传输时是否出错。
可选地,数据请求信息还包括数据校验信息,数据校验信息用于通知耳机是否需要重发数据包,也即在接收到耳机发送返回的含有数据包的回复信息后,将数据请求信息发送至耳机时,耳机可通过数据请求信息中的数据校验信息判断是否重发上一次已发送的数据包,需要说明的是,数据包校验信息包含有校验标志,通过校验标志可用于判断耳机是否需要重发数据包。举例来说,充电盒在接收到耳机发送的含有数据包的回复信息时,充电盒对回复信息中的校验信息进行验证,在获得的验证结果符合预设校验信息,也即数据包传输准确时,可通知耳机发送从发送队列获取的待发送的数据包,其中,可将校验标志标记为“1”以表示数据包接收正确;同理地,在获得的验证结果不符合预设校验信息,也即数据包传输错误时,可通知耳机重新发送上一次已发送的数据包,其中,可将校验标志标记为“0”以表示数据包接收错误,对此不做具体限定。又举例来说,在充电盒接收到耳机返回的含有数据包的回复信息后,耳机接收充电盒返回的数据请求信息,通过数据请求信息中的数据校验信息判断重发上一次已发送的数据包时,如上述耳机返回的数据包对应的数据标识号为8,在数据校验信息表示数据包接收正确时,则通知耳机发送包含有数据标识号为9对应的数据包的回复信息;在数据校验信息表示数据包接收错误时,则通知耳机重新发送包含有数据标识号为8对应的数据包的回复信息。
需要说明的是,回复信息包括但不限于数据包确认信息、数据包以及校验信息。其中,数据包确认信息用于判断充电盒是否需要重发数据包,可选地,数据包确认信息包含有校验标志,通过校验标志可用于判断充电盒是否需要重发数据包,也即在校验标志标记为数据包接收错误时,可向耳机重新发送上一次已发送的数据包,在校验标志标记为数据包接收正确时,可直接向耳机发送从发送队列获取的待发送数据包。需要说明的是,对校验标志标记的设置通过耳机在接收到充电盒的数据请求信息后,采用预设的校验方法对数据请求信息中的校验信息进行验证,在获得的验证结果符合预设校验信息,也即数据包传输准确时,可将校验标志标记为“1”以表示数据包接收正确;同理地,在获得的验证结果不符合预设校验信息,也即数据包传输错误时,可将校验标志标记为“0”以表示数据包接收错误,对此不做具体限定。 数据包为从耳机内发送队列中获取的待发送的数据包,其中,一数据包对应有可唯一识别该数据包的数据标识号,该数据标识号的概念与充电盒发送的数据请求信息中待发送数据包对应的数据标识号类似,在此不做赘述。校验信息为用于检验在耳机向充电盒发送数据包过程中是否存在数据传输出错。
在实际应用过程中,将包含有待发送数据包的数据请求信息发送至耳机的过程中,由于网络环境干扰或者其它不稳定因素的影响,可能导致数据包损坏或者丢失,也可能导致耳机接收到的数据包并非当前所需要的数据包,由此,基于充电盒发送的包含有待发送数据包的数据请求信息,耳机通过向充电盒发送回复信息,充电盒通过获取回复信息中的数据包确认信息以确定是否重新发送上一次已发送的数据包。需要说明的是,步骤S30中,接收到耳机的回复信息时,继续执行从发送队列中获取待发送数据包的步骤中,待发送数据包可以为上一次已发送的数据包,也可以是按照发送顺序获取上一次已发送数据包之后的待发送数据包。可选地,接收到耳机的回复信息时,对回复信息进行校验,以在校验成功时,执行从发送队列中获取待发送数据包的步骤,即为按照发送顺序从发送队列中获取上一次已发送数据包之后的待发送的数据包,校验失败时,重新发送包含有待发送数据包即为上一次已发送的数据包的数据请求信息,其中,对回复信息进行校验实质上是获取回复信息中的数据包确认信息的校验标志,在校验标志标记为数据包接收正确时,也即表示检验成功,在校验标志标记为数据包接收错误时,也即表示校验失败。举例来说,在充电盒向耳机发送包含有待发送数据包的数据请求信息时,其中待发送数据包对应的数据标识号为8,在耳机发送的回复信息中校验标志为数据包接收正确时,则向耳机发送包含有数据标识号为9对应的数据包的数据请求信息;在耳机发送的回复信息中校验标志为数据包接收错误时,则向耳机重新发送包含有数据标识号为8对应的数据包的数据请求信息。可选地,可在预设时长内未接收到耳机的回复信息时,执行步骤S10。
在本实施例公开的技术方案中,充电盒与耳机之间进行数据传输时,将充电盒总是作为主动发送方即主动向耳机发送数据请求信息,而耳机总是作为被动接收方即在接收到数据请求信息后向充电盒返回回复信息,在充电盒与耳机之间通过“一问一答”形式以实现充电盒与耳机之间通信,并不需要切换充电盒和耳机的主从关系就能实现充电盒与耳机之间进行数据传输,实 现简单且减少额外的通信负担。此外,在充电盒与耳机之间通过“一问一答”形式实现充电盒与耳机之间通信,可在数据传输过程中便于对传输出错的数据包进行容错处理,以及时获取准确的数据包,即当耳机接收到充电盒发送包含有待发送数据包的数据请求信息后,通过对数据请求信息中校验信息进行验证,在验证结果为数据传输出错时,通过向充电盒发送回复信息以通知充电盒重新发送待发送数据包;同理的,当充电盒接收到耳机返回的包含有数据包的回复信息后,通过对回复中校验信息进行验证,在验证结果为数据传输出错时,可以立马再向耳机发送数据请求信息以通知耳机重新发送数据包。
基于上述第一实施例提出本申请的耳机与充电盒的通信方法的第二实施例,请参考图3,图3为本申请的耳机与充电盒的通信方法第二实施例的流程示意图。在该实施例中,耳机与充电盒的通信方法还包括:
步骤S40,当所述发送队列中为空时,向耳机发送数据请求信息,直到持续收到耳机返回的未包含数据包的回复信息。
当发送队列中为空时,也即充电盒已没有待发送数据包,基于充电盒作为主动发送方,耳机作为被动接收方,充电盒通过向耳机发送数据请求信息获取耳机内待发送的数据包,在持续接收到耳机返回的未包含数据包的回复信息时,则表明耳机内已没有待发送的数据包,避免了由于耳机内待发送的数据包由于时延未能从应用层发送至链路层的发送队列,而造成未能及时获取耳机内待发送的数据包。可以理解的是,在发送队列为空时,向耳机发送数据请求信息的方式可以是直接向耳机发送数据请求信息,也可以是按照预设时间间隔向耳机发送数据请求信息,以便于及时获取耳机内存在的待发送的数据包。此外,持续接收到耳机返回的未包含数据包的回复信息可以是持续预设次数未接收到耳机返回的未包含数据包的回复信息,也可以是在预设时长内持续未接收到耳机返回的未包含数据包的回复信息,还可以是在预设时长内持续预设次数未接收到耳机返回的未包含数据包的回复信息,对此不做限定。
可选地,在回复信息中不包含数据包的次数满足预设切换次数时,切换至充电状态。基于充电盒中的发送队列为空,也即充电盒内没有待发送数据 包时,当耳机的回复信息中不包含数据包时,也即耳机的发送队列中不存在待发送数据包,表明充电盒与耳机之间均没有待发送数据包,可结束充电盒与耳机之间数据传输通信,进而将充电盒切换至充电状态,以对耳机进行充电。
可选地,请参考图4,图4为本申请的耳机与充电盒的通信方法中在充电盒的发送队列为空时执行的流程示意图,步骤S40包括:
步骤S41,当所述发送队列中为空时,判断所述耳机上一次的回复信息中是否包含数据包;
步骤S42,当所述耳机上一次的回复信息中包含数据包时,直接向耳机发送数据请求信息;或,
步骤S43,当所述耳机上一次的回复信息中未包含数据包时,延迟预设时间后,再向耳机发送数据请求信息。
需要说明的是,当发送队列为空也即充电盒内没有待发送数据包时,进一步通过判断耳机上一次的回复信息是否包含数据包以判断耳机内是否存在待发送的数据包,当耳机上一次的回复信息中包含数据包时,也即可认为耳机内大概率上存在待发送的数据包,可直接向耳机发送数据请求信息;当耳机上一次的回复信息中未包含数据包时,也即可认为耳机内大概率上不存在待发送的数据包,通过延迟预设时间后,向耳机发送数据请求信息,可避免了由于耳机内待发送的数据包由于还未能从应用层传送至链路层的发送队列,而造成未能及时获取耳机内待发送的数据包。可选地,步骤S43包括:当耳机上一次的回复信息中未包含数据包时,延迟预设时间后,按照预设时间间隔再向耳机发送数据请求信息,以及时获取耳机内待发送的数据包。
在本实施例公开的技术方案中,由于充电盒与耳机之间进行数据传输时,充电盒总是作为主动发送方即主动向耳机发送数据请求信息,耳机总是作为被动接收方即在接收到数据请求信息后向充电盒返回回复信息,当充电盒的发送队列为空,也即充电盒内已没有待发送数据包时,为获取耳机内的待发送的数据包,充电盒主动向耳机发送数据请求信息,如可以是预设时间间隔主动向耳机发送数据请求信息,并不需要切换充电盒和耳机的主从关系就能实现充电盒与耳机之间进行数据传输,实现简单且减少额外的通信负担。
基于上述耳机的结构框图,提出本申请的耳机与充电盒的通信方法的第三实施例。
本申请还提供一种耳机与充电盒的通信方法,请参考图5,图5为本申请的耳机与充电盒的通信方法第三实施例的流程示意图。在该实施例中,耳机与充电盒的通信方法包括以下步骤:
步骤S50,耳机接收到充电盒发送的数据请求信息时,从发送队列中获取数据包;
步骤S60,向所述充电盒发送包含有所述数据包的回复信息。
对应于上述第一实施例中在充电盒作为主动发送方时,向耳机发送包含有待发送数据包的数据请求信息,在本实施例中,耳机作为被动接收方接收充电盒发送的数据请求信息。
需要说明的是,充电盒发送的数据请求信息包括但不限于待发送数据包以及校验信息。发送队列为用于存储耳机内的待发送数据包,基于接收到充电盒发送的数据请求信息,耳机从发送队列获取待发送数据包,向与耳机建立数据通信的充电盒发送含有待发送数据包的回复信息。回复信息包括但不限于数据包确认信息、数据包以及校验信息。数据包确认信息用于通知充电盒是否需要重发数据包,可选地,数据包确认信息包含有校验标志,通过校验标志可用于判断充电盒是否需要重发数据包。举例来说,耳机在接收到充电盒发送的含有待发送数据包的数据请求信息时,耳机对数据请求信息中的校验信息进行验证,在获得的验证结果符合预设校验信息,也即数据包传输准确时,可通知充电盒发送从发送队列获取的待发送数据包,可将校验标志标记为“1”以表示数据包接收正确;同理地,在获得的验证结果不符合预设校验信息,也即数据包传输错误时,可通知充电盒重新发送上一次已发送的数据包,可将校验标志标记为“0”以表示数据包接收错误,对此不做具体限定。数据包为从耳机内发送队列中获取的待发送的数据包,其中,一数据包对应有可唯一识别该数据包的数据标识号。校验信息为用于检验在耳机向充电盒发送数据包过程中是否存在数据传输出错。
在实际应用过程中,将包含有数据包的回复信息发送至充电盒的过程中,由于网络环境干扰或者其它不稳定因素的影响,可能导致数据包损坏或者丢失,也可能导致充电盒接收到的数据包并非当前所需要的数据包,由此,基 于耳机发送的包含有数据包的回复信息,充电盒通过向耳机发送数据请求信息,耳机通过获取数据请求信息中的数据包校验信息以确定是否重新发送上一次已发送的数据包。需要说明的是,步骤S50中从发送队列中获取数据包之前包括:接收到充电盒发送的数据请求信息时,对所述数据请求信息进行校验,以在校验成功时,从发送队列中获取下一数据包,即为按照发送顺序从发送队列中获取上一次已发送数据包之后的待发送的数据包,校验失败时,重新发送包含有所述数据包的回复信息即为上一次已发送的含有数据包的回复信息。其中,对数据请求信息进行校验实质上是获取数据请求信息中的数据包校验信息的校验标志,在校验标志标记为数据包接收正确时,也即表示检验成功,在校验标志标记为数据包接收错误时,也即表示校验失败。
可选地,当所述发送队列中为空时,直接向所述充电盒发送回复信息。当发送队列为空时,也即耳机内没有待发送的数据包,可直接向充电盒发送回复信息,通过回复信息中的数据确认信息以向充电盒反馈是否接收到准确的数据包,容易理解的是,在数据确认信息为数据包接收错误时,以通知充电盒重发已发送的上一次数据包,在数据确认信息为数据包接收准确时,以通知充电盒将下一数据包发送至耳机,其中,下一数据包为按照发送顺序从发送队列中获取上一次已发送数据包之后的待发送的数据包。举例来说,已发送的上一数据包对应的数据标识号为8时,下一数据包对应的数据标识号为9。
可选地,在所述数据请求信息中不包含待发送数据包的次数满足预设切换次数时,切换至充电状态。基于耳机中的发送队列为空,也即耳机内没有待发送的数据包时,当充电盒的数据请求信息中不包含待发送数据包时,也即充电盒的发送队列中不存在待发送数据包,表明充电盒与耳机之间均没有待发送数据包,可结束充电盒与耳机之间的通信,进而将耳机切换至充电状态,以通过充电盒对耳机进行充电。
在本实施例公开的技术方案中,对应于上述第一实时例,充电盒与耳机之间进行数据传输时,将充电盒总是作为主动发送方即主动向耳机发送数据请求信息,而耳机总是作为被动接收方即在接收到数据请求信息后向充电盒返回回复信息,在充电盒与耳机之间通过“一问一答”形式以实现充电盒与耳机之间通信,由于并不需要切换充电盒和耳机的主从关系就能实现充电盒 与耳机之间进行数据传输,实现简单且减少额外的通信负担。此外,在充电盒与耳机之间通过“一问一答”形式实现充电盒与耳机之间通信,可在数据传输过程中便于对传输出错的数据包进行容错处理,以及时获取准确的数据包,即当耳机接收到充电盒发送包含有待发送数据包的数据请求信息后,通过对数据请求信息中校验信息进行验证,在验证结果为数据传输出错时,通过向充电盒发送回复信息以通知充电盒重新发送待发送数据包;同理的,当充电盒接收到耳机返回的包含有数据包的回复信息后,通过对回复中校验信息进行验证,在验证结果为数据传输出错时,可以立马再向耳机发送数据请求信息以通知耳机重新发送数据包。
本申请还提供一种充电盒,充电盒包括存储器、处理器以及存储在存储器里并可在处理器上运行的耳机与充电盒之间的通信程序,耳机与充电盒之间的通信程序被处理器执行时实现上述第一实施例或者第二实施例中的耳机与充电盒的通信方法的步骤。
本申请还提供一种耳机,耳机包括存储器、处理器以及存储在存储器里并可在处理器上运行的耳机与充电盒的通信程序,耳机与充电盒的通信程序被处理器执行时实现上述第一实施例或者第二实施例中的耳机与充电盒的通信方法的步骤。
本申请还提供一种可读存储介质,可读存储介质上存储有耳机与充电盒的通信程序,耳机与充电盒的通信程序被处理器执行时实现上述任一实施例中的耳机与充电盒的通信方法的步骤。
在本申请提供的充电盒或者耳机和可读存储介质的实施例中,包含了上述耳机与充电盒的通信方法各实施例的全部技术特征,说明书拓展和解释内容与上述耳机与充电盒的通信方法的各实施例基本相同,在此不做再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品 或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台移动终端(可以是手机,计算机,服务器,被控终端,或者网络设备等)执行本申请每个实施例的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (13)

  1. 一种耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法包括:
    充电盒从发送队列中获取待发送数据包;
    向耳机发送包含有所述待发送数据包的数据请求信息;
    接收到耳机的回复信息时,继续执行从发送队列中获取待发送数据包的步骤,直到所述发送队列中为空。
  2. 如权利要求1所述的耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法还包括:
    当所述发送队列为空时,向耳机发送数据请求信息,直到持续收到耳机返回的未包含数据包的回复信息。
  3. 如权利要求2所述的耳机与充电盒的通信方法,其特征在于,所述当所述发送队列中为空时,向耳机发送数据请求信息的步骤包括:
    当所述发送队列为空时,判断所述耳机上一次的回复信息中是否包含数据包;
    当所述耳机上一次的回复信息中包含数据包时,直接向耳机发送数据请求信息;或,
    当所述耳机上一次的回复中信息未包含数据包时,延迟预设时间后,再向耳机发送数据请求信息。
  4. 如权利要求1所述的耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法还包括:
    接收到所述耳机的回复信息时,对所述回复信息进行校验,以在校验成功时,执行从发送队列中获取待发送数据包的步骤,校验失败时,重新发送包含有所述待发送数据包的数据请求信息。
  5. 如权利要求2所述的耳机与充电盒的通信方法,其特征在于,所述耳 机与充电盒的通信方法包括:
    在所述回复信息中不包含数据包的次数满足预设切换次数时,切换至充电状态。
  6. 一种耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法包括:
    耳机接收到充电盒发送的数据请求信息时,从发送队列中获取数据包;
    向所述充电盒发送包含有所述数据包的回复信息。
  7. 如权利要求6所述的耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法还包括:
    当所述发送队列中为空时,直接向所述充电盒发送回复信息。
  8. 如权利要求6或者7所述的耳机与充电盒的通信方法,其特征在于,所述从发送队列中获取待发送数据包的步骤之前,所述耳机与充电盒的通信方法包括:
    接收到充电盒发送的数据请求信息时,对所述数据请求信息进行校验,以在校验成功时,从发送队列中获取下一数据包,校验失败时,重新发送包含有所述数据包的回复信息。
  9. 如权利要求7所述的耳机与充电盒的通信方法,其特征在于,所述耳机与充电盒的通信方法还包括:
    在所述数据请求信息中不包含数据包的次数满足预设切换次数时,切换至充电状态。
  10. 一种充电盒,其特征在于,所述充电盒包括:存储器、处理器以及存储在所述存储器里并可在所述处理器上运行的耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如权利要求1-5任一项耳机与充电盒的通信方法的步骤。
  11. 一种耳机,其特征在于,所述耳机包括:存储器、处理器以及存储在所述存储器里并可在所述处理器上运行的耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如权利要求6-9任一项耳机与充电盒的通信方法的步骤。
  12. 如权利要求10所述的充电盒,其特征在于,所述充电盒通过封装底层单总线进行通信。
  13. 一种可读存储介质,其特征在于,所述计算机可读存储介质上存储有耳机与充电盒的通信程序,所述耳机与充电盒的通信程序被所述处理器执行时实现如权利要求1-9任一项耳机与充电盒的通信方法的步骤。
PCT/CN2020/124861 2020-05-19 2020-10-29 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质 WO2021232681A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/997,304 US11889255B2 (en) 2020-05-19 2020-10-29 Communication method between earphones and charging box, charging box, earphones and readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010428657.3 2020-05-19
CN202010428657.3A CN111629368B (zh) 2020-05-19 2020-05-19 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质

Publications (1)

Publication Number Publication Date
WO2021232681A1 true WO2021232681A1 (zh) 2021-11-25

Family

ID=72273037

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124861 WO2021232681A1 (zh) 2020-05-19 2020-10-29 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质

Country Status (3)

Country Link
US (1) US11889255B2 (zh)
CN (1) CN111629368B (zh)
WO (1) WO2021232681A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111629368B (zh) * 2020-05-19 2022-10-18 歌尔科技有限公司 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质
CN112217610B (zh) * 2020-09-18 2023-03-14 广州市贺氏办公设备有限公司 数据处理方法、装置、消费机、终端及可读存储介质
CN112214755B (zh) * 2020-09-18 2024-05-03 广州市贺氏办公设备有限公司 一种多功能消费机
CN113127401B (zh) * 2021-03-10 2023-03-28 歌尔科技有限公司 一种耳机盒与耳机的通信方法和系统
CN114449563B (zh) * 2022-01-27 2024-05-28 厦门亚锝电子科技有限公司 一种提高蓝牙mesh网络设备工作稳定性的方法及蓝牙设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108429979A (zh) * 2018-06-15 2018-08-21 歌尔科技有限公司 一种充电盒升级方法、充电盒、无线耳机及tws耳机
EP3367582A1 (en) * 2017-02-24 2018-08-29 Beijing Xiaoniao Tingting Technology Co., Ltd Data processing method, charging device and mobile terminal
CN108600892A (zh) * 2018-06-15 2018-09-28 歌尔科技有限公司 一种升级方法、装置、无线耳机、tws耳机及充电盒
CN108769856A (zh) * 2018-06-12 2018-11-06 歌尔科技有限公司 一种建立单线连接的方法、装置、无线耳机及充电盒
CN111629368A (zh) * 2020-05-19 2020-09-04 歌尔科技有限公司 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013046734A1 (ja) * 2011-09-27 2013-04-04 三菱電機株式会社 スレーブ装置、マスター装置及び通信方法
US12027890B2 (en) * 2020-04-02 2024-07-02 Qualcomm Incorporated Modulating supply voltage generated by voltage regulator for transmission of data and power

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3367582A1 (en) * 2017-02-24 2018-08-29 Beijing Xiaoniao Tingting Technology Co., Ltd Data processing method, charging device and mobile terminal
CN108769856A (zh) * 2018-06-12 2018-11-06 歌尔科技有限公司 一种建立单线连接的方法、装置、无线耳机及充电盒
CN108429979A (zh) * 2018-06-15 2018-08-21 歌尔科技有限公司 一种充电盒升级方法、充电盒、无线耳机及tws耳机
CN108600892A (zh) * 2018-06-15 2018-09-28 歌尔科技有限公司 一种升级方法、装置、无线耳机、tws耳机及充电盒
CN111629368A (zh) * 2020-05-19 2020-09-04 歌尔科技有限公司 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质

Also Published As

Publication number Publication date
CN111629368B (zh) 2022-10-18
US11889255B2 (en) 2024-01-30
CN111629368A (zh) 2020-09-04
US20230179903A1 (en) 2023-06-08

Similar Documents

Publication Publication Date Title
WO2021232681A1 (zh) 耳机与充电盒的通信方法、充电盒、耳机及可读存储介质
US10986670B2 (en) Random access feedback method, random access processing method, base station and terminal
WO2019105143A1 (zh) 一种基于蓝牙的数据通讯的方法、设备及存储介质
EP1768296A2 (en) Method and apparatus for transmitting signaling data messages in a wireless communications system
JP2011509041A (ja) 再送プロトコルのためのステータス報告
WO2019001406A1 (zh) 数据传输方法、用户设备和网络设备
RU2701523C1 (ru) Система и способ обеспечения синхронизации в передачах в режиме без соединения
CN110234114A (zh) 数据传输方法、装置、设备、介质和系统
WO2018027814A1 (zh) 一种数据传输方法、数据接收设备及数据发送设备
EP3606134B1 (en) Methods for processing radio link failure, and terminal device
US7995517B2 (en) System and method for transmitting units of messages in a mobile communication system
WO2022134960A1 (zh) 通信方法、装置及设备
US8700070B2 (en) System and method for adaptive message retransmission
WO2019062555A1 (zh) 一种数据传输方法及装置
KR20210121217A (ko) 무선 연결 방법, 기기 그룹, 시스템 및 저장매체
CN115865830A (zh) 基于连接管理的减少rdma网络开销的方法、装置
CN101094046B (zh) 混合自动请求重传的传输方法及装置
CN101094241B (zh) 混合自动请求重传的传输方法及装置
EP3633900B1 (en) Method and device for transmitting voice signaling
CN112804622A (zh) 无线音频输出装置及其操作方法
WO2018076350A1 (zh) 确定接收状态的方法和装置
US11616627B2 (en) Communication system, data transmission method thereof and user equipment thereof
US20240163023A1 (en) Data transmission method, apparatus, and system
WO2021204263A1 (zh) 一种多收发点架构下重传的方法及装置
WO2019071463A1 (en) REQUEST FOR AUTOMATIC HYBRID REPEAT WITHOUT GRANT

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: 20936424

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20936424

Country of ref document: EP

Kind code of ref document: A1