[go: up one dir, main page]

CN114827967B - Software updating method, bluetooth device and storage medium - Google Patents

Software updating method, bluetooth device and storage medium Download PDF

Info

Publication number
CN114827967B
CN114827967B CN202210231714.8A CN202210231714A CN114827967B CN 114827967 B CN114827967 B CN 114827967B CN 202210231714 A CN202210231714 A CN 202210231714A CN 114827967 B CN114827967 B CN 114827967B
Authority
CN
China
Prior art keywords
data
bluetooth
slave
frame format
slave device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210231714.8A
Other languages
Chinese (zh)
Other versions
CN114827967A (en
Inventor
刘世林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Frequen Microelectronics Co ltd
Original Assignee
Shanghai Frequen Microelectronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Frequen Microelectronics Co ltd filed Critical Shanghai Frequen Microelectronics Co ltd
Priority to CN202210231714.8A priority Critical patent/CN114827967B/en
Publication of CN114827967A publication Critical patent/CN114827967A/en
Application granted granted Critical
Publication of CN114827967B publication Critical patent/CN114827967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a software updating method, bluetooth equipment and a storage medium. A software updating method is applied to a Bluetooth device comprising a Bluetooth master-slave function, and comprises the following steps: transmitting handshake information according to a set frame format through Bluetooth broadcasting; receiving response information of a plurality of slave devices, wherein the response information of each slave device comprises a Media Access Control (MAC) address of the slave device; and respectively transmitting burning data to each slave device according to a set frame format, wherein the burning data is used for updating the software program of each slave device. The slave devices are Bluetooth devices to be updated, handshake information is sent according to a set frame format by Bluetooth broadcasting, and then the software programs of the slave devices are updated by respectively transmitting burning data to the slave devices according to the set frame format, so that software updating can be performed on a plurality of Bluetooth devices at the same time, the trouble of wiring is avoided, and the updating efficiency is improved.

Description

软件更新方法、蓝牙设备及存储介质Software update method, bluetooth device and storage medium

技术领域technical field

本发明涉及蓝牙技术领域,尤其涉及一阵软件更新方法、蓝牙设备及存储介质。The invention relates to the technical field of bluetooth, in particular to a software update method, a bluetooth device and a storage medium.

背景技术Background technique

传统的蓝牙更新软件,有两种方式:一、有线连接;二、OTA(Over-the-AirTechnology,空中下载技术)升级。There are two ways to update software via traditional Bluetooth: 1. Wired connection; 2. OTA (Over-the-AirTechnology, over-the-air technology) upgrade.

有线连接受限于通信协议的约束,一个接口只能更新一台蓝牙设备软件,并且每台设备更新都需要重新接线,非常繁琐。OTA是以无线通信的方式对单个设备进行软件更新升级,这种方式虽无需接线,但是在数量众多的设备更新时,需要和每台设备单独建立无线通信信道,非常耗时。The wired connection is limited by the communication protocol. One interface can only update the software of one Bluetooth device, and each device update requires rewiring, which is very cumbersome. OTA is to update the software of a single device through wireless communication. Although this method does not require wiring, it is very time-consuming to establish a wireless communication channel with each device when updating a large number of devices.

因此,传统的蓝牙更新软件方式,在需软件更新的蓝牙设备数量众多时,存在接线不方便以及耗费时间的缺陷。Therefore, the traditional Bluetooth software update method has the disadvantages of inconvenient wiring and time-consuming when there are a large number of Bluetooth devices requiring software update.

发明内容Contents of the invention

本发明提供了一种软件更新方法、装置、监测设备及存储介质,以实现多个蓝牙设备的软件更新,无需接线,所需时间短,提高了更新效率。The invention provides a software update method, device, monitoring equipment and storage medium to realize software update of multiple bluetooth devices without wiring, short required time and improved update efficiency.

第一方面,本发明实施例提供了一种软件更新方法,应用于包含蓝牙主从功能的蓝牙设备,包括:In the first aspect, the embodiment of the present invention provides a software update method, which is applied to a Bluetooth device including a Bluetooth master-slave function, including:

通过蓝牙广播按照设定帧格式发送握手信息;Send handshake information according to the set frame format through Bluetooth broadcasting;

接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的媒体存取控制MAC地址;receiving response information from multiple slave devices, where the response information from each slave device includes the media access control MAC address of the slave device;

分别向各所述从设备按照设定帧格式下发烧录数据,所述烧录数据用于更新各所述从设备的软件程序。The programming data is sent to each of the slave devices according to the set frame format, and the programming data is used to update the software program of each of the slave devices.

可选的,在分别向各所述从设备按照设定帧格式下发烧录数据之后,还包括:Optionally, after sending the programming data to each of the slave devices according to the set frame format, it also includes:

接收至少一个从设备上报的数据请求,所述数据请求包括所述从设备的MAC地址;receiving at least one data request reported by the slave device, the data request including the MAC address of the slave device;

根据所述MAC地址向相应从设备发送缺失数据。Send the missing data to the corresponding slave device according to the MAC address.

可选的,所述设定帧格式包括以下字段:Optionally, the setting frame format includes the following fields:

同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Synchronous frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

可选的,在通过蓝牙广播按照设定帧格式发送握手信息之前,还包括:Optionally, before sending the handshake information according to the set frame format through the Bluetooth broadcast, it also includes:

通过串口接收用户设置的更新参数和更新数据,其中,所述更新参数包括待更新设备个数和广播数据长度,所述更新数据包括待更新软件程序的十六进制数据。The update parameters and update data set by the user are received through the serial port, wherein the update parameters include the number of devices to be updated and the length of broadcast data, and the update data includes hexadecimal data of the software program to be updated.

可选的,在分别向各所述从设备按照设定帧格式下发烧录数据之前,还包括:Optionally, before sending the programming data to each of the slave devices according to the set frame format, it also includes:

若发送应答信息的从设备个数达到所述待更新设备个数,则通过蓝牙广播发送握手完成信息。If the number of slave devices sending response information reaches the number of devices to be updated, handshake completion information is sent through Bluetooth broadcast.

第二方面,本发明实施例还提供了一种软件更新方法,应用于包含蓝牙主从功能的蓝牙设备,包括:In the second aspect, the embodiment of the present invention also provides a software update method, which is applied to a Bluetooth device including a Bluetooth master-slave function, including:

通过蓝牙扫描功能接收主设备发送的包含握手信息的广播;Receive the broadcast containing handshake information sent by the master device through the Bluetooth scanning function;

根据所述握手信息返回应答信息,所述应答信息包括所述从设备的MAC地址;Returning response information according to the handshake information, the response information including the MAC address of the slave device;

接收主设备下发的设定帧格式的烧录数据,并根据所述烧录数据更新软件程序。The programming data of the set frame format sent by the master device is received, and the software program is updated according to the programming data.

可选的,在根据所述烧录数据更新软件程序之前,还包括:Optionally, before updating the software program according to the burning data, it also includes:

通过比对所述烧录数据的包地址和哈希校验值确定缺失数据;Determine the missing data by comparing the package address and the hash check value of the burning data;

上报数据请求,以请求所述主设备发送所述缺失数据,所述数据请求包括所述从设备的MAC地址。Reporting a data request to request the master device to send the missing data, where the data request includes the MAC address of the slave device.

可选的,所述设定帧格式包括以下字段:Optionally, the setting frame format includes the following fields:

同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Synchronous frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

第三方面,本发明实施例还提供了一种蓝牙设备,包括:In a third aspect, the embodiment of the present invention also provides a Bluetooth device, including:

一个或多个处理器;one or more processors;

存储装置,用于存储一个或多个程序;storage means for storing one or more programs;

当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明实施例提供的软件更新方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the software update method provided by the embodiment of the present invention.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现本发明实施例提供的软件更新方法。In a fourth aspect, the embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and is characterized in that, when the program is executed by a processor, the software update method provided in the embodiment of the present invention is implemented.

本发明实施例提供了一种软件更新方法、装置、监测设备及存储介质,首先通过蓝牙广播按照设定帧格式发送握手信息;然后接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的MAC地址;最后分别向各从设备按照设定帧格式下发烧录数据,所述烧录数据用于更新各所述从设备的软件程序。其中,从设备是待更新的蓝牙设备,利用上述技术方案来更新各从设备的软件程序,能够实现同时对多个蓝牙设备进行软件更新,免去接线的麻烦,节省时间,提高更新效率。The embodiment of the present invention provides a software update method, device, monitoring equipment and storage medium, firstly send handshake information according to the set frame format through Bluetooth broadcast; then receive response information from multiple slave devices, each slave device response information It includes the MAC address of the slave device; finally, the programming data is sent to each slave device according to the set frame format, and the programming data is used to update the software program of each slave device. Wherein, the slave device is a Bluetooth device to be updated. Utilizing the above technical solution to update the software program of each slave device can realize software update for multiple Bluetooth devices at the same time, avoiding the trouble of wiring, saving time and improving update efficiency.

应当理解,本部分所描述的内容并非旨在标识本发明的实施例的关键或重要特征,也不用于限制本发明的范围。本发明的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will be easily understood from the following description.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1a是根据本发明实施例一提供的一种软件更新方法的流程图;FIG. 1a is a flow chart of a software update method provided according to Embodiment 1 of the present invention;

图1b是根据本发明实施例一提供的一种设定帧格式的示意图;FIG. 1b is a schematic diagram of setting a frame format according to Embodiment 1 of the present invention;

图2a是根据本发明实施例二提供的一种软件更新方法的流程图;FIG. 2a is a flow chart of a software update method provided according to Embodiment 2 of the present invention;

图2b是根据本发明实施例二提供的一种主设备与从设备握手的示意图;FIG. 2b is a schematic diagram of handshaking between a master device and a slave device according to Embodiment 2 of the present invention;

图2c是根据本发明实施例二提供的一种用户设置更新参数和更新数据的流程图;Fig. 2c is a flow chart of setting update parameters and update data by a user according to Embodiment 2 of the present invention;

图3a是根据本发明实施例三提供的一种软件更新方法的流程图;FIG. 3a is a flowchart of a software update method provided according to Embodiment 3 of the present invention;

图3b是根据本发明实施例三提供的一种主设备更新从设备软件程序的流程图;Fig. 3b is a flow chart of a master device updating a slave device software program according to Embodiment 3 of the present invention;

图4是根据本发明实施例四提供的一种软件更新装置的结构示意图;FIG. 4 is a schematic structural diagram of a software update device provided according to Embodiment 4 of the present invention;

图5是根据本发明实施例五提供的一种软件更新装置的结构示意图;FIG. 5 is a schematic structural diagram of a software update device provided according to Embodiment 5 of the present invention;

图6是根据本发明实施例六提供的一种蓝牙设备的结构示意图。Fig. 6 is a schematic structural diagram of a bluetooth device provided according to Embodiment 6 of the present invention.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is an embodiment of a part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first" and "second" in the description and claims of the present invention and the above drawings are used to distinguish similar objects, but not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having", as well as any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product or device comprising a sequence of steps or elements is not necessarily limited to the expressly listed instead, may include other steps or elements not explicitly listed or inherent to the process, method, product or apparatus.

实施例一Embodiment one

图1a为本发明实施例一提供的一种软件更新方法的流程图,本实施例可适用于多个蓝牙设备需要软件更新的情况,也可以应用于具有接收的功能的蓝牙设备或者2.4G/5.8G等速率大于1M的高速率无线通讯设备上,该方法可以由软件更新装置来执行,该装置可以采用硬件和/或软件的形式实现,该软件更新装置可配置于蓝牙设备中。Figure 1a is a flow chart of a software update method provided by Embodiment 1 of the present invention. This embodiment can be applied to the situation where multiple Bluetooth devices need software updates, and can also be applied to Bluetooth devices with the function of receiving or 2.4G/ 5.8G and other high-speed wireless communication devices with a rate greater than 1M, the method can be executed by a software update device, which can be implemented in the form of hardware and/or software, and the software update device can be configured in the Bluetooth device.

对于需要更新的和更新的蓝牙设备,均具有蓝牙主从功能,即广播和扫描功能。本实施例将更新软件的蓝牙设备作为主设备,将待更新的蓝牙设备作为从设备。For the bluetooth devices that need to be updated and updated, both have bluetooth master-slave functions, that is, broadcast and scan functions. In this embodiment, the Bluetooth device whose software is updated is used as the master device, and the Bluetooth device to be updated is used as the slave device.

如图1a所示,该方法包括:As shown in Figure 1a, the method includes:

S110、通过蓝牙广播按照设定帧格式发送握手信息。S110. Send the handshake information according to the set frame format through the Bluetooth broadcast.

具体的,主设备可以通过蓝牙广播的方式向一定范围内(例如10米内)的多个从设备按照设定帧格式发送握手信息,握手信息包括:握手包和烧录数据通过哈希校验生成的校验值。其中,烧录也叫刻录,就是把想要的数据通过刻录机等工具刻制到光盘、烧录卡等介质中。主设备通过蓝牙广播的方式发送握手信息可以与收到握手信息的多个从设备进行交互,即不用连线,就可以达到一与多交互的效果,通过设定帧格式发送握手信息,例如设定帧格式可以包括同步帧(Sync)、待更新设备地址(Mac Add,MD)等,Sync可以让主设备区分哪些从设备是此次需要握手交互的,MD可以让主设备知道从设备的设备地址,在交互过程中主设备可以将数据更准确的发送给相应的从设备。Specifically, the master device can send handshake information to multiple slave devices within a certain range (for example, within 10 meters) according to the set frame format through Bluetooth broadcasting. The handshake information includes: handshake packets and programming data are generated through hash verification check value. Among them, burning is also called burning, which is to burn the desired data into media such as CDs and burning cards through tools such as recorders. The master device sends handshake information through bluetooth broadcast to interact with multiple slave devices that receive the handshake information, that is, without connection, it can achieve the effect of one-to-many interaction, and send handshake information by setting the frame format, such as setting The fixed frame format can include synchronization frame (Sync), device address to be updated (Mac Add, MD), etc. Sync can let the master device distinguish which slave devices need handshake interaction this time, and MD can let the master device know the device of the slave device address, the master device can send data to the corresponding slave device more accurately during the interaction process.

S120、接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的媒体存取控制MAC地址。S120. Receive response information from multiple slave devices, where the response information from each slave device includes the MAC address of the slave device.

具体的,主设备通过蓝牙广播的方式发送握手信息,多个从设备收到握手信息后,会返回给主设备应答信息,主设备接收多个从设备的应答信息,完成握手流程。每个从设备的应答信息包括该从设备的MAC地址,主设备可以通过MAC地址判断收到的从设备个数。Specifically, the master device sends handshake information through Bluetooth broadcasting. After multiple slave devices receive the handshake information, they will return response information to the master device. The master device receives the response information from multiple slave devices to complete the handshake process. The response information of each slave device includes the MAC address of the slave device, and the master device can judge the number of slave devices received by the MAC address.

S130、分别向各所述从设备按照设定帧格式下发烧录数据。S130. Send the programming data to each of the slave devices according to the set frame format.

其中,烧录数据用于更新各从设备的软件程序。Wherein, the programming data is used to update the software program of each slave device.

具体的,烧录数据可以包括:待更新的设备个数,广播数据长度。主设备可以分别向各从设备按照设定帧格式下发烧录数据来更新从设备的软件程序。Specifically, the burning data may include: the number of devices to be updated, and the length of broadcast data. The master device can respectively send programming data to each slave device according to the set frame format to update the software program of the slave device.

可选的,设定帧格式可以包括以下字段:同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Optionally, the setting frame format may include the following fields: synchronization frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

具体的,在正常的使用场景中周围有很多的蓝牙设备,这些设备一直在发送不同的广播数据。蓝牙会将不同的蓝牙设备发送的广播包数据都搜索到,图1b为本发明实施例一提供的一种设定帧格式的示意图,如图1b所示,广播包的帧格式具体包括以下字段:同步帧(Sync);包类型(Packet Type,PT);包使能(Mac Enable,ME);数据获取类型(Mac Get,ME)、待更新设备地址(Mac Add,MD);包地址(Packet Add,PD);包长度(Packet Length,PL);数据(Payload);循环冗余校验(Cyclic Redundancy Check,CRC)。Specifically, there are many Bluetooth devices around in normal use scenarios, and these devices have been sending different broadcast data. Bluetooth will search all the broadcast packet data sent by different Bluetooth devices. Figure 1b is a schematic diagram of setting the frame format provided by Embodiment 1 of the present invention. As shown in Figure 1b, the frame format of the broadcast packet specifically includes the following fields : Synchronous frame (Sync); packet type (Packet Type, PT); packet enabling (Mac Enable, ME); data acquisition type (Mac Get, ME), device address to be updated (Mac Add, MD); packet address ( Packet Add, PD); packet length (Packet Length, PL); data (Payload); cyclic redundancy check (Cyclic Redundancy Check, CRC).

其中,同步帧(Sync)长度4字节(即4Byte),同步帧字段内容与主设备(即更新升级软件的蓝牙设备)相同的蓝牙设备,都是需要握手/升级的设备(即从设备)。Among them, the length of the synchronization frame (Sync) is 4 bytes (that is, 4Byte), and the content of the synchronization frame field is the same as that of the master device (that is, the Bluetooth device that updates and upgrades the software), and all Bluetooth devices that need to shake hands/upgrade (ie, slave devices) .

包类型PT的长度为2bits,其具体含义可以包括:The length of the packet type PT is 2 bits, and its specific meaning can include:

00:保留(即暂时不设置任何含义,以后根据实际需求可能增加新的含义);00: Reserved (that is, no meaning is set temporarily, and new meanings may be added according to actual needs in the future);

01:握手;01: handshake;

10:数据;10: data;

11:重发。11: Resend.

包使能ME的长度为1bit,其具体含义可以包括:The length of the packet enabling ME is 1 bit, and its specific meaning can include:

0:后续包中包含有MAC地址;0: The subsequent packet contains the MAC address;

1:后续包中不包含MAC地址。1: The MAC address is not included in subsequent packets.

数据获取类型MG的长度为1bit,其具体含义可以包括:The length of the data acquisition type MG is 1 bit, and its specific meaning may include:

0:发送包;0: send packet;

1:获取数据包请求指令。1: Get the packet request command.

PT、ME和MG共占用1字节,此外,还可以有一个长度4Bits的Rsv保留字段。PT, ME and MG occupy 1 byte in total. In addition, there may be a Rsv reserved field with a length of 4Bits.

包地址PD,可以将广播包数据以100Bytes长度开始分包,包从0开始计数,PD就是计数值。Packet address PD, the broadcast packet data can be divided into packets with a length of 100Bytes, the packet counts from 0, and PD is the count value.

包长度PD可以认为是主设备和从设备交互过程中所发包的长度。The packet length PD can be considered as the length of the packet sent during the interaction between the master device and the slave device.

数据(Payload)可以是烧录数据、握手信息等在主设备和从设备之间传输的具体数据。The data (Payload) can be the specific data transmitted between the master device and the slave device, such as programming data and handshake information.

循环冗余校验(Cyclic Redundancy Check,CRC),用于利用除法及余数的原理进行错误侦测,以检测或校验数据传输或者保存后可能出现的错误。Cyclic Redundancy Check (CRC) is used for error detection using the principle of division and remainder to detect or verify errors that may occur after data transmission or storage.

本发明实施例提供的软件更新方法,通过蓝牙广播按照设定帧格式发送握手信息;然后接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的MAC地址;最后分别向各从设备按照设定帧格式下发烧录数据,所述烧录数据用于更新各所述从设备的软件程序。利用上述技术方案来同时更新多个从设备的软件程序,能够免去接线的麻烦,节省时间,提高更新效率。The software update method provided by the embodiment of the present invention sends handshake information according to the set frame format through bluetooth broadcast; then receives response information from a plurality of slave devices, and the response information of each slave device includes the MAC address of the slave device; Each slave device sends burning data according to the set frame format, and the burning data is used to update the software program of each said slave device. Utilizing the above technical solution to simultaneously update the software programs of multiple slave devices can avoid the trouble of wiring, save time, and improve update efficiency.

实施例二Embodiment two

图2a为本发明实施例二提供的一种软件更新方法的流程图,本实施例二在上述各实施例的基础上进行优化。如图2a所示,该方法包括:Fig. 2a is a flow chart of a software updating method provided by Embodiment 2 of the present invention, and this Embodiment 2 is optimized on the basis of the foregoing embodiments. As shown in Figure 2a, the method includes:

S210、通过串口接收用户设置的更新参数和更新数据。S210. Receive update parameters and update data set by the user through the serial port.

其中,更新参数包括待更新设备个数和广播数据长度,更新数据包括待更新软件程序的十六进制数据。Wherein, the update parameters include the number of devices to be updated and the length of broadcast data, and the update data includes hexadecimal data of software programs to be updated.

S220、通过蓝牙广播按照设定帧格式发送握手信息。S220. Send the handshake information according to the set frame format through the Bluetooth broadcast.

具体的,图2b为本发明实施例二提供的一种主设备与从设备握手的示意图,如图2b所示,用户可以控制操作主设备,通过串口来设置需要更新设备(即待更新设备)的更新参数和更新数据,更新参数可以包括待更新设备个数和广播数据长度,更新数据可以包括待更新软件程序的十六进制数据,设置完成后,主设备会返回配置完成给用户,然后主设备与待更新的从设备进行握手交互。Specifically, FIG. 2b is a schematic diagram of a handshake between a master device and a slave device provided by Embodiment 2 of the present invention. As shown in FIG. 2b, the user can control and operate the master device, and set the device to be updated (that is, the device to be updated) through the serial port. Update parameters and update data. The update parameters can include the number of devices to be updated and the length of the broadcast data. The update data can include the hexadecimal data of the software program to be updated. After the settings are completed, the master device will return the configuration to the user, and then The master device performs a handshake interaction with the slave device to be updated.

S230、接收多个从设备的应答信息。S230. Receive response information from multiple slave devices.

其中,每个从设备的应答信息包括该从设备的MAC地址。Wherein, the response information of each slave device includes the MAC address of the slave device.

S240、若发送应答信息的从设备个数达到所述待更新设备个数,则通过蓝牙广播发送握手完成信息。S240. If the number of slave devices sending response information reaches the number of devices to be updated, send handshake completion information through Bluetooth broadcast.

具体的,主设备可以通过检测MAC地址来判断收到的从设备个数,若收到的从设备个数达到用户设定的待更新设备个数,则主设备通过蓝牙广播发送握手完成信息。在此基础上,可以实现对指定数量从设备的更新,满足更多样的软件更新需求。Specifically, the master device can judge the number of slave devices received by detecting the MAC address. If the number of slave devices received reaches the number of devices to be updated set by the user, the master device sends a handshake completion message through Bluetooth broadcast. On this basis, it is possible to update a specified number of slave devices to meet more diverse software update requirements.

S250、分别向各所述从设备按照设定帧格式下发烧录数据。S250. Send the burning and recording data to each of the slave devices according to the set frame format.

可选的,在分别向各所述从设备按照设定帧格式下发烧录数据之后,还包括:接收至少一个从设备上报的数据请求,所述数据请求包括所述从设备的MAC地址;根据所述MAC地址向相应从设备发送缺失数据。Optionally, after sending the programming data to each of the slave devices according to the set frame format, it also includes: receiving a data request reported by at least one slave device, the data request including the MAC address of the slave device; Send the missing data to the corresponding slave device according to the MAC address.

具体的,可能会存在发送的烧录数据从设备不一定会完全接收或者数据丢失的情况,此时,从设备在根据烧录数据更新软件程序之前,会检验烧录数据的完整性,从而判断是否向主设备索要数据,可以通过比对烧录数据的包地址(PD)和哈希校验值(CRC)来确认缺失数据,同时从设备上报数据请求,告知主设备所需要的缺失数据,主设备可以接收至少一个从设备上报的数据请求,数据请求包括从设备的MAC地址,根据MAC地址向相应从设备发送缺失数据,直到从设备的更新完成。Specifically, there may be cases where the slave device may not receive the programmed data completely or the data is lost. At this time, the slave device will check the integrity of the programmed data before updating the software program according to the programmed data, so as to judge Whether to ask the master device for data, you can confirm the missing data by comparing the packet address (PD) and the hash check value (CRC) of the burned data, and at the same time report the data request from the device to inform the master device of the missing data required, The master device may receive a data request reported by at least one slave device, the data request includes the MAC address of the slave device, and send missing data to the corresponding slave device according to the MAC address until the update of the slave device is completed.

示例性的,图2c为本发明实施例二提供的一种用户设置更新参数和更新数据的流程图,如图2c所示,具体包括:Exemplarily, Fig. 2c is a flow chart of a user setting update parameters and update data provided by Embodiment 2 of the present invention, as shown in Fig. 2c, specifically including:

S20、设置更新参数和更新数据。S20. Setting update parameters and update data.

S21、下发更新参数和更新数据给主设备。S21. Send update parameters and update data to the master device.

S22、主设备判断更新参数和更新数据是否正确,若是,则执行S23;若否,则执行S21。S22. The master device judges whether the update parameters and update data are correct, and if yes, executes S23; if not, executes S21.

S23、主设备判断是否进行从设备的软件程序更新,若是,则执行S24;若否,则直接结束设置参数的流程。S23. The master device judges whether to update the software program of the slave device, and if yes, executes S24; if not, directly ends the process of setting parameters.

S24、主设备更新从设备的软件程序。S24. The master device updates the software program of the slave device.

本发明实施例提供的软件更新方法,先通过串口接收用户设置的更新参数和更新数据,再通过蓝牙广播按照设定帧格式发送握手信息;然后接收多个从设备的应答信息;最后分别向各从设备按照设定帧格式下发烧录数据,通过烧录数据来更新各从设备的软件程序。利用上述技术方案来更新各从设备的软件程序,能够免去接线的麻烦,节省时间。The software update method provided by the embodiment of the present invention first receives the update parameters and update data set by the user through the serial port, and then sends the handshake information through the bluetooth broadcast according to the set frame format; then receives the response information from multiple slave devices; The slave devices send and record data according to the set frame format, and update the software program of each slave device by burning the data. Utilizing the above technical solution to update the software program of each slave device can avoid the trouble of wiring and save time.

实施例三Embodiment three

图3a为本发明实施例三提供的一种软件更新方法的流程图。该方法可应用于从设备。需要说明的是,未在本实施例中详尽描述的技术细节可参见上述任意实施例。Fig. 3a is a flow chart of a software update method provided by Embodiment 3 of the present invention. This method can be applied to slave devices. It should be noted that for technical details not exhaustively described in this embodiment, reference may be made to any of the foregoing embodiments.

如图3a所示,该方法包括:As shown in Figure 3a, the method includes:

S310、通过蓝牙扫描功能接收主设备发送的包含握手信息的广播。S310. Receive a broadcast including handshake information sent by the master device through the Bluetooth scanning function.

S320、根据所述握手信息返回应答信息。S320. Return response information according to the handshake information.

其中,应答信息包括所述从设备的MAC地址。Wherein, the response information includes the MAC address of the slave device.

S330、接收主设备下发的设定帧格式的烧录数据,并根据所述烧录数据更新软件程序。S330. Receive the programming data of the set frame format delivered by the master device, and update the software program according to the programming data.

本发明实施例提供的软件更新方法,从设备先通过蓝牙扫描功能接收主设备发送的包含握手信息的广播;然后根据所述握手信息返回应答信息。其中,应答信息包括所述从设备的MAC地址;最后接收主设备下发的设定帧格式的烧录数据,并根据所述烧录数据更新软件程序。利用上述技术方案,能够在数量众多的蓝牙设备需要更新,且接线不方便的情况下,通过蓝牙广播的方式实现多个蓝牙设备(即多个从设备)的同时更新,使蓝牙设备更新的方式更加灵活、高效。In the software update method provided by the embodiment of the present invention, the slave device first receives the broadcast containing handshake information sent by the master device through the Bluetooth scanning function; and then returns response information according to the handshake information. Wherein, the response information includes the MAC address of the slave device; finally, receiving the programming data in the frame format sent by the master device, and updating the software program according to the programming data. Utilizing the above-mentioned technical solution, when a large number of Bluetooth devices need to be updated and the connection is inconvenient, the simultaneous update of multiple Bluetooth devices (that is, multiple slave devices) can be realized through Bluetooth broadcasting. More flexible and efficient.

可选的,所述设定帧格式包括以下字段:同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Optionally, the setting frame format includes the following fields: synchronization frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

可选的,在根据烧录数据更新软件程序之前,还包括:通过比对烧录数据的包地址和哈希校验值确定缺失数据;上报数据请求,以请求所述主设备发送所述缺失数据,所述数据请求包括所述从设备的MAC地址。Optionally, before updating the software program according to the burning data, it also includes: determining the missing data by comparing the packet address and the hash check value of the burning data; reporting a data request to request the master device to send the missing data; data, the data request includes the MAC address of the slave device.

具体的,在接收主设备下发的设定帧格式的烧录数据,并根据烧录数据更新软件程序之前,会存在发送的烧录数据从设备不一定会完全接收,会存在数据丢失的情况,所以需要进行校验烧录数据的完整性,从设备可以通过比对烧录数据的包地址(PD)和哈希校验值(CRC)来确认缺失的数据,同时上报主设备,告知主设备需要所缺失的数据。主设备可以通过检测上报从设备的MAC地址,对单个从设备发送其所缺失的数据。Specifically, before receiving the programming data with the set frame format sent by the master device and updating the software program according to the programming data, the slave device may not necessarily receive all the programming data sent by the master device, and there may be data loss. , so it is necessary to verify the integrity of the burned data. The slave device can confirm the missing data by comparing the packet address (PD) and the hash check value (CRC) of the burned data, and report to the master device at the same time to inform the master The device requires the missing data. The master device can send missing data to a single slave device by detecting and reporting the MAC address of the slave device.

示例性的,图3b为本发明实施例三提供的一种主设备更新从设备软件程序的流程图,如图3b所示,具体包括:Exemplarily, Fig. 3b is a flow chart of a master device updating a slave device software program according to Embodiment 3 of the present invention, as shown in Fig. 3b, specifically including:

S30、主设备发送握手指令。S30. The master device sends a handshake instruction.

S31、从设备判断握手指令是否正确,若是,则执行S32;若否,则执行S30。S31. The slave device judges whether the handshake instruction is correct, and if yes, executes S32; if not, executes S30.

S32、主设备下发烧录数据。S32. The master device downloads and downloads the burning and recording data.

S33、从设备判断CRC是否正确,若是,则执行S34;若否,则从设备丢弃数据,执行S35。S33. The slave device judges whether the CRC is correct, and if yes, executes S34; if not, the slave device discards the data, and executes S35.

S34、从设备保存烧录数据。S34. Save the programming data from the device.

S35、主设备判断是否需要继续更新,若是,则执行S36;若否,则返回S32。S35. The main device judges whether to continue updating, if yes, execute S36; if not, return to S32.

S36、从设备判断烧录数据是否完整,若是,则结束;若否,则执行S37,返回S32。S36. The slave device judges whether the burning data is complete, if yes, then end; if not, execute S37, and return to S32.

S37、向主设备索要缺失数据。S37. Request missing data from the master device.

本发明实施例提供的软件更新方法,主设备通过蓝牙广播按照设定帧格式发送握手信息;然后从设备根据握手信息返回应答信息;再接收主设备下发的设定帧格式的烧录数据,并检验烧录程序的完整性,最后根烧录数据来更新各从设备的软件程序。利用上述技术方案,在需要更新的蓝牙设备数量众多的情况下,能够免去接线的麻烦,节省时间,提高更新效率。In the software update method provided by the embodiment of the present invention, the master device sends handshake information according to the set frame format through Bluetooth broadcast; then the slave device returns response information according to the handshake information; and then receives the programming data in the set frame format issued by the master device, And check the integrity of the burning program, and finally update the software program of each slave device based on the burning data. With the above technical solution, in the case of a large number of Bluetooth devices that need to be updated, the trouble of wiring can be avoided, time can be saved, and update efficiency can be improved.

本发明实施例提供的软件更新方法,主设备先统一发送烧录数据给所有从设备,然后从设备通过校验方式检测烧录数据完整性之后,判断是否向主设备索要缺失数据,主设备可以通过检测上报从设备的MAC地址,对单个从设备发送其所缺失的数据,通过此方式,可以快速的让所有设备收取数据。烧录数据发送完成后,也不拘泥于对某一个从设备单独更新直到该设备更新完成,而是充分利用主设备的带宽,收到任何一个从设备数据就可以向从设备更新数据,优势是可以快速大量的更新无线设备,不需要单独对设备进行交互。本发明实施例提供的软件更新方法的整个过程中,仅握手部分需要应答,从设备收到烧录数据就处理,没有收到就索要部分缺失数据,即保证了更新速度也保证了设备更新内容的完整性。In the software update method provided by the embodiment of the present invention, the master device first sends the programming data to all slave devices in a unified manner, and then the slave device detects the integrity of the programming data through a verification method, and then judges whether to request the missing data from the master device, and the master device can By detecting and reporting the MAC address of the slave device, the missing data is sent to a single slave device. In this way, all devices can quickly receive data. After the burning data is sent, it is not limited to updating a certain slave device until the device update is completed, but makes full use of the bandwidth of the master device, and can update the data to the slave device after receiving any data from the slave device. The advantage is Wireless devices can be quickly and massively updated without requiring individual device interaction. In the whole process of the software update method provided by the embodiment of the present invention, only the handshake part needs to be answered, and the burning data is processed when it is received from the device, and part of the missing data is requested if it is not received, which ensures the update speed and the update content of the device integrity.

实施例四Embodiment four

图4为本发明实施例四提供的一种软件更新装置的结构示意图。如图4所示,该装置包括:握手信息发送模块41、应答信息接收模块42、烧录信息下发模块43;FIG. 4 is a schematic structural diagram of a software update device provided by Embodiment 4 of the present invention. As shown in Figure 4, the device includes: a handshake information sending module 41, a response information receiving module 42, and a programming information sending module 43;

其中,握手信息发送模块41,用于通过蓝牙广播按照设定帧格式发送握手信息;Wherein, the handshake information sending module 41 is used to send the handshake information according to the set frame format through the bluetooth broadcast;

应答信息接收模块42,用于接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的MAC地址;Response information receiving module 42, for receiving the response information of a plurality of slave devices, the response information of each slave device includes the MAC address of the slave device;

烧录信息下发模块43,用于分别向各所述从设备按照设定帧格式下发烧录数据,所述烧录数据用于更新各所述从设备的软件程序。The programming information sending module 43 is used to send the programming data to each of the slave devices according to the set frame format, and the programming data is used to update the software program of each of the slave devices.

在本发明本实施例中,该装置通过利用蓝牙广播按照设定帧格式发送握手信息,然后分别向从设备按照设定帧格式下发烧录数据来更新各从设备的软件程序,能够同时对多个蓝牙设备进行软件更新,免去接线的麻烦,提高更新效率。In this embodiment of the present invention, the device uses Bluetooth broadcast to send handshake information in accordance with the set frame format, and then sends burning data to the slave devices in accordance with the set frame format to update the software program of each slave device, which can simultaneously Multiple Bluetooth devices can update software, eliminating the trouble of wiring and improving update efficiency.

进一步的,该装置还包括:Further, the device also includes:

数据请求接收模块,用于在分别向各所述从设备按照设定帧格式下发烧录数据之后,接收至少一个从设备上报的数据请求,所述数据请求包括所述从设备的MAC地址;The data request receiving module is used to receive at least one data request reported by the slave device after sending the programming data to each slave device according to the set frame format, and the data request includes the MAC address of the slave device;

缺失数据发送模块,用于根据所述MAC地址向相应从设备发送缺失数据。The missing data sending module is configured to send the missing data to the corresponding slave device according to the MAC address.

进一步的,所述设定帧格式包括以下字段:Further, the setting frame format includes the following fields:

同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Synchronous frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

进一步的,该装置还包括:Further, the device also includes:

更新参数和更新数据接收模块,用于在通过蓝牙广播按照设定帧格式发送握手信息之前,通过串口接收用户设置的更新参数和更新数据,其中,所述更新参数包括待更新设备个数和广播数据长度,所述更新数据包括待更新软件程序的十六进制数据。The update parameter and update data receiving module is used to receive the update parameters and update data set by the user through the serial port before sending the handshake information according to the set frame format through the Bluetooth broadcast, wherein the update parameters include the number of devices to be updated and the broadcast Data length, the update data includes hexadecimal data of the software program to be updated.

进一步的,该装置还包括:Further, the device also includes:

握手完成信息发送模块,用于分别向各所述从设备按照设定帧格式下发烧录数据之前,若发送应答信息的从设备个数达到所述待更新设备个数,则通过蓝牙广播发送握手完成信息。The handshake completion information sending module is used to send the burning data to each slave device according to the set frame format, if the number of slave devices sending response information reaches the number of devices to be updated, it will be sent by Bluetooth broadcast The handshake completes the message.

本发明实施例所提供的软件更新装置可执行本发明任意实施例所提供的软件更新方法,具备执行方法相应的功能模块和有益效果。The software update device provided by the embodiment of the present invention can execute the software update method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

实施例五Embodiment five

图5为本发明实施例五提供的一种软件更新装置的结构示意图。如图5所示,该装置包括:握手信息接收模块51、应答信息返回模块52、烧录数据接收模块53;FIG. 5 is a schematic structural diagram of a software update device provided by Embodiment 5 of the present invention. As shown in Figure 5, the device includes: a handshake information receiving module 51, a response information returning module 52, and a burning data receiving module 53;

其中,握手信息接收模块51,用于通过蓝牙扫描功能接收主设备发送的包含握手信息的广播;Wherein, the handshake information receiving module 51 is used to receive the broadcast containing the handshake information sent by the master device through the Bluetooth scanning function;

应答信息返回模块52,用于根据所述握手信息返回应答信息,所述应答信息包括所述从设备的MAC地址;A response information returning module 52, configured to return response information according to the handshake information, the response information including the MAC address of the slave device;

烧录数据接收模块53,用于接收主设备下发的设定帧格式的烧录数据,并根据所述烧录数据更新软件程序。The programming data receiving module 53 is configured to receive the programming data in the set frame format issued by the master device, and update the software program according to the programming data.

在本发明实施例中,该装置通过蓝牙扫描功能接收主设备发送的包含握手信息的广播;然后根据所述握手信息返回应答信息;最后接收主设备下发的设定帧格式的烧录数据,并根据所述烧录数据更新软件程序。能够在数量众多的蓝牙设备需要更新,且接线不方便的情况下,通过蓝牙广播的方式实现多个蓝牙设备,即多个从设备的同时更新,使蓝牙设备更新的方式更加灵活、高效。In the embodiment of the present invention, the device receives the broadcast containing the handshake information sent by the master device through the Bluetooth scanning function; then returns the response information according to the handshake information; finally receives the burning data of the set frame format issued by the master device, And update the software program according to the burning data. When a large number of Bluetooth devices need to be updated and the wiring is inconvenient, multiple Bluetooth devices can be updated through Bluetooth broadcasting, that is, multiple slave devices can be updated at the same time, making the Bluetooth device update method more flexible and efficient.

进一步的,该装置还包括:Further, the device also includes:

缺失数据确定模块,用于在根据所述烧录数据更新软件程序之前,通过比对所述烧录数据的包地址和哈希校验值确定缺失数据;The missing data determining module is used to determine the missing data by comparing the packet address and the hash check value of the burning data before updating the software program according to the burning data;

数据请求上报模块,用于上报数据请求,以请求所述主设备发送所述缺失数据,所述数据请求包括所述从设备的MAC地址。A data request reporting module, configured to report a data request to request the master device to send the missing data, and the data request includes the MAC address of the slave device.

进一步的,所述设定帧格式包括以下字段:Further, the setting frame format includes the following fields:

同步帧;包类型;包使能;数据获取类型;待更新设备地址;包地址;包长度;数据;循环冗余校验。Synchronous frame; packet type; packet enable; data acquisition type; device address to be updated; packet address; packet length; data; cyclic redundancy check.

本发明实施例所提供的软件更新装置可执行本发明任意实施例所提供的软件更新方法,具备执行方法相应的功能模块和有益效果。The software update device provided by the embodiment of the present invention can execute the software update method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

实施例六Embodiment six

图6示出了可以用来实施本发明的实施例的蓝牙设备10的结构示意图。蓝牙设备旨在表示具有蓝牙功能或可以通过蓝牙与其他设备建立连接的设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。蓝牙设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备(如头盔、眼镜、手表等)和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本发明的实现。FIG. 6 shows a schematic structural diagram of a Bluetooth device 10 that can be used to implement an embodiment of the present invention. Bluetooth device is intended to mean a device that has Bluetooth functionality or can establish a connection with other devices via Bluetooth, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computer. Bluetooth devices may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (eg, helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are by way of example only, and are not intended to limit implementations of the inventions described and/or claimed herein.

如图6所示,蓝牙设备10包括至少一个处理器11,以及与至少一个处理器11通信连接的存储器,如只读存储器(ROM)12、随机访问存储器(RAM)13等,其中,存储器存储有可被至少一个处理器执行的计算机程序,处理器11可以根据存储在只读存储器(ROM)12中的计算机程序或者从存储单元18加载到随机访问存储器(RAM)13中的计算机程序,来执行各种适当的动作和处理。在RAM 13中,还可存储蓝牙设备10操作所需的各种程序和数据。处理器11、ROM 12以及RAM 13通过总线14彼此相连。输入/输出(I/O)接口15也连接至总线14。As shown in FIG. 6, the Bluetooth device 10 includes at least one processor 11, and a memory connected in communication with the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores There is a computer program executable by at least one processor, and the processor 11 can operate according to a computer program stored in a read-only memory (ROM) 12 or loaded from a storage unit 18 into a random access memory (RAM) 13. Various appropriate actions and processes are performed. In the RAM 13, various programs and data necessary for the operation of the Bluetooth device 10 are also stored. The processor 11 , ROM 12 , and RAM 13 are connected to each other through a bus 14 . An input/output (I/O) interface 15 is also connected to the bus 14 .

蓝牙设备10中的多个部件连接至I/O接口15,包括:输入单元16,例如键盘、鼠标等;输出单元17,例如各种类型的显示器、扬声器等;存储单元18,例如磁盘、光盘等;以及通信单元19,例如网卡、调制解调器、无线通信收发机等。通信单元19允许蓝牙设备10通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Multiple components in the Bluetooth device 10 are connected to the I/O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, and the like. The communication unit 19 allows the Bluetooth device 10 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.

处理器11可以是各种具有处理和计算能力的通用和/或专用处理组件。处理器11的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的处理器、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。处理器11执行上文所描述的各个方法和处理,例如实现本发明上述实施例所提供的软件更新方法。Processor 11 may be various general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, digital signal processing processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, for example, implements the software update method provided in the above embodiments of the present invention.

实施例七Embodiment seven

本发明实施例七提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时用于执行软件更新方法,该方法包括:Embodiment 7 of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it is used to perform a software update method, the method comprising:

通过蓝牙广播按照设定帧格式发送握手信息;Send handshake information according to the set frame format through Bluetooth broadcasting;

接收多个从设备的应答信息,每个从设备的应答信息包括该从设备的MAC地址;Receiving response information from multiple slave devices, where the response information from each slave device includes the MAC address of the slave device;

分别向各所述从设备按照设定帧格式下发烧录数据,所述烧录数据用于更新各所述从设备的软件程序。The programming data is sent to each of the slave devices according to the set frame format, and the programming data is used to update the software program of each of the slave devices.

可选的,该程序被处理器执行时还可以用于执行本发明任意实施例所提供的软件更新方法。Optionally, when the program is executed by the processor, it can also be used to execute the software update method provided by any embodiment of the present invention.

用于实施本发明的方法的计算机程序可以采用一个或多个编程语言的任何组合来编写。这些计算机程序可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,使得计算机程序当由处理器执行时使流程图和/或框图中所规定的功能/操作被实施。计算机程序可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, so that the computer program causes the functions/operations specified in the flowcharts and/or block diagrams to be implemented when executed by the processor. A computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.

在本发明的上下文中,计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的计算机程序。计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。备选地,计算机可读存储介质可以是机器可读信号介质。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus or device. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.

为了提供与用户的交互,可以在电子设备上实施此处描述的系统和技术,该电子设备具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给电子设备。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。In order to provide interaction with the user, the systems and techniques described herein can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display)) for displaying information to the user. monitor); and a keyboard and pointing device (eg, a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and can be in any form (including Acoustic input, speech input or, tactile input) to receive input from the user.

可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)、区块链网络和互联网。The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., as a a user computer having a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system can be interconnected by any form or medium of digital data communication, eg, a communication network. Examples of communication networks include: local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

