Aiming at storing and transmitting the real time data of energy management system in the industrial production, an online data compression technique is proposed. Firstly, the auto regression model of a group of sequence is established. Secondly, the next sampled data can be predicted by the model. If the estimated error is in the allowable range, we save the parameters of model and the beginning data. Otherwise, we save the data and repeat the method from the next sampled data. At Last, the method is applied in electricity energy data compression of a beer production. The application result verifies the effectiveness of the proposed method.