System and method for realizing OTA upgrading of terminal product based on BNEP BluetoothTechnical Field
The invention belongs to the technical field of communication, and particularly relates to a system and a method for realizing OTA upgrading of a terminal product based on BNEP Bluetooth.
Background
Currently, by installing an APP on a mobile phone, the APP acquires firmware which needs OTA on a server. The method specifically comprises the following steps: 1) The APP calls different protocol interfaces of the SPP/GATT and transmits the data to the Bluetooth of the equipment according to the data transmission mode required by the corresponding protocol, and the Bluetooth of the equipment forwards the received OTA data to the MCU of the equipment through the Uart after receiving the data, so that the upgrading of the OTA firmware of the equipment is completed; 2) And the POS terminal is connected with the mobile phone test-down network through the 2G module, so that OTA upgrading is realized. However, this method has the following drawbacks: different devices use different Bluetooth schemes to cause compatibility differences in OTA; the mobile phone can realize the upgrading function only by downloading the app, and occupies mobile phone resources of the user; compatibility and suitability of APP on different mobile phones; the transmission speed is slow.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to design and provide a system and a method for realizing OTA upgrading of a terminal product based on BNEP Bluetooth, which can realize connection of a background server and a POS terminal by connecting a network only without downloading app by a user handheld device through the BNEP method, realize remote OTA upgrading, greatly improve the operation convenience of the user and save the resources of the user; and the data transmission efficiency is higher.
The system for realizing OTA upgrading of the terminal product based on BNEP Bluetooth is characterized by comprising a POS terminal, a mobile equipment end and a background server, wherein a Bluetooth RF transceiver module, a Bluetooth kernel processing module, a Bluetooth uart transceiver module and a POS terminal MCU processing module are arranged in the POS terminal, a Bluetooth transceiver end and a mobile network transceiver module are arranged in the mobile equipment end, and a data processing module and a server network transceiver module are arranged in the background server;
the Bluetooth RF transceiver module is responsible for receiving and transmitting data; the Bluetooth kernel processing module analyzes and processes the Bluetooth data; the Bluetooth uart receiving and transmitting module is in data communication with the POS terminal MCU processing module through a serial port; the POS terminal MCU processing module processes the received data and specific operation processing of a user, and sends corresponding service data to the Bluetooth uart receiving and transmitting module;
the mobile equipment terminal mainly plays a role of network bridging, and the mobile network transceiver module is connected with a background server through a network and receives and transmits received data; the Bluetooth transceiver end mainly receives the server data received by the network transceiver module, transmits the data to the POS terminal through the BNEP protocol, and can simultaneously receive the data transmitted by the POS terminal and forward the data to the mobile network transceiver module;
the server network transceiver module is mainly connected with a network, and is used for receiving data transmitted by the mobile equipment terminal through the network and transmitting the data to the mobile equipment terminal through the network; the data processing module is responsible for processing the received data information and sending data to the mobile equipment terminal through the server network transceiver module according to the requirement.
The system for realizing OTA upgrading of the terminal product based on BNEP Bluetooth is characterized in that the mobile equipment end is a mobile phone, a connection network between the mobile equipment end and a background server is 3G/4G/5G/WIFI, and the POS terminal is MPOS, a traditional POS or an intelligent POS product.
The method for realizing the system for upgrading the OTA of the terminal product based on BNEP Bluetooth is characterized by comprising the following steps:
1) The Bluetooth of the POS terminal product and the Bluetooth of the mobile equipment end are matched and connected;
2) The mobile equipment end starts a shared network switch, and the POS terminal is connected with a background server through BNEP;
3) The POS terminal actively initiates an OTA upgrading request, the background server receives an OTA upgrading request command and returns whether the POS terminal has OTA updating or not, and the POS terminal can select updating or cancel; the background server pushes OTA updating information, and the POS terminal can select whether updating is carried out or not;
4) After OTA upgrading is selected, the background server sends each packet of data to the POS terminal, the POS terminal checks after receiving the data, the data is stored in the equipment memory after passing the check, and error information is returned to the background server for retransmission after the check is wrong, and the downloading of the OTA firmware is completed after all the data are passed the check;
5) And the POS terminal finishes refreshing and the OTA upgrading is finished.
The method for realizing the system for upgrading the OTA of the terminal product based on BNEP Bluetooth is characterized by comprising the following steps:
the POS terminal is a slave machine, and the Bluetooth of the mobile equipment terminal is a master machine;
starting up the slave computer and starting broadcasting, scanning the Bluetooth equipment after the host computer is started up, and scanning the slave computer to reply to the host computer;
the host end clicks the connection, the slave end sends back a security request to request the host end to pair after receiving the connection request of the host end, and the host end initiates a pairing request after receiving a broadcast packet which the slave requests to pair;
after receiving the pairing request of the host, the slave replies that the host agrees to pair; the host computer and the slave computer can transmit information and generate a pairing secret key;
after the secret key is generated, the host computer and the slave computer store pairing information, and pairing is completed.
According to the method for realizing OTA upgrading of the terminal product based on BNEP Bluetooth, through the BNEP method, the upgrading process of the POS terminal equipment is simplified, the user mobile equipment is not required to download app, and the memory space of the client equipment is not occupied; the silent updating of the OTA firmware of the user is realized, and the user can update the POS terminal equipment without operation; the data transmission efficiency is higher.
Drawings
FIG. 1 is a block diagram of a system architecture of an upgrade method of the present invention;
FIG. 2 is a schematic diagram of a system according to the present invention;
FIG. 3 is a flow chart of an implementation of the upgrade method of the present invention;
FIG. 4 is a flow chart of the POS terminal and mobile phone Bluetooth pairing process according to the invention;
in the figure: the system comprises a 1-POS terminal, a 101-Bluetooth RF transceiver module, a 102-Bluetooth kernel processing module, a 103-Bluetooth uart transceiver module and a 104-POS terminal MCU processing module; 2-mobile equipment end, 201-Bluetooth transceiver end, 202-mobile network transceiver module; 3-background server, 301-data processing module, 302-server network transceiver module.
Detailed Description
The invention will be further described with reference to the accompanying drawings, which are simplified schematic illustrations, illustrating the basic structure of the invention by way of illustration only, and thus showing only the structures that are relevant to the invention.
BNEP is collectively referred to as Bluetooth Network Encapsulation Protocol (network encapsulation protocol, hereinafter BNEP). BNEP is designed for PAN applications and provides an application model for constructing bluetooth wireless local area networks, which can implement the mapping network protocol hierarchy from IP layer to L2CAP layer as shown in fig. 1. Bluetooth personal area networks use BNEP to provide networking capabilities for bluetooth devices, to enable two or more bluetooth devices to form a temporary Ad-hoc Network (GN), or to access a remote Network via a Network access point (Network Access Point, NAP). BNEP provides conversion of the bluetooth protocol stack and the TCP/IP protocol stack and the IEEE802.3 ethernet encapsulation supports the same upper layer network protocol. The MTU of the BNEP payload area locates 1691 bytes, which can ensure the one-time transmission of the ethernet layer packet sent downwards by the network layer. In terms of data transfer, the BNEP directly receives the ethernet packets sent down by the IP layer and copies the ethernet payload directly into the BNEP payload, plus the BNEP header, before sending to the L2CAP layer.
As shown in the figure, the system for realizing OTA upgrade of a terminal product based on BNEP bluetooth comprises a POS terminal 1, a mobile device end 2, and a background server 3, wherein the POS terminal 1 is provided with a bluetooth RF transceiver module 101, a bluetooth kernel processing module 102, a bluetooth uart transceiver module 103, and a POS terminal MCU processing module 104, the mobile device end 2 is provided with a bluetooth transceiver end 201, a mobile network transceiver module 202, and the background server 3 is provided with a data processing module 301 and a server network transceiver module 302;
the bluetooth RF transceiver module 101 is responsible for receiving and transmitting data; the Bluetooth kernel processing module 102 analyzes and processes the Bluetooth data; the Bluetooth uart transceiver module 103 is in data communication with the POS terminal MCU processing module 104 through a serial port; the POS terminal MCU processing module 104 processes the received data and the specific operation processing of the user, and sends corresponding service data to the Bluetooth uart receiving and transmitting module 103;
the mobile device end 2 mainly plays a role of network bridging, and the mobile network transceiver module 202 is connected with the background server 3 through a network to receive and send received data; the bluetooth transceiver 201 mainly receives server data received by the mobile network transceiver module 202, and sends the data to the POS terminal 1 through the BNEP protocol, and meanwhile, can receive data transmitted by the POS terminal 1 and forward the data to the mobile network transceiver module 202;
the server network transceiver module 302 is mainly connected to a network, and is used for receiving data transmitted by the mobile device 2 through the network and transmitting the data to the mobile device 2 through the network; the data processing module 301 is responsible for processing the received data information and transmitting the data to the mobile device 2 through the server network transceiver module 302 as required.
Preferably, the mobile device end 2 is a mobile phone, the connection network between the mobile device end 2 and the background server 3 is 3G/4G/5G/WIFI, and the POS terminal 1 is an MPOS, a conventional POS or an intelligent POS product.
The method for realizing the system for upgrading the OTA of the terminal product based on BNEP Bluetooth comprises the following steps:
1) The product of the POS terminal 1 is internally provided with a YIchip Bluetooth chip, and the Bluetooth of the product of the POS terminal 1 and the Bluetooth of the mobile equipment end 2 are connected in a pairing way;
2) The mobile equipment end 2 starts a shared network switch, and the POS terminal 1 is connected with the background server 3 through BNEP;
3) The POS terminal 1 actively initiates an OTA upgrade request, the background server 3 receives an OTA upgrade request command, returns whether the POS terminal 1 has OTA upgrade, and the POS terminal 1 can select to update or cancel; the background server 3 pushes OTA update information, and the POS terminal 1 can select whether update is performed;
4) After OTA upgrading is selected, the background server 3 sends each packet of data to the POS terminal 1, the POS terminal 1 checks after receiving the data, the data is stored in the equipment memory after passing the check, and error information is returned to the background server 3 for retransmission after the check is wrong, and the downloading of the OTA firmware is completed after all the data are received and checked;
5) The POS terminal 1 finishes refreshing and the OTA upgrading is finished.
Preferably, in the step 1), the following steps are performed:
the POS terminal 1 is a slave machine, and the mobile equipment end 2 Bluetooth is a master machine;
starting up the slave computer and starting broadcasting, scanning the Bluetooth equipment after the host computer is started up, and scanning the slave computer to reply to the host computer;
the host end clicks the connection, the slave end sends back a security request to request the host end to pair after receiving the connection request of the host end, and the host end initiates a pairing request after receiving a broadcast packet which the slave requests to pair;
after receiving the pairing request of the host, the slave replies that the host agrees to pair; the host computer and the slave computer can transmit information and generate a pairing secret key;
after the secret key is generated, the host computer and the slave computer store pairing information, and pairing is completed.
The conventional method for realizing OTA updating through APP needs configuration confirmation at the user end, and the user needs to pay attention at any time in the OTA data transmission process, and the upgrading time of normal OTA is in a few minutes. After the BNEP is used for realizing the OTA upgrading method, the silent upgrading of the OTA of the POS terminal equipment can be realized, and the time for the user to configure the APP and the equipment to carry out the OTA is saved.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that these are by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.