How to exchange data between embedded chip and java background?

encountered a project, there is a SpringBoot background, the terminal is an embedded chip, the data exchange between the two is required to be binary. Contact with this requirement for the first time, unlike the previous interaction with the mobile phone APP, do not know how to interact with the embedded chip data, such as the traditional controller return json data? Or do you want to use the socket protocol? In addition, how to subpackage the data? I hope you can give us some guidance. Thank you!


look at the resources of your embedded chip. If the memory is only more than ten k bytes or a few k bytes of single-chip microcomputer, it should not be possible to use json, a single json parser will take up a large part of the chip resources. One of the feasible solutions is to define the protocol by yourself, including the message format, the function of each field, and the corresponding type of each message. In embedded c code, you usually use struct structure to represent a message, and in your background program, you should define the data structure in the same way as in embedded programs. TLV is usually used to define the data structure, which is convenient for both parties to parse and consider future upgrades. Another solution is to use google protobuf (or ASN.1) as a serialization tool (library), which allows you to describe your protocol in a specific language (that is, all kinds of messages to be communicated between background programs and terminals), and automatically generate serialization and deserialization code on different platforms according to this protocol, so as to achieve the goal of communicating in programs of different programming languages.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9df5f-466de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9df5f-466de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?