CN106681774B - Software upgrading method of Bluetooth loudspeaker and intelligent terminal - Google Patents
- ️Tue Jan 12 2021
Background
In the prior art, in the process of upgrading software of a bluetooth speaker, an intelligent terminal (for example, a computer) with upgrade software is required to be manually connected with the bluetooth speaker through a USB connection line, and after connection is completed, the upgrade software is transmitted to the bluetooth speaker, so that the process of upgrading software in the bluetooth speaker is completed.
The technical scheme has the disadvantages that one intelligent terminal can only realize the software upgrading process of one Bluetooth loudspeaker at a time, and the upgrading efficiency of the Bluetooth loudspeaker is slow.
Disclosure of Invention
The invention mainly aims to provide a software upgrading method of a Bluetooth loudspeaker, aiming at avoiding the defect of slow Bluetooth loudspeaker upgrading efficiency caused by the fact that one intelligent terminal can only realize the software upgrading process of one Bluetooth loudspeaker at a time.
In order to achieve the above object, the present invention further provides a software upgrading method for bluetooth speakers, which is applied to an intelligent terminal, and is characterized in that the intelligent terminal and each bluetooth speaker realize communication connection through a bluetooth broadcast communication protocol, the intelligent terminal is pre-stored with upgrading software for the bluetooth speakers, and the software upgrading method for the bluetooth speakers includes the following steps:
the intelligent terminal scans the Bluetooth speakers in the surrounding environment and performs Bluetooth connection with the scanned Bluetooth speakers;
the intelligent terminal acquires the software version of each Bluetooth loudspeaker and compares the software version of the Bluetooth loudspeaker with the upgrade software;
and when the software version of the Bluetooth loudspeaker is inconsistent with the version of the upgrade software, the intelligent terminal sends the upgrade software to the Bluetooth loudspeaker in a Bluetooth broadcasting mode so that the Bluetooth loudspeaker finishes software upgrade according to the received upgrade software.
Preferably, the intelligent terminal sends the upgrade software to the bluetooth speaker in a bluetooth broadcast mode, including:
the intelligent terminal stores the upgrading software into a plurality of broadcast packets with a preset sending sequence;
the intelligent terminal sends the broadcast packets to the Bluetooth loudspeaker in a Bluetooth broadcast mode according to a preset sending sequence;
and when the intelligent terminal receives the message which is sent by the Bluetooth loudspeaker and completes the receiving, the intelligent terminal finishes the sending of the broadcast packet.
Preferably, the intelligent terminal stores the upgrade software as a plurality of broadcast packets having a preset transmission sequence, and the intelligent terminal transmits each broadcast packet to between the bluetooth speakers in a bluetooth broadcast manner according to the preset transmission sequence, further comprising:
the intelligent terminal adds a sending sequence identifier for each broadcast packet;
the intelligent terminal sends each broadcast package to the bluetooth speaker through the bluetooth broadcast mode according to preset sending order, includes:
the intelligent terminal sends the broadcast packets in the current sending sequence to the Bluetooth loudspeaker in a Bluetooth broadcasting mode according to a preset sending sequence, and detects a broadcast packet receiving identifier preset in the Bluetooth loudspeaker, wherein the receiving identifier has a preset initial value, and after the Bluetooth loudspeaker successfully stores the broadcast packets in the current sending sequence, the receiving identifier is correspondingly replaced by the sending sequence identifier of the broadcast packets in the current sending sequence;
the intelligent terminal receives a first message which is returned to the intelligent terminal after the receiving of the broadcast packets in the current sending sequence is finished after the broadcast packets in the current sending sequence are successfully stored when the receiving identification of the Bluetooth loudspeaker is equal to the sending sequence identification of the broadcast packets in the previous sending sequence;
and after receiving the first message, the intelligent terminal sends the broadcast packets of the next sending sequence to the Bluetooth loudspeaker in a Bluetooth broadcasting mode according to a preset sending sequence.
Preferably, the intelligent terminal sends the broadcast packets in the current sending sequence to the bluetooth speaker in a bluetooth broadcasting manner according to a preset sending sequence, and after detecting a broadcast packet receiving identifier preset in the bluetooth speaker, the intelligent terminal further includes:
the intelligent terminal receives a second message of an error sent by the current broadcast packet in the sending sequence returned by the intelligent terminal when the receiving identification of the Bluetooth loudspeaker is not equal to the sending sequence identification of the broadcast packet in the previous sending sequence;
and after receiving the second message, the intelligent terminal sends the broadcast packets in the previous sending sequence to the Bluetooth loudspeaker in a Bluetooth broadcast mode.
Preferably, the intelligent terminal sends the broadcast packets in the current sending sequence to the bluetooth speaker in a bluetooth broadcast manner according to a preset sending sequence, detects a broadcast packet receiving identifier preset in the bluetooth speaker, and after receiving the first packet, sends the broadcast packets in the next sending sequence to the bluetooth speaker in the bluetooth broadcast manner according to the preset sending sequence, further comprising:
and the intelligent terminal receives a first message which is returned to the intelligent terminal after the broadcasting packets in the current sending sequence are received after the broadcasting packets in the current sending sequence are successfully stored when the receiving identification of the Bluetooth loudspeaker is equal to the initial value.
In addition, to achieve the above object, the present invention further provides an intelligent terminal, where the intelligent terminal and each bluetooth speaker are in communication connection through a bluetooth broadcast communication protocol, and the intelligent terminal is pre-stored with upgrade software for the bluetooth speaker, and the intelligent terminal includes:
the Bluetooth connection module is used for scanning the Bluetooth speakers in the surrounding environment and performing Bluetooth connection with the scanned Bluetooth speakers;
the comparison module is used for acquiring the software version of each Bluetooth loudspeaker and comparing the software version of the Bluetooth loudspeaker with the upgrade software;
and the sending module is used for sending the upgrading software to the Bluetooth loudspeaker in a Bluetooth broadcasting mode when the software version of the Bluetooth loudspeaker is inconsistent with the version of the upgrading software, so that the Bluetooth loudspeaker finishes software upgrading according to the received upgrading software.
Preferably, the sending module includes:
the storage unit is used for storing the upgrading software into a plurality of broadcast packets with preset sending sequence;
the transmitting unit is used for transmitting each broadcast packet to the Bluetooth loudspeaker in a Bluetooth broadcast mode according to a preset transmitting sequence;
and the sending ending unit is used for ending the sending of the broadcast packet after receiving the receiving finishing message sent by the Bluetooth loudspeaker.
Preferably, the sending module further comprises:
an identification unit, configured to add a transmission sequence identification to each broadcast packet;
the transmitting unit includes:
the first subunit is configured to send broadcast packets in a current sending order to the bluetooth speaker in a bluetooth broadcast manner according to a preset sending order, and detect a broadcast packet receiving identifier preset in the bluetooth speaker, where the receiving identifier has a preset initial value, and after the bluetooth speaker successfully stores the broadcast packets in the current sending order, the receiving identifier is replaced with a sending order identifier of the broadcast packets in the current sending order;
the second subunit is configured to receive a first packet, which is returned to the intelligent terminal after the broadcast packets in the current sending sequence are successfully stored when the receiving identifier of the bluetooth speaker is equal to the sending sequence identifier of the broadcast packet in the previous sending sequence, and the first packet is received after the broadcast packets in the current sending sequence are successfully stored;
and the third subunit is configured to send, after receiving the first packet, the broadcast packets in the next sending order to the bluetooth speaker in a bluetooth broadcasting manner according to a preset sending order.
Preferably, the sending unit further includes:
a fourth subunit, configured to receive a second packet, which is returned by the bluetooth speaker and sent by an error to the intelligent terminal, when the receiving identifier is not equal to the sending sequence identifier of the broadcast packet in the previous sending sequence;
and the fifth subunit is configured to send, after receiving the second packet, the broadcast packets in the previous sending sequence to the bluetooth speaker in a bluetooth broadcast manner.
Preferably, the sending unit further includes:
and the sixth subunit is configured to receive the first packet, which is returned to the intelligent terminal after the broadcast packets in the current sending sequence are successfully stored when the receiving identifier of the bluetooth speaker is equal to the initial value, and the first packet is received after the broadcast packets in the current sending sequence are received.
In the technical scheme of the invention, the intelligent terminal and each Bluetooth loudspeaker are in communication connection through a Bluetooth broadcast communication protocol, the intelligent terminal scans the Bluetooth loudspeaker in the surrounding environment and performs Bluetooth connection with each scanned Bluetooth loudspeaker to acquire the software version of each Bluetooth loudspeaker, the software version of the Bluetooth loudspeaker is compared with the upgrade software, when the software version of the Bluetooth loudspeaker is inconsistent with the version of the upgrade software, the intelligent terminal sends the upgrade software to the Bluetooth loudspeaker in a Bluetooth broadcast mode to enable the Bluetooth loudspeaker to complete software upgrade according to the received upgrade software, and because the intelligent terminal and each Bluetooth loudspeaker are in communication connection through the Bluetooth broadcast communication protocol, therefore, the intelligent terminal can send the upgrade software to the plurality of Bluetooth speakers at one time, and the defect that the Bluetooth speaker upgrading efficiency is low due to the fact that one intelligent terminal can only realize the software upgrading process of one Bluetooth speaker at one time is overcome.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a software upgrading method of a Bluetooth loudspeaker.
Referring to fig. 1 to 3, to achieve the above object, a first embodiment of the present invention provides a method for upgrading software of bluetooth speakers, which is applied to an intelligent terminal, where the intelligent terminal and each bluetooth speaker are in communication connection through a bluetooth broadcast communication protocol, and the intelligent terminal pre-stores upgrade software of the bluetooth speakers, where the method for upgrading software of the bluetooth speakers includes the following steps:
step S10, the intelligent terminal scans the Bluetooth speakers in the surrounding environment and performs Bluetooth connection with the scanned Bluetooth speakers;
step S20, the intelligent terminal acquires the software version of each Bluetooth speaker and compares the software version of the Bluetooth speaker with the upgrade software;
and step S30, when the software version of the Bluetooth speaker is inconsistent with the version of the upgrade software, the intelligent terminal sends the upgrade software to the Bluetooth speaker in a Bluetooth broadcasting mode, so that the Bluetooth speaker completes software upgrade according to the received upgrade software.
In the technical scheme of the invention, the intelligent terminal and each Bluetooth loudspeaker are in communication connection through a Bluetooth broadcast communication protocol, the intelligent terminal scans the Bluetooth loudspeaker in the surrounding environment and performs Bluetooth connection with each scanned Bluetooth loudspeaker to acquire the software version of each Bluetooth loudspeaker, the software version of the Bluetooth loudspeaker is compared with the upgrade software, when the software version of the Bluetooth loudspeaker is inconsistent with the version of the upgrade software, the intelligent terminal sends the upgrade software to the Bluetooth loudspeaker in a Bluetooth broadcast mode to enable the Bluetooth loudspeaker to complete software upgrade according to the received upgrade software, and because the intelligent terminal and each Bluetooth loudspeaker are in communication connection through the Bluetooth broadcast communication protocol, therefore, the intelligent terminal can send the upgrade software to the plurality of Bluetooth speakers at one time, and the defect that the Bluetooth speaker upgrading efficiency is low due to the fact that one intelligent terminal can only realize the software upgrading process of one Bluetooth speaker at one time is overcome.
The intelligent terminal can be any device capable of storing the upgrade software, such as a computer, a notebook, an Ipad, a mobile phone and the like, and can be in communication connection with the Bluetooth loudspeaker through a Bluetooth broadcast communication protocol.
The intelligent terminal is provided with a control interface, the name and the connection state of each Bluetooth loudspeaker scanned by the intelligent terminal are displayed on the control interface, and the connection state is used for indicating whether the intelligent terminal and the Bluetooth loudspeaker are successfully connected or not and can be indicated by 'connected' or 'unconnected'.
When the Bluetooth loudspeaker which is not successfully connected with the intelligent terminal exists in the surrounding environment, after the software upgrading process of the Bluetooth loudspeaker which is successfully connected for the time is completed, the Bluetooth loudspeaker can be restarted or the Bluetooth loudspeaker can be scanned again to be connected again.
And when the Bluetooth loudspeaker is successfully connected with the intelligent terminal, the upgrading software can be automatically sent to the Bluetooth loudspeaker.
In this embodiment, in order to enhance controllability of a software upgrading process, a control key for starting upgrading may be further provided on the control interface of the intelligent terminal, and in addition, a selection key for selecting upgrading software may be further provided, and a user may select a software version to be upgraded in the intelligent terminal through the selection key, so as to upgrade the bluetooth speaker according to the software version to be upgraded.
In order to facilitate a user to check the software upgrading state of each Bluetooth speaker, the software upgrading state of each Bluetooth speaker can be acquired and displayed on a control interface of the intelligent terminal.
The Bluetooth loudspeaker and the intelligent terminal follow the following protocol.
Event(s) | Parameter(s) | Event(s) | Parameter(s) |
Device discovery request | "BRC-Discover" | Device broadcast request | “BRC-Broadcast” |
Device discovery response | "BRC-Response" | Start of upgrade | "Start-UPG" |
Stopping upgrade | "Stop-UPG" | End of upgrade | "End-UPG" |
Upgrade success/failure | 1/-1 | Connection success/failure | 1/-1 |
Referring to fig. 4, based on the first embodiment of the method for upgrading software of a bluetooth speaker of the present invention, and the second embodiment of the method for upgrading software of a bluetooth speaker of the present invention, the step S30 of sending the upgrade software to the bluetooth speaker by using a bluetooth broadcast mode by the intelligent terminal includes:
step S31, the intelligent terminal stores the upgrade software into a plurality of broadcast packets with a preset sending sequence;
step S32, the intelligent terminal sends the broadcast packets to the Bluetooth loudspeaker in a Bluetooth broadcast mode according to a preset sending sequence;
and step S33, when the intelligent terminal receives the message which is sent by the Bluetooth loudspeaker and completes receiving, the intelligent terminal finishes sending the broadcast packet.
The files are transmitted based on the Bluetooth broadcast communication protocol, a form of broadcast packets needs to be adopted, and the size of each broadcast packet should be set according to the Bluetooth broadcast communication protocol to ensure that each broadcast packet can be transmitted smoothly.
In this embodiment, 10 bytes of data are taken from the upgrade software each time to form a broadcast packet, and of course, the data of the last broadcast packet may be less than 10 bytes. A transmission order is preset for each broadcast packet so that the respective broadcast packets are transmitted in order. Of course, the size of each broadcast packet may be arbitrarily set within the allowable range of the bluetooth broadcast communication protocol, and is not further limited herein.
And in order to identify the transmission end point of the upgrade software, adding an ending identifier which can be identified by the Bluetooth loudspeaker into the last broadcast packet, and when the Bluetooth loudspeaker receives the last broadcast packet, feeding back the message of completing reception to the intelligent terminal by identifying the ending identifier so that the intelligent terminal identifies that the transmission process of the upgrade software is ended. Meanwhile, the file receiving state of each Bluetooth loudspeaker can be displayed on the control interface, and/or the state of a broadcast packet sent to the Bluetooth loudspeaker by the intelligent terminal.
Based on the second embodiment of the software upgrading method for a bluetooth speaker of the present invention, the third embodiment of the software upgrading method for a bluetooth speaker of the present invention, between the step S31 and the step S32, further includes:
step S34 (not shown), the intelligent terminal adds a transmission sequence identifier to each broadcast packet;
referring to fig. 5, the step S32 includes:
step S32a, the intelligent terminal sends the broadcast packet of the current sending sequence to the Bluetooth loudspeaker in a Bluetooth broadcast mode according to a preset sending sequence, and detects a broadcast packet receiving identifier preset in the Bluetooth loudspeaker, wherein the receiving identifier has a preset initial value, and after the Bluetooth loudspeaker successfully stores the broadcast packet of the current sending sequence, the receiving identifier is correspondingly replaced by the sending sequence identifier of the broadcast packet of the current sending sequence;
step S32b, the intelligent terminal receives a first message that the receiving of the broadcast packets in the current sending sequence is finished and returns to the intelligent terminal after the broadcast packets in the current sending sequence are successfully stored when the receiving identification of the Bluetooth speaker is equal to the sending sequence identification of the broadcast packets in the previous sending sequence;
step S32c, after receiving the first message, the intelligent terminal sends the broadcast packets in the next sending sequence to the bluetooth speaker in a bluetooth broadcasting manner according to a preset sending sequence.
And adding a sending sequence identifier for each broadcast packet prestored in the intelligent terminal, and presetting a receiving identifier of the broadcast packet in the Bluetooth loudspeaker. In this embodiment, the transmission sequence identifier is marked by an index, for example, the index of the first transmission sequence broadcast packet is 1, the index of the second transmission sequence broadcast packet is 2, and the index of the nth transmission sequence broadcast packet is n, where n is a positive integer. The sending sequence identifier is not limited to this, as long as the sending sequence can be indicated.
The receiving identifier has a preset initial value, and the receiving identifier is also marked by an index. In this embodiment, the initial value of the receiving identifier is 0.
When the receiving identifier in the bluetooth speaker is equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, indicating that the broadcast packet in the previous transmitting sequence is already stored in the bluetooth speaker, at this time, the broadcast packet in the current transmitting sequence may be stored in the bluetooth speaker.
For example, when a broadcast packet with a current transmission order of 5 is transmitted to the bluetooth speaker, if it is detected that the reception identifier index in the bluetooth speaker is 4, it indicates that a broadcast packet with a previous transmission order (i.e., a broadcast packet with a fourth transmission order) has been stored in the bluetooth speaker, at this time, the broadcast packet with the transmission order of 5 is stored in the bluetooth speaker, and after the bluetooth speaker successfully stores the broadcast packet with the current transmission order, the reception identifier is replaced with the transmission order identifier of the broadcast packet with the current transmission order, for example, when the bluetooth speaker successfully stores the broadcast packet with the current transmission order of 5 and the transmission order identifier of 5, the reception identifier index is replaced with 5.
The first packet may be an acknowledgement packet whose index is a current sending sequence value, for example, when the current sending sequence is 1, the bluetooth speaker sends the acknowledgement packet whose index is 1 to the intelligent terminal after successfully receiving the broadcast packet in the first sending sequence.
Referring to fig. 6, based on the third embodiment of the software upgrading method for a bluetooth speaker of the present invention, the fourth embodiment of the software upgrading method for a bluetooth speaker of the present invention further includes, after step S32 a:
step S32d, the intelligent terminal receives a second message of an error sent by the Bluetooth speaker to the broadcast packet in the current sending sequence returned by the intelligent terminal when the receiving identifier is not equal to the sending sequence identifier of the broadcast packet in the previous sending sequence;
step S32e, after receiving the second message, the intelligent terminal sends the broadcast packets in the previous sending sequence to the bluetooth speaker in a bluetooth broadcasting manner.
When the receiving identifier in the bluetooth speaker is not equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, it indicates that the broadcast packet in the previous transmitting sequence is not stored in the bluetooth speaker, that is, the broadcast packet in the previous transmitting sequence is lost in the transmitting process, at this time, it is necessary to return the broadcast packet in the current transmitting sequence to the intelligent terminal to transmit an erroneous second message, so that the intelligent terminal can re-transmit the broadcast packet in the previous transmitting sequence to the bluetooth speaker in a bluetooth broadcasting manner according to the second message.
For example, when a broadcast packet with a current transmission order of 5 is transmitted to the bluetooth speaker, if it is detected that the reception identifier index in the bluetooth speaker is 3, it indicates that a broadcast packet with a previous transmission order (i.e., a broadcast packet with a fourth transmission order) is not stored in the bluetooth speaker, and at this time, the bluetooth speaker may transmit a second packet to the smart terminal instead of receiving the broadcast packet with the current transmission order.
The second packet may be an error packet with a transmission sequence identifier of a previous transmission sequence value, for example, when the current transmission sequence is 2, and when the reception identifier in the bluetooth speaker is not equal to the transmission sequence identifier (index is 1) of the broadcast packet in the previous transmission sequence (broadcast packet in the first transmission sequence), the bluetooth speaker transmits the error packet with index being 1 to the smart terminal, so as to indicate that the first broadcast packet is not successfully received.
And the intelligent terminal sends a broadcast packet which is consistent with the sending sequence identifier in the second message to the Bluetooth loudspeaker based on the sending sequence identifier in the second message.
Based on the third embodiment or the fourth embodiment of the software upgrading method for a bluetooth speaker of the present invention, in the fifth embodiment of the software upgrading method for a bluetooth speaker of the present invention, between the step S32a and the step S32c, the method further includes:
step S32f (not shown), the intelligent terminal receives the first message that the receiving of the broadcast packet in the current sending sequence is completed, which is returned to the intelligent terminal after the broadcast packet in the current sending sequence is successfully stored when the receiving identifier of the bluetooth speaker is equal to the initial value.
Presetting an initial value for the receiving identifier, and when the receiving identifier is detected to be the initial value, the bluetooth speaker needs to receive a broadcast packet in a first sending sequence, wherein the index of the broadcast packet is 1. And storing the broadcast packets in the current transmission sequence (the broadcast packets in the first transmission sequence) in the bluetooth speaker, and correspondingly replacing the receiving identifier index with 1 to complete the reception of the first broadcast packet.
Further, when the receiving identifier in the bluetooth speaker is not equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, it may be further determined whether the transmitting sequence of the broadcast packet in the current transmitting sequence is the first sequence;
when the sending sequence of the broadcast packets in the current sending sequence is a first sequence, storing the broadcast packets in the current sending sequence in the Bluetooth loudspeaker, and returning a first message that the receiving of the broadcast packets in the current sending sequence is finished to the intelligent terminal;
when the sending sequence of the broadcast packets in the current sending sequence is not the first sequence, returning a second message with an error in sending of the broadcast packets in the current sending sequence to the intelligent terminal;
and after receiving the second message, retransmitting the broadcast packets in the previous transmission sequence to the Bluetooth loudspeaker in a Bluetooth broadcast mode.
In addition, referring to fig. 1, fig. 2 and fig. 7, to achieve the above object, a first embodiment of the present invention provides an intelligent terminal, where the intelligent terminal and each bluetooth speaker implement communication connection through a bluetooth broadcast communication protocol, and upgrade software of the bluetooth speaker is prestored in the intelligent terminal, and the intelligent terminal further includes:
a
bluetooth connection module10, configured to scan the bluetooth speakers in the surrounding environment, and perform bluetooth connection with each of the scanned bluetooth speakers;
a
comparison module20, configured to obtain a software version of each bluetooth speaker, and compare the software version of the bluetooth speaker with the upgrade software;
and the sending
module30 is configured to send the upgrade software to the bluetooth speaker in a bluetooth broadcast manner when the software version of the bluetooth speaker is inconsistent with the version of the upgrade software, so that the bluetooth speaker completes software upgrade according to the received upgrade software.
In the technical scheme of the invention, the intelligent terminal and each Bluetooth loudspeaker are in communication connection through a Bluetooth broadcast communication protocol, the intelligent terminal scans the Bluetooth loudspeaker in the surrounding environment and performs Bluetooth connection with each scanned Bluetooth loudspeaker to acquire the software version of each Bluetooth loudspeaker, the software version of the Bluetooth loudspeaker is compared with the upgrade software, when the software version of the Bluetooth loudspeaker is inconsistent with the version of the upgrade software, the intelligent terminal sends the upgrade software to the Bluetooth loudspeaker in a Bluetooth broadcast mode to enable the Bluetooth loudspeaker to complete software upgrade according to the received upgrade software, and because the intelligent terminal and each Bluetooth loudspeaker are in communication connection through the Bluetooth broadcast communication protocol, therefore, the intelligent terminal can send the upgrade software to the plurality of Bluetooth speakers at one time, and the defect that the Bluetooth speaker upgrading efficiency is low due to the fact that one intelligent terminal can only realize the software upgrading process of one Bluetooth speaker at one time is overcome.
The intelligent terminal can be any device capable of storing the upgrade software, such as a computer, a notebook, an Ipad, a mobile phone and the like, and can be in communication connection with the Bluetooth loudspeaker through a Bluetooth broadcast communication protocol.
The intelligent terminal is provided with a control interface, the name and the connection state of each Bluetooth loudspeaker scanned by the intelligent terminal are displayed on the control interface, and the connection state is used for indicating whether the intelligent terminal and the Bluetooth loudspeaker are successfully connected or not and can be indicated by 'connected' or 'unconnected'.
When the Bluetooth loudspeaker which is not successfully connected with the intelligent terminal exists in the surrounding environment, after the software upgrading process of the Bluetooth loudspeaker which is successfully connected for the time is completed, the Bluetooth loudspeaker can be restarted or the Bluetooth loudspeaker can be scanned again to be connected again.
And when the Bluetooth loudspeaker is successfully connected with the intelligent terminal, the upgrading software can be automatically sent to the Bluetooth loudspeaker.
In this embodiment, in order to enhance controllability of a software upgrading process, a control key for starting upgrading may be further provided on the control interface of the intelligent terminal, and in addition, a selection key for selecting upgrading software may be further provided, and a user may select a software version to be upgraded in the intelligent terminal through the selection key, so as to upgrade the bluetooth speaker according to the software version to be upgraded.
In order to facilitate a user to check the software upgrading state of each Bluetooth speaker, the software upgrading state of each Bluetooth speaker can be acquired and displayed on a control interface of the intelligent terminal.
The Bluetooth loudspeaker and the intelligent terminal follow the following protocol.
Event(s) | Parameter(s) | Event(s) | Parameter(s) |
Device discovery request | "BRC-Discover" | Device broadcast request | “BRC-Broadcast” |
Device discovery response | "BRC-Response" | Start of upgrade | "Start-UPG" |
Stopping upgrade | "Stop-UPG" | End of upgrade | "End-UPG" |
Upgrade success/failure | 1/-1 | Connection success/failure | 1/-1 |
Referring to fig. 8, based on the first embodiment of the intelligent terminal of the present invention, in the second embodiment of the intelligent terminal of the present invention, the sending
module30 includes:
a
storage unit31 for storing the upgrade software as a plurality of broadcast packets having a preset transmission order;
a sending
unit32, configured to send each broadcast packet to the bluetooth speaker in a bluetooth broadcast manner according to a preset sending sequence;
and an
end sending unit33, configured to end sending the broadcast packet after receiving the reception completion message sent by the bluetooth speaker.
The files are transmitted based on the Bluetooth broadcast communication protocol, a form of broadcast packets needs to be adopted, and the size of each broadcast packet should be set according to the Bluetooth broadcast communication protocol to ensure that each broadcast packet can be transmitted smoothly.
In this embodiment, 10 bytes of data are taken from the upgrade software each time to form a broadcast packet, and of course, the data of the last broadcast packet may be less than 10 bytes. A transmission order is preset for each broadcast packet so that the respective broadcast packets are transmitted in order. Of course, the size of each broadcast packet may be arbitrarily set within the allowable range of the bluetooth broadcast communication protocol, and is not further limited herein.
And in order to identify the transmission end point of the upgrade software, adding an ending identifier which can be identified by the Bluetooth loudspeaker into the last broadcast packet, and when the Bluetooth loudspeaker receives the last broadcast packet, feeding back the message of completing reception to the intelligent terminal by identifying the ending identifier so that the intelligent terminal identifies that the transmission process of the upgrade software is ended. Meanwhile, the file receiving state of each Bluetooth loudspeaker can be displayed on the control interface, and/or the state of a broadcast packet sent to the Bluetooth loudspeaker by the intelligent terminal.
Based on the second embodiment of the intelligent terminal of the present invention, in a third embodiment of the intelligent terminal of the present invention, the sending
module30 further includes:
an identification unit 34 (not shown) for adding a transmission sequence identification to each of the broadcast packets;
referring to fig. 9, the sending
unit32 includes:
a
first subunit32a, configured to send broadcast packets in a current sending order to the bluetooth speaker in a bluetooth broadcast manner according to a preset sending order, and detect a broadcast packet receiving identifier preset in the bluetooth speaker, where the receiving identifier has a preset initial value, and after the bluetooth speaker successfully stores broadcast packets in the current sending order, the receiving identifier is replaced with a sending order identifier of the broadcast packets in the current sending order;
a
second subunit32b, configured to receive, when the receiving identifier is equal to the transmission sequence identifier of the broadcast packet in the previous transmission sequence, the first packet that is returned to the intelligent terminal after the broadcast packet in the current transmission sequence is successfully stored, where the first packet is a first packet that is received after the broadcast packet in the current transmission sequence is received;
and a
third subunit32c, configured to, after receiving the first packet, send a broadcast packet in a next sending order to the bluetooth speaker in a bluetooth broadcasting manner according to a preset sending order.
And adding a sending sequence identifier for each broadcast packet prestored in the intelligent terminal, and presetting a receiving identifier of the broadcast packet in the Bluetooth loudspeaker. In this embodiment, the transmission sequence identifier is marked by an index, for example, the index of the first transmission sequence broadcast packet is 1, the index of the second transmission sequence broadcast packet is 2, and the index of the nth transmission sequence broadcast packet is n, where n is a positive integer. The sending sequence identifier is not limited to this, as long as the sending sequence can be indicated.
The receiving identifier has a preset initial value, and the receiving identifier is also marked by an index. In this embodiment, the initial value of the receiving identifier is 0.
When the receiving identifier in the bluetooth speaker is equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, indicating that the broadcast packet in the previous transmitting sequence is already stored in the bluetooth speaker, at this time, the broadcast packet in the current transmitting sequence may be stored in the bluetooth speaker.
For example, when a broadcast packet with a current transmission order of 5 is transmitted to the bluetooth speaker, if it is detected that the reception identifier index in the bluetooth speaker is 4, it indicates that a broadcast packet with a previous transmission order (i.e., a broadcast packet with a fourth transmission order) has been stored in the bluetooth speaker, at this time, the broadcast packet with the transmission order of 5 is stored in the bluetooth speaker, and after the bluetooth speaker successfully stores the broadcast packet with the current transmission order, the reception identifier is replaced with the transmission order identifier of the broadcast packet with the current transmission order, for example, when the bluetooth speaker successfully stores the broadcast packet with the current transmission order of 5 and the transmission order identifier of 5, the reception identifier index is replaced with 5.
The first packet may be an acknowledgement packet whose index is a current sending sequence value, for example, when the current sending sequence is 1, the bluetooth speaker sends the acknowledgement packet whose index is 1 to the intelligent terminal after successfully receiving the broadcast packet in the first sending sequence.
Referring to fig. 10, based on the third embodiment of the intelligent terminal of the present invention, in the fourth embodiment of the intelligent terminal of the present invention, the sending
unit32 further includes:
a
fourth subunit32d, configured to receive, when the receiving identifier is not equal to the sending sequence identifier of the broadcast packet in the previous sending sequence, the second packet that is returned by the bluetooth speaker and is in error in sending the broadcast packet in the current sending sequence to the intelligent terminal;
and a
fifth sub-unit32e, configured to send the broadcast packets in the previous sending sequence to the bluetooth speaker in a bluetooth broadcast manner after receiving the second message.
When the receiving identifier in the bluetooth speaker is not equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, it indicates that the broadcast packet in the previous transmitting sequence is not stored in the bluetooth speaker, that is, the broadcast packet in the previous transmitting sequence is lost in the transmitting process, at this time, it is necessary to return the broadcast packet in the current transmitting sequence to the intelligent terminal to transmit an erroneous second message, so that the intelligent terminal can re-transmit the broadcast packet in the previous transmitting sequence to the bluetooth speaker in a bluetooth broadcasting manner according to the second message.
For example, when a broadcast packet with a current transmission order of 5 is transmitted to the bluetooth speaker, if it is detected that the reception identifier index in the bluetooth speaker is 3, it indicates that a broadcast packet with a previous transmission order (i.e., a broadcast packet with a fourth transmission order) is not stored in the bluetooth speaker, and at this time, the bluetooth speaker may transmit a second packet to the smart terminal instead of receiving the broadcast packet with the current transmission order.
The second packet may be an error packet with a transmission sequence identifier of a previous transmission sequence value, for example, when the current transmission sequence is 2, and when the reception identifier in the bluetooth speaker is not equal to the transmission sequence identifier (index is 1) of the broadcast packet in the previous transmission sequence (broadcast packet in the first transmission sequence), the bluetooth speaker transmits the error packet with index being 1 to the smart terminal, so as to indicate that the first broadcast packet is not successfully received.
And the intelligent terminal sends a broadcast packet which is consistent with the sending sequence identifier in the second message to the Bluetooth loudspeaker based on the sending sequence identifier in the second message.
Based on the third embodiment or the fourth embodiment of the intelligent terminal of the present invention, in a fifth embodiment of the intelligent terminal of the present invention, the sending
unit32 further includes:
a sixth subunit 32f (not shown), configured to receive the first packet that is returned to the intelligent terminal after the bluetooth speaker successfully stores the broadcast in the current sending sequence when the receiving identifier is equal to the initial value, and that is obtained after the receiving of the broadcast packet in the current sending sequence is completed.
Presetting an initial value for the receiving identifier, and when the receiving identifier is detected to be the initial value, the bluetooth speaker needs to receive a broadcast packet in a first sending sequence, wherein the index of the broadcast packet is 1. And storing the broadcast packets in the current transmission sequence (the broadcast packets in the first transmission sequence) in the bluetooth speaker, and correspondingly replacing the receiving identifier index with 1 to complete the reception of the first broadcast packet.
Further, when the receiving identifier in the bluetooth speaker is not equal to the transmitting sequence identifier of the broadcast packet in the previous transmitting sequence, it may be further determined whether the transmitting sequence of the broadcast packet in the current transmitting sequence is the first sequence;
when the sending sequence of the broadcast packets in the current sending sequence is a first sequence, storing the broadcast packets in the current sending sequence in the Bluetooth loudspeaker, and returning a first message that the receiving of the broadcast packets in the current sending sequence is finished to the intelligent terminal;
when the sending sequence of the broadcast packets in the current sending sequence is not the first sequence, returning a second message with an error in sending of the broadcast packets in the current sending sequence to the intelligent terminal;
and after receiving the second message, retransmitting the broadcast packets in the previous transmission sequence to the Bluetooth loudspeaker in a Bluetooth broadcast mode.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.