public synchronized  void changeMessage(Message message){
       long now=System.currentTimeMillis();
       long cost=now-message.getAddtime();
      // System.out.println("cost="+cost);
      
      if(cost>socket_timeout*1000&&socket!=null&&!socket.isClosed())
       {
          
            try{
                socket.close();
            }catch(Exception e){
                e.printStackTrace();
               thread_log.info("设备关闭异常");
            }
           thread_log.info("设备连接超时120S，关闭该设备");
           //System.out.println("设备超时异常，关闭该设备");
       }
     else  if(cost>dv.getCollection_frq()*1000+1000){
           /*说明数据超时3秒中*/
           message.setHex("--");
          // thread_log.info("此时未有数据上传 ");
           try{
               sqlServer.saveValue(now,message.getHex());
           }catch(Exception e){
               e.printStackTrace();
           }
       }
    else   
     {
         thread_log.info("此时有数据上传 "+message.getHex());
         try{
         sqlServer.saveValue(message.getAddtime(),message.getHex());
      }catch(Exception e){
          e.printStackTrace();
          thread_log.info("数据保存至数据库异常");
      }
     }
      
          
    }