计算系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务中,存在的管理难度大,业务扩展性弱的缺陷。A computing system can include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also known as a cloud computing server or a cloud host. It is a host product in the cloud computing service system to solve the problems of difficult management and weak business expansion in traditional physical hosts and VPS services. defect.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发明中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本发明的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, each step described in the present invention may be executed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution of the present invention can be achieved, there is no limitation herein.

上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above specific implementation methods do not constitute a limitation to the protection scope of the present invention. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (8)

1. A software updating method applied to a bluetooth device comprising a bluetooth master-slave function, comprising:
transmitting handshake information according to a set frame format through Bluetooth broadcasting;
receiving response information of a plurality of slave devices, wherein the response information of each slave device comprises a Media Access Control (MAC) address of the slave device;
respectively transmitting burning data to each slave device according to a set frame format, wherein the burning data is used for updating the software program of each slave device;
after the data is transmitted to each slave device according to the set frame format, the method further comprises the following steps:
receiving a data request reported by at least one slave device, wherein the data request comprises an MAC address of the slave device;
and sending missing data to the corresponding slave equipment according to the MAC address.
2. The method of claim 1, wherein the set frame format comprises the following fields:
synchronizing the frames; a package type; packet enablement; a data acquisition type; an equipment address to be updated; a packet address; a packet length; data; and (5) cyclic redundancy check.
3. The method of claim 1, further comprising, prior to transmitting the handshake information in the set frame format via bluetooth broadcast:
and receiving the update parameters and the update data set by the user through the serial port, wherein the update parameters comprise the number of the equipment to be updated and the length of the broadcast data, and the update data comprise hexadecimal data of the software program to be updated.
4. The method of claim 3, further comprising, prior to downloading the burned data to each of the slave devices in the set frame format, respectively:
and if the number of the slave devices sending the response information reaches the number of the devices to be updated, sending handshake completion information through Bluetooth broadcasting.
5. A software updating method applied to a bluetooth device comprising a bluetooth master-slave function, comprising:
receiving a broadcast containing handshake information sent by a main device through a Bluetooth scanning function;
returning response information according to the handshake information, wherein the response information comprises a Media Access Control (MAC) address of the slave device;
receiving burning data in a set frame format issued by main equipment, and updating a software program according to the burning data;
before the software program is updated according to the burning data, the method further comprises the following steps:
determining missing data by comparing the packet address of the burnt data with a hash check value;
and reporting a data request to request the master device to send the missing data, wherein the data request comprises the MAC address of the slave device.
6. The method of claim 5, wherein the set frame format comprises the following fields:
synchronizing the frames; a package type; packet enablement; a data acquisition type; an equipment address to be updated; a packet address; a packet length; data; and (5) cyclic redundancy check.
7. A bluetooth device, comprising:
one or more processors;
a storage means for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the software update method of any of claims 1-6.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the software updating method according to any of claims 1-6.
CN202210231714.8A 2022-03-10 2022-03-10 Software updating method, bluetooth device and storage medium Active CN114827967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210231714.8A CN114827967B (en) 2022-03-10 2022-03-10 Software updating method, bluetooth device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210231714.8A CN114827967B (en) 2022-03-10 2022-03-10 Software updating method, bluetooth device and storage medium

