Data interaction system and method for upgrading TBOX and obtaining TBOX logs
Technical Field
The invention relates to the technical field of vehicle-mounted software data transmission, in particular to a data interaction system and a data interaction method for upgrading TBOX and acquiring TBOX logs.
Background
The automotive TBOX (Telematics Box) is a vehicle information and Positioning transmission System composed of a power conversion circuit, an OBD (On Board Diagnostics), an MCU (Microcontroller Unit), a GPRS (General Packet Radio Service), a GPS (Global Positioning System) and a sensor, and with increasingly powerful TBOX functions, software update is frequent, and actual vehicle software update iteration processing is often required, and a currently common update mode is: and after the vehicle is dismounted, the computer connecting equipment is locally upgraded. The limitations of this approach are: the TBOX whole vehicle is remote in arrangement position, a baffle, a screw and the like nearby need to be detached frequently, so that the computer and the TBOX port can be connected for local upgrading, a large amount of labor and time are consumed for each upgrading, the risk of scratching is likely to occur in the vehicle detaching and reinstalling processes, and research, development, debugging and after-sale maintenance are not facilitated.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a data interaction system and a method for upgrading a TBOX and acquiring TBOX logs, so as to achieve the purposes of upgrading software of the TBOX and acquiring TBOX logs without detaching a vehicle.
The purpose of the invention can be realized by the following technical scheme: the utility model provides a data interaction system for upgrading TBOX and obtaining TBOX log, includes the car machine with TBOX interconnect, the car machine is connected with the USB interface, the USB interface sets up in the car, the USB interface is connected with the USB flash disk, TBOX is used for providing wireless communication network signal for the car machine, connect in order to realize data interaction through establishing socket between TBOX and the car machine, the USB interface is used for realizing the data interaction between USB flash disk and the car machine.
Further, a USB data line for providing wireless communication network signals is connected between the TBOX and the vehicle machine.
Further, the wireless communication network signal is specifically a 4G network signal.
Furthermore, the USB interface is arranged at the position of the central control hand-held box.
Further, a software upgrade package is stored in the U disk.
A data interaction method for upgrading TBOX, comprising the steps of:
s1, taking the TBOX as a server, and then initializing, binding and monitoring the server;
s2, when the car machine needs to transmit a software upgrade package to the TBOX, the car machine is used as a client side, and the client side is connected with a socket;
s3, the client acquires a software upgrading package from the USB flash disk inserted into the USB interface and sends the software upgrading package to the server through the socket;
s4, after the software upgrading package is sent, the client closes the current socket connection;
s5, the server side verifies the received software upgrading packet, if the verification is successful, upgrading is carried out according to the content of the software upgrading packet, and if the verification is failed, a corresponding instruction is output to the vehicle machine;
and S6, the server side continues to wait for the subsequent socket connection of the client side.
A data interaction method for acquiring TBOX logs, comprising the steps of:
d1, taking the vehicle machine as a server, and then initializing, binding and monitoring the server;
d2, when the car machine needs to acquire logs from the TBOX, taking the TBOX as a client, and connecting the client with a socket;
d3, the client sends the log to the server through the socket;
d4, after the log is sent, closing the current socket connection by the client;
d5, the server transmits the received log to a USB flash disk inserted with a USB interface;
d6, the server side continuously waits for the subsequent socket connection of the client side.
Further, the TBOX is in communication connection with the APK in the in-vehicle engineering mode, and the USB interface is in communication connection with the APK in the in-vehicle engineering mode.
Further, the APK of the engineering mode in the locomotive acquires logs from the TBOX through the socket or transmits a software upgrade package to the TBOX through the socket.
Further, the USB interface transmits a software upgrade package to the APK of the in-vehicle engineering mode through an instruction, or acquires a TBOX log from the APK of the in-vehicle engineering mode through the instruction.
Compared with the prior art, the method utilizes the USB interface which is originally irrelevant to TBOX, and the USB disk is connected with the USB interface, the USB interface is connected with the vehicle machine, and the vehicle machine is connected with the TBOX, so that the software upgrading packet in the USB disk can be transmitted to the vehicle machine, and then the software upgrading packet is acquired by the TBOX and is upgraded; in addition, through a reverse data transmission path, the car machine can also acquire logs from the TBOX and then transmit the logs to a USB flash disk connected with the USB, so that the TBOX can be upgraded without dismantling the car, log information can be acquired from the TBOX, labor hour and labor consumption are greatly reduced, and the risk of scratching the structure in the car is avoided;
the invention provides a wireless communication network to the vehicle machine by using the TBOX, in the data interaction process, the TBOX and the vehicle machine are respectively used as a client or a server, data transmission is carried out based on the socket, and the received file is verified by combining the TBOX, thereby further ensuring the reliability of data transmission.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention;
FIG. 2 is a schematic diagram of an application principle of the embodiment;
FIG. 3 is a schematic flow chart of the method for upgrading TBOX in accordance with the present invention;
FIG. 4 is a flow chart of a method for TBOX log acquisition according to the invention;
FIG. 5 is a schematic diagram of the TBOX upgrading process in the embodiment;
the notation in the figure is: 1. TBOX, 2, a vehicle machine, 3, a USB interface, 4 and a U disk.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments.
Examples
As shown in fig. 1, a data interaction system for upgrading a TBOX and obtaining a TBOX log includes a car machine 2 interconnected with a TBOX1, the car machine 2 is connected with a USB interface 3, the USB interface 3 is disposed in the car (in this embodiment, the USB interface 3 is disposed at a central control hand box position), the USB interface 3 is connected with a USB disk 4, the TBOX1 is configured to provide a wireless communication network signal to the car machine 2, the TBOX1 is connected with the car machine 2 by establishing a socket to implement data interaction, the USB interface 3 is configured to implement data interaction between the USB disk 4 and the car machine 2, and when a TBOX is upgraded, a software upgrade packet is stored in the USB disk 4; when the TBOX log is acquired, the log is stored in the usb disk 4.
As shown in fig. 2, a USB data line for providing a wireless communication network signal (in this embodiment, the wireless communication network signal is specifically a 4G network signal) is connected between the TBOX and the car machine, the TBOX is communicatively connected to an APK in the in-car engineering mode, the USB interface is communicatively connected to an APK in the in-car engineering mode, the APK in the in-car engineering mode obtains a log from the TBOX through a socket, and transmits a software upgrade packet (i.e., a differential packet in the figure) to the TBOX through the socket; the USB interface transmits a software upgrade package to the APK of the in-vehicle engineering mode through the instruction, and acquires the TBOX log from the APK of the in-vehicle engineering mode through the instruction.
The data interaction system is applied to realize a data interaction method for upgrading TBOX, and as shown in FIG. 3, the method comprises the following steps:
s1, taking the TBOX as a server, and then initializing, binding and monitoring the server;
s2, when the car machine needs to transmit a software upgrade package to the TBOX, the car machine is used as a client side, and the client side is connected with a socket;
s3, the client acquires a software upgrading package from the USB flash disk inserted into the USB interface and sends the software upgrading package to the server through the socket;
s4, after the software upgrading package is sent, the client closes the current socket connection;
s5, the server side verifies the received software upgrading packet, if the verification is successful, upgrading is carried out according to the content of the software upgrading packet, and if the verification is failed, a corresponding instruction is output to the vehicle machine;
and S6, the server side continues to wait for the subsequent socket connection of the client side.
Similarly, the data interaction system is applied to implement a data interaction method for acquiring TBOX logs, as shown in fig. 4, including the following steps:
d1, taking the vehicle machine as a server, and then initializing, binding and monitoring the server;
d2, when the car machine needs to acquire logs from the TBOX, taking the TBOX as a client, and connecting the client with a socket;
d3, the client sends the log to the server through the socket;
d4, after the log is sent, closing the current socket connection by the client;
d5, the server transmits the received log to a USB flash disk inserted with a USB interface;
d6, the server side continuously waits for the subsequent socket connection of the client side.
In summary, the invention uses the USB interface of the central control hand box which is originally unrelated to TBOX, inputs the USB interface into the APK implanted into the vehicle machine engineering mode through the software package, and transmits the APK through the USB protocol connected between the TBOX and the vehicle machine, and finally obtains the software package to upgrade; in addition, log logs can be acquired from the TBOX through the same path, and are transmitted to the APK of the vehicle machine through the USB protocol, and finally are led into the U disk. In this embodiment, when performing TBOX upgrade, as shown in fig. 5, a vehicle machine and a TBOX newly establish a socket connection to transmit an upgrade package file, the TBOX serves as a server end, the vehicle machine serves as a Client end, and the specific transmission steps are as follows:
after the server end completes initialization, binding and list, waiting for the access of the client end;
when the vehicle machine needs to transmit an upgrade packet to the TBOX, the client end is connected with the socket;
the Client end reads the contents of the upgrade package file and sends the contents to the server end through the socket;
after the upgrade package file is sent, the client end closes the socket connection, and the file transmission is finished;
the Server end carries out length check on the received upgrade packet file, if the check is successful, the transmission is indicated to be successful, the following USB upgrade flow is continued, if the check is failed, the transmission is indicated to be in problem, and the vehicle machine is informed in a USB instruction mode;
the Server side continues to wait for the next connection of the client side.
The invention can realize the upgrading of the TBOX and the acquisition of the TBOX log under the condition of not detaching the vehicle, has the advantages of high efficiency and convenience, and can reliably ensure the reliability of data interaction.