The invention belongs to the technical field of
computer data processing, and discloses a method for analyzing data reported by equipment based
on Protocol Buffer, which comprises the following steps of: S1, configuring a protobuf file according to service requirements; s2, the sending end generates a message
data stream according to the data collected by the equipment; s3, the sending end sends the message
data stream to a message
server; s4, the receiving end converts the protobuf file into a class function which can be called by the
Java code; and S5, the receiving end monitors the message
server in real time, and constructs the
data stream into a corresponding object through the
Java class function of the protobuf after receiving the data
stream issued by the message
server. When the data collected by the equipment is changed, source codes do not need to be modified, only the protobuf file needs to be redefined, and a new class function is generated. When a large batch of data is processed, the data represented by protobuf can be more efficient, the compressed data is smaller, and the transmission efficiency is improved. Moreover, due to the fact that the
data structure is defined in advance,
data analysis is more efficient.