Publications (2)

Publication Number Publication Date
CN114827967A CN114827967A (en) 2022-07-29
CN114827967B true CN114827967B (en) 2023-08-01

Family

ID=82529053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210231714.8A Active CN114827967B (en) 2022-03-10 2022-03-10 Software updating method, bluetooth device and storage medium

Country Status (1)

Country Link
CN (1) CN114827967B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115002941B (en) * 2022-08-08 2022-11-08 浙江正泰仪器仪表有限责任公司 Communication method of Bluetooth electric energy meter
CN115696502A (en) * 2022-09-19 2023-02-03 深圳市硅格半导体有限公司 Hardware burning method, system, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378144A (en) * 2014-10-10 2015-02-25 惠州市博泰通讯设备有限公司 Bluetooth equipment software installing method and system
CN109417691A (en) * 2018-09-17 2019-03-01 深圳市汇顶科技股份有限公司 A kind of blue tooth cluster online upgrading method and device
CN112261635A (en) * 2020-10-21 2021-01-22 上海闻泰信息技术有限公司 Bluetooth test method, device, electronic equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201826136A (en) * 2017-01-13 2018-07-16 致伸科技股份有限公司 Bluetooth pairing system and method for operating a bluetooth pairing system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378144A (en) * 2014-10-10 2015-02-25 惠州市博泰通讯设备有限公司 Bluetooth equipment software installing method and system
CN109417691A (en) * 2018-09-17 2019-03-01 深圳市汇顶科技股份有限公司 A kind of blue tooth cluster online upgrading method and device
CN112261635A (en) * 2020-10-21 2021-01-22 上海闻泰信息技术有限公司 Bluetooth test method, device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN114827967A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN114827967B (en) Software updating method, bluetooth device and storage medium
CN108334367B (en) Firmware remote upgrading method for BMC chip
US20190302867A1 (en) Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker
US20240396984A1 (en) Data transmission method and apparatus, device, and storage medium
CN112039722B (en) A kind of MQTT protocol simulation method and simulation device
US12126664B2 (en) Data download method and apparatus, computer device, and storage medium
US20220217093A1 (en) Sequence Number Synchronization Method and Apparatus
CN116321253A (en) Self-organizing network simulation test method, device, terminal equipment and readable storage medium
CN115001932A (en) A method and system for restoring or modifying equipment parameters in batches
CN114780519A (en) DBC file generation method, device, equipment and medium based on CAN communication
CN114390578A (en) A method, device, electronic device and medium for testing network performance
CN104683130B (en) A kind of method and apparatus of configuring stacking port
TW201328273A (en) Remote management system and remote management method
CN118784474A (en) Baud rate adjustment method, device, equipment and storage medium
CN116204215A (en) MCU upgrading method and system, computer equipment and storage medium
CN115484272A (en) Synchronous conversation method, device, equipment and storage medium
CN113133107B (en) Method and device for synchronizing information
CN114489730A (en) A remote upgrade method, terminal device and computer-readable storage medium thereof
CN116599871B (en) Network time delay determining method and related device
WO2022237428A1 (en) Method and apparatus for processing network request information, and device and storage medium
CN116319820A (en) Method and device for determining information transmission path, electronic equipment and storage medium
WO2023273468A1 (en) Communication method, apparatus and system
CN118784738A (en) A data processing method and related device, data exchange module
CN119669177A (en) File system synchronization method, device, electronic device and storage medium
CN119759385A (en) FOTA upgrading pressure testing method, system, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Software update methods, Bluetooth devices, and storage media

Granted publication date: 20230801

Pledgee: CITIC Bank Limited by Share Ltd. Shanghai branch

Pledgor: SHANGHAI FREQUEN MICROELECTRONICS CO.,LTD.

Registration number: Y2025310000445

PE01 Entry into force of the registration of the contract for pledge of patent right