Commit d9112a54 by 杨林龙

项目初始化

0 parents
Showing 130 changed files with 11340 additions and 0 deletions
.vscode
__pycache__
This diff could not be displayed because it is too large.
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface BaseStationService extends Ice.Object,
_BaseStationServiceOperations, _BaseStationServiceOperationsNC
{
public static final long serialVersionUID = -4927076960967750416L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServiceHolder extends Ice.ObjectHolderBase<BaseStationService>
{
public
BaseStationServiceHolder()
{
}
public
BaseStationServiceHolder(BaseStationService value)
{
this.value = value;
}
public void
patch(Ice.Object v)
{
if(v == null || v instanceof BaseStationService)
{
value = (BaseStationService)v;
}
else
{
IceInternal.Ex.throwUOE(type(), v);
}
}
public String
type()
{
return _BaseStationServiceDisp.ice_staticId();
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface BaseStationServicePrx extends Ice.ObjectPrx
{
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp);
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Callback_BaseStationService_GetGpsByBs __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBs __cb);
public boolean end_GetGpsByBs(BsDataRespHolder resp, Ice.AsyncResult __result);
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp);
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Callback_BaseStationService_GetGpsByBsList __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBsList __cb);
public boolean end_GetGpsByBsList(BsDataRespHolder resp, Ice.AsyncResult __result);
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res);
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Ice.Callback __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Callback_BaseStationService_getPoiTypeFromGeo __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Callback_BaseStationService_getPoiTypeFromGeo __cb);
public boolean end_getPoiTypeFromGeo(DaoPoiInfoRespHolder res, Ice.AsyncResult __result);
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServicePrxHelper extends Ice.ObjectPrxHelperBase implements BaseStationServicePrx
{
private static final String __GetGpsByBs_name = "GetGpsByBs";
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp)
{
return GetGpsByBs(req, resp, null, false);
}
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx)
{
return GetGpsByBs(req, resp, __ctx, true);
}
private boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "GetGpsByBs", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("GetGpsByBs");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.GetGpsByBs(req, resp, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req)
{
return begin_GetGpsByBs(req, null, false, null);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx)
{
return begin_GetGpsByBs(req, __ctx, true, null);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Ice.Callback __cb)
{
return begin_GetGpsByBs(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_GetGpsByBs(req, __ctx, true, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Callback_BaseStationService_GetGpsByBs __cb)
{
return begin_GetGpsByBs(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBs __cb)
{
return begin_GetGpsByBs(req, __ctx, true, __cb);
}
private Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__GetGpsByBs_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __GetGpsByBs_name, __cb);
try
{
__result.__prepare(__GetGpsByBs_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_GetGpsByBs(BsDataRespHolder resp, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __GetGpsByBs_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
private static final String __GetGpsByBsList_name = "GetGpsByBsList";
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp)
{
return GetGpsByBsList(req, resp, null, false);
}
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx)
{
return GetGpsByBsList(req, resp, __ctx, true);
}
private boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "GetGpsByBsList", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("GetGpsByBsList");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.GetGpsByBsList(req, resp, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req)
{
return begin_GetGpsByBsList(req, null, false, null);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx)
{
return begin_GetGpsByBsList(req, __ctx, true, null);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Ice.Callback __cb)
{
return begin_GetGpsByBsList(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_GetGpsByBsList(req, __ctx, true, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Callback_BaseStationService_GetGpsByBsList __cb)
{
return begin_GetGpsByBsList(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBsList __cb)
{
return begin_GetGpsByBsList(req, __ctx, true, __cb);
}
private Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__GetGpsByBsList_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __GetGpsByBsList_name, __cb);
try
{
__result.__prepare(__GetGpsByBsList_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_GetGpsByBsList(BsDataRespHolder resp, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __GetGpsByBsList_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
private static final String __getPoiTypeFromGeo_name = "getPoiTypeFromGeo";
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res)
{
return getPoiTypeFromGeo(pt, res, null, false);
}
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx)
{
return getPoiTypeFromGeo(pt, res, __ctx, true);
}
private boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "getPoiTypeFromGeo", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("getPoiTypeFromGeo");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.getPoiTypeFromGeo(pt, res, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt)
{
return begin_getPoiTypeFromGeo(pt, null, false, null);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, null);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Ice.Callback __cb)
{
return begin_getPoiTypeFromGeo(pt, null, false, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Callback_BaseStationService_getPoiTypeFromGeo __cb)
{
return begin_getPoiTypeFromGeo(pt, null, false, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Callback_BaseStationService_getPoiTypeFromGeo __cb)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, __cb);
}
private Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__getPoiTypeFromGeo_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __getPoiTypeFromGeo_name, __cb);
try
{
__result.__prepare(__getPoiTypeFromGeo_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
pt.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_getPoiTypeFromGeo(DaoPoiInfoRespHolder res, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __getPoiTypeFromGeo_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
res.value = new DaoPoiInfoResp();
res.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
if(__obj.ice_isA(ice_staticId()))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
if(__obj.ice_isA(ice_staticId(), __ctx))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, String __facet)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
try
{
if(__bb.ice_isA(ice_staticId()))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
}
catch(Ice.FacetNotExistException ex)
{
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
try
{
if(__bb.ice_isA(ice_staticId(), __ctx))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
}
catch(Ice.FacetNotExistException ex)
{
}
}
return __d;
}
public static BaseStationServicePrx uncheckedCast(Ice.ObjectPrx __obj)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
return __d;
}
public static BaseStationServicePrx uncheckedCast(Ice.ObjectPrx __obj, String __facet)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
return __d;
}
public static final String[] __ids =
{
"::BaseStationData::BaseStationService",
"::Ice::Object"
};
public static String ice_staticId()
{
return __ids[0];
}
protected Ice._ObjectDelM __createDelegateM()
{
return new _BaseStationServiceDelM();
}
protected Ice._ObjectDelD __createDelegateD()
{
return new _BaseStationServiceDelD();
}
public static void __write(IceInternal.BasicStream __os, BaseStationServicePrx v)
{
__os.writeProxy(v);
}
public static BaseStationServicePrx __read(IceInternal.BasicStream __is)
{
Ice.ObjectPrx proxy = __is.readProxy();
if(proxy != null)
{
BaseStationServicePrxHelper result = new BaseStationServicePrxHelper();
result.__copyFrom(proxy);
return result;
}
return null;
}
public static final long serialVersionUID = 0L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServicePrxHolder
{
public
BaseStationServicePrxHolder()
{
}
public
BaseStationServicePrxHolder(BaseStationServicePrx value)
{
this.value = value;
}
public BaseStationServicePrx value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsData implements java.lang.Cloneable, java.io.Serializable
{
public int mnc;
public int lac;
public int cellid;
public BsData()
{
}
public BsData(int mnc, int lac, int cellid)
{
this.mnc = mnc;
this.lac = lac;
this.cellid = cellid;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsData _r = null;
if(rhs instanceof BsData)
{
_r = (BsData)rhs;
}
if(_r != null)
{
if(mnc != _r.mnc)
{
return false;
}
if(lac != _r.lac)
{
return false;
}
if(cellid != _r.cellid)
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsData");
__h = IceInternal.HashUtil.hashAdd(__h, mnc);
__h = IceInternal.HashUtil.hashAdd(__h, lac);
__h = IceInternal.HashUtil.hashAdd(__h, cellid);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(mnc);
__os.writeInt(lac);
__os.writeInt(cellid);
}
public void
__read(IceInternal.BasicStream __is)
{
mnc = __is.readInt();
lac = __is.readInt();
cellid = __is.readInt();
}
public static final long serialVersionUID = -1180175726157969065L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataHolder
{
public
BsDataHolder()
{
}
public
BsDataHolder(BsData value)
{
this.value = value;
}
public BsData value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataListReq implements java.lang.Cloneable, java.io.Serializable
{
public BsData[] bsList;
public BsDataListReq()
{
}
public BsDataListReq(BsData[] bsList)
{
this.bsList = bsList;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataListReq _r = null;
if(rhs instanceof BsDataListReq)
{
_r = (BsDataListReq)rhs;
}
if(_r != null)
{
if(!java.util.Arrays.equals(bsList, _r.bsList))
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataListReq");
__h = IceInternal.HashUtil.hashAdd(__h, bsList);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
BsListReqHelper.write(__os, bsList);
}
public void
__read(IceInternal.BasicStream __is)
{
bsList = BsListReqHelper.read(__is);
}
public static final long serialVersionUID = 3819908727059142693L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataListReqHolder
{
public
BsDataListReqHolder()
{
}
public
BsDataListReqHolder(BsDataListReq value)
{
this.value = value;
}
public BsDataListReq value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataReq implements java.lang.Cloneable, java.io.Serializable
{
public BsData bs;
public BsDataReq()
{
}
public BsDataReq(BsData bs)
{
this.bs = bs;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataReq _r = null;
if(rhs instanceof BsDataReq)
{
_r = (BsDataReq)rhs;
}
if(_r != null)
{
if(bs != _r.bs)
{
if(bs == null || _r.bs == null || !bs.equals(_r.bs))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataReq");
__h = IceInternal.HashUtil.hashAdd(__h, bs);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
bs.__write(__os);
}
public void
__read(IceInternal.BasicStream __is)
{
bs = new BsData();
bs.__read(__is);
}
public static final long serialVersionUID = -7067405279854981467L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataReqHolder
{
public
BsDataReqHolder()
{
}
public
BsDataReqHolder(BsDataReq value)
{
this.value = value;
}
public BsDataReq value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataResp implements java.lang.Cloneable, java.io.Serializable
{
public int ret;
public GpsData gps;
public BsDataResp()
{
}
public BsDataResp(int ret, GpsData gps)
{
this.ret = ret;
this.gps = gps;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataResp _r = null;
if(rhs instanceof BsDataResp)
{
_r = (BsDataResp)rhs;
}
if(_r != null)
{
if(ret != _r.ret)
{
return false;
}
if(gps != _r.gps)
{
if(gps == null || _r.gps == null || !gps.equals(_r.gps))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataResp");
__h = IceInternal.HashUtil.hashAdd(__h, ret);
__h = IceInternal.HashUtil.hashAdd(__h, gps);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(ret);
gps.__write(__os);
}
public void
__read(IceInternal.BasicStream __is)
{
ret = __is.readInt();
gps = new GpsData();
gps.__read(__is);
}
public static final long serialVersionUID = 2440970033832249670L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataRespHolder
{
public
BsDataRespHolder()
{
}
public
BsDataRespHolder(BsDataResp value)
{
this.value = value;
}
public BsDataResp value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsListReqHelper
{
public static void
write(IceInternal.BasicStream __os, BsData[] __v)
{
if(__v == null)
{
__os.writeSize(0);
}
else
{
__os.writeSize(__v.length);
for(int __i0 = 0; __i0 < __v.length; __i0++)
{
__v[__i0].__write(__os);
}
}
}
public static BsData[]
read(IceInternal.BasicStream __is)
{
BsData[] __v;
final int __len0 = __is.readAndCheckSeqSize(12);
__v = new BsData[__len0];
for(int __i0 = 0; __i0 < __len0; __i0++)
{
__v[__i0] = new BsData();
__v[__i0].__read(__is);
}
return __v;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsListReqHolder
{
public
BsListReqHolder()
{
}
public
BsListReqHolder(BsData[] value)
{
this.value = value;
}
public BsData[] value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsPoint implements java.lang.Cloneable, java.io.Serializable
{
public float lng;
public float lat;
public BsPoint()
{
}
public BsPoint(float lng, float lat)
{
this.lng = lng;
this.lat = lat;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsPoint _r = null;
if(rhs instanceof BsPoint)
{
_r = (BsPoint)rhs;
}
if(_r != null)
{
if(lng != _r.lng)
{
return false;
}
if(lat != _r.lat)
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsPoint");
__h = IceInternal.HashUtil.hashAdd(__h, lng);
__h = IceInternal.HashUtil.hashAdd(__h, lat);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeFloat(lng);
__os.writeFloat(lat);
}
public void
__read(IceInternal.BasicStream __is)
{
lng = __is.readFloat();
lat = __is.readFloat();
}
public static final long serialVersionUID = -2591565704925713803L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsPointHolder
{
public
BsPointHolder()
{
}
public
BsPointHolder(BsPoint value)
{
this.value = value;
}
public BsPoint value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_GetGpsByBs extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, BsDataResp resp);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
BsDataRespHolder resp = new BsDataRespHolder();
try
{
__ret = __proxy.end_GetGpsByBs(resp, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, resp.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_GetGpsByBsList extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, BsDataResp resp);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
BsDataRespHolder resp = new BsDataRespHolder();
try
{
__ret = __proxy.end_GetGpsByBsList(resp, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, resp.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_getPoiTypeFromGeo extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, DaoPoiInfoResp res);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
DaoPoiInfoRespHolder res = new DaoPoiInfoRespHolder();
try
{
__ret = __proxy.end_getPoiTypeFromGeo(res, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, res.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class DaoPoiInfoResp implements java.lang.Cloneable, java.io.Serializable
{
public int size;
public PoiInfo[] records;
public DaoPoiInfoResp()
{
}
public DaoPoiInfoResp(int size, PoiInfo[] records)
{
this.size = size;
this.records = records;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
DaoPoiInfoResp _r = null;
if(rhs instanceof DaoPoiInfoResp)
{
_r = (DaoPoiInfoResp)rhs;
}
if(_r != null)
{
if(size != _r.size)
{
return false;
}
if(!java.util.Arrays.equals(records, _r.records))
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::DaoPoiInfoResp");
__h = IceInternal.HashUtil.hashAdd(__h, size);
__h = IceInternal.HashUtil.hashAdd(__h, records);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(size);
poiDatasHelper.write(__os, records);
}
public void
__read(IceInternal.BasicStream __is)
{
size = __is.readInt();
records = poiDatasHelper.read(__is);
}
public static final long serialVersionUID = 6922468175968905097L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class DaoPoiInfoRespHolder
{
public
DaoPoiInfoRespHolder()
{
}
public
DaoPoiInfoRespHolder(DaoPoiInfoResp value)
{
this.value = value;
}
public DaoPoiInfoResp value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class GpsData implements java.lang.Cloneable, java.io.Serializable
{
public int lng;
public int lat;
public String addr;
public GpsData()
{
}
public GpsData(int lng, int lat, String addr)
{
this.lng = lng;
this.lat = lat;
this.addr = addr;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
GpsData _r = null;
if(rhs instanceof GpsData)
{
_r = (GpsData)rhs;
}
if(_r != null)
{
if(lng != _r.lng)
{
return false;
}
if(lat != _r.lat)
{
return false;
}
if(addr != _r.addr)
{
if(addr == null || _r.addr == null || !addr.equals(_r.addr))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::GpsData");
__h = IceInternal.HashUtil.hashAdd(__h, lng);
__h = IceInternal.HashUtil.hashAdd(__h, lat);
__h = IceInternal.HashUtil.hashAdd(__h, addr);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(lng);
__os.writeInt(lat);
__os.writeString(addr);
}
public void
__read(IceInternal.BasicStream __is)
{
lng = __is.readInt();
lat = __is.readInt();
addr = __is.readString();
}
public static final long serialVersionUID = -2420777293799941752L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class GpsDataHolder
{
public
GpsDataHolder()
{
}
public
GpsDataHolder(GpsData value)
{
this.value = value;
}
public GpsData value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class PoiInfo implements java.lang.Cloneable, java.io.Serializable
{
public float distance;
public String type;
public PoiInfo()
{
}
public PoiInfo(float distance, String type)
{
this.distance = distance;
this.type = type;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
PoiInfo _r = null;
if(rhs instanceof PoiInfo)
{
_r = (PoiInfo)rhs;
}
if(_r != null)
{
if(distance != _r.distance)
{
return false;
}
if(type != _r.type)
{
if(type == null || _r.type == null || !type.equals(_r.type))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::PoiInfo");
__h = IceInternal.HashUtil.hashAdd(__h, distance);
__h = IceInternal.HashUtil.hashAdd(__h, type);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeFloat(distance);
__os.writeString(type);
}
public void
__read(IceInternal.BasicStream __is)
{
distance = __is.readFloat();
type = __is.readString();
}
public static final long serialVersionUID = 129041973163109527L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class PoiInfoHolder
{
public
PoiInfoHolder()
{
}
public
PoiInfoHolder(PoiInfo value)
{
this.value = value;
}
public PoiInfo value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceDel extends Ice._ObjectDel
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class _BaseStationServiceDelD extends Ice._ObjectDelD implements _BaseStationServiceDel
{
public boolean GetGpsByBs(final BsDataReq req, final BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "GetGpsByBs", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.GetGpsByBs(req, resp, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
public boolean GetGpsByBsList(final BsDataListReq req, final BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "GetGpsByBsList", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.GetGpsByBsList(req, resp, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
public boolean getPoiTypeFromGeo(final BsPoint pt, final DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "getPoiTypeFromGeo", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.getPoiTypeFromGeo(pt, res, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class _BaseStationServiceDelM extends Ice._ObjectDelM implements _BaseStationServiceDel
{
public boolean
GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("GetGpsByBs", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
public boolean
GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("GetGpsByBsList", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
public boolean
getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("getPoiTypeFromGeo", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
pt.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
res.value = new DaoPoiInfoResp();
res.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class _BaseStationServiceDisp extends Ice.ObjectImpl implements BaseStationService
{
protected void
ice_copyStateFrom(Ice.Object __obj)
throws java.lang.CloneNotSupportedException
{
throw new java.lang.CloneNotSupportedException();
}
public static final String[] __ids =
{
"::BaseStationData::BaseStationService",
"::Ice::Object"
};
public boolean ice_isA(String s)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public boolean ice_isA(String s, Ice.Current __current)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public String[] ice_ids()
{
return __ids;
}
public String[] ice_ids(Ice.Current __current)
{
return __ids;
}
public String ice_id()
{
return __ids[0];
}
public String ice_id(Ice.Current __current)
{
return __ids[0];
}
public static String ice_staticId()
{
return __ids[0];
}
public final boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp)
{
return GetGpsByBs(req, resp, null);
}
public final boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp)
{
return GetGpsByBsList(req, resp, null);
}
public final boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res)
{
return getPoiTypeFromGeo(pt, res, null);
}
public static Ice.DispatchStatus ___GetGpsByBs(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsDataReq req;
req = new BsDataReq();
req.__read(__is);
__inS.endReadParams();
BsDataRespHolder resp = new BsDataRespHolder();
boolean __ret = __obj.GetGpsByBs(req, resp, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
resp.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus ___GetGpsByBsList(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsDataListReq req;
req = new BsDataListReq();
req.__read(__is);
__inS.endReadParams();
BsDataRespHolder resp = new BsDataRespHolder();
boolean __ret = __obj.GetGpsByBsList(req, resp, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
resp.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus ___getPoiTypeFromGeo(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsPoint pt;
pt = new BsPoint();
pt.__read(__is);
__inS.endReadParams();
DaoPoiInfoRespHolder res = new DaoPoiInfoRespHolder();
boolean __ret = __obj.getPoiTypeFromGeo(pt, res, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
res.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
private final static String[] __all =
{
"GetGpsByBs",
"GetGpsByBsList",
"getPoiTypeFromGeo",
"ice_id",
"ice_ids",
"ice_isA",
"ice_ping"
};
public Ice.DispatchStatus __dispatch(IceInternal.Incoming in, Ice.Current __current)
{
int pos = java.util.Arrays.binarySearch(__all, __current.operation);
if(pos < 0)
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
switch(pos)
{
case 0:
{
return ___GetGpsByBs(this, in, __current);
}
case 1:
{
return ___GetGpsByBsList(this, in, __current);
}
case 2:
{
return ___getPoiTypeFromGeo(this, in, __current);
}
case 3:
{
return ___ice_id(this, in, __current);
}
case 4:
{
return ___ice_ids(this, in, __current);
}
case 5:
{
return ___ice_isA(this, in, __current);
}
case 6:
{
return ___ice_ping(this, in, __current);
}
}
assert(false);
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
protected void __writeImpl(IceInternal.BasicStream __os)
{
__os.startWriteSlice(ice_staticId(), -1, true);
__os.endWriteSlice();
}
protected void __readImpl(IceInternal.BasicStream __is)
{
__is.startReadSlice();
__is.endReadSlice();
}
public static final long serialVersionUID = 0L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceOperations
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, Ice.Current __current);
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, Ice.Current __current);
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, Ice.Current __current);
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceOperationsNC
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp);
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp);
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res);
}
# Generated by slice2py - DO NOT EDIT!
#
import Ice
Ice.updateModule("BaseStationData")
# Modules:
import bsd_ice
# Submodules:
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class poiDatasHelper
{
public static void
write(IceInternal.BasicStream __os, PoiInfo[] __v)
{
if(__v == null)
{
__os.writeSize(0);
}
else
{
__os.writeSize(__v.length);
for(int __i0 = 0; __i0 < __v.length; __i0++)
{
__v[__i0].__write(__os);
}
}
}
public static PoiInfo[]
read(IceInternal.BasicStream __is)
{
PoiInfo[] __v;
final int __len0 = __is.readAndCheckSeqSize(5);
__v = new PoiInfo[__len0];
for(int __i0 = 0; __i0 < __len0; __i0++)
{
__v[__i0] = new PoiInfo();
__v[__i0].__read(__is);
}
return __v;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class poiDatasHolder
{
public
poiDatasHolder()
{
}
public
poiDatasHolder(PoiInfo[] value)
{
this.value = value;
}
public PoiInfo[] value;
}
# Generated by slice2py - DO NOT EDIT!
#
import Ice
Ice.updateModule("DISTRICT")
# Modules:
import district_ice
# Submodules:
# Generated by slice2py - DO NOT EDIT!
#
import Ice
Ice.updateModule("POI")
# Modules:
import ipoi_ice
# Submodules:
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import random
import datetime
import pandas as pd
from pandas import DataFrame
from kafka import KafkaConsumer, TopicPartition
from kafka import KafkaProducer
from kafka.errors import KafkaError
import traceback,happybase
from thrift.protocol import TBinaryProtocol
from thrift.transport import THttpClient
# 下面的模块通过 thrift --gen py hbase.thrift 来生成
import sys
sys.path.append("../")
from kafka_protobuffer.kafka_gps_pb2 import TrackDataReq,BaseStReq,WifiInfoReq,GPSAndBSReq
from myhbase import THBaseService
from myhbase.ttypes import TColumnValue, TColumn, TTableName, TTableDescriptor, TColumnFamilyDescriptor, TNamespaceDescriptor, TGet, TPut, TScan
import logging
LOG_FORMAT = "%(asctime)s.%(msecs)03d[%(levelname)s][%(filename)s:%(lineno)d] > %(message)s" # 日志格式化输出
DATE_FORMAT = "%m-%d-%Y %H:%M:%S" # 日期格式
fp = logging.FileHandler(f"createLocus_{datetime.datetime.now().strftime('%Y-%m-%d')}.log", encoding='utf-8')
fs = logging.StreamHandler()
logging.basicConfig(level=logging.CRITICAL, format=LOG_FORMAT, datefmt=DATE_FORMAT, handlers=[fp, fs]) # 调用
#高效率的生产者模块
# from confluent_kafka import Producer,Consumer
# p = Producer(
# {
# 'bootstrap.servers': 'qc131:9092',
# 'session.timeout.ms': 30000,
# 'auto.offset.reset': 'earliest',
# 'api.version.request': False,
# 'broker.version.fallback': '0.8.1.1',
# 'group.id': 'python-producer'
# }
# )
class gpsInfo:
def __init__(self,sn='',lng=0,lat=0,gpsTime='',speed=0,accessTime=''):
self.sn = sn
self.lng = lng
self.lat = lat
self.gpsTime=gpsTime
self.speed = speed
self.accessTime = accessTime
def connect_hbase_test():
#记得启动thrift
#/usr/local/hadoopcluster/hbase/bin/hbase-daemon.sh start thrift
#/opt/glsx-projects/java-projects/zlq/hbase-client/alihbase-2.0.14/bin/hbase-daemon.sh start thrift
connection = happybase.Connection(host='192.168.3.246', port=9090, timeout=None,
autoconnect=True, table_prefix=None, table_prefix_separator=b'_',
compat='0.94', transport='buffered'
)
connection.open()
# l_tables = connection.tables() #获取所有表
# 对应需要关系
# connection.close()
return connection
#gps_gpsdata_change,device_state_change,gps_basestation_change,gps_gpsandbs_change
def connect_hbase():
headers={}
# 线上外网
url = "http://ld-wz9qs00b91uucde9j-proxy-hbaseue-pub.hbaseue.rds.aliyuncs.com:9190"
# 线上内网
# url = "http://ld-wz9qs00b91uucde9j-proxy-hbaseue.hbaseue.rds.aliyuncs.com:9190"
transport = THttpClient.THttpClient(url)
headers["ACCESSKEYID"]="root"
# 密码
headers["ACCESSSIGNATURE"]="root"
transport.setCustomHeaders(headers)
protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
client = THBaseService.Client(protocol)
transport.open()
return client
# GPS、GPRS最新连接时间
def getGPSinfoByHbase(connection, tableName, sn,startTime,endTime):
tableInbytes = "default:"+ tableName # 表,行,dataFrame,转化输出
tableInbytes = tableInbytes.encode("utf8")
#05-00001000000000-20201217101700
row_start ='05-0000' + str(sn)
row_stop ='05-0000' + str(sn)
if len(sn) == 11:
row_start='05-000'+sn
row_stop='05-000'+sn
row_start += f"-{startTime}"
row_stop += f"-{endTime}"
scan = TScan(startRow=row_start.encode("utf8"),stopRow=row_stop.encode("utf8"),limit=1)
currentResults = connection.getScannerResults(tableInbytes, scan, 99999)
gpsInfoList = []
for itemResult in currentResults:
try:
a = itemResult
except:
return 'nan'
b = str(a).split('TColumnValue')
lng = 0
lat=0
speed=0
gpstime=''
accessTime=''
for val in b:
if 'gpsTime' in val:
gpsTime = re.search("value=b'(.*)'",val).group(1)
elif 'longitude' in val:
lng = int(float(re.search("value=b'(.*)'", val).group(1))*1000000)
elif 'latitude' in val:
lat = int(float(re.search("value=b'(.*)'", val).group(1))*1000000)
elif 'speed' in val:
speed = int(re.search("value=b'(.*)'",val).group(1))
elif 'accessTime' in val:
accessTime = re.search("value=b'(.*)'",val).group(1)
gpsInfoList.append(gpsInfo(sn,lng,lat,gpsTime,speed,accessTime))
return gpsInfoList
def producer_demo(SerializeToString,broker,topic,partition):
producer = KafkaProducer(bootstrap_servers=[broker],api_version = (0,8,1,1))
future = producer.send(topic,value=SerializeToString,partition=partition) # 向分区0发送消息
# print(f"send {SerializeToString}")
try:
future.get(timeout=2) # 监控是否发送成功
except KafkaError: # 发送失败抛出kafka_errors
print(traceback.format_exc())
kafka_broker = 'qc131:9092'
# kafka_broker = '192.168.5.17:9093'
def sendBufferToKafka(info):
req = TrackDataReq()
req.devicesn = info.sn
req.facid = 'glsx'
# req.svrtime = int(datetime.datetime.now().timestamp())
req.svrtime = int(datetime.datetime.strptime(info.accessTime,'%Y-%m-%d %H:%M:%S').timestamp())
gpsdata = req.gpsdata.add()
gpsdata.longitude = info.lng
gpsdata.latitude = info.lat
# gpsdata.time = int(datetime.datetime.now().timestamp())
gpsdata.time = int(datetime.datetime.strptime(info.gpsTime, '%Y-%m-%d %H:%M:%S').timestamp())
# gpsdata.time = int(datetime.now().timestamp()-random.randint(0,60*60*24))
gpsdata.speed = int(info.speed)
gpsdata.direction = 0
gpsdata.alt = 0
gpsdata.valid = 'A'
print(f"{req.devicesn},{info.gpsTime},{info.lng},{info.lat},{gpsdata.speed}")
producer_demo(req.SerializeToString(), kafka_broker, 'gps_gpsdata', 0)
def sendGpsAndBsToKafka(info):
req = GPSAndBSReq()
req.devicesn = info.sn
req.svrtime = int(datetime.datetime.strptime(info.accessTime,'%Y-%m-%d %H:%M:%S').timestamp())
req.gpsdata.longitude = info.lng
req.gpsdata.latitude = info.lat
req.gpsdata.time = int(datetime.datetime.strptime(info.gpsTime, '%Y-%m-%d %H:%M:%S').timestamp())
req.gpsdata.speed = int(info.speed)
req.gpsdata.valid = 'A'
req.gpsdata.direction = 0
req.gpsdata.alt = 0
req.mcc = 460
req.mnc = 0
req.bscnt = 1
bstdata = req.bstdata.add()
bstdata.lac = 34067
bstdata.cellid = 142713602
bstdata.signal = 66
req.num = 6
req.voltage = "12V"
print(f"{req.devicesn},{info.gpsTime},{info.lng},{info.lat},{info.speed}")
producer_demo(req.SerializeToString(), kafka_broker, 'gps_gpsandbs', 0)
def getGPSinfoByHbase_test(connection, tableName, sn,startTime,endTime):
tableInbytes = "default:" + tableName # 表,行,dataFrame,转化输出
tableInbytes = tableInbytes.encode("utf8")
# 05-00001000000000-20201217101700
row_start = '05-0000' + str(sn)
row_stop = '05-0000' + str(sn)
if len(sn) == 11:
row_start = '05-000' + sn
row_stop = '05-000' + sn
row_start += f"-{startTime}"
row_stop += f"-{endTime}"
table = happybase.Table(tableInbytes, connection)
# 获取一个扫描器,返回一个generator
scanner = table.scan(row_start=row_start, row_stop=row_stop)
gpsInfoList = []
lng = 0
lat = 0
speed = 0
gpstime = ''
accessTime = ''
for rowkey, v in scanner:
hasValue = True
for index in v.keys():
# print(type(index)) # bytes.decode(index) bytes 类型转 str
if bytes.decode(index) == "info:accessTime":
accessTime = bytes.decode(v[index])
elif bytes.decode(index) == "info:gpsTime":
gpstime = bytes.decode(v[index])
elif bytes.decode(index) == "info:latitude":
lat = float(bytes.decode(v[index]))
elif bytes.decode(index) == "info:longitude":
lng = float(bytes.decode(v[index]))
elif bytes.decode(index) == "info:speed":
speed = int(bytes.decode(v[index]))
gpsInfoList.append(gpsInfo(sn, int(lng*1000000), int(lat*1000000), gpstime, speed, accessTime))
if hasValue is False:
return None
return gpsInfoList
# 1510802141 激活时间:2021-12-07 16:45:43
# 1511213547 激活时间:2022-02-28 20:23:40
# 1511213035 激活时间:2022-01-14 13:21:22
# snList = ['1511213035','1510802141','1511213547']
snList = ['1510118357']
#是否是正式环境
is_upload = False
if __name__ == "__main__":
#从线上同步位置点到测试环境
client = connect_hbase() if is_upload else connect_hbase_test()
for sn in snList:
gpsInfoList = getGPSinfoByHbase(client,'track_gps_2022',sn,'2022112114000','20221121230000') if is_upload else getGPSinfoByHbase_test(client,'track_gps_2022',sn,'2022112114000','20221121230000')
# gpsInfoList = getGPSinfoByHbase(client, 'track_gps', sn, '20220920150000', '20220925000000')
print(len(gpsInfoList))
if len(gpsInfoList) > 0:
for gpsInfo in gpsInfoList:
sendBufferToKafka(gpsInfo)
# sendGpsAndBsToKafka(gpsInfo)
if is_upload is False:
client.close()
#从表格同步位置点到测试环境
# fileData = pd.read_excel("86207100020_行车轨迹.xls")
# print(fileData)
# for i in range(0,len(fileData)):
# gpstime = str(fileData.iloc[i]['时间'])
# timestemp = int(datetime.strptime(gpstime,"%Y-%m-%d %H:%M:%S").timestamp())
# info = gpsInfo(str(fileData.iloc[i]['设备号']),fileData.iloc[i]['经度'],fileData.iloc[i]['纬度'],timestemp,fileData.iloc[i]['速度(km/h)'])
# sendBufferToKafka(info)
print("end")
\ No newline at end of file \ No newline at end of file
#!/usr/bin/python
# -*- coding:utf-8 -*-
from urllib import parse
import pandas as pd
import pymysql,traceback
from sqlalchemy import create_engine
#清理接入侧的设备
#线上gpsdb
gpsdb_conn = pymysql.Connect(host='192.168.5.21', port=3306, user='c_gps',passwd='942b319271da', db='gpsdb', charset='utf8')
# gpsdb_conn = pymysql.connect(host='192.168.3.222', port=3307, user='root',passwd='Msd^*$@online', db='gpsdb', charset='utf8')
#从库
# gpsdb_conn_slave = pymysql.connect(host='192.168.5.22', port=3306, user='user_chenqj', passwd='MtWSIfaf', db='gpsdb',charset='utf8')
#gpsdb备份
conn_gpsdb_test = pymysql.connect(host='192.168.3.222', port=3307, user='root',passwd='Msd^*$@online', db='gpsdb', charset='utf8')
def insertsn(snList):
print(f"{len(snList)}")
sql = f"insert into t_clear_hbase_sn (DEVICENO) values"
bFirst = True
for sn in snList:
if bFirst is False:
sql+=','
sql += f"('{sn}')"
bFirst = False
cursor = gpsdb_conn.cursor()
try:
cursor.execute(sql)
gpsdb_conn.commit()
except Exception:
val = traceback.format_exc() # 获取异常信息
print(val)
def add_delete_sn():
df = pd.read_excel("可删除的设备号.xlsx")
print(df.columns)
df['sn'] = df['sn'].astype(str)
snList = list(df['sn'])
total = len(snList)
sumCount = int(total/10000)
sn_df = insertsn(snList[0:10000])
for n in range(sumCount):
startRow = (n+1)*10000
endRow = (n+2)*10000
insertsn(snList[startRow:endRow])
def backup_track_info_to_test():
sql = "SELECT * FROM t_tracker_info WHERE DEVICENO IN (SELECT DEVICENO FROM t_clear_hbase_sn tchs)"
cursor = gpsdb_conn.cursor()
cursor.execute(sql)
result = cursor.fetchall()
df = pd.DataFrame(list(result),columns=('ID','DEVICENO','FACID','TYPE','IP','CREATETIME','UPDATETIME'))
df.to_sql("t_tracker_info_clear_bak",
con=create_engine(f'mysql+pymysql://root:{parse.quote_plus("Msd^*$@online")}@192.168.3.222:3307/gpsdb?charset=utf8'),
index=False,
if_exists="append")
if __name__ == '__main__':
# 导入要删除的设备
# add_delete_sn()
# 把要删除的数据备份到测试环境:t_tracker_info_clear_bak
# backup_track_info_to_test()
# 从track_info里删除信息
sql = "delete from t_tracker_info where DEVICENO in (select DEVICENO FROM t_clear_hbase_sn)"
cursor = gpsdb_conn.cursor()
try:
cursor.execute(sql)
gpsdb_conn.commit()
except Exception:
val = traceback.format_exc() # 获取异常信息
print(val)
\ No newline at end of file \ No newline at end of file
This file is too large to display.
#!/usr/bin/python
# -*- coding:utf-8 -*-
from urllib import parse
import pandas as pd
import pymysql,traceback
from sqlalchemy import create_engine
#在glsx_pap库中创建要删除的sn表
#在glsx_pap库中创建要保留的sn表
#线上
conn_pap = pymysql.connect(host='192.168.5.24', port=3307, user='biz_glsx_pap',passwd='kj32iiewdd', db='glsx_pap', charset='utf8')
#测试
# conn_pap = pymysql.connect(host='192.168.3.222', port=3307, user='root',passwd='Msd^*$@online', db='glsx_pap', charset='utf8')
def insertsn(snList,tablename):
print(f"{len(snList)}")
sql = f"insert into {tablename} (sn,opType) values"
bFirst = True
for sn in snList:
if bFirst is False:
sql+=','
sql += f"('{sn}',0)"
bFirst = False
cursor = conn_pap.cursor()
try:
cursor.execute(sql)
conn_pap.commit()
except Exception:
val = traceback.format_exc() # 获取异常信息
print(val)
def add_delete_gps_sn():
df = pd.read_excel("可删除的设备号.xlsx")
print(df.columns)
df['sn'] = df['sn'].astype(str)
snList = list(df['sn'])
total = len(snList)
sumCount = int(total/10000)
insertsn(snList[0:10000],"t_gps_device_del")
for n in range(sumCount):
startRow = (n+1)*10000
endRow = (n+2)*10000
insertsn(snList[startRow:endRow],"t_gps_device_del")
def add_delete_lbs_sn():
df = pd.read_excel("lbs可删除的包含有源设备.xlsx")
print(df.columns)
df['sn'] = df['sn'].astype(str)
snList = list(df['sn'])
total = len(snList)
sumCount = int(total/10000)
insertsn(snList[0:10000],"t_lbs_device_del")
for n in range(sumCount):
startRow = (n+1)*10000
endRow = (n+2)*10000
insertsn(snList[startRow:endRow],"t_lbs_device_del")
def add_retain_sn_gps():
sql = "select sn,0 from t_device_gps_recent where device_type='05'"
cursor_recent = conn_pap.cursor()
cursor_recent.execute(sql)
result = cursor_recent.fetchall()
df = pd.DataFrame(list(result),columns=('sn','opType'))
sql = "select sn,0 from t_gps_device_del"
cursor_del = conn_pap.cursor()
cursor_recent.execute(sql)
result = cursor_recent.fetchall()
df_del = pd.DataFrame(list(result), columns=('sn','opType'))
df = df.append(df_del)
df = df.append(df_del)
df.drop_duplicates(subset=['sn'], keep=False, inplace=True)
df.to_sql("t_gps_device_retain",
con=create_engine(f'mysql+pymysql://biz_glsx_pap:kj32iiewdd@192.168.5.24:3307/glsx_pap?charset=utf8'),
index=False,
if_exists="append")
def add_retain_sn_lbs():
sql = "select sn,0 from t_device_lbs_recent where type='05'"
cursor_recent = conn_pap.cursor()
cursor_recent.execute(sql)
result = cursor_recent.fetchall()
df = pd.DataFrame(list(result),columns=('sn','opType'))
sql = "select sn,0 from t_lbs_device_del"
cursor_del = conn_pap.cursor()
cursor_recent.execute(sql)
result = cursor_recent.fetchall()
df_del = pd.DataFrame(list(result), columns=('sn','opType'))
df = df.append(df_del)
df = df.append(df_del)
df.drop_duplicates(subset=['sn'], keep=False, inplace=True)
df.to_sql("t_lbs_device_retain",
con=create_engine(f'mysql+pymysql://biz_glsx_pap:kj32iiewdd@192.168.5.24:3307/glsx_pap?charset=utf8'),
index=False,
if_exists="append")
if __name__ == '__main__':
# 导入要删除的设备
# add_delete_gps_sn()
# add_delete_lbs_sn()
#导入要保留的gps
# add_retain_sn_gps()
#导入要保留的lbs
# add_retain_sn_lbs()
print("complate")
\ No newline at end of file \ No newline at end of file
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import datetime
import logging
from dateutil.relativedelta import relativedelta
import numpy as np
import pandas as pd
import pymysql
#从业务提供的表中导出对应的设备号
#线上
db_conn_gps = pymysql.Connect(host='192.168.5.22', port=3307, user='user_chenqj',
passwd='MtWSIfaf', db='gps', charset='utf8')
def selectSnbyVin(vinList):
print(f"{len(vinList)}")
vinListStr = "','".join(vinList)
sql = f"SELECT dti.sn,dv.standno FROM d_vehicle dv LEFT JOIN d_track_info dti ON dv.vehicleId = dti.trackerId WHERE dti.sn IS NOT NULL AND dv.standno IN ('{vinListStr}')"
cursor = db_conn_gps.cursor()
cursor.execute(sql)
result = cursor.fetchall()
df = pd.DataFrame(list(result),columns=('sn','vin'))
return df
if __name__ == '__main__':
df = pd.read_excel("2018~2019可清除的车架号.xlsx")
print(df.columns)
df['vin'] = df['vin'].astype(str)
vinList = list(df['vin'])
total = len(vinList)
sumCount = int(total/10000)
sn_df = selectSnbyVin(vinList[0:10000])
for n in range(sumCount):
startRow = (n+1)*10000
endRow = (n+2)*10000
sn_df_tmp = selectSnbyVin(vinList[startRow:endRow])
sn_df = sn_df.append(sn_df_tmp)
sn_df.to_excel("2018~2019可清除的sn.xlsx",index=False)
\ No newline at end of file \ No newline at end of file
No preview for this file type
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 1.0 金克龙 2016/01/18 初稿:提供各类设备的gps信息、基站、电压信息的查询;
// 1.1 金克龙 2017/10/13 为追踪器提供其workMode的查询;
// 1.2 金克龙 2017/10/31 为通过IMEI上报gps等信息的车机/后视镜提供通过IMEI查询最新Gps点、查询历史gps记录的接口;
// 1.3 金克龙 2019/03/04 为虎哥e盾2.5增加批量监控的查询接口
//////////////////////////////////////////////////////////////////
module HDaoGps
{
/*==========================================================
* GPS
*==========================================================*/
/******* common *********/
struct GpsRecord
{
int gpsTime; /* GPS时间戳 */
int lng; /* 经度 */
int lat; /* 纬度 */
int alt; /* 海拔 */
int speed; /* 速度 */
int dir; /* 方向 */
int gLng; /* 高德地图经度 */
int gLat; /* 高德地图经度 */
int bLng; /* 百度地图经度 */
int bLat; /* 百度地图经度 */
int storeTime; /* 数据存储时间 */
};
sequence<GpsRecord> GpsRecords;
/*--------------------
apType: also named as devType, its value defined as below:
2: OBD;
4: DDbox(DVD)
5: Tracker
6: rearMirror
7: car recorder
---------------------*/
/*--------------------
apSubType: also named as devSubType. The field is used in Recent Gps/Bs query in order to speed up query process.
when apType is 5(tracker), it is defined as below:
0: reserved
1: with wire power;
2: without wire power;
---------------------*/
/*--------------------
oprResult:
0: OK, records found
1: OK, no record found
other: operation failed
---------------------*/
/*--------------------
extraMapReq:
0: none
1: google&baidu
2: google
3: baidu
---------------------*/
/******* Latest Gps record *********/
struct LatestGpsGetRequest
{
long userID;
int apType;
int extraMapReq;
};
/******* Latest Gps record with bindTime *********/
struct LatestGpsGetRequestWithBindTime
{
long userID;
int apType;
int extraMapReq;
int bindTime;
};
struct LatestGpsGetResponse
{
int oprResult;
GpsRecord record;
};
struct LatestGpsTimeGetResponse
{
int oprResult;
int gpsTime;
};
/******* Recent Gps records *********/
struct RecentGpsGetRequest
{
long userID;
int apType;
int apSubType;
int extraMapReq;
int reqCount;
};
struct RecentGpsGetResponse
{
int oprResult;
GpsRecords records;
};
/******** history Gps Record *************/
struct GpsGetRequest
{
long userID;
int apType;
int extraMapReq;
int startTime; /*开始时间*/
int endTime; /*结束时间*/
int reqCount; /*请求记录数*/
};
struct GpsGetResponse
{
int oprResult;
GpsRecords records;
};
/********====================*******/
/* definition of filterLevel */
/* 0 - no filter */
/* 1 - filter level1: interval of 30 seconds(filter neighboring gps point, if following point who is less than 30 seconds) */
/* 2 - filter level2: interval of 60 seconds(filter neighboring gps point, if following point who is less than 60 seconds) */
/* 3 - filter level3: interval of 90 seconds(filter neighboring gps point, if following point who is less than 90 seconds) */
struct GpsGetExRequest
{
long userID;
int apType;
int extraMapReq; /*返回地图类型*/
int startTime; /*开始时间*/
int endTime; /*结束时间*/
int reqCount; /*请求记录数*/
int filterLevel; /* definition, please see above */
};
struct GpsGetExResponse
{
int oprResult;
GpsRecords records;
bool fullFlag; /* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */
int lastGpsTime; /* sample time of last record from hbase/Gpc */
};
/******* DevSn to DidiNo mapping ********/
struct Sn2DdMapGetReq
{
long userID;
int apType;
int startTime; /*开始时间*/
int endTime; /*结束时间*/
int reqCount; /*请求记录数*/
};
struct SnMapRecord
{
int ddNo;
int devType;
int beginTime; /*开始时间*/
int endTime; /*结束时间*/
};
sequence<SnMapRecord> SnMapRecords;
struct Sn2DdMapGetResponse
{
int oprResult;
SnMapRecord curMapRecord;
SnMapRecords historyMapRecords;
};
/******* Last Gps record for the request date *********/
struct DayLastGpsGetRequest
{
long userID;
int apType;
int extraMapReq;
int year;
int month;
int day;
};
struct DayLastGpsGetResponse
{
int oprResult;
GpsRecord record;
};
/******* Latest Rgps(GPS or rough GPS) record *********/
struct LatestRgpsGetRequest
{
long userID;
int apType;
int extraMapReq;
};
struct LatestRgpsGetResponse
{
int oprResult;
GpsRecord record;
};
/******* Batch Gps Device Info request for tiger e-shield ********/
/*--------------------
subDevType:
0: Unknown
1: Wire
2: Wireless
onlineState:
1: online state;
2: offline state;
locType:
0: gps
1: bs
---------------------*/
sequence<long> UserIdSeq;
struct GpsDevInfo
{
long userID;
GpsRecord record;
short subDevType;
short locType;
short onlineState;
};
sequence<GpsDevInfo> GpsDevInfoSeq;
struct BatchGpsDevInfoRequest
{
UserIdSeq userIds; /* max num is less than 1000 */
int extraMapReq;
int seqNo; /* 0: initiated;
* increase by 1 each time refresshing */
};
/**
** batchResult:
** 0: ok for all users;
** 1: ok for part, the succesful part of device info is followed;
** -1: failed, the followed gpsDevInfo is meaningless.
**/
struct BatchGpsDevInfoResponse
{
int batchResult;
GpsDevInfoSeq gpsDevInfos;
};
/*==========================================================
* BaseStation
*==========================================================*/
/* common part */
struct BsInfo
{
int lac; /* 位置区号 */
int cellId; /* 位置塔号 */
int signal; /* 信号强度 */
};
sequence<BsInfo> BsInfoArray;
struct BsRecord
{
int gpsTime; /* GPS上报时间 */
int storeTime; /* 数据存储时间 */
int mcc; /* 国家码 */
int mnc; /* 所属运营商 */
BsInfoArray bsInfos;
};
sequence<BsRecord> BsRecords;
/******* Latest BaseStation record *********/
struct LatestBsGetRequest
{
long userID;
int apType;
};
struct LatestBsGetResponse
{
int oprResult;
BsRecord record;
};
/****** Recent BaseStation records *******/
struct RecentBsGetRequest
{
long userID;
int apType;
int apSubType;
int reqCount;
};
struct RecentBsGetResponse
{
int oprResult;
BsRecords records;
};
/****** history BaseStation record *******/
struct BsGetRequest
{
long userID;
int apType;
int startTime; /* 开始时间 */
int endTime; /* 结束时间 */
int reqCount;
};
struct BsGetResponse
{
int oprResult;
BsRecords records;
};
/******** Gps&BS Record *************/
struct GpsBsRecord
{
int gpsTime; /* GPS上报时间 */
int storeTime; /* 数据存储时间 */
bool gpsValid; /* GPS有效位 */
int lng; /* 经度 */
int lat; /* 纬度 */
int gLng; /* 高德地图经度 */
int gLat; /* 高德地图纬度 */
int bLng; /* 百度地图经度 */
int bLat; /* 百度地图纬度 */
int alt; /* 海拨 */
int speed; /* 速度 */
int dir; /* 方向 */
bool bsValid; /* 基站有效位 */
int mcc; /* 国家码 */
int mnc; /* 所属运营商 */
BsInfoArray bsInfos;
};
sequence<GpsBsRecord> GpsBsRecords;
struct GpsBsGetResponse
{
int oprResult;
GpsBsRecords records;
};
struct LatestGpsBsRecord
{
GpsRecord recordgps;
BsRecord recordbs;
};
struct LatestGpsBsReponse
{
bool gpsValid; /* GPS有效位 */
bool bsValid; /* 基站有效位 */
int oprGpsResult;
int oprBsResult;
LatestGpsBsRecord record;
};
/****** SIM card's related record *******/
struct DataCardGetRequest
{
long userID;
int apType;
};
struct DataCardInfo
{
int gpsTime;
string iccid;
};
struct DataCardGetResponse
{
int oprResult;
DataCardInfo cardInfo;
};
/******* workmode record: gsensor and workmode field *********/
/*-----GPS related workmode record------*/
struct GpsWorkModeRecord
{
int gpsTime; /* GPS上报时间 */
int lng; /* 经度 */
int lat; /* 纬度 */
int speed; /* 速度 */
int gsensor; /* GSENSOR值 */
int workmode; /* 工作模式 */
int storeTime; /* 数据存储时间 */
};
sequence<GpsWorkModeRecord> GpsWorkModeRecords;
struct GpsWorkModeGetRequest
{
long userID;
int apType;
int startTime; /* 开始时间 */
int endTime; /* 结束时间 */
int reqCount; /* 请求记录数 */
};
struct GpsWorkModeGetResponse
{
int oprResult;
GpsWorkModeRecords records;
};
/*-----BS related workmode record------*/
struct BsWorkModeRecord
{
int gpsTime; /* GPS上报时间 */
int storeTime; /* 数据存储时间 */
int mcc; /* 国家码 */
int mnc; /* 所属运营商 */
BsInfoArray bsInfos; /* 基站信息 */
int gsensor; /* GSENSOR值 */
int workmode; /* 工作模式 */
};
sequence<BsWorkModeRecord> BsWorkModeRecords;
struct BsWorkModeGetRequest
{
long userID;
int apType;
int startTime; /* 开始时间 */
int endTime; /* 结束时间 */
int reqCount; /* 请求记录数 */
};
struct BsWorkModeGetResponse
{
int oprResult;
BsWorkModeRecords records;
};
/*==========================================================
* Voltage
*==========================================================*/
/******** latest Voltage Record *************/
struct LatestVoltageGetRequest
{
long userID;
int apType;
int startTime;
};
struct VoltageRecord
{
int gpsTime;
int voltage; /* multipled by 100 */
int storeTime;
};
struct LatestVoltageGetResponse
{
int oprResult;
VoltageRecord record;
};
/******** history Voltage Record *************/
struct VoltageGetRequest
{
long userID;
int apType;
int startTime; /* 开始时间 */
int endTime; /* 结束时间 */
int reqCount; /* 请求记录数 */
};
sequence<VoltageRecord> VoltageRecords;
struct VoltageGetResponse
{
int oprResult;
VoltageRecords records;
bool finishFlag;
int lastRecTime;
};
/*** Voltage max diff ***/
struct DiffVoltageGetRequest
{
long userID;
int apType;
int startTime; /* 开始时间 */
int endTime; /* 结束时间 */
};
struct DiffVoltageGetResponse
{
int oprResult;
int maxVolDiff; /* multipled by 100 */
};
/*==========================================================
* Battery
*==========================================================*/
/******** latest Battery Record *************/
struct LatestBatteryGetRequest
{
long userID;
int apType;
int startTime; /* 结束时间 */
};
struct BatteryRecord
{
int gpsTime;
int battery; /* percentage: such as 50, represent 50% */
int storeTime;
};
struct LatestBatteryGetResponse
{
int oprResult;
BatteryRecord record;
};
/*==========================================================
* ParadeCar
*==========================================================*/
/******** ParadeCar Gps Record *************/
struct ParadeCarGpsRecord
{
int gpsTime;
int lng;
int lat;
int alarmState;
int speed;
int dir;
int status;
int gLng;
int gLat;
int bLng;
int bLat;
int storeTime;
};
sequence<ParadeCarGpsRecord> ParadeCarGpsRecords;
struct GpsParadeCarGetResponse
{
int oprResult;
ParadeCarGpsRecords records;
bool fullFlag; /* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */
int lastGpsTime; /* sample time of last record from hbase/Gpc */
};
struct AlarmGetRequest
{
long userID;
int apType;
int startTime;
int endTime;
int reqCount;
};
struct AlarmRecord
{
int alarmTime;
int alarmState;
};
sequence<AlarmRecord> AlarmRecords;
struct AlarmGetResponse
{
int oprResult;
AlarmRecords records;
bool fullFlag; /* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */
int lastAlarmTime; /* sample time of last record from hbase/Gpc */
};
enum ConvType { WGS2GG, WGS2BD };
struct ConvRequest
{
ConvType type;
int lng;
int lat;
};
struct ConvResponse
{
int lng;
int lat;
};
struct ConvResponseResult
{
int oprResult;
ConvResponse gps;
};
struct DevicesTotalCountGetRequest
{
long sn;
};
struct DevicesTotalCountRes
{
int oprResult;
int deviceCount;
string updataTime;
};
struct GpsWifiRequest
{
long userID;
int apType;
};
struct wifiData
{
string mac;
int single;
};
sequence<wifiData> wifiDatas;
struct GpsWifiGetResponse
{
int oprResult;
int gpsTime;
int svcTime;
wifiDatas records;
};
struct DaoGpsData
{
int gpsTime;
int storeTime;
int lng;
int lat;
string addr;
};
struct DaoBsDataResp
{
int ret;
DaoGpsData gps;
};
struct RegionData
{
int leftLng;
int leftLat;
int rightLng;
int rightLat;
};
struct DeviceInfo
{
long sn;
int lng;
int lat;
int gpsTime;
string addr;
};
sequence<DeviceInfo> DeviceList;
struct InRegionDevices
{
int ret;
DeviceList devInfo;
};
// service interface
interface DaoGpsService
{
/*bs & gps record*/
bool getLatestGpsBsRecord(LatestGpsGetRequest req, out LatestGpsBsReponse res);
/* baseStation related */
bool getBsRecords(BsGetRequest req, out BsGetResponse res);
bool getLatestBsRecord(LatestBsGetRequest req, out LatestBsGetResponse res);
bool getRecentBsRecords(RecentBsGetRequest req, out RecentBsGetResponse res);
bool getFirstBsRecord(BsGetRequest req, out BsGetResponse res);
/* Gps related */
bool getFirstGpsRecord(GpsGetRequest req, out GpsGetResponse res);
bool getLatestGpsRecord(LatestGpsGetRequest req, out LatestGpsGetResponse res);
bool getLatestGpsTime(LatestGpsGetRequest req, out LatestGpsTimeGetResponse res);
bool getRecentGpsRecords(RecentGpsGetRequest req, out RecentGpsGetResponse res);
bool getGpsRecords(GpsGetRequest req, out GpsGetResponse res);
bool getGpsRecordsEx(GpsGetRequest req, out GpsGetExResponse res);
/* Batch: ONLY for tracker */
bool getDevicesGpsInfo(BatchGpsDevInfoRequest req, out BatchGpsDevInfoResponse res);
/* support DDbox/rearMirror device who reports gps info by IMEI instead of didiID */
bool getLatestGpsRecordByImei(LatestGpsGetRequestWithBindTime req, out LatestGpsGetResponse res);
bool getGpsRecordsByImei(GpsGetRequest req, out GpsGetExResponse res);
/* DDbox device used for FRMS purpose */
bool getLatestGpsRecordByMapSn(LatestGpsGetRequest req, out LatestGpsGetResponse res);
bool getGpsRecordsByMapSn(GpsGetExRequest req, out GpsGetExResponse res);
bool getSnMapRecords(Sn2DdMapGetReq req, out Sn2DdMapGetResponse res);
bool getLatestRgpsRecord(LatestRgpsGetRequest req, out LatestRgpsGetResponse res);
/* Get location by LBS record, NOT recommended, ONLY used when there is NO gps info available */
bool getLatestLocationByLbsRecord(LatestGpsGetRequest req, out LatestGpsGetResponse res);
bool getDayLastGpsRecord(DayLastGpsGetRequest req, out DayLastGpsGetResponse res);
bool getGpsBsRecords(GpsGetRequest req, out GpsBsGetResponse res);
bool getFirstGpsBsRecord(GpsGetRequest req, out GpsBsGetResponse res);
/* Voltage related */
bool getLatestVolRecord(LatestVoltageGetRequest req, out LatestVoltageGetResponse res);
bool getMaxVolDiff(DiffVoltageGetRequest req, out DiffVoltageGetResponse res);
bool getVoltageRecords(VoltageGetRequest req, out VoltageGetResponse res);
/* Battery related */
bool getLatestBatteryRecord(LatestBatteryGetRequest req, out LatestBatteryGetResponse res);
/* Info of data card installed in the device */
bool getDataCardInfo(DataCardGetRequest req, out DataCardGetResponse res);
/* workmode related: the interfaces are used for problem resoving */
bool getGpsWorkModeRecords(GpsWorkModeGetRequest req, out GpsWorkModeGetResponse res);
bool getBsWorkModeRecords(BsWorkModeGetRequest req, out BsWorkModeGetResponse res);
/* ParadeCar related */
bool getParadeCarGpsRecords(GpsGetRequest req, out GpsParadeCarGetResponse res);
bool getParadeCarAlarmRecords(AlarmGetRequest req, out AlarmGetResponse res);
bool convGeoGps(ConvRequest req, out ConvResponseResult rsp);
bool getDevicesTotalCount(DevicesTotalCountGetRequest req, out DevicesTotalCountRes res);
/*gps wifi info*/
bool getLatestGpsWifiRecords(GpsWifiRequest req, out GpsWifiGetResponse res);
/*bs list by bsSvrICe*/
bool getGpsByLatestBsRecord(LatestBsGetRequest req, out DaoBsDataResp res);
bool getGpsByBsRecordsOfLatesBs(BsGetRequest req, out DaoBsDataResp res);
bool getDeviceInfoOfRegion(RegionData req, out InRegionDevices res);
};
};
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 1.0 金克龙 2016/05/18 初稿:提供行程的里程统计功能;
// 1.1 金克龙 2017/10/31 为通过IMEI上报gps等信息的车机/后视镜提供通过IMEI查询的接口;
//////////////////////////////////////////////////////////////////
module HDaoMile
{
/*==========================================================
* Mileage Statistics
*==========================================================*/
/******* common *********/
struct GpsPos
{
int gpsTime; /* GPS时间戳 */
int lng; /* 经度 */
int lat; /* 纬度 */
string addr; /* 地址信息 */
};
/*--------------------
apType: also named as devType, its value defined as below:
2: OBD;
4: DDbox(DVD)
5: Tracker
6: rearMirror
7: car recorder
---------------------*/
/*--------------------
oprResult:
0: OK
1: reserved
other: operation failed
---------------------*/
/******** Start mileage statistics *************/
struct MileStatBeginRequest
{
long userID;
int apType;
int beginTime; /*开始统计里程时间*/
};
struct MileStatBeginResponse
{
int oprResult;
};
/******* End mileage statistics *********/
struct MileStatEndRequest
{
long userID;
int apType;
int beginTime; /*开始时间*/
int endTime; /*结束时间*/
bool bRetGpsTime; /*返回最后GPS记录时间*/
};
struct MileStatEndResponse
{
int oprResult;
int mileage; /* unit: meter */
GpsPos beginPos; /* 开始位置信息 */
GpsPos endPos; /* 结束位置信息*/
float over80Percent; /* percentage of gpsPoints that are over speed ranging from 80km/h to 120km/h */
float over120Percent; /* percentage of gpsPoints that are over speed above 120km/h */
int maxSpeed; /* unit: km/h */
int gpsBgnTime; /* time of the first gps record of the journey. Maybe filled if bRetGpsTime is true */
int gpsEndTime; /* time of the last gps record of the journey. Maybe filled if bRetGpsTime is true */
};
/******* mileage statistics *********/
struct MileStatRequest
{
long userID;
int apType;
int beginTime; /* 开始时间 */
int endTime; /* 结束时间 */
};
struct MileStatResponse
{
int oprResult;
int mileage; /* unit: meter */
GpsPos beginPos; /* 开始位置信息 */
GpsPos endPos; /* 结束位置信息*/
float over80Percent; /* 超速gps点(80km/h-120km/h) 占行程的百分比 */
float over120Percent; /* 超速gps点(120km/h以上) 占行程的百分比 */
int maxSpeed; /* unit: km/h */
};
/******** journey and overSpeed *************/
struct Date
{
int year;
int month;
int day;
};
struct GetJourneyRecordsReq
{
long userID;
int apType;
bool bReqAddr; /* 缺省是false, 当为true时,表示响应结果中携带文字地址 */
Date bgnDate; /* 开始日期 */
Date endDate; /* 结束日期 */
int extraMapReq; /* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
};
struct GpsLoc
{
int lng;
int lat;
int glng; /* 高德坐标 */
int glat;
int blng; /* 百度坐标 */
int blat;
};
struct JourneyRecord
{
int bgnTime; /*开始时间*/
int endTime; /*结束时间*/
int duration; /*持续时间*/
string bgnAddress; /*开始位置点地址*/
GpsLoc bgnGps; /*开始位置点*/
string endAddress; /*结束位置点地址*/
GpsLoc endGps; /*结束位置点*/
int mileage; /* 单位: 米 */
};
sequence<JourneyRecord> JourneyRecords;
struct GetJourneyRecordsRes
{
int oprResult;
long userID;
JourneyRecords jourRecords; /* 历史行程记录 */
};
struct GetDailyMileRecordsReq
{
long userID;
int apType;
Date bgnDate; /*开始日期*/
Date endDate; /*结束日期*/
};
struct DailyMileRecord
{
int jourCount;
int mileage; /* 单位: 米 */
Date jourDate; /*行程所属日期*/
long duration; /*行程时间*/
};
sequence<DailyMileRecord> DailyMileRecords;
struct GetDailyMileRecordsRes
{
int oprResult;
long userID;
DailyMileRecords dailMileRecords; /* 日里程 */
};
struct GetOverSpeedRecordsReq
{
long userID;
int apType;
Date bgnDate; /*开始日期*/
Date endDate; /*结束日期*/
int extraMapReq; /* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
};
struct OverSpeedRecord
{
int bgnTime; /*开始时间*/
int endTime; /*结束时间*/
int duration; /*持续时间*/
GpsLoc bgnGps; /*开始位置点*/
GpsLoc endGps; /*结束位置点*/
int averageSpeed; /*平均速度*/
};
sequence<OverSpeedRecord> OverSpeedRecords;
struct GetOverSpeedRecordsRes
{
int oprResult;
long userID;
OverSpeedRecords overSpdRecords;
};
/******** journey and overSpeed *************/
/******** month mileage *************/
struct Month
{
int year;
int mon;
};
struct GetMonthMileRecordsReq
{
long userID;
int apType;
Month bgnMonth; /* 开始月份 2019-08 */
Month endMonth; /* 结束月份 2019-10 */
};
struct MonthMileRecord
{
int monthMileage; /* 月里程 */
int monthCount; /* 月开车次数 */
int monthDuration; /* 月开车时长 */
int monthDay; /* 月开车天数 */
float averageMileage; /* 平均里程 */
float averageCount; /* 平均次数 */
float averageDuration; /* 平均时长 */
Month whichMonth; /* 所属月份 */
};
sequence<MonthMileRecord> MonthMileRecords;
struct GetMonthMileRecordsRes
{
int oprResult;
long userID;
MonthMileRecords monMileRecords;
};
/******** month mileage *************/
/******** month reside *************/
struct GetMonthResideRecordsReq
{
long userID;
int apType;
Month bgnMonth; /* 起始月份 */
Month endMonth; /* 结束月份 */
};
struct MonthResideRecord
{
string fstResideLoc; /* 第一常驻地地址 */
int fstResideDuration; /* 第一常驻地停留时长 */
int fstResideTimes; /* 第一常驻地停留次数 */
string sndResideLoc; /* 第二常驻地地址 */
int sndResideDuration; /* 第二常驻地停留时长 */
int sndResideTimes; /* 第二常驻地停留次数 */
string trdResideLoc; /* 第三常驻地地址 */
int trdResideDuration; /* 第三常驻地停留时长 */
int trdResideTimes; /* 第三常驻地停留次数 */
Month whichMonth; /* 所属月份 */
};
sequence<MonthResideRecord> MonthResideRecords;
struct GetMonthResideRecordsRes
{
int oprResult;
long userID;
MonthResideRecords monResideRecords;
};
struct GetResideInfoRecordReq
{
long userID;
};
struct GetResideInfoRecordRes
{
int oprResult;
long userID;
string homeaddress; /*预测家庭地址*/
string homeLng;
string homeLat;
string workaddress; /*预测工作地址*/
string workLng;
string workLat;
};
/******** month reside *************/
/******** stay point *************/
struct GetStayPointRecordsReq
{
long userID;
int apType;
Date bgnDate; /* 开始日期 */
Date endDate; /* 结束日期 */
int periodType; /* 0:全天 1:06:00~12:00 2:12:00~21:00 3:21:00~06:00 */
int minDuration; /* 最小持续时长 */
int maxDuration; /* 最大持续时长 */
int extraMapReq; /* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
};
struct StayPointRecord
{
int bgnTime; /* 开始时间 */
int endTime; /* 结束时间 */
int duration; /* 持续时长 */
GpsLoc stayGps; /* 停留位置点信息 */
};
sequence<StayPointRecord> StayPointRecords;
struct GetStayPointRecordsRes
{
int oprResult;
long userID;
StayPointRecords stayPoints; /* 停留点信息 */
};
/******** stay point *************/
/******** total mileage *************/
struct GetTotalMileageReq
{
long userID;
int apType;
int bgnDayTime; /* 开始日期 */
int endDayTime; /* 开始日期 */
int bReqDailyRecord; /* 默认0, 非0:获取日里程记录 */
};
struct GetTotalandAverageMilageReq
{
long userID;
};
struct GetTotalandAverageMilageRes
{
long userID;
int oprResult;
long totalMileage;
long monthAveMiles;
long yearthAveMiles;
};
struct GetTotalMileageRes
{
int oprResult;
long userID;
long totalMileage; /* 总里程:米(m) */
long totalJourCount; /* 总行驶次数 */
long totalDuration; /* 总时长 */
DailyMileRecords dailMileRecords; /* 日里程 */
};
/******** total mileage *************/
struct GetBlackAreaReq
{
long userID;
};
struct GetBlackAreaRes
{
long userID;
int oprResult;
bool flag; /*ture: 在黑区 false:不在黑区*/
string aggKey; /*falg == true 才返回该字段*/
};
struct GetGahterReq
{
long userID;
};
struct GetGatherRes
{
long userID;
int oprResult;
string aggKey;
};
// service interface
interface DaoMileService
{
/* Mile Stat related */
bool beginUserMileStat(MileStatBeginRequest req, out MileStatBeginResponse res);
bool endUserMileStat(MileStatEndRequest req, out MileStatEndResponse res);
bool JourneyMileStat(MileStatRequest req, out MileStatResponse res);
/* for ddbox device that reports gps info by IMEI instead of didiID */
bool endUserMileStatByImei(MileStatEndRequest req, out MileStatEndResponse res);
/* for journey and overSpedd */
bool getJourneyRecords(GetJourneyRecordsReq req, out GetJourneyRecordsRes res);
bool getDailyMileageRecords(GetDailyMileRecordsReq req, out GetDailyMileRecordsRes res);
bool getOverSpeedRecords(GetOverSpeedRecordsReq req, out GetOverSpeedRecordsRes res);
/* for month mileage */
bool getMonthMileageRecords(GetMonthMileRecordsReq req,out GetMonthMileRecordsRes res);
/* for month reside */
bool getMonthResideRecords(GetMonthResideRecordsReq req,out GetMonthResideRecordsRes res);
/* for work and family reside */
bool getWorkandFamilyResideRecords(GetResideInfoRecordReq req, out GetResideInfoRecordRes res);
/* for stay point */
bool getStayPointRecords(GetStayPointRecordsReq req,out GetStayPointRecordsRes res);
/* for totalMileage */
bool getToatlMileage(GetTotalMileageReq req, out GetTotalMileageRes res);
bool getToatlandAverageMilage(GetTotalandAverageMilageReq req, out GetTotalandAverageMilageRes res);
/*Black area and gather*/
bool getBlackAreaData(GetBlackAreaReq req, out GetBlackAreaRes res);
bool getGatherData(GetGahterReq req, out GetGatherRes res);
};
};
module HDaoMile
{
/*==========================================================
* Mileage Statistics
*==========================================================*/
/******* common *********/
struct GpsPos
{
int gpsTime;
int lng;
int lat;
string addr;
};
/*--------------------
apType: also named as devType, its value defined as below:
2: OBD;
4: DDbox(DVD)
5: Tracker
6: rearMirror
7: car recorder
---------------------*/
/*--------------------
oprResult:
0: OK
1: reserved
other: operation failed
---------------------*/
/******** Start mileage statistics *************/
struct MileStatBeginRequest
{
long userID;
int apType;
int beginTime;
};
struct MileStatBeginResponse
{
int oprResult;
};
/******* End mileage statistics *********/
struct MileStatEndRequest
{
long userID;
int apType;
int beginTime;
int endTime;
bool bRetGpsTime;
};
struct MileStatEndResponse
{
int oprResult;
int mileage; /* unit: meter */
GpsPos beginPos;
GpsPos endPos;
float over80Percent; /* percentage of gpsPoints that are over speed ranging from 80km/h to 120km/h */
float over120Percent; /* percentage of gpsPoints that are over speed above 120km/h */
int maxSpeed; /* unit: km/h */
int gpsBgnTime; /* time of the first gps record of the journey. Maybe filled if bRetGpsTime is true */
int gpsEndTime; /* time of the last gps record of the journey. Maybe filled if bRetGpsTime is true */
};
/******* mileage statistics *********/
struct MileStatRequest
{
long userID;
int apType;
int beginTime;
int endTime;
};
struct MileStatResponse
{
int oprResult;
int mileage; /* unit: meter */
GpsPos beginPos;
GpsPos endPos;
float over80Percent; /* 超速gps点(80km/h-120km/h) 占行程的百分比 */
float over120Percent; /* 超速gps点(120km/h以上) 占行程的百分比 */
int maxSpeed; /* unit: km/h */
};
// service interface
interface DaoMileService
{
/* Mile Stat related */
bool beginUserMileStat(MileStatBeginRequest req, out MileStatBeginResponse res);
bool endUserMileStat(MileStatEndRequest req, out MileStatEndResponse res);
bool JourneyMileStat(MileStatRequest req, out MileStatResponse res);
};
};
\ No newline at end of file \ No newline at end of file
module BaseStationData
{
struct BsData
{
int mnc; /*运营商编码*/
int lac; /*区号*/
int cellid; /*塔号*/
};
sequence<BsData> BsListReq;
struct BsDataListReq
{
BsListReq bsList;
};
struct BsDataReq
{
BsData bs;
};
struct GpsData
{
int lng; /*经度*/
int lat; /*纬度*/
string addr; /*地址*/
};
struct BsDataResp
{
int ret;
GpsData gps;
};
struct BsPoint
{
float lng;
float lat;
};
struct PoiInfo
{
float distance;
string type;
float lng;
float lat;
string addr;
};
sequence<PoiInfo> poiDatas;
struct DaoPoiInfoResp
{
int size;
poiDatas records;
};
interface BaseStationService
{
bool GetGpsByBs(BsDataReq req, out BsDataResp resp);
bool GetGpsByBsList(BsDataListReq req, out BsDataResp resp);
/*get gaode poiType*/
bool getPoiTypeFromGeo(BsPoint pt, out DaoPoiInfoResp res);
};
};
module DISTRICT {
interface IDistrictFinder{
bool get_distinfo_by_pos(float lng,float lat,out int distCode,out string strDistName);
bool get_distdetail_by_code(int distCode,out string strProvName,out string strCityName,out string strCountyName);
bool get_distdetail_by_pos(float lng, float lat, out string strProvName, out string strCityName, out string strCountyName);
};
};
module FspOnline
{
struct GpsLoc
{
double longitude;
double latitude;
double glng; /* 高德坐标 */
double glat;
double blng; /* 百度坐标 */
double blat;
};
struct ResideBaseInfo
{
string userId;
int apType;
int totalDuration;
int totalTimes;
GpsLoc gps;
};
enum PeriodType
{
Morning = 1,
Afternoon = 2,
Night = 4,
};
sequence<ResideBaseInfo> ResideBaseInfos;
struct FspReq
{
string userId;
int apType;
int beginTime;
int endTime;
int locInfoType; /* 1.gps 2.bs */
int perType;
int extraMapReq; /* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
};
struct FspResp
{
int ret;
ResideBaseInfos baseInfos;
};
interface FspService
{
int GetFsp(FspReq req, out FspResp resp);
};
};
module POI {
struct poi_info_t
{
int id; //poi id
float lng;
float lat;
int citycode;
int type;
string name;
string addr;
string tel;
int weight;
int distance;
};
sequence<poi_info_t> poi_info_seq_t;
sequence<int> poi_type_seq_t;
enum POI_INDEX_TYPE_CONSTANTS
{
emIndexName,
emIndexAddr,
emIndexCustom,
index_type_count,
};
struct geopoint
{
float lng;
float lat;
};
struct geocoding_result
{
int level;
int confidence;
geopoint pt;
};
/*
* POI search
*/
interface IPOISearchFTR
{
/*
input:
emIndexType
key
citycode
limit
output:
a list of poi
*/
int poi_search_by_key(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_key_and_type(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, poi_type_seq_t arrType, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
lng lat :pos
maxDis:distance
output:
a list of poi
*/
int poi_search_by_key_type_near(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, poi_type_seq_t arrType, geopoint pt, int maxDis, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
key
region city
limit
output:
a list of poi
*/
int poi_search_by_key_cityname(string key, string cityname, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
key
citycode
limit
省内查询
output:
a list of poi
*/
int poi_search_by_key_citycode(string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
地址解析
input:
string strGeopointDescription
output:
geocoding_result rst
*/
int Geocoding(string strAddress, out geocoding_result rst);
}; // interface IPOISearchFTR
interface IPOISearchNear
{
/*
input:
ptLL
ptRR
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_rect(geopoint ptLL,geopoint ptRR,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
pt
maxDis
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_circle(geopoint pt,int maxDis,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_city(int citycode,poi_type_seq_t arrType,int limit,out poi_info_seq_t arrPoiInfo);
/*
逆地址解析
input:
geopoint pt
output:
string strGeopointDescription
*/
int ReverseGeocoding(geopoint pt,out string strGeopointDescription);
// 逆地址解析, 格式:广东省广州市天河区国际康体贸易中心附近
int ReverseGeocoding2(geopoint pt, out string strGeopointDescription);
}; // interface IPOISearchFTR
}; // module
\ No newline at end of file \ No newline at end of file
__all__ = ['kafka_gps_pb2','black_abnormal_pb2','fence_pb2','kafka_journey_pb2','kafka_device_state_pb2']
//***********************************************************************
//* 文件名:kafka_black_abnoraml.proto
//* 版本记录:
//************************************************************************
syntax = "proto2";
package black_abnormal;
option java_package = "com.glsx.protoTemplate";
message abnormalAndBlackRegion
{
required string sn = 1; //设备号
required string aggkey = 2; //黑区or异常聚集编号
required string alarmaddress = 3; //报警地址
required string alarmtime = 4; //报警时间
required int32 alarmtype = 5; //黑区报警or异常聚集报警 1:黑区报警 2:异常聚集报警 3:新黑区报警
required int32 status=6; //当前设备状态 1:已恢复 2:未恢复
required float lng=7; //报警地经度信息
required float lat=8; //报警地纬度信息
required string leaveTime = 9; //驶出时间
required string poiType = 10; //Poi类型
}
message KafkaSecondData
{
required string sn = 1; //设备号
required string second_type = 2; //二押区域规则类型(二押地停留)
required string second_name = 3; //二押区域规则名称(二押地停留)
required string second_alarm_time = 4; // 二押区域报警时间
required string second_alarm_address = 5; //二押区域报警位置
optional string second_leave_time = 6; //离开二押区域时间
optional string second_stay_time = 7; //二押区域停留时长
required string second_id = 8; //二押区域停留附件二手车行ID
required string second_stay_longitude = 9; //二押区域停留经度
required string second_stay_latitude = 10; //二押区域停留纬度
required string eventTime = 11; //事件时间,写入事件
}
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: black_abnormal.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14\x62lack_abnormal.proto\x12\x0e\x62lack_abnormal\"\xbe\x01\n\x16\x61\x62normalAndBlackRegion\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x0e\n\x06\x61ggkey\x18\x02 \x02(\t\x12\x14\n\x0c\x61larmaddress\x18\x03 \x02(\t\x12\x11\n\talarmtime\x18\x04 \x02(\t\x12\x11\n\talarmtype\x18\x05 \x02(\x05\x12\x0e\n\x06status\x18\x06 \x02(\x05\x12\x0b\n\x03lng\x18\x07 \x02(\x02\x12\x0b\n\x03lat\x18\x08 \x02(\x02\x12\x11\n\tleaveTime\x18\t \x02(\t\x12\x0f\n\x07poiType\x18\n \x02(\t\"\x98\x02\n\x0fKafkaSecondData\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x13\n\x0bsecond_type\x18\x02 \x02(\t\x12\x13\n\x0bsecond_name\x18\x03 \x02(\t\x12\x19\n\x11second_alarm_time\x18\x04 \x02(\t\x12\x1c\n\x14second_alarm_address\x18\x05 \x02(\t\x12\x19\n\x11second_leave_time\x18\x06 \x01(\t\x12\x18\n\x10second_stay_time\x18\x07 \x01(\t\x12\x11\n\tsecond_id\x18\x08 \x02(\t\x12\x1d\n\x15second_stay_longitude\x18\t \x02(\t\x12\x1c\n\x14second_stay_latitude\x18\n \x02(\t\x12\x11\n\teventTime\x18\x0b \x02(\tB\x18\n\x16\x63om.glsx.protoTemplate')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'black_abnormal_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\026com.glsx.protoTemplate'
_ABNORMALANDBLACKREGION._serialized_start=41
_ABNORMALANDBLACKREGION._serialized_end=231
_KAFKASECONDDATA._serialized_start=234
_KAFKASECONDDATA._serialized_end=514
# @@protoc_insertion_point(module_scope)
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: kafka_journey.proto
package cn.com.glsx.kafka.protocol;
public final class kafka_journey {
private kafka_journey() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface e_nshield_journey_reqOrBuilder extends
// @@protoc_insertion_point(interface_extends:protos_journey.e_nshield_journey_req)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return Whether the sn field is set.
*/
boolean hasSn();
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The sn.
*/
java.lang.String getSn();
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The bytes for sn.
*/
com.google.protobuf.ByteString
getSnBytes();
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return Whether the beginTime field is set.
*/
boolean hasBeginTime();
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The beginTime.
*/
java.lang.String getBeginTime();
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The bytes for beginTime.
*/
com.google.protobuf.ByteString
getBeginTimeBytes();
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return Whether the beginLng field is set.
*/
boolean hasBeginLng();
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The beginLng.
*/
java.lang.String getBeginLng();
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The bytes for beginLng.
*/
com.google.protobuf.ByteString
getBeginLngBytes();
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return Whether the beginLat field is set.
*/
boolean hasBeginLat();
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The beginLat.
*/
java.lang.String getBeginLat();
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The bytes for beginLat.
*/
com.google.protobuf.ByteString
getBeginLatBytes();
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return Whether the endTime field is set.
*/
boolean hasEndTime();
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The endTime.
*/
java.lang.String getEndTime();
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The bytes for endTime.
*/
com.google.protobuf.ByteString
getEndTimeBytes();
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return Whether the endLng field is set.
*/
boolean hasEndLng();
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The endLng.
*/
java.lang.String getEndLng();
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The bytes for endLng.
*/
com.google.protobuf.ByteString
getEndLngBytes();
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return Whether the endLat field is set.
*/
boolean hasEndLat();
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The endLat.
*/
java.lang.String getEndLat();
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The bytes for endLat.
*/
com.google.protobuf.ByteString
getEndLatBytes();
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return Whether the mileage field is set.
*/
boolean hasMileage();
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return The mileage.
*/
int getMileage();
}
/**
* <pre>
*topic:e_nshield_journey
* </pre>
*
* Protobuf type {@code protos_journey.e_nshield_journey_req}
*/
public static final class e_nshield_journey_req extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:protos_journey.e_nshield_journey_req)
e_nshield_journey_reqOrBuilder {
private static final long serialVersionUID = 0L;
// Use e_nshield_journey_req.newBuilder() to construct.
private e_nshield_journey_req(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private e_nshield_journey_req() {
sn_ = "";
beginTime_ = "";
beginLng_ = "";
beginLat_ = "";
endTime_ = "";
endLng_ = "";
endLat_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new e_nshield_journey_req();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private e_nshield_journey_req(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000001;
sn_ = bs;
break;
}
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000002;
beginTime_ = bs;
break;
}
case 34: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000004;
beginLng_ = bs;
break;
}
case 42: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000008;
beginLat_ = bs;
break;
}
case 50: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000010;
endTime_ = bs;
break;
}
case 58: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000020;
endLng_ = bs;
break;
}
case 66: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000040;
endLat_ = bs;
break;
}
case 72: {
bitField0_ |= 0x00000080;
mileage_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.kafka.protocol.kafka_journey.internal_static_protos_journey_e_nshield_journey_req_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.kafka.protocol.kafka_journey.internal_static_protos_journey_e_nshield_journey_req_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.class, cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.Builder.class);
}
private int bitField0_;
public static final int SN_FIELD_NUMBER = 1;
private volatile java.lang.Object sn_;
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return Whether the sn field is set.
*/
@java.lang.Override
public boolean hasSn() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The sn.
*/
@java.lang.Override
public java.lang.String getSn() {
java.lang.Object ref = sn_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
sn_ = s;
}
return s;
}
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The bytes for sn.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSnBytes() {
java.lang.Object ref = sn_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sn_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BEGINTIME_FIELD_NUMBER = 3;
private volatile java.lang.Object beginTime_;
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return Whether the beginTime field is set.
*/
@java.lang.Override
public boolean hasBeginTime() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The beginTime.
*/
@java.lang.Override
public java.lang.String getBeginTime() {
java.lang.Object ref = beginTime_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginTime_ = s;
}
return s;
}
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The bytes for beginTime.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getBeginTimeBytes() {
java.lang.Object ref = beginTime_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginTime_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BEGINLNG_FIELD_NUMBER = 4;
private volatile java.lang.Object beginLng_;
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return Whether the beginLng field is set.
*/
@java.lang.Override
public boolean hasBeginLng() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The beginLng.
*/
@java.lang.Override
public java.lang.String getBeginLng() {
java.lang.Object ref = beginLng_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginLng_ = s;
}
return s;
}
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The bytes for beginLng.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getBeginLngBytes() {
java.lang.Object ref = beginLng_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginLng_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BEGINLAT_FIELD_NUMBER = 5;
private volatile java.lang.Object beginLat_;
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return Whether the beginLat field is set.
*/
@java.lang.Override
public boolean hasBeginLat() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The beginLat.
*/
@java.lang.Override
public java.lang.String getBeginLat() {
java.lang.Object ref = beginLat_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginLat_ = s;
}
return s;
}
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The bytes for beginLat.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getBeginLatBytes() {
java.lang.Object ref = beginLat_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginLat_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ENDTIME_FIELD_NUMBER = 6;
private volatile java.lang.Object endTime_;
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return Whether the endTime field is set.
*/
@java.lang.Override
public boolean hasEndTime() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The endTime.
*/
@java.lang.Override
public java.lang.String getEndTime() {
java.lang.Object ref = endTime_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endTime_ = s;
}
return s;
}
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The bytes for endTime.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getEndTimeBytes() {
java.lang.Object ref = endTime_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endTime_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ENDLNG_FIELD_NUMBER = 7;
private volatile java.lang.Object endLng_;
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return Whether the endLng field is set.
*/
@java.lang.Override
public boolean hasEndLng() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The endLng.
*/
@java.lang.Override
public java.lang.String getEndLng() {
java.lang.Object ref = endLng_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endLng_ = s;
}
return s;
}
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The bytes for endLng.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getEndLngBytes() {
java.lang.Object ref = endLng_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endLng_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ENDLAT_FIELD_NUMBER = 8;
private volatile java.lang.Object endLat_;
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return Whether the endLat field is set.
*/
@java.lang.Override
public boolean hasEndLat() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The endLat.
*/
@java.lang.Override
public java.lang.String getEndLat() {
java.lang.Object ref = endLat_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endLat_ = s;
}
return s;
}
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The bytes for endLat.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getEndLatBytes() {
java.lang.Object ref = endLat_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endLat_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MILEAGE_FIELD_NUMBER = 9;
private int mileage_;
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return Whether the mileage field is set.
*/
@java.lang.Override
public boolean hasMileage() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return The mileage.
*/
@java.lang.Override
public int getMileage() {
return mileage_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!hasSn()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasBeginTime()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasBeginLng()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasBeginLat()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasEndTime()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasEndLng()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasEndLat()) {
memoizedIsInitialized = 0;
return false;
}
if (!hasMileage()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sn_);
}
if (((bitField0_ & 0x00000002) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, beginTime_);
}
if (((bitField0_ & 0x00000004) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, beginLng_);
}
if (((bitField0_ & 0x00000008) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, beginLat_);
}
if (((bitField0_ & 0x00000010) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, endTime_);
}
if (((bitField0_ & 0x00000020) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, endLng_);
}
if (((bitField0_ & 0x00000040) != 0)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, endLat_);
}
if (((bitField0_ & 0x00000080) != 0)) {
output.writeUInt32(9, mileage_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sn_);
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, beginTime_);
}
if (((bitField0_ & 0x00000004) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, beginLng_);
}
if (((bitField0_ & 0x00000008) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, beginLat_);
}
if (((bitField0_ & 0x00000010) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, endTime_);
}
if (((bitField0_ & 0x00000020) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, endLng_);
}
if (((bitField0_ & 0x00000040) != 0)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, endLat_);
}
if (((bitField0_ & 0x00000080) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(9, mileage_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req)) {
return super.equals(obj);
}
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req other = (cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req) obj;
if (hasSn() != other.hasSn()) return false;
if (hasSn()) {
if (!getSn()
.equals(other.getSn())) return false;
}
if (hasBeginTime() != other.hasBeginTime()) return false;
if (hasBeginTime()) {
if (!getBeginTime()
.equals(other.getBeginTime())) return false;
}
if (hasBeginLng() != other.hasBeginLng()) return false;
if (hasBeginLng()) {
if (!getBeginLng()
.equals(other.getBeginLng())) return false;
}
if (hasBeginLat() != other.hasBeginLat()) return false;
if (hasBeginLat()) {
if (!getBeginLat()
.equals(other.getBeginLat())) return false;
}
if (hasEndTime() != other.hasEndTime()) return false;
if (hasEndTime()) {
if (!getEndTime()
.equals(other.getEndTime())) return false;
}
if (hasEndLng() != other.hasEndLng()) return false;
if (hasEndLng()) {
if (!getEndLng()
.equals(other.getEndLng())) return false;
}
if (hasEndLat() != other.hasEndLat()) return false;
if (hasEndLat()) {
if (!getEndLat()
.equals(other.getEndLat())) return false;
}
if (hasMileage() != other.hasMileage()) return false;
if (hasMileage()) {
if (getMileage()
!= other.getMileage()) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasSn()) {
hash = (37 * hash) + SN_FIELD_NUMBER;
hash = (53 * hash) + getSn().hashCode();
}
if (hasBeginTime()) {
hash = (37 * hash) + BEGINTIME_FIELD_NUMBER;
hash = (53 * hash) + getBeginTime().hashCode();
}
if (hasBeginLng()) {
hash = (37 * hash) + BEGINLNG_FIELD_NUMBER;
hash = (53 * hash) + getBeginLng().hashCode();
}
if (hasBeginLat()) {
hash = (37 * hash) + BEGINLAT_FIELD_NUMBER;
hash = (53 * hash) + getBeginLat().hashCode();
}
if (hasEndTime()) {
hash = (37 * hash) + ENDTIME_FIELD_NUMBER;
hash = (53 * hash) + getEndTime().hashCode();
}
if (hasEndLng()) {
hash = (37 * hash) + ENDLNG_FIELD_NUMBER;
hash = (53 * hash) + getEndLng().hashCode();
}
if (hasEndLat()) {
hash = (37 * hash) + ENDLAT_FIELD_NUMBER;
hash = (53 * hash) + getEndLat().hashCode();
}
if (hasMileage()) {
hash = (37 * hash) + MILEAGE_FIELD_NUMBER;
hash = (53 * hash) + getMileage();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
*topic:e_nshield_journey
* </pre>
*
* Protobuf type {@code protos_journey.e_nshield_journey_req}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:protos_journey.e_nshield_journey_req)
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_reqOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return cn.com.glsx.kafka.protocol.kafka_journey.internal_static_protos_journey_e_nshield_journey_req_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return cn.com.glsx.kafka.protocol.kafka_journey.internal_static_protos_journey_e_nshield_journey_req_fieldAccessorTable
.ensureFieldAccessorsInitialized(
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.class, cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.Builder.class);
}
// Construct using cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
sn_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
beginTime_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
beginLng_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
beginLat_ = "";
bitField0_ = (bitField0_ & ~0x00000008);
endTime_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
endLng_ = "";
bitField0_ = (bitField0_ & ~0x00000020);
endLat_ = "";
bitField0_ = (bitField0_ & ~0x00000040);
mileage_ = 0;
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return cn.com.glsx.kafka.protocol.kafka_journey.internal_static_protos_journey_e_nshield_journey_req_descriptor;
}
@java.lang.Override
public cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req getDefaultInstanceForType() {
return cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.getDefaultInstance();
}
@java.lang.Override
public cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req build() {
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req buildPartial() {
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req result = new cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
to_bitField0_ |= 0x00000001;
}
result.sn_ = sn_;
if (((from_bitField0_ & 0x00000002) != 0)) {
to_bitField0_ |= 0x00000002;
}
result.beginTime_ = beginTime_;
if (((from_bitField0_ & 0x00000004) != 0)) {
to_bitField0_ |= 0x00000004;
}
result.beginLng_ = beginLng_;
if (((from_bitField0_ & 0x00000008) != 0)) {
to_bitField0_ |= 0x00000008;
}
result.beginLat_ = beginLat_;
if (((from_bitField0_ & 0x00000010) != 0)) {
to_bitField0_ |= 0x00000010;
}
result.endTime_ = endTime_;
if (((from_bitField0_ & 0x00000020) != 0)) {
to_bitField0_ |= 0x00000020;
}
result.endLng_ = endLng_;
if (((from_bitField0_ & 0x00000040) != 0)) {
to_bitField0_ |= 0x00000040;
}
result.endLat_ = endLat_;
if (((from_bitField0_ & 0x00000080) != 0)) {
result.mileage_ = mileage_;
to_bitField0_ |= 0x00000080;
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req) {
return mergeFrom((cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req other) {
if (other == cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req.getDefaultInstance()) return this;
if (other.hasSn()) {
bitField0_ |= 0x00000001;
sn_ = other.sn_;
onChanged();
}
if (other.hasBeginTime()) {
bitField0_ |= 0x00000002;
beginTime_ = other.beginTime_;
onChanged();
}
if (other.hasBeginLng()) {
bitField0_ |= 0x00000004;
beginLng_ = other.beginLng_;
onChanged();
}
if (other.hasBeginLat()) {
bitField0_ |= 0x00000008;
beginLat_ = other.beginLat_;
onChanged();
}
if (other.hasEndTime()) {
bitField0_ |= 0x00000010;
endTime_ = other.endTime_;
onChanged();
}
if (other.hasEndLng()) {
bitField0_ |= 0x00000020;
endLng_ = other.endLng_;
onChanged();
}
if (other.hasEndLat()) {
bitField0_ |= 0x00000040;
endLat_ = other.endLat_;
onChanged();
}
if (other.hasMileage()) {
setMileage(other.getMileage());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
if (!hasSn()) {
return false;
}
if (!hasBeginTime()) {
return false;
}
if (!hasBeginLng()) {
return false;
}
if (!hasBeginLat()) {
return false;
}
if (!hasEndTime()) {
return false;
}
if (!hasEndLng()) {
return false;
}
if (!hasEndLat()) {
return false;
}
if (!hasMileage()) {
return false;
}
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object sn_ = "";
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return Whether the sn field is set.
*/
public boolean hasSn() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The sn.
*/
public java.lang.String getSn() {
java.lang.Object ref = sn_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
sn_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return The bytes for sn.
*/
public com.google.protobuf.ByteString
getSnBytes() {
java.lang.Object ref = sn_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
sn_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @param value The sn to set.
* @return This builder for chaining.
*/
public Builder setSn(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
sn_ = value;
onChanged();
return this;
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @return This builder for chaining.
*/
public Builder clearSn() {
bitField0_ = (bitField0_ & ~0x00000001);
sn_ = getDefaultInstance().getSn();
onChanged();
return this;
}
/**
* <pre>
*设备号
* </pre>
*
* <code>required string sn = 1;</code>
* @param value The bytes for sn to set.
* @return This builder for chaining.
*/
public Builder setSnBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
sn_ = value;
onChanged();
return this;
}
private java.lang.Object beginTime_ = "";
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return Whether the beginTime field is set.
*/
public boolean hasBeginTime() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The beginTime.
*/
public java.lang.String getBeginTime() {
java.lang.Object ref = beginTime_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginTime_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return The bytes for beginTime.
*/
public com.google.protobuf.ByteString
getBeginTimeBytes() {
java.lang.Object ref = beginTime_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginTime_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @param value The beginTime to set.
* @return This builder for chaining.
*/
public Builder setBeginTime(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
beginTime_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @return This builder for chaining.
*/
public Builder clearBeginTime() {
bitField0_ = (bitField0_ & ~0x00000002);
beginTime_ = getDefaultInstance().getBeginTime();
onChanged();
return this;
}
/**
* <pre>
*行程开始时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string beginTime = 3;</code>
* @param value The bytes for beginTime to set.
* @return This builder for chaining.
*/
public Builder setBeginTimeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
beginTime_ = value;
onChanged();
return this;
}
private java.lang.Object beginLng_ = "";
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return Whether the beginLng field is set.
*/
public boolean hasBeginLng() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The beginLng.
*/
public java.lang.String getBeginLng() {
java.lang.Object ref = beginLng_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginLng_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return The bytes for beginLng.
*/
public com.google.protobuf.ByteString
getBeginLngBytes() {
java.lang.Object ref = beginLng_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginLng_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @param value The beginLng to set.
* @return This builder for chaining.
*/
public Builder setBeginLng(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
beginLng_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @return This builder for chaining.
*/
public Builder clearBeginLng() {
bitField0_ = (bitField0_ & ~0x00000004);
beginLng_ = getDefaultInstance().getBeginLng();
onChanged();
return this;
}
/**
* <pre>
*行程开始经度,如:118.726725
* </pre>
*
* <code>required string beginLng = 4;</code>
* @param value The bytes for beginLng to set.
* @return This builder for chaining.
*/
public Builder setBeginLngBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
beginLng_ = value;
onChanged();
return this;
}
private java.lang.Object beginLat_ = "";
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return Whether the beginLat field is set.
*/
public boolean hasBeginLat() {
return ((bitField0_ & 0x00000008) != 0);
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The beginLat.
*/
public java.lang.String getBeginLat() {
java.lang.Object ref = beginLat_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
beginLat_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return The bytes for beginLat.
*/
public com.google.protobuf.ByteString
getBeginLatBytes() {
java.lang.Object ref = beginLat_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
beginLat_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @param value The beginLat to set.
* @return This builder for chaining.
*/
public Builder setBeginLat(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
beginLat_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @return This builder for chaining.
*/
public Builder clearBeginLat() {
bitField0_ = (bitField0_ & ~0x00000008);
beginLat_ = getDefaultInstance().getBeginLat();
onChanged();
return this;
}
/**
* <pre>
*行程开始纬度,如:39.709744
* </pre>
*
* <code>required string beginLat = 5;</code>
* @param value The bytes for beginLat to set.
* @return This builder for chaining.
*/
public Builder setBeginLatBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
beginLat_ = value;
onChanged();
return this;
}
private java.lang.Object endTime_ = "";
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return Whether the endTime field is set.
*/
public boolean hasEndTime() {
return ((bitField0_ & 0x00000010) != 0);
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The endTime.
*/
public java.lang.String getEndTime() {
java.lang.Object ref = endTime_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endTime_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return The bytes for endTime.
*/
public com.google.protobuf.ByteString
getEndTimeBytes() {
java.lang.Object ref = endTime_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endTime_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @param value The endTime to set.
* @return This builder for chaining.
*/
public Builder setEndTime(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
endTime_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @return This builder for chaining.
*/
public Builder clearEndTime() {
bitField0_ = (bitField0_ & ~0x00000010);
endTime_ = getDefaultInstance().getEndTime();
onChanged();
return this;
}
/**
* <pre>
*行程结束时间,如:2020-03-21 08:53:23
* </pre>
*
* <code>required string endTime = 6;</code>
* @param value The bytes for endTime to set.
* @return This builder for chaining.
*/
public Builder setEndTimeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
endTime_ = value;
onChanged();
return this;
}
private java.lang.Object endLng_ = "";
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return Whether the endLng field is set.
*/
public boolean hasEndLng() {
return ((bitField0_ & 0x00000020) != 0);
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The endLng.
*/
public java.lang.String getEndLng() {
java.lang.Object ref = endLng_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endLng_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return The bytes for endLng.
*/
public com.google.protobuf.ByteString
getEndLngBytes() {
java.lang.Object ref = endLng_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endLng_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @param value The endLng to set.
* @return This builder for chaining.
*/
public Builder setEndLng(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
endLng_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @return This builder for chaining.
*/
public Builder clearEndLng() {
bitField0_ = (bitField0_ & ~0x00000020);
endLng_ = getDefaultInstance().getEndLng();
onChanged();
return this;
}
/**
* <pre>
*行程结束经度,如:118.726725
* </pre>
*
* <code>required string endLng = 7;</code>
* @param value The bytes for endLng to set.
* @return This builder for chaining.
*/
public Builder setEndLngBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
endLng_ = value;
onChanged();
return this;
}
private java.lang.Object endLat_ = "";
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return Whether the endLat field is set.
*/
public boolean hasEndLat() {
return ((bitField0_ & 0x00000040) != 0);
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The endLat.
*/
public java.lang.String getEndLat() {
java.lang.Object ref = endLat_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (bs.isValidUtf8()) {
endLat_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return The bytes for endLat.
*/
public com.google.protobuf.ByteString
getEndLatBytes() {
java.lang.Object ref = endLat_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
endLat_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @param value The endLat to set.
* @return This builder for chaining.
*/
public Builder setEndLat(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
endLat_ = value;
onChanged();
return this;
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @return This builder for chaining.
*/
public Builder clearEndLat() {
bitField0_ = (bitField0_ & ~0x00000040);
endLat_ = getDefaultInstance().getEndLat();
onChanged();
return this;
}
/**
* <pre>
*行程结束纬度,如:39.709744
* </pre>
*
* <code>required string endLat = 8;</code>
* @param value The bytes for endLat to set.
* @return This builder for chaining.
*/
public Builder setEndLatBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000040;
endLat_ = value;
onChanged();
return this;
}
private int mileage_ ;
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return Whether the mileage field is set.
*/
@java.lang.Override
public boolean hasMileage() {
return ((bitField0_ & 0x00000080) != 0);
}
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return The mileage.
*/
@java.lang.Override
public int getMileage() {
return mileage_;
}
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @param value The mileage to set.
* @return This builder for chaining.
*/
public Builder setMileage(int value) {
bitField0_ |= 0x00000080;
mileage_ = value;
onChanged();
return this;
}
/**
* <pre>
*里程,单位:米,如:4302
* </pre>
*
* <code>required uint32 mileage = 9;</code>
* @return This builder for chaining.
*/
public Builder clearMileage() {
bitField0_ = (bitField0_ & ~0x00000080);
mileage_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:protos_journey.e_nshield_journey_req)
}
// @@protoc_insertion_point(class_scope:protos_journey.e_nshield_journey_req)
private static final cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req();
}
public static cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser<e_nshield_journey_req>
PARSER = new com.google.protobuf.AbstractParser<e_nshield_journey_req>() {
@java.lang.Override
public e_nshield_journey_req parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new e_nshield_journey_req(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<e_nshield_journey_req> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<e_nshield_journey_req> getParserForType() {
return PARSER;
}
@java.lang.Override
public cn.com.glsx.kafka.protocol.kafka_journey.e_nshield_journey_req getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_protos_journey_e_nshield_journey_req_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_protos_journey_e_nshield_journey_req_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\023kafka_journey.proto\022\016protos_journey\"\234\001" +
"\n\025e_nshield_journey_req\022\n\n\002sn\030\001 \002(\t\022\021\n\tb" +
"eginTime\030\003 \002(\t\022\020\n\010beginLng\030\004 \002(\t\022\020\n\010begi" +
"nLat\030\005 \002(\t\022\017\n\007endTime\030\006 \002(\t\022\016\n\006endLng\030\007 " +
"\002(\t\022\016\n\006endLat\030\010 \002(\t\022\017\n\007mileage\030\t \002(\rB+\n\032" +
"cn.com.glsx.kafka.protocolB\rkafka_journe" +
"y"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_protos_journey_e_nshield_journey_req_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_protos_journey_e_nshield_journey_req_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_protos_journey_e_nshield_journey_req_descriptor,
new java.lang.String[] { "Sn", "BeginTime", "BeginLng", "BeginLat", "EndTime", "EndLng", "EndLat", "Mileage", });
}
// @@protoc_insertion_point(outer_class_scope)
}
syntax = "proto2";
package InstanceFence;
option java_package = "cn.com.glsx.kafka.protocol";
option java_outer_classname = "FakeOfflineFence";
message CommonResult
{
required int32 result = 1; //系统错误码
optional int32 errCode = 2; //业务错误码
optional string errMsg = 3; //错误信息
}
message GpsLoc
{
required uint32 lng = 1; //经度*1000000
required uint32 lat = 2; //纬度*1000000
}
message GpsLocDetail
{
required GpsLoc gpsloc = 1; //位置
required uint32 time = 2; //时间
required uint32 speed = 3; //速度
required uint32 direction = 4; //方向
required int32 alt = 5; //海拔
required string valid = 6; //有效性
}
message FenceInfo
{
required uint32 fenceId = 1; //围栏唯一标识
required uint32 svcSystemId = 2; //业务渠道唯一标识
required int32 fenceType = 3; //围栏类型(1.驶入 2.驶出)
required int32 fenceShapeType = 4; //围栏形状(1.圆形 2.矩形 3.多边形 4.行政区域)
required int32 locInfoType = 5; //定位信息类型(1.gps 2.基站)
optional string fenceName = 6; //围栏名称
optional int32 status = 7; //围栏状态(0.正常 1.关闭 )
optional int32 ownerType = 8; //围栏属主类型(1.商户 2.设备)
optional int32 ownerId = 9; //围栏属主唯一标识(仅当属主类型是商户时字段有效)
optional int32 scope = 10; //围栏范围
optional int32 triggerType = 11; //触发类型(1.点数(个) 2.时长(秒))
optional int32 enterSpan= 12; //驶入跨度
optional int32 outerSpan= 13; //驶出跨度
repeated GpsLoc gpslocs = 14; //端点位置
optional int32 areaCode = 15; //行政区域编码(fenceType==4时有效)
optional int32 merchantType = 16; //门店类型(ownerType==1时有效 0.非4s店 1.4s店)
optional int32 stayTime = 17; //停留时长的阈值,大于这个值报警(ownerType==1时有效, 单位s)
optional string address = 18; //地址
}
message FenceDeviceFamilyInfo
{
required string sn = 1; //设备sn
repeated GpsLoc gpslocs = 2; //端点位置
optional int32 instayTime = 3;
optional int32 outstayTime = 4;
optional int32 leaverscope = 5;
optional int32 gethomescope = 6;
}
message FenceMember
{
required uint32 fenceId = 1; //围栏唯一标识
required uint32 svcSystemId = 2; //业务渠道唯一标识
required string devicesn = 3; //设备唯一标识
required int32 deviceType = 4; //设备类型
optional int32 status = 5; //
}
message TriggerDeviceFamilyInfo //围栏触发(写kafka)
{
required string sn = 1; //设备sn
required int32 status = 2; //设备状态 1:离家通知 2:到家通知
required uint32 triggerTime = 3; //触发时间
}
message TriggerInfo //围栏触发信息(写kafka)
{
required string devicesn = 1; //设备唯一标识
required uint32 fenceId = 2; //围栏唯一标识
required uint32 svcSystemId = 3; //业务渠道唯一标识
required int32 triggerType = 4; //驶入或驶出
required int32 locInfoType = 5; //定位信息类型(1.gps 2.基站)
optional uint32 triggerTime= 6; //触发时间
optional GpsLocDetail triggerLoc = 7; //触发点详情
optional string merchantName = 8; //门店名称
optional int32 merchantType = 9; //门店类型
optional string enterTime = 10; //进围栏时间
optional string outTime = 11; //出围栏时间
optional int32 alarmType = 12; //流失预警或其他(1.流失预警 2.其他)
}
//topic: fence_fake_offline
message FakeOfflineInfo //家和公司围栏触发信息(写kafka)
{
required string devicesn = 1; //设备唯一标识
required uint32 fenceId = 2; //围栏唯一标识
required uint32 svcSystemId = 3; //业务渠道唯一标识
required int32 triggerType = 4; //驶入或驶出(1.驶入 2.驶出)
required int32 locInfoType = 5; //定位信息类型(1.gps 2.基站)
optional uint32 triggerTime= 6; //触发时间
optional GpsLocDetail triggerLoc = 7; //触发点详情
optional string merchantName = 8; //围栏名称(家庭或工作地)
optional int32 merchantType = 9; //围栏类型(1家庭,2公司)
optional string enterTime = 10; //进围栏时间
optional string outTime = 11; //出围栏时间
optional int32 alarmType = 12; //流失预警或其他(1.流失预警 3.到店提醒 其它)
optional string addr = 13; //地址
}
message BoderAlarm
{
required string devicesn = 1; //设备唯一标识
optional int32 positionStaus = 2; //设备位置状态(0.国内,1.边境线上 2.国外)
optional int32 distance = 3; //
}
enum OperationType //围栏操作类型
{
ADD = 1;
DEL = 2;
GET = 3;
UPDATE = 4;
ADDANDUPDATE = 5;
}
message OptFenceInfo //围栏信息操作
{
required OperationType operationType = 1;
repeated FenceInfo fenceInfos = 2;
}
message OptFenceMember //围栏成员操作
{
required OperationType operationType = 1;
repeated FenceMember fenceMembers = 2;
}
message OptFamilyFenceInfo //家庭围栏信息(读kafka)
{
required OperationType operationType = 1;
repeated FenceDeviceFamilyInfo familyfenceInfos = 2;
}
message OptFenceReq //围栏信息操作请求(读kafka)
{
optional OptFenceInfo optFenceInfo = 1;
optional OptFenceMember optFenceMember = 2;
}
message OptFenceResp //围栏信息操作返回(写kafka暂时未用)
{
required CommonResult result = 1;
repeated FenceInfo fenceInfos = 2;
repeated FenceMember fenceMembers = 3;
}
message TriggerInfoResp //围栏触发信息返回(写kafka)
{
required TriggerInfo triggerInfo = 1;
}
//topic:fence_drive
message TriggerTestDriveInfo //试驾围栏触发信息(写kafka)
{
required string devicesn = 1; //设备唯一标识
required uint32 fenceId = 2; //围栏唯一标识
required uint32 svcSystemId = 3; //业务渠道唯一标识
optional uint32 journeyTime= 4; //行程开始时间
optional int32 percent = 5; //重合百分百,值为20 即是 20%
}
message TriggerInStoreInfo //记录试驾车辆有效时间内是否在门店内(写kafka)
{
required string devicesn = 1; //设备唯一标识
required uint32 positionState = 2; //0:非新疆 1:新疆
required uint32 fenceId = 3; //门店围栏
required uint32 gpsState = 4; //0:工作时间有进出门店 1:工作时间一直在门店内 2:工作时间内一直在门店外
optional string gpsTime = 5; //gpsState = 0 ,填写该字段的时间用于判断是否工作时间内在门店,gpsState = 1 or gpsState = 1,则不用填写,因为一直在门店内或门店外
}
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fence.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x66\x65nce.proto\x12\rInstanceFence\"?\n\x0c\x43ommonResult\x12\x0e\n\x06result\x18\x01 \x02(\x05\x12\x0f\n\x07\x65rrCode\x18\x02 \x01(\x05\x12\x0e\n\x06\x65rrMsg\x18\x03 \x01(\t\"\"\n\x06GpsLoc\x12\x0b\n\x03lng\x18\x01 \x02(\r\x12\x0b\n\x03lat\x18\x02 \x02(\r\"\x81\x01\n\x0cGpsLocDetail\x12%\n\x06gpsloc\x18\x01 \x02(\x0b\x32\x15.InstanceFence.GpsLoc\x12\x0c\n\x04time\x18\x02 \x02(\r\x12\r\n\x05speed\x18\x03 \x02(\r\x12\x11\n\tdirection\x18\x04 \x02(\r\x12\x0b\n\x03\x61lt\x18\x05 \x02(\x05\x12\r\n\x05valid\x18\x06 \x02(\t\"\xf5\x02\n\tFenceInfo\x12\x0f\n\x07\x66\x65nceId\x18\x01 \x02(\r\x12\x13\n\x0bsvcSystemId\x18\x02 \x02(\r\x12\x11\n\tfenceType\x18\x03 \x02(\x05\x12\x16\n\x0e\x66\x65nceShapeType\x18\x04 \x02(\x05\x12\x13\n\x0blocInfoType\x18\x05 \x02(\x05\x12\x11\n\tfenceName\x18\x06 \x01(\t\x12\x0e\n\x06status\x18\x07 \x01(\x05\x12\x11\n\townerType\x18\x08 \x01(\x05\x12\x0f\n\x07ownerId\x18\t \x01(\x05\x12\r\n\x05scope\x18\n \x01(\x05\x12\x13\n\x0btriggerType\x18\x0b \x01(\x05\x12\x11\n\tenterSpan\x18\x0c \x01(\x05\x12\x11\n\touterSpan\x18\r \x01(\x05\x12&\n\x07gpslocs\x18\x0e \x03(\x0b\x32\x15.InstanceFence.GpsLoc\x12\x10\n\x08\x61reaCode\x18\x0f \x01(\x05\x12\x14\n\x0cmerchantType\x18\x10 \x01(\x05\x12\x10\n\x08stayTime\x18\x11 \x01(\x05\x12\x0f\n\x07\x61\x64\x64ress\x18\x12 \x01(\t\"\x9f\x01\n\x15\x46\x65nceDeviceFamilyInfo\x12\n\n\x02sn\x18\x01 \x02(\t\x12&\n\x07gpslocs\x18\x02 \x03(\x0b\x32\x15.InstanceFence.GpsLoc\x12\x12\n\ninstayTime\x18\x03 \x01(\x05\x12\x13\n\x0boutstayTime\x18\x04 \x01(\x05\x12\x13\n\x0bleaverscope\x18\x05 \x01(\x05\x12\x14\n\x0cgethomescope\x18\x06 \x01(\x05\"i\n\x0b\x46\x65nceMember\x12\x0f\n\x07\x66\x65nceId\x18\x01 \x02(\r\x12\x13\n\x0bsvcSystemId\x18\x02 \x02(\r\x12\x10\n\x08\x64\x65vicesn\x18\x03 \x02(\t\x12\x12\n\ndeviceType\x18\x04 \x02(\x05\x12\x0e\n\x06status\x18\x05 \x01(\x05\"J\n\x17TriggerDeviceFamilyInfo\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x0e\n\x06status\x18\x02 \x02(\x05\x12\x13\n\x0btriggerTime\x18\x03 \x02(\r\"\x98\x02\n\x0bTriggerInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07\x66\x65nceId\x18\x02 \x02(\r\x12\x13\n\x0bsvcSystemId\x18\x03 \x02(\r\x12\x13\n\x0btriggerType\x18\x04 \x02(\x05\x12\x13\n\x0blocInfoType\x18\x05 \x02(\x05\x12\x13\n\x0btriggerTime\x18\x06 \x01(\r\x12/\n\ntriggerLoc\x18\x07 \x01(\x0b\x32\x1b.InstanceFence.GpsLocDetail\x12\x14\n\x0cmerchantName\x18\x08 \x01(\t\x12\x14\n\x0cmerchantType\x18\t \x01(\x05\x12\x11\n\tenterTime\x18\n \x01(\t\x12\x0f\n\x07outTime\x18\x0b \x01(\t\x12\x11\n\talarmType\x18\x0c \x01(\x05\"\xaa\x02\n\x0f\x46\x61keOfflineInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07\x66\x65nceId\x18\x02 \x02(\r\x12\x13\n\x0bsvcSystemId\x18\x03 \x02(\r\x12\x13\n\x0btriggerType\x18\x04 \x02(\x05\x12\x13\n\x0blocInfoType\x18\x05 \x02(\x05\x12\x13\n\x0btriggerTime\x18\x06 \x01(\r\x12/\n\ntriggerLoc\x18\x07 \x01(\x0b\x32\x1b.InstanceFence.GpsLocDetail\x12\x14\n\x0cmerchantName\x18\x08 \x01(\t\x12\x14\n\x0cmerchantType\x18\t \x01(\x05\x12\x11\n\tenterTime\x18\n \x01(\t\x12\x0f\n\x07outTime\x18\x0b \x01(\t\x12\x11\n\talarmType\x18\x0c \x01(\x05\x12\x0c\n\x04\x61\x64\x64r\x18\r \x01(\t\"G\n\nBoderAlarm\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x15\n\rpositionStaus\x18\x02 \x01(\x05\x12\x10\n\x08\x64istance\x18\x03 \x01(\x05\"q\n\x0cOptFenceInfo\x12\x33\n\roperationType\x18\x01 \x02(\x0e\x32\x1c.InstanceFence.OperationType\x12,\n\nfenceInfos\x18\x02 \x03(\x0b\x32\x18.InstanceFence.FenceInfo\"w\n\x0eOptFenceMember\x12\x33\n\roperationType\x18\x01 \x02(\x0e\x32\x1c.InstanceFence.OperationType\x12\x30\n\x0c\x66\x65nceMembers\x18\x02 \x03(\x0b\x32\x1a.InstanceFence.FenceMember\"\x89\x01\n\x12OptFamilyFenceInfo\x12\x33\n\roperationType\x18\x01 \x02(\x0e\x32\x1c.InstanceFence.OperationType\x12>\n\x10\x66\x61milyfenceInfos\x18\x02 \x03(\x0b\x32$.InstanceFence.FenceDeviceFamilyInfo\"w\n\x0bOptFenceReq\x12\x31\n\x0coptFenceInfo\x18\x01 \x01(\x0b\x32\x1b.InstanceFence.OptFenceInfo\x12\x35\n\x0eoptFenceMember\x18\x02 \x01(\x0b\x32\x1d.InstanceFence.OptFenceMember\"\x9b\x01\n\x0cOptFenceResp\x12+\n\x06result\x18\x01 \x02(\x0b\x32\x1b.InstanceFence.CommonResult\x12,\n\nfenceInfos\x18\x02 \x03(\x0b\x32\x18.InstanceFence.FenceInfo\x12\x30\n\x0c\x66\x65nceMembers\x18\x03 \x03(\x0b\x32\x1a.InstanceFence.FenceMember\"B\n\x0fTriggerInfoResp\x12/\n\x0btriggerInfo\x18\x01 \x02(\x0b\x32\x1a.InstanceFence.TriggerInfo\"t\n\x14TriggerTestDriveInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07\x66\x65nceId\x18\x02 \x02(\r\x12\x13\n\x0bsvcSystemId\x18\x03 \x02(\r\x12\x13\n\x0bjourneyTime\x18\x04 \x01(\r\x12\x0f\n\x07percent\x18\x05 \x01(\x05\"q\n\x12TriggerInStoreInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x15\n\rpositionState\x18\x02 \x02(\r\x12\x0f\n\x07\x66\x65nceId\x18\x03 \x02(\r\x12\x10\n\x08gpsState\x18\x04 \x02(\r\x12\x0f\n\x07gpsTime\x18\x05 \x01(\t*H\n\rOperationType\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\x07\n\x03\x44\x45L\x10\x02\x12\x07\n\x03GET\x10\x03\x12\n\n\x06UPDATE\x10\x04\x12\x10\n\x0c\x41\x44\x44\x41NDUPDATE\x10\x05\x42.\n\x1a\x63n.com.glsx.kafka.protocolB\x10\x46\x61keOfflineFence')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fence_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\032cn.com.glsx.kafka.protocolB\020FakeOfflineFence'
_OPERATIONTYPE._serialized_start=2597
_OPERATIONTYPE._serialized_end=2669
_COMMONRESULT._serialized_start=30
_COMMONRESULT._serialized_end=93
_GPSLOC._serialized_start=95
_GPSLOC._serialized_end=129
_GPSLOCDETAIL._serialized_start=132
_GPSLOCDETAIL._serialized_end=261
_FENCEINFO._serialized_start=264
_FENCEINFO._serialized_end=637
_FENCEDEVICEFAMILYINFO._serialized_start=640
_FENCEDEVICEFAMILYINFO._serialized_end=799
_FENCEMEMBER._serialized_start=801
_FENCEMEMBER._serialized_end=906
_TRIGGERDEVICEFAMILYINFO._serialized_start=908
_TRIGGERDEVICEFAMILYINFO._serialized_end=982
_TRIGGERINFO._serialized_start=985
_TRIGGERINFO._serialized_end=1265
_FAKEOFFLINEINFO._serialized_start=1268
_FAKEOFFLINEINFO._serialized_end=1566
_BODERALARM._serialized_start=1568
_BODERALARM._serialized_end=1639
_OPTFENCEINFO._serialized_start=1641
_OPTFENCEINFO._serialized_end=1754
_OPTFENCEMEMBER._serialized_start=1756
_OPTFENCEMEMBER._serialized_end=1875
_OPTFAMILYFENCEINFO._serialized_start=1878
_OPTFAMILYFENCEINFO._serialized_end=2015
_OPTFENCEREQ._serialized_start=2017
_OPTFENCEREQ._serialized_end=2136
_OPTFENCERESP._serialized_start=2139
_OPTFENCERESP._serialized_end=2294
_TRIGGERINFORESP._serialized_start=2296
_TRIGGERINFORESP._serialized_end=2362
_TRIGGERTESTDRIVEINFO._serialized_start=2364
_TRIGGERTESTDRIVEINFO._serialized_end=2480
_TRIGGERINSTOREINFO._serialized_start=2482
_TRIGGERINSTOREINFO._serialized_end=2595
# @@protoc_insertion_point(module_scope)
syntax = "proto2";
package FspOffline;
option java_package = "cn.com.glsx.FspOffline.proto";
option java_outer_classname = "FspOffline";
enum UserOptType
{
ADD_USER_INFO = 1;
GET_USER_INFO = 2;
UPDATE_USER_INFO = 3;
DELETE_USER_INFO = 4;
}
message ResideExtendInfo
{
optional string location = 1; //常驻地坐标(经度与纬度组合 eq:114.025974,22.546054)
optional string address = 2; //常驻地地址
optional int32 distance = 3; //常驻地与提报地址距离
optional int32 totalStayDuration = 4; //总停留时长
optional int32 totalStayTimes = 5; //总停留时间
}
message UserMatchInfo
{
required uint64 userId = 1; //唯一标识
required int32 apType = 2; //设备类型(OBD:2 DDbox:4 Tracker:5)
optional int32 addrMatchResult = 3; //匹配结果(1:超出距离 2:匹配结果不一致 3.匹配结果一致 4.无足够gps轨迹点 5:无常驻地 6:无提报地址 7:地址解析失败 8:坐标校准失败 9:坐标反校准失败)
optional string registerAddress = 4; //提报地址
optional string registerLocation= 5; //提报地址坐标(经度与纬度组合 eq:114.025974,22.546054)
repeated ResideExtendInfo resideInfos = 6; //常驻地信息
optional int32 status = 7; //常驻地状态(0:正常 1:异常)
optional uint32 beginTime = 8; //计算起始时间
optional uint32 endTime = 9; //计算结束时间
optional uint32 merchantCode = 10; //门店编码
optional string merchantName = 11; //门店名称
}
message UserBaseInfo
{
required uint64 userId = 1; //唯一标识
required int32 apType = 2; //设备类型(OBD:2 DDbox:4 Tracker:5)
optional uint32 activateDate = 3; //激活日期
optional string registerAddress = 4; //提报地址
optional uint32 merchantCode = 5; //门店编码
optional string merchantName = 6; //门店名称
}
message CustomFspInfo //定制常驻地计算返回
{
required string seqId = 1;
optional int32 serviceType = 2; //1.普通计算 2.匹配常驻地是否异常
repeated UserMatchInfo userMatchInfo = 3;
}
message CycleFspInfo //周期常驻地计算返回
{
optional UserMatchInfo userMatchInfo = 1;
}
message CustomFspReq //定制常驻地计算请求
{
required string seqId = 1;
required int32 serviceType= 2; //1.普通计算 2.匹配常驻地是否异常
required uint32 beginTime = 3;
optional uint32 endTime = 4; //默认为当前时间
required UserBaseInfo userInfo = 5;
}
message CycleFspReq //周期计算请求
{
required UserOptType optType = 1;
repeated UserBaseInfo userInfos = 2;
}
message FspResp
{
required int32 calcType = 2; //计算类型(1:周期计算 2:定制计算)
optional CycleFspInfo cycleFspInfo = 3;
optional CustomFspInfo customFspInfo = 4;
}
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: fsp_offline.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x66sp_offline.proto\x12\nFspOffline\"z\n\x10ResideExtendInfo\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x10\n\x08\x64istance\x18\x03 \x01(\x05\x12\x19\n\x11totalStayDuration\x18\x04 \x01(\x05\x12\x16\n\x0etotalStayTimes\x18\x05 \x01(\x05\"\x8e\x02\n\rUserMatchInfo\x12\x0e\n\x06userId\x18\x01 \x02(\x04\x12\x0e\n\x06\x61pType\x18\x02 \x02(\x05\x12\x17\n\x0f\x61\x64\x64rMatchResult\x18\x03 \x01(\x05\x12\x17\n\x0fregisterAddress\x18\x04 \x01(\t\x12\x18\n\x10registerLocation\x18\x05 \x01(\t\x12\x31\n\x0bresideInfos\x18\x06 \x03(\x0b\x32\x1c.FspOffline.ResideExtendInfo\x12\x0e\n\x06status\x18\x07 \x01(\x05\x12\x11\n\tbeginTime\x18\x08 \x01(\r\x12\x0f\n\x07\x65ndTime\x18\t \x01(\r\x12\x14\n\x0cmerchantCode\x18\n \x01(\r\x12\x14\n\x0cmerchantName\x18\x0b \x01(\t\"\x89\x01\n\x0cUserBaseInfo\x12\x0e\n\x06userId\x18\x01 \x02(\x04\x12\x0e\n\x06\x61pType\x18\x02 \x02(\x05\x12\x14\n\x0c\x61\x63tivateDate\x18\x03 \x01(\r\x12\x17\n\x0fregisterAddress\x18\x04 \x01(\t\x12\x14\n\x0cmerchantCode\x18\x05 \x01(\r\x12\x14\n\x0cmerchantName\x18\x06 \x01(\t\"e\n\rCustomFspInfo\x12\r\n\x05seqId\x18\x01 \x02(\t\x12\x13\n\x0bserviceType\x18\x02 \x01(\x05\x12\x30\n\ruserMatchInfo\x18\x03 \x03(\x0b\x32\x19.FspOffline.UserMatchInfo\"@\n\x0c\x43ycleFspInfo\x12\x30\n\ruserMatchInfo\x18\x01 \x01(\x0b\x32\x19.FspOffline.UserMatchInfo\"\x82\x01\n\x0c\x43ustomFspReq\x12\r\n\x05seqId\x18\x01 \x02(\t\x12\x13\n\x0bserviceType\x18\x02 \x02(\x05\x12\x11\n\tbeginTime\x18\x03 \x02(\r\x12\x0f\n\x07\x65ndTime\x18\x04 \x01(\r\x12*\n\x08userInfo\x18\x05 \x02(\x0b\x32\x18.FspOffline.UserBaseInfo\"d\n\x0b\x43ycleFspReq\x12(\n\x07optType\x18\x01 \x02(\x0e\x32\x17.FspOffline.UserOptType\x12+\n\tuserInfos\x18\x02 \x03(\x0b\x32\x18.FspOffline.UserBaseInfo\"}\n\x07\x46spResp\x12\x10\n\x08\x63\x61lcType\x18\x02 \x02(\x05\x12.\n\x0c\x63ycleFspInfo\x18\x03 \x01(\x0b\x32\x18.FspOffline.CycleFspInfo\x12\x30\n\rcustomFspInfo\x18\x04 \x01(\x0b\x32\x19.FspOffline.CustomFspInfo*_\n\x0bUserOptType\x12\x11\n\rADD_USER_INFO\x10\x01\x12\x11\n\rGET_USER_INFO\x10\x02\x12\x14\n\x10UPDATE_USER_INFO\x10\x03\x12\x14\n\x10\x44\x45LETE_USER_INFO\x10\x04\x42*\n\x1c\x63n.com.glsx.FspOffline.protoB\nFspOffline')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fsp_offline_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\034cn.com.glsx.FspOffline.protoB\nFspOffline'
_USEROPTTYPE._serialized_start=1101
_USEROPTTYPE._serialized_end=1196
_RESIDEEXTENDINFO._serialized_start=33
_RESIDEEXTENDINFO._serialized_end=155
_USERMATCHINFO._serialized_start=158
_USERMATCHINFO._serialized_end=428
_USERBASEINFO._serialized_start=431
_USERBASEINFO._serialized_end=568
_CUSTOMFSPINFO._serialized_start=570
_CUSTOMFSPINFO._serialized_end=671
_CYCLEFSPINFO._serialized_start=673
_CYCLEFSPINFO._serialized_end=737
_CUSTOMFSPREQ._serialized_start=740
_CUSTOMFSPREQ._serialized_end=870
_CYCLEFSPREQ._serialized_start=872
_CYCLEFSPREQ._serialized_end=972
_FSPRESP._serialized_start=974
_FSPRESP._serialized_end=1099
# @@protoc_insertion_point(module_scope)
//***********************************************************************
//* 文件名:gps_alarm_notify.proto
//* 版本记录:
//* 版本号 时间 作者 说明
//* 1.0 2019-01-08
//************************************************************************
syntax = "proto2";
package gps_alarm_notify;
//for Java package and class name
option java_package = "com.glsx.alarmkafka";
option java_outer_classname = "alarmkafka";
enum GPS_ALARM_TYPE
{
COLLISION_ALARM_TYPE = 0x01; //碰撞告警
LOW_VOLTAGE_ALARM_TYPE = 0x02; //低电压告警
BLACKOUT_ALARM_TYPE = 0x03; //断电告警
PSEUDOBS_ALARM_TYPE = 0x04; //伪基站报警
SEPERATE_ALARM_TYPE = 0x05; //子母分离报警
SHOCK_ALARM_TYPE = 0x06; //震动报警
}
////////////////////////////////////////////////////
//kafka
//发送包括碰撞告警在内的告警数据通知,供业务使用
//topic: gps_alarm_notify
////////////////////////////////////////////////////
message AlarmNotifyReq {
required string devicesn = 1; //设备标识
required uint32 gpstime = 2; //服务器时间 1970之后的秒数
required int32 longitude = 3; //报警位置:经度
required int32 latitude = 4; //报警位置:纬度
required int32 alarmtype = 5; //告警类型, 定义见GPS_ALARM_TYPE
required int32 alarmdata = 6; //报警数据
required int32 speed = 7; //报警数据
optional float grange = 8; //gsensor值
optional string gsensors = 9; //gsensor序列
optional float accurate = 10; //准确率
optional string task_id = 11; //视频关联id,目前只有普方达行车记录仪有此字段
}
//topic: 3rd_device_onekeyhelpres //toWeb,碰撞视频算法结果
//topic: recsvr_collision_media //to视频碰撞检测算法
message OneKeyHelpRes{
required uint32 mtype = 1;
required string url = 2;
required string task_id = 3;
optional string result = 4; // 判别结果
optional string video_result = 5; // 视频结果
optional string audio_result = 6; // 音频结果
optional string yolo_path = 7; // YOLO本地路径
}
//topic: 3rd_device_onekeyhelp 一键救援
message OnekeyHelp{
required string imei = 1;
required string troubletype = 2;
required uint32 troubletime = 3;
required uint32 longitude = 4; //经度
required uint32 latitude = 5; //纬度
required string task_id = 6;
}
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: gps_alarm_ntofiy.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16gps_alarm_ntofiy.proto\x12\x10gps_alarm_notify\"\xd2\x01\n\x0e\x41larmNotifyReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07gpstime\x18\x02 \x02(\r\x12\x11\n\tlongitude\x18\x03 \x02(\x05\x12\x10\n\x08latitude\x18\x04 \x02(\x05\x12\x11\n\talarmtype\x18\x05 \x02(\x05\x12\x11\n\talarmdata\x18\x06 \x02(\x05\x12\r\n\x05speed\x18\x07 \x02(\x05\x12\x0e\n\x06grange\x18\x08 \x01(\x02\x12\x10\n\x08gsensors\x18\t \x01(\t\x12\x10\n\x08\x61\x63\x63urate\x18\n \x01(\x02\x12\x0f\n\x07task_id\x18\x0b \x01(\t\"\x8b\x01\n\rOneKeyHelpRes\x12\r\n\x05mtype\x18\x01 \x02(\r\x12\x0b\n\x03url\x18\x02 \x02(\t\x12\x0f\n\x07task_id\x18\x03 \x02(\t\x12\x0e\n\x06result\x18\x04 \x01(\t\x12\x14\n\x0cvideo_result\x18\x05 \x01(\t\x12\x14\n\x0c\x61udio_result\x18\x06 \x01(\t\x12\x11\n\tyolo_path\x18\x07 \x01(\t\"z\n\nOnekeyHelp\x12\x0c\n\x04imei\x18\x01 \x02(\t\x12\x13\n\x0btroubletype\x18\x02 \x02(\t\x12\x13\n\x0btroubletime\x18\x03 \x02(\r\x12\x11\n\tlongitude\x18\x04 \x02(\r\x12\x10\n\x08latitude\x18\x05 \x02(\r\x12\x0f\n\x07task_id\x18\x06 \x02(\t*\xa7\x01\n\x0eGPS_ALARM_TYPE\x12\x18\n\x14\x43OLLISION_ALARM_TYPE\x10\x01\x12\x1a\n\x16LOW_VOLTAGE_ALARM_TYPE\x10\x02\x12\x17\n\x13\x42LACKOUT_ALARM_TYPE\x10\x03\x12\x17\n\x13PSEUDOBS_ALARM_TYPE\x10\x04\x12\x17\n\x13SEPERATE_ALARM_TYPE\x10\x05\x12\x14\n\x10SHOCK_ALARM_TYPE\x10\x06\x42!\n\x13\x63om.glsx.alarmkafkaB\nalarmkafka')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'gps_alarm_ntofiy_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\023com.glsx.alarmkafkaB\nalarmkafka'
_GPS_ALARM_TYPE._serialized_start=524
_GPS_ALARM_TYPE._serialized_end=691
_ALARMNOTIFYREQ._serialized_start=45
_ALARMNOTIFYREQ._serialized_end=255
_ONEKEYHELPRES._serialized_start=258
_ONEKEYHELPRES._serialized_end=397
_ONEKEYHELP._serialized_start=399
_ONEKEYHELP._serialized_end=521
# @@protoc_insertion_point(module_scope)
syntax = "proto2";
package protos_ddkafkasvr;
//***********************************************************************
//*
//* 文件名:kafka_ddbox.proto
//*
//* 文件描述:DDBOX kafka
//*
//*
//* 版本号:1.0
//*
//* 备注:
//* 2016-01-06 杨继阶 1.增加GPS+基站 上传协议
//* 2016-01-11 杨继阶 2.Kafka 所有的队列数据支持设备类型 关联Topic gpsdata_ddbox rtgps_ddbox ignition_ddbox ignition_ddbox msgreport_ddbox gpsandbsdata_ddbox
//*
//*
//************************************************************************/
//for Java package and class name
option java_package = "com.glsx.kafkasvr";
option java_outer_classname = "kafkasvr";
enum CMD
{
CMD_KAFKA_SVR = 0x3088;
}
enum SUBCMD
{
SUBCMD_DD_GPSDATA = 0x01; //topic gpsdata_ddbox
SUBCMD_DD_RTGPSDATA = 0x02; //topic rtgps_ddbox
SUBCMD_DD_FLOWDATA = 0x03; //topic flowdata_ddbox
SUBCMD_DD_IGNITIONDATA=0x04; //topic ignition_ddbox
SUBCMD_DD_FLAMEOUTDATA=0x05; //topic flameout_ddbox
SUBCMD_DD_DEBUGDATA = 0x06; //topic debugdata_ddbox
SUBCMD_DD_LOGINGLOG = 0x07; //topic loginglog_ddbox
SUBCMD_DD_MSGREPORT = 0x08; //topic msgreport_ddbox
SUBCMD_DD_GPSANDBSDATA = 0x09; //topic gpsandbsdata_ddbox
SUBCMD_DD_GPSANDBSDATA_HIS=0x0a; //topic gpsandbsdata_his_ddbox
SUBCMD_DD_DEVICEEVENT = 0x0b; //topic deviceevent_ddbox
SUBCMD_DD_DEVICEGPSANDBS = 0x0c; //topic ddbox_gpsandbsdata
SUBCMD_DD_DEVICEGPSANDBS_HIS = 0x0d; //topic ddbox_gpsandbsdata_his
SUBCMD_DD_DEVICEIGNITION = 0x0e; //topic ddbox_ignition
SUBCMD_DD_DEVICEFLAMEOUT = 0x0f; //topic ddbox_flameout
SUBCMD_DD_DEVICEIGNITION_HIS = 0x10; //topic ddbox_ignition_his
SUBCMD_DD_DEVICEFLAMEOUT_HIS = 0x11; //topic ddbox_flameout_his
SUBCMD_DD_CARINFO_DATA = 0x12; //topic ddbox_carinfo_data
SUBCMD_DD_RAPID_ACCELERATION = 0x13; //topic ddbox_Rapid_data
}
// 客户端终端类型
enum ClientTerminalType {
// windowd PC, 默认类型
WinPC = 0;
// Wince车机
WinCEPad = 1;
// android车机
AndroidPad = 2;
// ipad车机
IOSPad = 3;
//WINCE 后视镜
WinCEBackMirror = 4;
//Android 后视镜
AndroidBackMirror = 5;
//Ios 后视镜
IosBackMirror = 6;
// iphone
IOSPhone = 7;
// android
AndroidPhone = 8;
// windows
WindowsPhone = 9;
//行车记录仪
OthCarRec = 10;
//普方达记录仪
GPSDevice = 11;
//Android行车记录仪
AndroidCarRec = 12;
//车充精灵
LighterDevice = 13;
//外接服务器设备
ThirdSvrDevice = 800;
//外接智行设备
ThirdZhixingDevice = 801;
//外接小镜设备
ThirdXiaojingDevice = 802;
}
enum RESULT_CODE
{
RESULT_SUCCESS = 0;
RESULT_FAIL = 1;//异常原因,导致失败
}
enum GPS_TYPE
{
RAW_GPS = 0; //原始经纬度
GAODE_GPS = 1; //高德经纬度
BAIDU_GPS = 2; //百度经纬度
}
message GPSDATA {
required int32 longitude = 1; //经度
required int32 latitude = 2; //纬度
required uint32 time = 3; ////1970之后的秒数
required uint32 speed = 4; //速度
required uint32 direction = 5; //方向
required int32 alt = 6; //海拨
}
////////////////////////////////////////////////////
//kafka
//用户发送轨迹数据
//实时位置和历史轨迹使用相同的格式
//topic gpsdata_ddbox 历史轨迹点
//topic rtgps_ddbox 实时位置点
////////////////////////////////////////////////////
message TrackDataReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 svrtime = 3; //服务器时间
repeated GPSDATA gpsdata = 4; //GPS数据
optional ClientTerminalType clientType = 5; //设备类型
optional GPS_TYPE gpstype = 6; //经纬度类型
}
message TrackDataRsp {
required uint32 result = 1; //结果
}
message FlowInfoUnit{
optional string appname = 1; //应用
optional string appversion = 2; //应用版本号
optional string packetname = 3; //包名
required uint32 model =4 ; //模块
required uint32 appid = 5; //应用ID
required uint32 uprate = 6; //上行流量
required uint32 downrate = 7; //下行流量
required uint32 begintime = 8; //开始统计时间
required uint32 endtime = 9; //结束统计时间 //1970之后的秒数
}
////////////////////////////////////////////////////
//kafka
//用户上传流量数据
////////////////////////////////////////////////////
message UpFlowInfoCountReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required ClientTerminalType clientType = 3; //终端类型
repeated FlowInfoUnit flowUnit = 4; //流量信息
}
message UpFlowInfoCountRsp{
required uint32 result = 1; //应答
}
////////////////////////////////////////////////////
//kafka
//用户发送点火熄火数据
//topic ignition_ddbox 点火
//topic flameout_ddbox 熄火
//topic ddbox_ignition 点火 (devicesn 指的是IMEI)
//topic ddbox_flameout 熄火 (devicesn 指的是IMEI)
//topic ddbox_ignition_his 点火补报数据 (devicesn 指的是IMEI)
//topic ddbox_flameout_his 熄火补报数据 (devicesn 指的是IMEI)
////////////////////////////////////////////////////
message EventStateReportReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 time = 3; //终端时间 //1970之后的秒数
required uint32 svrtime = 4; //服务器时间
optional uint32 longitude = 5; //经度
optional uint32 latitude = 6; //纬度
optional ClientTerminalType clientType = 7; //设备类型
optional uint32 gpstime = 8; //GPS Time
optional GPS_TYPE gpstype = 9; //经纬度类型
}
message EventStateReportRsp{
required uint32 result = 1; //结果
}
////////////////////////////////////////////////////
//kafka
//用户发送终端连接时间段调试日志
////////////////////////////////////////////////////
message UpDebugLogInfoReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 time = 3; //客户端时间 //1970之后的秒数
required string data = 4; //日志
optional ClientTerminalType clientType = 5; //设备类型
}
message UpDebugLogInfoRsp{
required uint32 result = 1; //结果
}
////////////////////////////////////////////////////
//kafka 与客户端无关由接入平台上报
//
////////////////////////////////////////////////////
message UserLoginLogRecord {
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required ClientTerminalType clientType = 3; //终端类型
required string sdkversion = 4; //SDK版本
required uint32 svrtime = 5; //服务器时间 //1970之后的秒数
required uint32 state = 6; //1 登录 2登出 3超时登出
optional string svrip = 7; // 服务器IP
}
////////////////////////////////////////////////////
//kafka
//用户发送重要消息数据
//topic msgreport_ddbox 重要消息报告
message ImportantMessageRecord {
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 messagetype = 3; //消息类型
required string msgid = 4; //消息ID
required uint32 clienttime = 5; //终端时间 //1970之后的秒数
required uint32 servertime = 6; //服务器时间
optional ClientTerminalType clientType = 7; //设备类型
}
message GPSCell{
required uint32 longitude = 1; //经度
required uint32 latitude = 2; //纬度
required uint32 speed = 3; //速度
required uint32 direction = 4; //方向
required uint32 alt = 5; //海拨
}
message BaseStationCell
{
required uint32 LAC = 1; //基站区号
required uint32 CELLID = 2; //基站塔号
required uint32 SI = 3; //信号强度
}
message GpsAndBsDataRecord {
required uint32 clienttime = 1; //终端时间
optional GPSCell gpsCell = 2; //gps数据
repeated BaseStationCell baseStationCell = 3; //bs 数据
}
//gpsandbsdata_his_ddbox
//gpsandbsdata_ddbox
message GpsAndBsDataReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 svrtime = 3; //服务器时间
optional uint32 mnc = 4; // 00:"CHINA MOBILE", "CN" 中国移动 01:"CHN-CUGSM", "CN" 中国联通 02:"CHINA MOBILE", "CN" 中国移动 (TD) 03:"CHINA TELECOM", "CN" 中国电信
repeated GpsAndBsDataRecord gpsandbsdata = 5; //GPS和基站数据
optional ClientTerminalType clientType = 6; //设备类型
optional GPS_TYPE gpstype = 7; //经纬度类型
}
////////////////////////////////////////////////////
//kafka
//用户发送设备事件数据
//topic deviceevent_ddbox
//
////////////////////////////////////////////////////
message DeviceEventReportReq{
optional uint32 userid = 1; //用户ID
required string devicesn = 2; //设备标识
required uint32 time = 3; //终端时间 //1970之后的秒数
required uint32 svrtime = 4; //服务器时间
required uint32 eventid = 5; //1:未检测到卡2:移动网络开3:移动网络关
optional uint32 longitude = 6; //经度
optional uint32 latitude = 7; //纬度
optional ClientTerminalType clientType = 8; //设备类型
optional uint32 gpstime = 9; //GPS Time
optional GPS_TYPE gpstype = 10; //经纬度类型
}
message DeviceEventReportRsp{
required uint32 result = 1; //结果
}
//ddbox_gpsandbsdata 设备上报GPS和基站数据
//ddbox_gpsandbsdata_his 设备补报GPS和基站数据
message DeviceGpsAndBsDataReq{
required string imei = 1; //设备标识
required uint32 svrtime = 2; //服务器时间
optional uint32 mnc = 3; // 00:"CHINA MOBILE", "CN" 中国移动 01:"CHN-CUGSM", "CN" 中国联通 02:"CHINA MOBILE", "CN" 中国移动 (TD) 03:"CHINA TELECOM", "CN" 中国电信
optional ClientTerminalType clientType = 4; //设备类型
repeated GpsAndBsDataRecord gpsandbsdata = 5; //GPS和基站数据
optional GPS_TYPE gpstype = 6; //经纬度类型
}
//终端上报车况数据协议topic ddbox_carinfo_data
message UploadCarInfoData{
required string deviceno = 1;
required uint32 clientType = 2;
required uint32 devtime = 3;
required uint32 svrtime = 4;
required uint32 mileage = 5;
required uint32 battery = 6;
required uint32 innage = 7;
required uint32 average = 8;
}
//终端上报急加速数据,topic:ddbox_Rapid_data
message UploadRapidData
{
required string deviceno = 1;
required uint32 clienttime = 2;
required uint32 svrtime = 3;
required string gsensor = 4;
required uint32 Longitude = 5;
required uint32 Latitude = 6;
required uint32 Altitude = 7;
required uint32 Speed = 8;
required uint32 dir = 9;
optional uint32 clienttype = 10;
}
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kafka_ddbox.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11kafka_ddbox.proto\x12\x11protos_ddkafkasvr\"k\n\x07GPSDATA\x12\x11\n\tlongitude\x18\x01 \x02(\x05\x12\x10\n\x08latitude\x18\x02 \x02(\x05\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\r\n\x05speed\x18\x04 \x02(\r\x12\x11\n\tdirection\x18\x05 \x02(\r\x12\x0b\n\x03\x61lt\x18\x06 \x02(\x05\"\xd7\x01\n\x0cTrackDataReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12+\n\x07gpsdata\x18\x04 \x03(\x0b\x32\x1a.protos_ddkafkasvr.GPSDATA\x12\x39\n\nclientType\x18\x05 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12,\n\x07gpstype\x18\x06 \x01(\x0e\x32\x1b.protos_ddkafkasvr.GPS_TYPE\"\x1e\n\x0cTrackDataRsp\x12\x0e\n\x06result\x18\x01 \x02(\r\"\xab\x01\n\x0c\x46lowInfoUnit\x12\x0f\n\x07\x61ppname\x18\x01 \x01(\t\x12\x12\n\nappversion\x18\x02 \x01(\t\x12\x12\n\npacketname\x18\x03 \x01(\t\x12\r\n\x05model\x18\x04 \x02(\r\x12\r\n\x05\x61ppid\x18\x05 \x02(\r\x12\x0e\n\x06uprate\x18\x06 \x02(\r\x12\x10\n\x08\x64ownrate\x18\x07 \x02(\r\x12\x11\n\tbegintime\x18\x08 \x02(\r\x12\x0f\n\x07\x65ndtime\x18\t \x02(\r\"\xa4\x01\n\x12UpFlowInfoCountReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x39\n\nclientType\x18\x03 \x02(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12\x31\n\x08\x66lowUnit\x18\x04 \x03(\x0b\x32\x1f.protos_ddkafkasvr.FlowInfoUnit\"$\n\x12UpFlowInfoCountRsp\x12\x0e\n\x06result\x18\x01 \x02(\r\"\xf5\x01\n\x13\x45ventStateReportReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\x0f\n\x07svrtime\x18\x04 \x02(\r\x12\x11\n\tlongitude\x18\x05 \x01(\r\x12\x10\n\x08latitude\x18\x06 \x01(\r\x12\x39\n\nclientType\x18\x07 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12\x0f\n\x07gpstime\x18\x08 \x01(\r\x12,\n\x07gpstype\x18\t \x01(\x0e\x32\x1b.protos_ddkafkasvr.GPS_TYPE\"%\n\x13\x45ventStateReportRsp\x12\x0e\n\x06result\x18\x01 \x02(\r\"\x8c\x01\n\x11UpDebugLogInfoReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\x0c\n\x04\x64\x61ta\x18\x04 \x02(\t\x12\x39\n\nclientType\x18\x05 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\"#\n\x11UpDebugLogInfoRsp\x12\x0e\n\x06result\x18\x01 \x02(\r\"\xb4\x01\n\x12UserLoginLogRecord\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x39\n\nclientType\x18\x03 \x02(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12\x12\n\nsdkversion\x18\x04 \x02(\t\x12\x0f\n\x07svrtime\x18\x05 \x02(\r\x12\r\n\x05state\x18\x06 \x02(\r\x12\r\n\x05svrip\x18\x07 \x01(\t\"\xc1\x01\n\x16ImportantMessageRecord\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x13\n\x0bmessagetype\x18\x03 \x02(\r\x12\r\n\x05msgid\x18\x04 \x02(\t\x12\x12\n\nclienttime\x18\x05 \x02(\r\x12\x12\n\nservertime\x18\x06 \x02(\r\x12\x39\n\nclientType\x18\x07 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\"]\n\x07GPSCell\x12\x11\n\tlongitude\x18\x01 \x02(\r\x12\x10\n\x08latitude\x18\x02 \x02(\r\x12\r\n\x05speed\x18\x03 \x02(\r\x12\x11\n\tdirection\x18\x04 \x02(\r\x12\x0b\n\x03\x61lt\x18\x05 \x02(\r\":\n\x0f\x42\x61seStationCell\x12\x0b\n\x03LAC\x18\x01 \x02(\r\x12\x0e\n\x06\x43\x45LLID\x18\x02 \x02(\r\x12\n\n\x02SI\x18\x03 \x02(\r\"\x92\x01\n\x12GpsAndBsDataRecord\x12\x12\n\nclienttime\x18\x01 \x02(\r\x12+\n\x07gpsCell\x18\x02 \x01(\x0b\x32\x1a.protos_ddkafkasvr.GPSCell\x12;\n\x0f\x62\x61seStationCell\x18\x03 \x03(\x0b\x32\".protos_ddkafkasvr.BaseStationCell\"\xf7\x01\n\x0fGpsAndBsDataReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\x0b\n\x03mnc\x18\x04 \x01(\r\x12;\n\x0cgpsandbsdata\x18\x05 \x03(\x0b\x32%.protos_ddkafkasvr.GpsAndBsDataRecord\x12\x39\n\nclientType\x18\x06 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12,\n\x07gpstype\x18\x07 \x01(\x0e\x32\x1b.protos_ddkafkasvr.GPS_TYPE\"\x87\x02\n\x14\x44\x65viceEventReportReq\x12\x0e\n\x06userid\x18\x01 \x01(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\x0f\n\x07svrtime\x18\x04 \x02(\r\x12\x0f\n\x07\x65ventid\x18\x05 \x02(\r\x12\x11\n\tlongitude\x18\x06 \x01(\r\x12\x10\n\x08latitude\x18\x07 \x01(\r\x12\x39\n\nclientType\x18\x08 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12\x0f\n\x07gpstime\x18\t \x01(\r\x12,\n\x07gpstype\x18\n \x01(\x0e\x32\x1b.protos_ddkafkasvr.GPS_TYPE\"&\n\x14\x44\x65viceEventReportRsp\x12\x0e\n\x06result\x18\x01 \x02(\r\"\xe9\x01\n\x15\x44\x65viceGpsAndBsDataReq\x12\x0c\n\x04imei\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\x0b\n\x03mnc\x18\x03 \x01(\r\x12\x39\n\nclientType\x18\x04 \x01(\x0e\x32%.protos_ddkafkasvr.ClientTerminalType\x12;\n\x0cgpsandbsdata\x18\x05 \x03(\x0b\x32%.protos_ddkafkasvr.GpsAndBsDataRecord\x12,\n\x07gpstype\x18\x06 \x01(\x0e\x32\x1b.protos_ddkafkasvr.GPS_TYPE\"\x9e\x01\n\x11UploadCarInfoData\x12\x10\n\x08\x64\x65viceno\x18\x01 \x02(\t\x12\x12\n\nclientType\x18\x02 \x02(\r\x12\x0f\n\x07\x64\x65vtime\x18\x03 \x02(\r\x12\x0f\n\x07svrtime\x18\x04 \x02(\r\x12\x0f\n\x07mileage\x18\x05 \x02(\r\x12\x0f\n\x07\x62\x61ttery\x18\x06 \x02(\r\x12\x0e\n\x06innage\x18\x07 \x02(\r\x12\x0f\n\x07\x61verage\x18\x08 \x02(\r\"\xc0\x01\n\x0fUploadRapidData\x12\x10\n\x08\x64\x65viceno\x18\x01 \x02(\t\x12\x12\n\nclienttime\x18\x02 \x02(\r\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\x0f\n\x07gsensor\x18\x04 \x02(\t\x12\x11\n\tLongitude\x18\x05 \x02(\r\x12\x10\n\x08Latitude\x18\x06 \x02(\r\x12\x10\n\x08\x41ltitude\x18\x07 \x02(\r\x12\r\n\x05Speed\x18\x08 \x02(\r\x12\x0b\n\x03\x64ir\x18\t \x02(\r\x12\x12\n\nclienttype\x18\n \x01(\r*\x19\n\x03\x43MD\x12\x12\n\rCMD_KAFKA_SVR\x10\x88\x61*\xa8\x04\n\x06SUBCMD\x12\x15\n\x11SUBCMD_DD_GPSDATA\x10\x01\x12\x17\n\x13SUBCMD_DD_RTGPSDATA\x10\x02\x12\x16\n\x12SUBCMD_DD_FLOWDATA\x10\x03\x12\x1a\n\x16SUBCMD_DD_IGNITIONDATA\x10\x04\x12\x1a\n\x16SUBCMD_DD_FLAMEOUTDATA\x10\x05\x12\x17\n\x13SUBCMD_DD_DEBUGDATA\x10\x06\x12\x17\n\x13SUBCMD_DD_LOGINGLOG\x10\x07\x12\x17\n\x13SUBCMD_DD_MSGREPORT\x10\x08\x12\x1a\n\x16SUBCMD_DD_GPSANDBSDATA\x10\t\x12\x1e\n\x1aSUBCMD_DD_GPSANDBSDATA_HIS\x10\n\x12\x19\n\x15SUBCMD_DD_DEVICEEVENT\x10\x0b\x12\x1c\n\x18SUBCMD_DD_DEVICEGPSANDBS\x10\x0c\x12 \n\x1cSUBCMD_DD_DEVICEGPSANDBS_HIS\x10\r\x12\x1c\n\x18SUBCMD_DD_DEVICEIGNITION\x10\x0e\x12\x1c\n\x18SUBCMD_DD_DEVICEFLAMEOUT\x10\x0f\x12 \n\x1cSUBCMD_DD_DEVICEIGNITION_HIS\x10\x10\x12 \n\x1cSUBCMD_DD_DEVICEFLAMEOUT_HIS\x10\x11\x12\x1a\n\x16SUBCMD_DD_CARINFO_DATA\x10\x12\x12 \n\x1cSUBCMD_DD_RAPID_ACCELERATION\x10\x13*\xc6\x02\n\x12\x43lientTerminalType\x12\t\n\x05WinPC\x10\x00\x12\x0c\n\x08WinCEPad\x10\x01\x12\x0e\n\nAndroidPad\x10\x02\x12\n\n\x06IOSPad\x10\x03\x12\x13\n\x0fWinCEBackMirror\x10\x04\x12\x15\n\x11\x41ndroidBackMirror\x10\x05\x12\x11\n\rIosBackMirror\x10\x06\x12\x0c\n\x08IOSPhone\x10\x07\x12\x10\n\x0c\x41ndroidPhone\x10\x08\x12\x10\n\x0cWindowsPhone\x10\t\x12\r\n\tOthCarRec\x10\n\x12\r\n\tGPSDevice\x10\x0b\x12\x11\n\rAndroidCarRec\x10\x0c\x12\x11\n\rLighterDevice\x10\r\x12\x13\n\x0eThirdSvrDevice\x10\xa0\x06\x12\x17\n\x12ThirdZhixingDevice\x10\xa1\x06\x12\x18\n\x13ThirdXiaojingDevice\x10\xa2\x06*2\n\x0bRESULT_CODE\x12\x12\n\x0eRESULT_SUCCESS\x10\x00\x12\x0f\n\x0bRESULT_FAIL\x10\x01*5\n\x08GPS_TYPE\x12\x0b\n\x07RAW_GPS\x10\x00\x12\r\n\tGAODE_GPS\x10\x01\x12\r\n\tBAIDU_GPS\x10\x02\x42\x1d\n\x11\x63om.glsx.kafkasvrB\x08kafkasvr')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kafka_ddbox_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\021com.glsx.kafkasvrB\010kafkasvr'
_CMD._serialized_start=3076
_CMD._serialized_end=3101
_SUBCMD._serialized_start=3104
_SUBCMD._serialized_end=3656
_CLIENTTERMINALTYPE._serialized_start=3659
_CLIENTTERMINALTYPE._serialized_end=3985
_RESULT_CODE._serialized_start=3987
_RESULT_CODE._serialized_end=4037
_GPS_TYPE._serialized_start=4039
_GPS_TYPE._serialized_end=4092
_GPSDATA._serialized_start=40
_GPSDATA._serialized_end=147
_TRACKDATAREQ._serialized_start=150
_TRACKDATAREQ._serialized_end=365
_TRACKDATARSP._serialized_start=367
_TRACKDATARSP._serialized_end=397
_FLOWINFOUNIT._serialized_start=400
_FLOWINFOUNIT._serialized_end=571
_UPFLOWINFOCOUNTREQ._serialized_start=574
_UPFLOWINFOCOUNTREQ._serialized_end=738
_UPFLOWINFOCOUNTRSP._serialized_start=740
_UPFLOWINFOCOUNTRSP._serialized_end=776
_EVENTSTATEREPORTREQ._serialized_start=779
_EVENTSTATEREPORTREQ._serialized_end=1024
_EVENTSTATEREPORTRSP._serialized_start=1026
_EVENTSTATEREPORTRSP._serialized_end=1063
_UPDEBUGLOGINFOREQ._serialized_start=1066
_UPDEBUGLOGINFOREQ._serialized_end=1206
_UPDEBUGLOGINFORSP._serialized_start=1208
_UPDEBUGLOGINFORSP._serialized_end=1243
_USERLOGINLOGRECORD._serialized_start=1246
_USERLOGINLOGRECORD._serialized_end=1426
_IMPORTANTMESSAGERECORD._serialized_start=1429
_IMPORTANTMESSAGERECORD._serialized_end=1622
_GPSCELL._serialized_start=1624
_GPSCELL._serialized_end=1717
_BASESTATIONCELL._serialized_start=1719
_BASESTATIONCELL._serialized_end=1777
_GPSANDBSDATARECORD._serialized_start=1780
_GPSANDBSDATARECORD._serialized_end=1926
_GPSANDBSDATAREQ._serialized_start=1929
_GPSANDBSDATAREQ._serialized_end=2176
_DEVICEEVENTREPORTREQ._serialized_start=2179
_DEVICEEVENTREPORTREQ._serialized_end=2442
_DEVICEEVENTREPORTRSP._serialized_start=2444
_DEVICEEVENTREPORTRSP._serialized_end=2482
_DEVICEGPSANDBSDATAREQ._serialized_start=2485
_DEVICEGPSANDBSDATAREQ._serialized_end=2718
_UPLOADCARINFODATA._serialized_start=2721
_UPLOADCARINFODATA._serialized_end=2879
_UPLOADRAPIDDATA._serialized_start=2882
_UPLOADRAPIDDATA._serialized_end=3074
# @@protoc_insertion_point(module_scope)
syntax = "proto2";
package protos_device_statesvr;
message DeviceStateReq
{
required string devicesn = 1; //设备sn
required int32 state = 2; //设备状态:1.停止 3.行驶
required int32 statebegintime= 3; //状态开始时间,时间戳
};
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kafka_device_state.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18kafka_device_state.proto\x12\x16protos_device_statesvr\"I\n\x0e\x44\x65viceStateReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\r\n\x05state\x18\x02 \x02(\x05\x12\x16\n\x0estatebegintime\x18\x03 \x02(\x05')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kafka_device_state_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_DEVICESTATEREQ._serialized_start=52
_DEVICESTATEREQ._serialized_end=125
# @@protoc_insertion_point(module_scope)
//***********************************************************************
//* 文件名:kafka_gps.proto
//* 版本记录:
//* 版本号 时间 作者 说明
//* 1.0 2016-01-06 杨继阶 初稿
//* 1.1 2017-03-27 胡永安 GPSAndBSReq增加字段gsensor
//************************************************************************
syntax = "proto2";
package protos_gpssvr;
//for Java package and class name
//option java_package = "com.glsx.gps.kafka";
option java_package = "com.glsx.kafkasvr";
option java_outer_classname = "kafkasvr";
enum CMD
{
CMD_KAFKA_SVR = 0x3089;
}
enum SUBCMD
{
SUBCMD_GPS_GPSDATA = 0x0; //topic gps_gpsdata gps信息
SUBCMD_GPS_ALARM = 0x01; //topic gps_alarm 报警信息
SUBCMD_GPS_BASESTATION = 0x02; //topic gps_basestation 基站信息
SUBCMD_GPS_LOGIN = 0x03; //topic gps_login
SUBCMD_GPS_LOGOUT = 0x04; //topic gps_logout
SUBCMD_GPS_SLEEP = 0x05; //topic gps_sleep
SUBCMD_GPS_ONLINE = 0x06; //topic gps_online
SUBCMD_GPS_VOLTAGE = 0x07; //topic gps_voltage
SUBCMD_GPS_GPAANDBT = 0x08; //topic gps_gpsandbs gps+基站信息
SUBCMD_GPS_GPAANDBT_HIS = 0x09; //topic gps_gpsandbs_his gps+基站信息的补传
SUBCMD_GPS_SCANRF = 0x0A; //topic gps_scanrf
SUBCMD_GPS_ALARM_HIS = 0x0B; //topic gps_alarm_his 报警信息的补传
SUBCMD_GPS_GSENSOR_DATA = 0x0C; //topic gps_gsensor_data
SUBCMD_GPS_WIFI_DATA = 0x0D; //topic gps_wifi_data
SUBCMD_GPS_GSENSOR_DATA2 = 0x0E; //topic gps_gsensor_data2
SUBCMD_SET_OILELECTRIC_RSP = 0x0F; //topic gps_setOilElectricRsp
}
enum RESULT_CODE
{
RESULT_SUCCESS = 0;
RESULT_FAIL = 1;//异常原因,导致失败
}
message GPSDATA {
required int32 longitude = 1; //经度
required int32 latitude = 2; //纬度
required uint32 time = 3; ////1970之后的秒数
required uint32 speed = 4; //速度
required uint32 direction = 5; //方向
required int32 alt = 6; //海拨
required string valid = 7; //有效性 'A' 有效 'V' 无效
optional uint32 ip = 8; //终端设备的IP
}
message MINIGPSDATA {
required int32 longitude = 1; //经度
required int32 latitude = 2; //纬度
required uint32 time = 3; ////1970之后的秒数
required uint32 speed = 4; //速度 km/h
required string valid = 5; //有效性 'A' 有效 'V' 无效
}
message ALARMDATA {
required uint32 overspeed = 1; //超速
required uint32 lowervol = 2; //低压
required uint32 blackout = 3; //断电,拔出,or 无源是光感
required uint32 gpsopen = 4; //gps开路
required uint32 rob = 5; //劫警
required string info = 6; //报警原始数据
optional uint32 gpsfault = 7; //gps故障报警
optional uint32 rffault = 8; //rf 发射源或者接受源故障
optional uint32 separate = 9; //子母分离报警
optional uint32 shock = 10; //震动报警
optional uint32 collision = 11; //碰撞报警
optional uint32 pseudobsc = 12; //伪基站检测
optional uint32 pseudobs = 13; //伪基站报警
optional uint32 lightalarm = 14; //有源的光感报警
optional uint32 flipalarm = 15; //翻转报警
optional uint32 demolition = 16; //拆除报警
}
message BASESTDATA {
required uint32 lac = 1; //区号 十进制
required uint32 cellid = 2; //塔号 十进制
required uint32 signal = 3; //信号强度 十进制
}
////////////////////////////////////////////////////
//kafka
//用户发送轨迹数据
//实时位置和历史轨迹使用相同的格式
//topic gps_gpsdata 历史轨迹点
////////////////////////////////////////////////////
message TrackDataReq {
required string devicesn = 1; //设备标识
required string facid = 2; //厂商码
required uint32 svrtime = 3; //服务器时间 1970之后的秒数
repeated GPSDATA gpsdata = 4; //GPS数据
optional string voltage = 5; //电压
optional uint32 battery = 6; //电池电量百分百(0~100)
optional uint32 gsensor = 7; //G-Sensor的状态,(0: 静止;1:运动)
}
///////////////////////////////////////////////////
//基站数据
///////////////////////////////////////////////////
message BaseStReq {
required string devicesn = 1; //设备标识
required string facid = 2; //厂商码
required uint32 svrtime = 3; //服务器时间 1970之后的秒数
required uint32 mcc = 4; //国家编码
required uint32 mnc = 5; //运营商编码
required uint32 time = 6; //终端上传时间
repeated BASESTDATA bstdata = 7; //基站数据
}
///////////////////////////////////////////////////
//报警数据
///////////////////////////////////////////////////
message AlarmReq {
required string devicesn = 1; //设备标识
required string facid = 2; //厂商码
required uint32 svrtime = 3; //服务器时间 1970之后的秒数
required MINIGPSDATA gpsdata = 4; //报警位置
required ALARMDATA alarmdata = 5; //报警数据
required string voltage = 6; //电压
optional uint32 history = 7; //如果为 NULL, 0, 都是实时报警,如果为 1,就是补传报警
optional BASESTDATA bstdata = 8; //基站数据 只一条
}
///////////////////////////////////////////////////
//上线,休眠, 登陆, 登出
///////////////////////////////////////////////////
message StatusReportReq {
required string devicesn = 1; //设备标识
required string facid = 2; //厂商码
required uint32 svrtime = 3; //服务器时间 1970之后的秒数
optional string iccid = 4; //设备上报的iccid
}
message VoltageReq
{
required string devicesn = 1;
required string voltage = 2;
required uint32 devttime = 3;
required uint32 svrtime = 4;
}
message GPSAndBSReq
{
required string devicesn = 1; //sn
required uint32 svrtime = 2; //服务器时间
required GPSDATA gpsdata = 3; //gps数据
required uint32 mcc = 4; //国家编码
required uint32 mnc = 5; //运营商编码
required uint32 bscnt = 6; //基站数
repeated BASESTDATA bstdata = 7; //基站数据
required uint32 num = 8; //卫星数
required string voltage = 9; //电压
optional uint32 gsensor = 10; //G-Sensor的状态,(0: 静止;1:运动)
optional uint32 battery = 11; //电池电量百分百(0~100)
optional uint32 workmode = 12; //工作模式(0.出厂模式,1.工作,2.休眠,3.自定义,4.只发基站,5.半休眠,6.,7.无线模式)
}
message GPSAndBSAndAlarmReq
{
required string devicesn = 1; //sn
required uint32 svrtime = 2; //服务器时间
required GPSDATA gpsdata = 3; //gps数据
required uint32 mcc = 4; //国家编码
required uint32 mnc = 5; //运营商编码
required uint32 bscnt = 6; //基站数
repeated BASESTDATA bstdata = 7; //基站数据
required uint32 num = 8; //卫星数
required string voltage = 9; //电压
optional uint32 gsensor = 10; //G-Sensor的状态,(0: 静止;1:运动)
optional uint32 battery = 11; //电池电量百分百(0~100)
optional uint32 workmode = 12; //工作模式(0.出厂模式,1.工作,2.休眠,3.自定义,4.只发基站,5.半休眠,6.,7.无线模式)
optional ALARMDATA alarmdata = 13;
}
//! 扫描到的RF 发射源的SN
message GPSScanRF
{
required string devicesn = 1; //sn
required uint32 svrtime = 2; //服务器时间
required uint32 sncnt = 3; //扫描到RF发射源的个数
repeated string rfsn = 4; //发射源sn的数组
}
message SensorData
{
required uint32 x = 1;
required uint32 y = 2;
required uint32 z = 3;
}
message SensorData2
{
required sint32 x = 1; //带符号的
required sint32 y = 2;
required sint32 z = 3;
}
//topic gps_gsensor_data
message GsensorInfo
{
required string devicesn = 1;
required uint32 svrtime = 2;
required uint32 devicetime = 3;
repeated SensorData gsensor = 4;
}
//topic gps_gsensor_data2
message GsensorInfo2
{
required string devicesn = 1;
required uint32 svrtime = 2;
required uint32 devicetime = 3;
repeated SensorData2 gsensor = 4;
}
//topic gps_wifi_data
message wifiData
{
required string mac = 1; //mac地址
required uint32 single = 2; //信号强度
}
message WifiInfoReq
{
required uint32 type = 1;
required string devicesn = 2;
required uint32 gpstime = 3;
required uint32 svrtime = 4;
repeated wifiData data = 5;
optional uint32 mcc = 6; //国家编码
optional uint32 mnc = 7; //运营商编码
optional uint32 bscnt = 8; //基站数
repeated BASESTDATA bstdata = 9; //基站数据
}
message gps_setOilElectricRsp
{
required string devicesn = 1; //设备号
required uint32 svrtime = 2; //服务器时间
required uint32 gpstime = 3; //设备时间
required uint32 flowid = 4; //流水号
required uint32 result = 5; //结果,0是成功 1是失败 2修改的状态和设备状态一致
optional uint32 curState = 6; //当前设备的状态 1 断开油电 ; 2 正常油电
}
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kafka_gps.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fkafka_gps.proto\x12\rprotos_gpssvr\"\x86\x01\n\x07GPSDATA\x12\x11\n\tlongitude\x18\x01 \x02(\x05\x12\x10\n\x08latitude\x18\x02 \x02(\x05\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\r\n\x05speed\x18\x04 \x02(\r\x12\x11\n\tdirection\x18\x05 \x02(\r\x12\x0b\n\x03\x61lt\x18\x06 \x02(\x05\x12\r\n\x05valid\x18\x07 \x02(\t\x12\n\n\x02ip\x18\x08 \x01(\r\"^\n\x0bMINIGPSDATA\x12\x11\n\tlongitude\x18\x01 \x02(\x05\x12\x10\n\x08latitude\x18\x02 \x02(\x05\x12\x0c\n\x04time\x18\x03 \x02(\r\x12\r\n\x05speed\x18\x04 \x02(\r\x12\r\n\x05valid\x18\x05 \x02(\t\"\xa5\x02\n\tALARMDATA\x12\x11\n\toverspeed\x18\x01 \x02(\r\x12\x10\n\x08lowervol\x18\x02 \x02(\r\x12\x10\n\x08\x62lackout\x18\x03 \x02(\r\x12\x0f\n\x07gpsopen\x18\x04 \x02(\r\x12\x0b\n\x03rob\x18\x05 \x02(\r\x12\x0c\n\x04info\x18\x06 \x02(\t\x12\x10\n\x08gpsfault\x18\x07 \x01(\r\x12\x0f\n\x07rffault\x18\x08 \x01(\r\x12\x10\n\x08separate\x18\t \x01(\r\x12\r\n\x05shock\x18\n \x01(\r\x12\x11\n\tcollision\x18\x0b \x01(\r\x12\x11\n\tpseudobsc\x18\x0c \x01(\r\x12\x10\n\x08pseudobs\x18\r \x01(\r\x12\x12\n\nlightalarm\x18\x0e \x01(\r\x12\x11\n\tflipalarm\x18\x0f \x01(\r\x12\x12\n\ndemolition\x18\x10 \x01(\r\"9\n\nBASESTDATA\x12\x0b\n\x03lac\x18\x01 \x02(\r\x12\x0e\n\x06\x63\x65llid\x18\x02 \x02(\r\x12\x0e\n\x06signal\x18\x03 \x02(\r\"\x9c\x01\n\x0cTrackDataReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\r\n\x05\x66\x61\x63id\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\'\n\x07gpsdata\x18\x04 \x03(\x0b\x32\x16.protos_gpssvr.GPSDATA\x12\x0f\n\x07voltage\x18\x05 \x01(\t\x12\x0f\n\x07\x62\x61ttery\x18\x06 \x01(\r\x12\x0f\n\x07gsensor\x18\x07 \x01(\r\"\x91\x01\n\tBaseStReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\r\n\x05\x66\x61\x63id\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\x0b\n\x03mcc\x18\x04 \x02(\r\x12\x0b\n\x03mnc\x18\x05 \x02(\r\x12\x0c\n\x04time\x18\x06 \x02(\r\x12*\n\x07\x62stdata\x18\x07 \x03(\x0b\x32\x19.protos_gpssvr.BASESTDATA\"\xe4\x01\n\x08\x41larmReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\r\n\x05\x66\x61\x63id\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12+\n\x07gpsdata\x18\x04 \x02(\x0b\x32\x1a.protos_gpssvr.MINIGPSDATA\x12+\n\talarmdata\x18\x05 \x02(\x0b\x32\x18.protos_gpssvr.ALARMDATA\x12\x0f\n\x07voltage\x18\x06 \x02(\t\x12\x0f\n\x07history\x18\x07 \x01(\r\x12*\n\x07\x62stdata\x18\x08 \x01(\x0b\x32\x19.protos_gpssvr.BASESTDATA\"R\n\x0fStatusReportReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\r\n\x05\x66\x61\x63id\x18\x02 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\r\n\x05iccid\x18\x04 \x01(\t\"R\n\nVoltageReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07voltage\x18\x02 \x02(\t\x12\x10\n\x08\x64\x65vttime\x18\x03 \x02(\r\x12\x0f\n\x07svrtime\x18\x04 \x02(\r\"\x80\x02\n\x0bGPSAndBSReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\'\n\x07gpsdata\x18\x03 \x02(\x0b\x32\x16.protos_gpssvr.GPSDATA\x12\x0b\n\x03mcc\x18\x04 \x02(\r\x12\x0b\n\x03mnc\x18\x05 \x02(\r\x12\r\n\x05\x62scnt\x18\x06 \x02(\r\x12*\n\x07\x62stdata\x18\x07 \x03(\x0b\x32\x19.protos_gpssvr.BASESTDATA\x12\x0b\n\x03num\x18\x08 \x02(\r\x12\x0f\n\x07voltage\x18\t \x02(\t\x12\x0f\n\x07gsensor\x18\n \x01(\r\x12\x0f\n\x07\x62\x61ttery\x18\x0b \x01(\r\x12\x10\n\x08workmode\x18\x0c \x01(\r\"\xb5\x02\n\x13GPSAndBSAndAlarmReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\'\n\x07gpsdata\x18\x03 \x02(\x0b\x32\x16.protos_gpssvr.GPSDATA\x12\x0b\n\x03mcc\x18\x04 \x02(\r\x12\x0b\n\x03mnc\x18\x05 \x02(\r\x12\r\n\x05\x62scnt\x18\x06 \x02(\r\x12*\n\x07\x62stdata\x18\x07 \x03(\x0b\x32\x19.protos_gpssvr.BASESTDATA\x12\x0b\n\x03num\x18\x08 \x02(\r\x12\x0f\n\x07voltage\x18\t \x02(\t\x12\x0f\n\x07gsensor\x18\n \x01(\r\x12\x0f\n\x07\x62\x61ttery\x18\x0b \x01(\r\x12\x10\n\x08workmode\x18\x0c \x01(\r\x12+\n\talarmdata\x18\r \x01(\x0b\x32\x18.protos_gpssvr.ALARMDATA\"K\n\tGPSScanRF\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\r\n\x05sncnt\x18\x03 \x02(\r\x12\x0c\n\x04rfsn\x18\x04 \x03(\t\"-\n\nSensorData\x12\t\n\x01x\x18\x01 \x02(\r\x12\t\n\x01y\x18\x02 \x02(\r\x12\t\n\x01z\x18\x03 \x02(\r\".\n\x0bSensorData2\x12\t\n\x01x\x18\x01 \x02(\x11\x12\t\n\x01y\x18\x02 \x02(\x11\x12\t\n\x01z\x18\x03 \x02(\x11\"p\n\x0bGsensorInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\x12\n\ndevicetime\x18\x03 \x02(\r\x12*\n\x07gsensor\x18\x04 \x03(\x0b\x32\x19.protos_gpssvr.SensorData\"r\n\x0cGsensorInfo2\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\x12\n\ndevicetime\x18\x03 \x02(\r\x12+\n\x07gsensor\x18\x04 \x03(\x0b\x32\x1a.protos_gpssvr.SensorData2\"\'\n\x08wifiData\x12\x0b\n\x03mac\x18\x01 \x02(\t\x12\x0e\n\x06single\x18\x02 \x02(\r\"\xcb\x01\n\x0bWifiInfoReq\x12\x0c\n\x04type\x18\x01 \x02(\r\x12\x10\n\x08\x64\x65vicesn\x18\x02 \x02(\t\x12\x0f\n\x07gpstime\x18\x03 \x02(\r\x12\x0f\n\x07svrtime\x18\x04 \x02(\r\x12%\n\x04\x64\x61ta\x18\x05 \x03(\x0b\x32\x17.protos_gpssvr.wifiData\x12\x0b\n\x03mcc\x18\x06 \x01(\r\x12\x0b\n\x03mnc\x18\x07 \x01(\r\x12\r\n\x05\x62scnt\x18\x08 \x01(\r\x12*\n\x07\x62stdata\x18\t \x03(\x0b\x32\x19.protos_gpssvr.BASESTDATA\"}\n\x15gps_setOilElectricRsp\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\x0f\n\x07gpstime\x18\x03 \x02(\r\x12\x0e\n\x06\x66lowid\x18\x04 \x02(\r\x12\x0e\n\x06result\x18\x05 \x02(\r\x12\x10\n\x08\x63urState\x18\x06 \x01(\r*\x19\n\x03\x43MD\x12\x12\n\rCMD_KAFKA_SVR\x10\x89\x61*\xa0\x03\n\x06SUBCMD\x12\x16\n\x12SUBCMD_GPS_GPSDATA\x10\x00\x12\x14\n\x10SUBCMD_GPS_ALARM\x10\x01\x12\x1a\n\x16SUBCMD_GPS_BASESTATION\x10\x02\x12\x14\n\x10SUBCMD_GPS_LOGIN\x10\x03\x12\x15\n\x11SUBCMD_GPS_LOGOUT\x10\x04\x12\x14\n\x10SUBCMD_GPS_SLEEP\x10\x05\x12\x15\n\x11SUBCMD_GPS_ONLINE\x10\x06\x12\x16\n\x12SUBCMD_GPS_VOLTAGE\x10\x07\x12\x17\n\x13SUBCMD_GPS_GPAANDBT\x10\x08\x12\x1b\n\x17SUBCMD_GPS_GPAANDBT_HIS\x10\t\x12\x15\n\x11SUBCMD_GPS_SCANRF\x10\n\x12\x18\n\x14SUBCMD_GPS_ALARM_HIS\x10\x0b\x12\x1b\n\x17SUBCMD_GPS_GSENSOR_DATA\x10\x0c\x12\x18\n\x14SUBCMD_GPS_WIFI_DATA\x10\r\x12\x1c\n\x18SUBCMD_GPS_GSENSOR_DATA2\x10\x0e\x12\x1e\n\x1aSUBCMD_SET_OILELECTRIC_RSP\x10\x0f*2\n\x0bRESULT_CODE\x12\x12\n\x0eRESULT_SUCCESS\x10\x00\x12\x0f\n\x0bRESULT_FAIL\x10\x01\x42\x1d\n\x11\x63om.glsx.kafkasvrB\x08kafkasvr')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kafka_gps_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\021com.glsx.kafkasvrB\010kafkasvr'
_CMD._serialized_start=2675
_CMD._serialized_end=2700
_SUBCMD._serialized_start=2703
_SUBCMD._serialized_end=3119
_RESULT_CODE._serialized_start=3121
_RESULT_CODE._serialized_end=3171
_GPSDATA._serialized_start=35
_GPSDATA._serialized_end=169
_MINIGPSDATA._serialized_start=171
_MINIGPSDATA._serialized_end=265
_ALARMDATA._serialized_start=268
_ALARMDATA._serialized_end=561
_BASESTDATA._serialized_start=563
_BASESTDATA._serialized_end=620
_TRACKDATAREQ._serialized_start=623
_TRACKDATAREQ._serialized_end=779
_BASESTREQ._serialized_start=782
_BASESTREQ._serialized_end=927
_ALARMREQ._serialized_start=930
_ALARMREQ._serialized_end=1158
_STATUSREPORTREQ._serialized_start=1160
_STATUSREPORTREQ._serialized_end=1242
_VOLTAGEREQ._serialized_start=1244
_VOLTAGEREQ._serialized_end=1326
_GPSANDBSREQ._serialized_start=1329
_GPSANDBSREQ._serialized_end=1585
_GPSANDBSANDALARMREQ._serialized_start=1588
_GPSANDBSANDALARMREQ._serialized_end=1897
_GPSSCANRF._serialized_start=1899
_GPSSCANRF._serialized_end=1974
_SENSORDATA._serialized_start=1976
_SENSORDATA._serialized_end=2021
_SENSORDATA2._serialized_start=2023
_SENSORDATA2._serialized_end=2069
_GSENSORINFO._serialized_start=2071
_GSENSORINFO._serialized_end=2183
_GSENSORINFO2._serialized_start=2185
_GSENSORINFO2._serialized_end=2299
_WIFIDATA._serialized_start=2301
_WIFIDATA._serialized_end=2340
_WIFIINFOREQ._serialized_start=2343
_WIFIINFOREQ._serialized_end=2546
_GPS_SETOILELECTRICRSP._serialized_start=2548
_GPS_SETOILELECTRICRSP._serialized_end=2673
# @@protoc_insertion_point(module_scope)
syntax = "proto2";
package protos_journey;
option java_package = "cn.com.glsx.kafka.protocol";
option java_outer_classname = "kafka_journey";
//topic:neshield_journey
message neshield_journey_req
{
required string sn = 1; //设备号
required string beginTime = 3; //行程开始时间,如:2020-03-21 08:53:23
required string beginLng = 4; //行程开始经度,如:118.726725
required string beginLat = 5; //行程开始纬度,如:39.709744
required string endTime = 6; //行程结束时间,如:2020-03-21 08:53:23
required string endLng = 7; //行程结束经度,如:118.726725
required string endLat = 8; //行程结束纬度,如:39.709744
required uint32 mileage = 9; //里程,单位:米,如:4302
};
//topic: track_journey_overspeed
message track_journey_overspeed_req
{
required string sn = 1; //设备号
required string beginTime = 2; //超速开始时间
required string endTime = 3; //超速结束时间
required uint32 duration = 4; //超速时长,以秒为单位',
required double averageSpeed = 5; //超速平均速度,单位km/h',
};
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kafka_journey.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13kafka_journey.proto\x12\x0eprotos_journey\"\x9b\x01\n\x14neshield_journey_req\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x11\n\tbeginTime\x18\x03 \x02(\t\x12\x10\n\x08\x62\x65ginLng\x18\x04 \x02(\t\x12\x10\n\x08\x62\x65ginLat\x18\x05 \x02(\t\x12\x0f\n\x07\x65ndTime\x18\x06 \x02(\t\x12\x0e\n\x06\x65ndLng\x18\x07 \x02(\t\x12\x0e\n\x06\x65ndLat\x18\x08 \x02(\t\x12\x0f\n\x07mileage\x18\t \x02(\r\"u\n\x1btrack_journey_overspeed_req\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x11\n\tbeginTime\x18\x02 \x02(\t\x12\x0f\n\x07\x65ndTime\x18\x03 \x02(\t\x12\x10\n\x08\x64uration\x18\x04 \x02(\r\x12\x14\n\x0c\x61verageSpeed\x18\x05 \x02(\x01\x42+\n\x1a\x63n.com.glsx.kafka.protocolB\rkafka_journey')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kafka_journey_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\032cn.com.glsx.kafka.protocolB\rkafka_journey'
_NESHIELD_JOURNEY_REQ._serialized_start=40
_NESHIELD_JOURNEY_REQ._serialized_end=195
_TRACK_JOURNEY_OVERSPEED_REQ._serialized_start=197
_TRACK_JOURNEY_OVERSPEED_REQ._serialized_end=314
# @@protoc_insertion_point(module_scope)
//***********************************************************************
//* 文件名:kafka_rec.proto
//* 版本记录:
//************************************************************************
syntax = "proto2";
package protos_recordsvr;
option java_package = "cn.com.glsx.ddh.smartcar.queue.proto";
option java_outer_classname = "KafkaRec";
enum CMD
{
CMD_REC_KAFKA_SVR = 0x8089;
CMD_SUBMCD_FILEINFO = 0x3090;
}
enum SUBCMD
{
SUBCMD_REC_UPLOADMEDIA_READY = 0x00; //topic: recsvr_uploadmedia 终端媒体上传完成通知
SUBCMD_REC_LIVEMEDIA_READY = 0x01; //topic: recsvr_livemedia 直播准备就绪
SUBCMD_REC_SCANMEDIA_READY = 0x02; //topic: recsvr_scanmedia 媒体检索完成 1078的
SUBCMD_REC_PALYMEDIA_READY = 0x03; //topic: recsvr_playmedia 媒体回放就绪
SUBCMD_REC_GPSDATA = 0x04; //topic: recsvr_gpsdata 位置点信息、报警数据
SUBCMD_REC_STATUS = 0x05; //topic: recsvr_status 设备状态,登录、登出
SUBCMD_REC_FILE_LIST = 0x06; //topic: recsvr_file_list 检索后的文件id列表 808里的
SUBCMD_REC_GSENSOR_DATA = 0x07; //topic: recsvr_gsensor 设备上报Gsensor数据
///comm_gsensor_data
SUBCMD_REC_QUERY_PARAM = 0x08; //topic: recsvr_query_param 查询参数
SUBCMD_REC_NOTIFY_COLLISION = 0x09; //topic: gps_alarm_notify 到业务端的碰撞报警,仅震动图片推送
SUBCMD_REC_MEDIA_URL = 0x0A; //topic: recsvr_collision_media 震动视频to吴昊宇的视频碰撞检测 (不用了:topic: 3rd_device_onekeyhelpres)
SUBCMD_REC_COLLISION_EVOLUTION = 0x0B; //topic: alarm_collision_evolution 碰撞视频走碰撞评分模型
////comm_collision_data
SUBCMD_REC_MEDIA_URL_TO_WEB = 0x0C; //topic: 3rd_device_onekeyhelpres 也发给web端
SUBCMD_REC_FILEINFO_ALIYUN = 0xCF; //子进程间通讯协议
}
message LocBasic //位置基本信息
{
required uint32 alerttype = 1; //报警类型 大于1为有报警,详见 ALARM_STATE_FLAG
required CarStatus status = 2; //车辆状态
required int32 longitude = 3; //经度,度为单位x10^6
required int32 latitude = 4; //纬度,度为单位x10^6
required int32 altitude = 5; //高程,米为单位
required float speed = 6; //速度,km/h
required int32 direction = 7; //方向,0-359,正北为0
required string clienttime = 8; //触发终端时间
}
message UploadMedia //媒体上传完成通知
{
required string sn = 1;//设备号
required uint32 mediatype = 2;//媒体类型,0:图像 1:音频 2:视频
required uint32 mediaformat = 3;//媒体格式,0:JPEG 1:TIF 2:MP3 3:WAV 4:WMV 5:MP4
required uint32 eventtype = 4;//多媒体事件类型,0:平台下发指令 1:定时动作 2:抢劫报警触发 3:碰撞侧翻报警 4:打开车门 5:关闭车门
required LocBasic location = 5;//位置信息
required string mediaurl = 6;//媒体地址
optional uint32 mediaid = 7;//可选,若存在则表示平台下发的媒体id,用于请求的上下文关联
optional string msgtime = 8; //消息发送kafka时间+
optional uint32 camerano = 9; //摄像头通道,当列表为空,就没有此字段,需要做特殊处理
}
message LiveMediaResult //直播媒体
{
required string sn = 1;//设备号
required uint32 mediaid = 2;//平台下发的媒体id,用于请求的上下文关联
required string mediaurl = 3;//媒体地址
optional LocBasic location = 4;//位置信息
optional string msgtime = 5; //消息发送kafka时间
optional string filedownurl = 6; //文件下载地址
}
message MediaInfo //媒体信息
{
required string begintime = 1;//开始时间
required string endtime = 2;//结束时间
required uint32 alerttype = 3;//报警标志
required uint32 mediatype = 4;//0:音视频,1:音频,2:视频
required uint32 filesize = 5;//文件大小,单位字节(byte)
}
message ScanMediaResult //检索媒体结果
{
required string sn = 1;//设备号
required uint32 mediaid = 2;//平台下发的媒体id,用于请求的上下文关联
repeated MediaInfo medialist = 3;//
optional string msgtime = 4; //消息发送kafka时间
optional uint32 camerano = 5; //摄像头通道,当列表为空,就没有此字段,需要做特殊处理
}
//SUBCMD_REC_FILE_LIST topic: recsvr_file_list 检索后的文件id列表file_list_info
message mediaInfofor808
{
required uint32 fileId = 1; //时间戳
required uint32 mediatype = 2;//0:图像;1:音频;2:视频
required uint32 eventCode = 3;//0:平台下发指令;1:定时动作;2:抢劫报警触发;3:碰撞侧翻报警触发;其他保留
required LocBasic gpsData = 4;//表示拍摄或录制的起始时刻的位置基本信息数据
}
//文件检索结果
message file_list_info
{
required string devicesn = 1;
required uint32 flowid = 2; //应答流水号
required uint32 fileNumber = 3; //文件数量
repeated mediaInfofor808 filelist = 4; //文件id列表
optional string msgtime = 5; //消息发送kafka时间
}
enum ALARM_STATE_FLAG
{
FLAG_URGENT_ALARM = 0x00000001; //bit0 1:紧急报警,触动报警开关后触发
FLAG_OVER_SPEED_ALARM = 0x00000002; //bit1 1:超速报警
FLAG_SLEEPY_DRIVE_ALARM = 0x00000004; //bit2 1:疲劳驾驶
FLAG_DANGER_ALARM = 0x00000008; //bit3 1:危险预警
FLAG_GNSS_MODULE_ALARM = 0x00000010; //bit4 1:GNSS 模块发生故障
FLAG_GNSS_ANTENNA_ALARM = 0x00000020; //bit5 1:GNSS 天线未接或被剪断
FlAG_GNSS_ANTENNA_SHORTOUT_ALARM = 0x00000040; //bit6 1:GNSS 天线短路
FlAG_LOW_POWER_ALARM = 0x00000080; //bit7 1:终端主电源欠压
FlAG_LEAK_POWER_ALARM = 0x00000100; //bit8 1:终端主电源掉电
FlAG_LED_ALARM = 0x00000200; //bit9 1:终端LCD 或显示器故障
FlAG_TTS_MODULE_ALARM = 0x00000400; //bit10 1:TTS 模块故障
FLAG_CAMERA_ALARM = 0x00000800; //bit11 1:摄像头故障
FlAG_ICCARD_ALARM = 0x00001000; //bit12 1:道路运输证IC 卡模块故障
FLAG_OVER_SPEED_EARLY_ALARM = 0x00002000; //bit13 1:超速预警
FLAG_SLEEPY_DRIVE_EARLY_ALARM = 0x00004000; //bit14 1:疲劳驾驶预警
FLAG_RESERVE15 = 0x00008000; //bit15 1:保留
FLAG_RESERVE16 = 0x00010000; //bit16 1:保留
FLAG_RESERVE17 = 0x00020000; //bit17 1:保留
FlAG_DAY_DRIVE_ALARM = 0x00040000; //bit18 1:当天累计驾驶超时
FlAG_OVER_STOP_ALARM = 0x00080000; //bit19 1:超时停车
FlAG_IN_OUT_ROUTE_ALARM = 0x00100000; //bit20 1:进出区域
FlAG_ROUTE_OVER_ALARM = 0x00200000; //bit21 1:进出路线
FLAG_ROUTE_LACKOVER_ALARM = 0x00400000; //bit22 1:路段行驶时间不足/过长
FLAG_ROUTE_EXCURSION_ALARM = 0x00800000; //bit23 1:路线偏离报警
FlAG_VSS_ALARM = 0x01000000; //bit24 1:车辆VSS 故障
FlAG_OIL_ALARM = 0x02000000; //bit25 1:车辆油量异常
FLAG_STOLEN_ALARM = 0x04000000; //bit26 1:车辆被盗(通过车辆防盗器)
FLAG_ILLEGAL_IGNITION_ALARM = 0x08000000; //bit27 1:车辆非法点火
FlAG_ILLEGAL_MOVE_ALARM = 0x10000000; //bit28 1:车辆非法位移
FLAG_IMPACT_ALARM = 0x20000000; //bit29 1:碰撞预警
FLAG_ROLLOVER_ALARM = 0x40000000; //bit30 1:侧翻预警
//FLAG_ILLEGAL_OPENDOOR_ALARM = 0x80000000;//bit31 1:非法开门报警(终端未设置区域时,不判断非法开门)
}
message CarStatus
{
required bool gpsstatus = 1; //0:已卫星定位;1:未卫星定位
optional bool operation = 2; //0:运营状态;1:停运状态
optional bool acc = 3; //0:ACC关;1:ACC开
optional bool oil = 4; //0:车辆油路正常;1:车辆油路断开
optional bool circuit = 5; //0:车辆电路正常;1:车辆电路断开
optional bool doorlock = 6; //0:车门解锁;1:车门加锁
}
message BASESTDATA
{
required uint32 lac = 1; //区号 十进制
required uint32 cellid = 2; //塔号 十进制
required uint32 signal = 3; //信号强度 十进制
}
message BaseStReq {
required string devicesn = 1; //设备标识
required uint32 svrtime = 3; //服务器时间 1970之后的秒数
required uint32 mcc = 4; //国家编码
required uint32 mnc = 5; //运营商编码
required uint32 time = 6; //终端上传时间
repeated BASESTDATA bstdata = 7; //基站数据
}
//topic: recsvr_gpsdata 位置点信息
message GPSDATA {
required string devicesn = 1; //设备号
required int32 longitude = 2; //经度
required int32 latitude = 3; //纬度
required uint32 time = 4; //1970之后的秒数
required uint32 speed = 5; //速度
required uint32 direction = 6; //方向
required uint32 altitude = 7; //高度,海拔
required uint32 alarm_state = 8; //报警状态位 大于1为有报警,详见 ALARM_STATE_FLAG
required CarStatus status = 9; //位置点信息状态数据
required int32 history = 10; // 1为补传数据,0为实时数据
required int32 svrtime = 11; //服务器时间 1970之后的秒数
optional BaseStReq bs_data = 12; //扩展基站数据
optional string task_id = 13; //视频关联id
}
enum DEVICE_STATUS
{
DEVICE_STATUS_LOGIN = 1; //登录
DEVICE_STATUS_LOGOUT = 2; //登出
DEVICE_STATUS_LIVING = 3; //在线
}
//topic: gpsstd_status 登录、登出
message StatusReportReq {
required string devicesn = 1; //设备标识
required uint32 svrtime = 2; //服务器时间 1970之后的秒数
required DEVICE_STATUS state = 3;
}
enum UPDATERESULT
{
RESULT_SAME = 0; //软件版本号一致,无需升级
RESULT_OK = 1; //升级成功
RESULT_FAIL = 2; //升级失败
RESULT_FACID_ERROR = 3; //厂商标识不一致
RESULT_HARDWARE_ERR = 4;//硬件版本号不一致
RESULT_DOWNLOAD_FAIL = 5;//下载升级文件失败
RESULT_SERVER_CANCEL = 6;//升级服务器主动取消升级
RESULT_DEVICE_CANCEL = 7;//设备主动放弃升级(非自身程序)
}
message updateComplete
{
required string devicesn = 1;
required uint32 type = 2;
required uint32 facid = 3;
required uint32 hversion = 4; //硬件版本
required uint32 sversion = 5; //软件版本
required UPDATERESULT result = 6; //结果
optional string msgtime = 7; //消息发送kafka时间
}
message GsensorInfo
{
required string devicesn = 1;
required uint32 svrtime = 2;
required uint32 devicetime = 3;
repeated SensorData gsensor = 4;
}
message SensorData
{
required sint32 x = 1; //带符号的
required sint32 y = 2;
required sint32 z = 3;
}
message ParamUnitRsp
{
required uint32 type = 1; //参数id
optional uint32 intValue = 2;
optional string strValue = 3;
}
//topic: recsvr_query_param 查询参数
message SetParamRsp
{
required string devicesn = 1;
required uint32 flowid = 2; //应答流水号
repeated ParamUnitRsp paramUnit = 3;
}
////////////////////////////////////////////////////
//kafka
//发送包括碰撞告警在内的告警数据通知,供业务使用
//topic: gps_alarm_notify
////////////////////////////////////////////////////
enum GPS_ALARM_TYPE
{
COLLISION_ALARM_TYPE = 0x01; //碰撞告警
LOW_VOLTAGE_ALARM_TYPE = 0x02; //低电压告警
BLACKOUT_ALARM_TYPE = 0x03; //断电告警
PSEUDOBS_ALARM_TYPE = 0x04; //伪基站报警
SEPERATE_ALARM_TYPE = 0x05; //子母分离报警
SHOCK_ALARM_TYPE = 0x06; //震动报警
}
message AlarmNotifyReq {
required string devicesn = 1; //设备标识
required uint32 gpstime = 2; //服务器时间 1970之后的秒数
required int32 longitude = 3; //报警位置:经度
required int32 latitude = 4; //报警位置:纬度
required int32 alarmtype = 5; //告警类型, 定义见GPS_ALARM_TYPE//COLLISION_ALARM_TYPE
required int32 alarmdata = 6; //报警数据
required int32 speed = 7; //报警数据
optional float grange = 8; //gsensor值
optional string gsensors = 9; //gsensor序列
optional float accurate = 10; //准确率
optional string task_id = 11; //视频关联id
}
//topic: 3rd_device_onekeyhelpres 碰撞视频路径推送
message OneKeyHelpRes{
required uint32 mtype = 1; //1的图片,2是视频
required string url = 2;
required string task_id = 3;
optional string result = 4; // 判别结果
optional string video_result = 5; // 视频结果
optional string audio_result = 6; // 音频结果
optional string yolo_path = 7; // YOLO本地路径
optional uint32 camerano = 8; //视频来源通道ID,1是前摄像头,2是后摄像头
}
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kafka_rec.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fkafka_rec.proto\x12\x10protos_recordsvr\"\xb7\x01\n\x08LocBasic\x12\x11\n\talerttype\x18\x01 \x02(\r\x12+\n\x06status\x18\x02 \x02(\x0b\x32\x1b.protos_recordsvr.CarStatus\x12\x11\n\tlongitude\x18\x03 \x02(\x05\x12\x10\n\x08latitude\x18\x04 \x02(\x05\x12\x10\n\x08\x61ltitude\x18\x05 \x02(\x05\x12\r\n\x05speed\x18\x06 \x02(\x02\x12\x11\n\tdirection\x18\x07 \x02(\x05\x12\x12\n\nclienttime\x18\x08 \x02(\t\"\xc8\x01\n\x0bUploadMedia\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x11\n\tmediatype\x18\x02 \x02(\r\x12\x13\n\x0bmediaformat\x18\x03 \x02(\r\x12\x11\n\teventtype\x18\x04 \x02(\r\x12,\n\x08location\x18\x05 \x02(\x0b\x32\x1a.protos_recordsvr.LocBasic\x12\x10\n\x08mediaurl\x18\x06 \x02(\t\x12\x0f\n\x07mediaid\x18\x07 \x01(\r\x12\x0f\n\x07msgtime\x18\x08 \x01(\t\x12\x10\n\x08\x63\x61merano\x18\t \x01(\r\"\x94\x01\n\x0fLiveMediaResult\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x0f\n\x07mediaid\x18\x02 \x02(\r\x12\x10\n\x08mediaurl\x18\x03 \x02(\t\x12,\n\x08location\x18\x04 \x01(\x0b\x32\x1a.protos_recordsvr.LocBasic\x12\x0f\n\x07msgtime\x18\x05 \x01(\t\x12\x13\n\x0b\x66iledownurl\x18\x06 \x01(\t\"g\n\tMediaInfo\x12\x11\n\tbegintime\x18\x01 \x02(\t\x12\x0f\n\x07\x65ndtime\x18\x02 \x02(\t\x12\x11\n\talerttype\x18\x03 \x02(\r\x12\x11\n\tmediatype\x18\x04 \x02(\r\x12\x10\n\x08\x66ilesize\x18\x05 \x02(\r\"\x81\x01\n\x0fScanMediaResult\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x0f\n\x07mediaid\x18\x02 \x02(\r\x12.\n\tmedialist\x18\x03 \x03(\x0b\x32\x1b.protos_recordsvr.MediaInfo\x12\x0f\n\x07msgtime\x18\x04 \x01(\t\x12\x10\n\x08\x63\x61merano\x18\x05 \x01(\r\"t\n\x0fmediaInfofor808\x12\x0e\n\x06\x66ileId\x18\x01 \x02(\r\x12\x11\n\tmediatype\x18\x02 \x02(\r\x12\x11\n\teventCode\x18\x03 \x02(\r\x12+\n\x07gpsData\x18\x04 \x02(\x0b\x32\x1a.protos_recordsvr.LocBasic\"\x8c\x01\n\x0e\x66ile_list_info\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0e\n\x06\x66lowid\x18\x02 \x02(\r\x12\x12\n\nfileNumber\x18\x03 \x02(\r\x12\x33\n\x08\x66ilelist\x18\x04 \x03(\x0b\x32!.protos_recordsvr.mediaInfofor808\x12\x0f\n\x07msgtime\x18\x05 \x01(\t\"n\n\tCarStatus\x12\x11\n\tgpsstatus\x18\x01 \x02(\x08\x12\x11\n\toperation\x18\x02 \x01(\x08\x12\x0b\n\x03\x61\x63\x63\x18\x03 \x01(\x08\x12\x0b\n\x03oil\x18\x04 \x01(\x08\x12\x0f\n\x07\x63ircuit\x18\x05 \x01(\x08\x12\x10\n\x08\x64oorlock\x18\x06 \x01(\x08\"9\n\nBASESTDATA\x12\x0b\n\x03lac\x18\x01 \x02(\r\x12\x0e\n\x06\x63\x65llid\x18\x02 \x02(\r\x12\x0e\n\x06signal\x18\x03 \x02(\r\"\x85\x01\n\tBaseStReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x03 \x02(\r\x12\x0b\n\x03mcc\x18\x04 \x02(\r\x12\x0b\n\x03mnc\x18\x05 \x02(\r\x12\x0c\n\x04time\x18\x06 \x02(\r\x12-\n\x07\x62stdata\x18\x07 \x03(\x0b\x32\x1c.protos_recordsvr.BASESTDATA\"\xa5\x02\n\x07GPSDATA\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x11\n\tlongitude\x18\x02 \x02(\x05\x12\x10\n\x08latitude\x18\x03 \x02(\x05\x12\x0c\n\x04time\x18\x04 \x02(\r\x12\r\n\x05speed\x18\x05 \x02(\r\x12\x11\n\tdirection\x18\x06 \x02(\r\x12\x10\n\x08\x61ltitude\x18\x07 \x02(\r\x12\x13\n\x0b\x61larm_state\x18\x08 \x02(\r\x12+\n\x06status\x18\t \x02(\x0b\x32\x1b.protos_recordsvr.CarStatus\x12\x0f\n\x07history\x18\n \x02(\x05\x12\x0f\n\x07svrtime\x18\x0b \x02(\x05\x12,\n\x07\x62s_data\x18\x0c \x01(\x0b\x32\x1b.protos_recordsvr.BaseStReq\x12\x0f\n\x07task_id\x18\r \x01(\t\"d\n\x0fStatusReportReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12.\n\x05state\x18\x03 \x02(\x0e\x32\x1f.protos_recordsvr.DEVICE_STATUS\"\xa4\x01\n\x0eupdateComplete\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0c\n\x04type\x18\x02 \x02(\r\x12\r\n\x05\x66\x61\x63id\x18\x03 \x02(\r\x12\x10\n\x08hversion\x18\x04 \x02(\r\x12\x10\n\x08sversion\x18\x05 \x02(\r\x12.\n\x06result\x18\x06 \x02(\x0e\x32\x1e.protos_recordsvr.UPDATERESULT\x12\x0f\n\x07msgtime\x18\x07 \x01(\t\"s\n\x0bGsensorInfo\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07svrtime\x18\x02 \x02(\r\x12\x12\n\ndevicetime\x18\x03 \x02(\r\x12-\n\x07gsensor\x18\x04 \x03(\x0b\x32\x1c.protos_recordsvr.SensorData\"-\n\nSensorData\x12\t\n\x01x\x18\x01 \x02(\x11\x12\t\n\x01y\x18\x02 \x02(\x11\x12\t\n\x01z\x18\x03 \x02(\x11\"@\n\x0cParamUnitRsp\x12\x0c\n\x04type\x18\x01 \x02(\r\x12\x10\n\x08intValue\x18\x02 \x01(\r\x12\x10\n\x08strValue\x18\x03 \x01(\t\"b\n\x0bSetParamRsp\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0e\n\x06\x66lowid\x18\x02 \x02(\r\x12\x31\n\tparamUnit\x18\x03 \x03(\x0b\x32\x1e.protos_recordsvr.ParamUnitRsp\"\xd2\x01\n\x0e\x41larmNotifyReq\x12\x10\n\x08\x64\x65vicesn\x18\x01 \x02(\t\x12\x0f\n\x07gpstime\x18\x02 \x02(\r\x12\x11\n\tlongitude\x18\x03 \x02(\x05\x12\x10\n\x08latitude\x18\x04 \x02(\x05\x12\x11\n\talarmtype\x18\x05 \x02(\x05\x12\x11\n\talarmdata\x18\x06 \x02(\x05\x12\r\n\x05speed\x18\x07 \x02(\x05\x12\x0e\n\x06grange\x18\x08 \x01(\x02\x12\x10\n\x08gsensors\x18\t \x01(\t\x12\x10\n\x08\x61\x63\x63urate\x18\n \x01(\x02\x12\x0f\n\x07task_id\x18\x0b \x01(\t\"\x9d\x01\n\rOneKeyHelpRes\x12\r\n\x05mtype\x18\x01 \x02(\r\x12\x0b\n\x03url\x18\x02 \x02(\t\x12\x0f\n\x07task_id\x18\x03 \x02(\t\x12\x0e\n\x06result\x18\x04 \x01(\t\x12\x14\n\x0cvideo_result\x18\x05 \x01(\t\x12\x14\n\x0c\x61udio_result\x18\x06 \x01(\t\x12\x11\n\tyolo_path\x18\x07 \x01(\t\x12\x10\n\x08\x63\x61merano\x18\x08 \x01(\r*8\n\x03\x43MD\x12\x17\n\x11\x43MD_REC_KAFKA_SVR\x10\x89\x81\x02\x12\x18\n\x13\x43MD_SUBMCD_FILEINFO\x10\x90\x61*\xad\x03\n\x06SUBCMD\x12 \n\x1cSUBCMD_REC_UPLOADMEDIA_READY\x10\x00\x12\x1e\n\x1aSUBCMD_REC_LIVEMEDIA_READY\x10\x01\x12\x1e\n\x1aSUBCMD_REC_SCANMEDIA_READY\x10\x02\x12\x1e\n\x1aSUBCMD_REC_PALYMEDIA_READY\x10\x03\x12\x16\n\x12SUBCMD_REC_GPSDATA\x10\x04\x12\x15\n\x11SUBCMD_REC_STATUS\x10\x05\x12\x18\n\x14SUBCMD_REC_FILE_LIST\x10\x06\x12\x1b\n\x17SUBCMD_REC_GSENSOR_DATA\x10\x07\x12\x1a\n\x16SUBCMD_REC_QUERY_PARAM\x10\x08\x12\x1f\n\x1bSUBCMD_REC_NOTIFY_COLLISION\x10\t\x12\x18\n\x14SUBCMD_REC_MEDIA_URL\x10\n\x12\"\n\x1eSUBCMD_REC_COLLISION_EVOLUTION\x10\x0b\x12\x1f\n\x1bSUBCMD_REC_MEDIA_URL_TO_WEB\x10\x0c\x12\x1f\n\x1aSUBCMD_REC_FILEINFO_ALIYUN\x10\xcf\x01*\xf7\x06\n\x10\x41LARM_STATE_FLAG\x12\x15\n\x11\x46LAG_URGENT_ALARM\x10\x01\x12\x19\n\x15\x46LAG_OVER_SPEED_ALARM\x10\x02\x12\x1b\n\x17\x46LAG_SLEEPY_DRIVE_ALARM\x10\x04\x12\x15\n\x11\x46LAG_DANGER_ALARM\x10\x08\x12\x1a\n\x16\x46LAG_GNSS_MODULE_ALARM\x10\x10\x12\x1b\n\x17\x46LAG_GNSS_ANTENNA_ALARM\x10 \x12$\n FlAG_GNSS_ANTENNA_SHORTOUT_ALARM\x10@\x12\x19\n\x14\x46lAG_LOW_POWER_ALARM\x10\x80\x01\x12\x1a\n\x15\x46lAG_LEAK_POWER_ALARM\x10\x80\x02\x12\x13\n\x0e\x46lAG_LED_ALARM\x10\x80\x04\x12\x1a\n\x15\x46lAG_TTS_MODULE_ALARM\x10\x80\x08\x12\x16\n\x11\x46LAG_CAMERA_ALARM\x10\x80\x10\x12\x16\n\x11\x46lAG_ICCARD_ALARM\x10\x80 \x12 \n\x1b\x46LAG_OVER_SPEED_EARLY_ALARM\x10\x80@\x12#\n\x1d\x46LAG_SLEEPY_DRIVE_EARLY_ALARM\x10\x80\x80\x01\x12\x14\n\x0e\x46LAG_RESERVE15\x10\x80\x80\x02\x12\x14\n\x0e\x46LAG_RESERVE16\x10\x80\x80\x04\x12\x14\n\x0e\x46LAG_RESERVE17\x10\x80\x80\x08\x12\x1a\n\x14\x46lAG_DAY_DRIVE_ALARM\x10\x80\x80\x10\x12\x1a\n\x14\x46lAG_OVER_STOP_ALARM\x10\x80\x80 \x12\x1d\n\x17\x46lAG_IN_OUT_ROUTE_ALARM\x10\x80\x80@\x12\x1c\n\x15\x46lAG_ROUTE_OVER_ALARM\x10\x80\x80\x80\x01\x12 \n\x19\x46LAG_ROUTE_LACKOVER_ALARM\x10\x80\x80\x80\x02\x12!\n\x1a\x46LAG_ROUTE_EXCURSION_ALARM\x10\x80\x80\x80\x04\x12\x15\n\x0e\x46lAG_VSS_ALARM\x10\x80\x80\x80\x08\x12\x15\n\x0e\x46lAG_OIL_ALARM\x10\x80\x80\x80\x10\x12\x18\n\x11\x46LAG_STOLEN_ALARM\x10\x80\x80\x80 \x12\"\n\x1b\x46LAG_ILLEGAL_IGNITION_ALARM\x10\x80\x80\x80@\x12\x1f\n\x17\x46lAG_ILLEGAL_MOVE_ALARM\x10\x80\x80\x80\x80\x01\x12\x19\n\x11\x46LAG_IMPACT_ALARM\x10\x80\x80\x80\x80\x02\x12\x1b\n\x13\x46LAG_ROLLOVER_ALARM\x10\x80\x80\x80\x80\x04*\\\n\rDEVICE_STATUS\x12\x17\n\x13\x44\x45VICE_STATUS_LOGIN\x10\x01\x12\x18\n\x14\x44\x45VICE_STATUS_LOGOUT\x10\x02\x12\x18\n\x14\x44\x45VICE_STATUS_LIVING\x10\x03*\xbe\x01\n\x0cUPDATERESULT\x12\x0f\n\x0bRESULT_SAME\x10\x00\x12\r\n\tRESULT_OK\x10\x01\x12\x0f\n\x0bRESULT_FAIL\x10\x02\x12\x16\n\x12RESULT_FACID_ERROR\x10\x03\x12\x17\n\x13RESULT_HARDWARE_ERR\x10\x04\x12\x18\n\x14RESULT_DOWNLOAD_FAIL\x10\x05\x12\x18\n\x14RESULT_SERVER_CANCEL\x10\x06\x12\x18\n\x14RESULT_DEVICE_CANCEL\x10\x07*\xa7\x01\n\x0eGPS_ALARM_TYPE\x12\x18\n\x14\x43OLLISION_ALARM_TYPE\x10\x01\x12\x1a\n\x16LOW_VOLTAGE_ALARM_TYPE\x10\x02\x12\x17\n\x13\x42LACKOUT_ALARM_TYPE\x10\x03\x12\x17\n\x13PSEUDOBS_ALARM_TYPE\x10\x04\x12\x17\n\x13SEPERATE_ALARM_TYPE\x10\x05\x12\x14\n\x10SHOCK_ALARM_TYPE\x10\x06\x42\x30\n$cn.com.glsx.ddh.smartcar.queue.protoB\x08KafkaRec')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'kafka_rec_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n$cn.com.glsx.ddh.smartcar.queue.protoB\010KafkaRec'
_CMD._serialized_start=2650
_CMD._serialized_end=2706
_SUBCMD._serialized_start=2709
_SUBCMD._serialized_end=3138
_ALARM_STATE_FLAG._serialized_start=3141
_ALARM_STATE_FLAG._serialized_end=4028
_DEVICE_STATUS._serialized_start=4030
_DEVICE_STATUS._serialized_end=4122
_UPDATERESULT._serialized_start=4125
_UPDATERESULT._serialized_end=4315
_GPS_ALARM_TYPE._serialized_start=4318
_GPS_ALARM_TYPE._serialized_end=4485
_LOCBASIC._serialized_start=38
_LOCBASIC._serialized_end=221
_UPLOADMEDIA._serialized_start=224
_UPLOADMEDIA._serialized_end=424
_LIVEMEDIARESULT._serialized_start=427
_LIVEMEDIARESULT._serialized_end=575
_MEDIAINFO._serialized_start=577
_MEDIAINFO._serialized_end=680
_SCANMEDIARESULT._serialized_start=683
_SCANMEDIARESULT._serialized_end=812
_MEDIAINFOFOR808._serialized_start=814
_MEDIAINFOFOR808._serialized_end=930
_FILE_LIST_INFO._serialized_start=933
_FILE_LIST_INFO._serialized_end=1073
_CARSTATUS._serialized_start=1075
_CARSTATUS._serialized_end=1185
_BASESTDATA._serialized_start=1187
_BASESTDATA._serialized_end=1244
_BASESTREQ._serialized_start=1247
_BASESTREQ._serialized_end=1380
_GPSDATA._serialized_start=1383
_GPSDATA._serialized_end=1676
_STATUSREPORTREQ._serialized_start=1678
_STATUSREPORTREQ._serialized_end=1778
_UPDATECOMPLETE._serialized_start=1781
_UPDATECOMPLETE._serialized_end=1945
_GSENSORINFO._serialized_start=1947
_GSENSORINFO._serialized_end=2062
_SENSORDATA._serialized_start=2064
_SENSORDATA._serialized_end=2109
_PARAMUNITRSP._serialized_start=2111
_PARAMUNITRSP._serialized_end=2175
_SETPARAMRSP._serialized_start=2177
_SETPARAMRSP._serialized_end=2275
_ALARMNOTIFYREQ._serialized_start=2278
_ALARMNOTIFYREQ._serialized_end=2488
_ONEKEYHELPRES._serialized_start=2491
_ONEKEYHELPRES._serialized_end=2648
# @@protoc_insertion_point(module_scope)
//***********************************************************************
//* 文件名:stay_often.proto
//* 版本记录:
//************************************************************************
message stayOften {
required string sn = 1; //设备号
optional string homeaddress = 2; //预测家庭地址
optional string homelng = 3; //家庭地址经度,23.234234
optional string homelat = 4; //家庭地址纬度
optional string workaddress = 5; //预测工作地址
optional string worklng=6; //工作地址经度
optional string worklat=7; //工作地址纬度
optional string time=8; //推送数据时间 2024-03-20 16:21:03
}
message deviceOfflineIsFalseOrBuilder{
required string sn = 1;//设备号
required string vin = 2;//车架号
required string uploadtime = 3; //上传时间
required string datastatus = 4; //数据状态(0:正常、1代表结束)
}
\ No newline at end of file \ No newline at end of file
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: stay_often.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import builder as _builder
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10stay_often.proto\"\x93\x01\n\tstayOften\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x13\n\x0bhomeaddress\x18\x02 \x01(\t\x12\x0f\n\x07homelng\x18\x03 \x01(\t\x12\x0f\n\x07homelat\x18\x04 \x01(\t\x12\x13\n\x0bworkaddress\x18\x05 \x01(\t\x12\x0f\n\x07worklng\x18\x06 \x01(\t\x12\x0f\n\x07worklat\x18\x07 \x01(\t\x12\x0c\n\x04time\x18\x08 \x01(\t\"`\n\x1d\x64\x65viceOfflineIsFalseOrBuilder\x12\n\n\x02sn\x18\x01 \x02(\t\x12\x0b\n\x03vin\x18\x02 \x02(\t\x12\x12\n\nuploadtime\x18\x03 \x02(\t\x12\x12\n\ndatastatus\x18\x04 \x02(\t')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'stay_often_pb2', globals())
if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
_STAYOFTEN._serialized_start=21
_STAYOFTEN._serialized_end=168
_DEVICEOFFLINEISFALSEORBUILDER._serialized_start=170
_DEVICEOFFLINEISFALSEORBUILDER._serialized_end=266
# @@protoc_insertion_point(module_scope)
protoc --python_out=./ *.proto
#安装一个protoc,版本3.20.0-rc2
\ No newline at end of file \ No newline at end of file
#!/usr/bin/env python
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
import sys
import pprint
if sys.version_info[0] > 2:
from urllib.parse import urlparse
else:
from urlparse import urlparse
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
from hbase import THBaseService
from hbase.ttypes import *
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print('')
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
print('')
print('Functions:')
print(' bool exists(string table, TGet tget)')
print(' existsAll(string table, tgets)')
print(' TResult get(string table, TGet tget)')
print(' getMultiple(string table, tgets)')
print(' void put(string table, TPut tput)')
print(' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut tput)')
print(' void putMultiple(string table, tputs)')
print(' void deleteSingle(string table, TDelete tdelete)')
print(' deleteMultiple(string table, tdeletes)')
print(' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete tdelete)')
print(' TResult increment(string table, TIncrement tincrement)')
print(' TResult append(string table, TAppend tappend)')
print(' i32 openScanner(string table, TScan tscan)')
print(' getScannerRows(i32 scannerId, i32 numRows)')
print(' void closeScanner(i32 scannerId)')
print(' void mutateRow(string table, TRowMutations trowMutations)')
print(' getScannerResults(string table, TScan tscan, i32 numRows)')
print(' THRegionLocation getRegionLocation(string table, string row, bool reload)')
print(' getAllRegionLocations(string table)')
print(' bool checkAndMutate(string table, string row, string family, string qualifier, TCompareOp compareOp, string value, TRowMutations rowMutations)')
print(' TTableDescriptor getTableDescriptor(TTableName table)')
print(' getTableDescriptors( tables)')
print(' bool tableExists(TTableName tableName)')
print(' getTableDescriptorsByPattern(string regex, bool includeSysTables)')
print(' getTableDescriptorsByNamespace(string name)')
print(' getTableNamesByPattern(string regex, bool includeSysTables)')
print(' getTableNamesByNamespace(string name)')
print(' void createTable(TTableDescriptor desc, splitKeys)')
print(' void deleteTable(TTableName tableName)')
print(' void truncateTable(TTableName tableName, bool preserveSplits)')
print(' void enableTable(TTableName tableName)')
print(' void disableTable(TTableName tableName)')
print(' bool isTableEnabled(TTableName tableName)')
print(' bool isTableDisabled(TTableName tableName)')
print(' bool isTableAvailable(TTableName tableName)')
print(' bool isTableAvailableWithSplit(TTableName tableName, splitKeys)')
print(' void addColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)')
print(' void deleteColumnFamily(TTableName tableName, string column)')
print(' void modifyColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)')
print(' void modifyTable(TTableDescriptor desc)')
print(' void createNamespace(TNamespaceDescriptor namespaceDesc)')
print(' void modifyNamespace(TNamespaceDescriptor namespaceDesc)')
print(' void deleteNamespace(string name)')
print(' TNamespaceDescriptor getNamespaceDescriptor(string name)')
print(' listNamespaceDescriptors()')
print('')
sys.exit(0)
pp = pprint.PrettyPrinter(indent=2)
host = 'localhost'
port = 9090
uri = ''
framed = False
ssl = False
validate = True
ca_certs = None
keyfile = None
certfile = None
http = False
argi = 1
if sys.argv[argi] == '-h':
parts = sys.argv[argi + 1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
argi += 2
if sys.argv[argi] == '-u':
url = urlparse(sys.argv[argi + 1])
parts = url[1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
else:
port = 80
uri = url[2]
if url[4]:
uri += '?%s' % url[4]
http = True
argi += 2
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
framed = True
argi += 1
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
ssl = True
argi += 1
if sys.argv[argi] == '-novalidate':
validate = False
argi += 1
if sys.argv[argi] == '-ca_certs':
ca_certs = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-keyfile':
keyfile = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-certfile':
certfile = sys.argv[argi+1]
argi += 2
cmd = sys.argv[argi]
args = sys.argv[argi + 1:]
if http:
transport = THttpClient.THttpClient(host, port, uri)
else:
if ssl:
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
else:
socket = TSocket.TSocket(host, port)
if framed:
transport = TTransport.TFramedTransport(socket)
else:
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol(transport)
client = THBaseService.Client(protocol)
transport.open()
if cmd == 'exists':
if len(args) != 2:
print('exists requires 2 args')
sys.exit(1)
pp.pprint(client.exists(args[0], eval(args[1]),))
elif cmd == 'existsAll':
if len(args) != 2:
print('existsAll requires 2 args')
sys.exit(1)
pp.pprint(client.existsAll(args[0], eval(args[1]),))
elif cmd == 'get':
if len(args) != 2:
print('get requires 2 args')
sys.exit(1)
pp.pprint(client.get(args[0], eval(args[1]),))
elif cmd == 'getMultiple':
if len(args) != 2:
print('getMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.getMultiple(args[0], eval(args[1]),))
elif cmd == 'put':
if len(args) != 2:
print('put requires 2 args')
sys.exit(1)
pp.pprint(client.put(args[0], eval(args[1]),))
elif cmd == 'checkAndPut':
if len(args) != 6:
print('checkAndPut requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndPut(args[0], args[1], args[2], args[3], args[4], eval(args[5]),))
elif cmd == 'putMultiple':
if len(args) != 2:
print('putMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.putMultiple(args[0], eval(args[1]),))
elif cmd == 'deleteSingle':
if len(args) != 2:
print('deleteSingle requires 2 args')
sys.exit(1)
pp.pprint(client.deleteSingle(args[0], eval(args[1]),))
elif cmd == 'deleteMultiple':
if len(args) != 2:
print('deleteMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.deleteMultiple(args[0], eval(args[1]),))
elif cmd == 'checkAndDelete':
if len(args) != 6:
print('checkAndDelete requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndDelete(args[0], args[1], args[2], args[3], args[4], eval(args[5]),))
elif cmd == 'increment':
if len(args) != 2:
print('increment requires 2 args')
sys.exit(1)
pp.pprint(client.increment(args[0], eval(args[1]),))
elif cmd == 'append':
if len(args) != 2:
print('append requires 2 args')
sys.exit(1)
pp.pprint(client.append(args[0], eval(args[1]),))
elif cmd == 'openScanner':
if len(args) != 2:
print('openScanner requires 2 args')
sys.exit(1)
pp.pprint(client.openScanner(args[0], eval(args[1]),))
elif cmd == 'getScannerRows':
if len(args) != 2:
print('getScannerRows requires 2 args')
sys.exit(1)
pp.pprint(client.getScannerRows(eval(args[0]), eval(args[1]),))
elif cmd == 'closeScanner':
if len(args) != 1:
print('closeScanner requires 1 args')
sys.exit(1)
pp.pprint(client.closeScanner(eval(args[0]),))
elif cmd == 'mutateRow':
if len(args) != 2:
print('mutateRow requires 2 args')
sys.exit(1)
pp.pprint(client.mutateRow(args[0], eval(args[1]),))
elif cmd == 'getScannerResults':
if len(args) != 3:
print('getScannerResults requires 3 args')
sys.exit(1)
pp.pprint(client.getScannerResults(args[0], eval(args[1]), eval(args[2]),))
elif cmd == 'getRegionLocation':
if len(args) != 3:
print('getRegionLocation requires 3 args')
sys.exit(1)
pp.pprint(client.getRegionLocation(args[0], args[1], eval(args[2]),))
elif cmd == 'getAllRegionLocations':
if len(args) != 1:
print('getAllRegionLocations requires 1 args')
sys.exit(1)
pp.pprint(client.getAllRegionLocations(args[0],))
elif cmd == 'checkAndMutate':
if len(args) != 7:
print('checkAndMutate requires 7 args')
sys.exit(1)
pp.pprint(client.checkAndMutate(args[0], args[1], args[2], args[3], eval(args[4]), args[5], eval(args[6]),))
elif cmd == 'getTableDescriptor':
if len(args) != 1:
print('getTableDescriptor requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptor(eval(args[0]),))
elif cmd == 'getTableDescriptors':
if len(args) != 1:
print('getTableDescriptors requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptors(eval(args[0]),))
elif cmd == 'tableExists':
if len(args) != 1:
print('tableExists requires 1 args')
sys.exit(1)
pp.pprint(client.tableExists(eval(args[0]),))
elif cmd == 'getTableDescriptorsByPattern':
if len(args) != 2:
print('getTableDescriptorsByPattern requires 2 args')
sys.exit(1)
pp.pprint(client.getTableDescriptorsByPattern(args[0], eval(args[1]),))
elif cmd == 'getTableDescriptorsByNamespace':
if len(args) != 1:
print('getTableDescriptorsByNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptorsByNamespace(args[0],))
elif cmd == 'getTableNamesByPattern':
if len(args) != 2:
print('getTableNamesByPattern requires 2 args')
sys.exit(1)
pp.pprint(client.getTableNamesByPattern(args[0], eval(args[1]),))
elif cmd == 'getTableNamesByNamespace':
if len(args) != 1:
print('getTableNamesByNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.getTableNamesByNamespace(args[0],))
elif cmd == 'createTable':
if len(args) != 2:
print('createTable requires 2 args')
sys.exit(1)
pp.pprint(client.createTable(eval(args[0]), eval(args[1]),))
elif cmd == 'deleteTable':
if len(args) != 1:
print('deleteTable requires 1 args')
sys.exit(1)
pp.pprint(client.deleteTable(eval(args[0]),))
elif cmd == 'truncateTable':
if len(args) != 2:
print('truncateTable requires 2 args')
sys.exit(1)
pp.pprint(client.truncateTable(eval(args[0]), eval(args[1]),))
elif cmd == 'enableTable':
if len(args) != 1:
print('enableTable requires 1 args')
sys.exit(1)
pp.pprint(client.enableTable(eval(args[0]),))
elif cmd == 'disableTable':
if len(args) != 1:
print('disableTable requires 1 args')
sys.exit(1)
pp.pprint(client.disableTable(eval(args[0]),))
elif cmd == 'isTableEnabled':
if len(args) != 1:
print('isTableEnabled requires 1 args')
sys.exit(1)
pp.pprint(client.isTableEnabled(eval(args[0]),))
elif cmd == 'isTableDisabled':
if len(args) != 1:
print('isTableDisabled requires 1 args')
sys.exit(1)
pp.pprint(client.isTableDisabled(eval(args[0]),))
elif cmd == 'isTableAvailable':
if len(args) != 1:
print('isTableAvailable requires 1 args')
sys.exit(1)
pp.pprint(client.isTableAvailable(eval(args[0]),))
elif cmd == 'isTableAvailableWithSplit':
if len(args) != 2:
print('isTableAvailableWithSplit requires 2 args')
sys.exit(1)
pp.pprint(client.isTableAvailableWithSplit(eval(args[0]), eval(args[1]),))
elif cmd == 'addColumnFamily':
if len(args) != 2:
print('addColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.addColumnFamily(eval(args[0]), eval(args[1]),))
elif cmd == 'deleteColumnFamily':
if len(args) != 2:
print('deleteColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.deleteColumnFamily(eval(args[0]), args[1],))
elif cmd == 'modifyColumnFamily':
if len(args) != 2:
print('modifyColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.modifyColumnFamily(eval(args[0]), eval(args[1]),))
elif cmd == 'modifyTable':
if len(args) != 1:
print('modifyTable requires 1 args')
sys.exit(1)
pp.pprint(client.modifyTable(eval(args[0]),))
elif cmd == 'createNamespace':
if len(args) != 1:
print('createNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.createNamespace(eval(args[0]),))
elif cmd == 'modifyNamespace':
if len(args) != 1:
print('modifyNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.modifyNamespace(eval(args[0]),))
elif cmd == 'deleteNamespace':
if len(args) != 1:
print('deleteNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.deleteNamespace(args[0],))
elif cmd == 'getNamespaceDescriptor':
if len(args) != 1:
print('getNamespaceDescriptor requires 1 args')
sys.exit(1)
pp.pprint(client.getNamespaceDescriptor(args[0],))
elif cmd == 'listNamespaceDescriptors':
if len(args) != 0:
print('listNamespaceDescriptors requires 0 args')
sys.exit(1)
pp.pprint(client.listNamespaceDescriptors())
else:
print('Unrecognized method %s' % cmd)
sys.exit(1)
transport.close()
This diff could not be displayed because it is too large.
__all__ = ['ttypes', 'constants', 'THBaseService']
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
#
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec
import sys
from .ttypes import *
This diff could not be displayed because it is too large.
#!/usr/bin/python
# -*- coding:utf-8 -*-
import random
import re
import sys
import time
import traceback
from datetime import date, datetime
import pandas as pd
import pymysql
from kafka import KafkaProducer
from kafka.errors import KafkaError
from thrift.protocol import TBinaryProtocol
from thrift.transport import THttpClient
import Ice
from kafka_protobuffer.black_abnormal_pb2 import KafkaSecondData, abnormalAndBlackRegion
from kafka_protobuffer.fence_pb2 import FakeOfflineInfo, TriggerInfoResp
from kafka_protobuffer.fsp_offline_pb2 import FspResp
from kafka_protobuffer.gps_alarm_ntofiy_pb2 import AlarmNotifyReq, OnekeyHelp
from kafka_protobuffer.kafka_ddbox_pb2 import ClientTerminalType, EventStateReportReq
from kafka_protobuffer.kafka_device_state_pb2 import DeviceStateReq
from kafka_protobuffer.kafka_gps_pb2 import (
AlarmReq,
BaseStReq,
GPSAndBSReq,
TrackDataReq,
WifiInfoReq,
)
from kafka_protobuffer.kafka_journey_pb2 import (
neshield_journey_req,
track_journey_overspeed_req,
)
from kafka_protobuffer.kafka_rec_pb2 import OneKeyHelpRes
from kafka_protobuffer.stay_often_pb2 import deviceOfflineIsFalseOrBuilder, stayOften
# 下面的模块通过 thrift --gen py hbase.thrift 来生成
from myhbase import THBaseService
from myhbase.ttypes import (
TColumn,
TColumnFamilyDescriptor,
TColumnValue,
TGet,
TNamespaceDescriptor,
TPut,
TScan,
TTableDescriptor,
TTableName,
)
Ice.loadSlice("--all -I.. ice/bsd.ice")
Ice.loadSlice("--all -I.. ice/Hdao_gps.ice")
import HDaoGps
# ice的环境ip
env_host = "192.168.3.101"
# env_host = "192.168.5.27"
# 测试环境db
testConn = pymysql.Connect(
host="192.168.3.222",
port=3307,
user="root",
passwd="Msd^*$@online",
db="neshield",
charset="utf8",
)
# 线上frms
# frmsDBconn = pymysql.Connect(host='192.168.5.24', port=3306, user='biz_neshield_tmp',passwd='TmM6IJAr', db='neshield', charset='utf8')
frmsDBconn = pymysql.Connect(
host="47.115.150.194",
port=3307,
user="user_chenqj",
passwd="MtWSIfaf",
db="gps",
charset="utf8",
)
def getDeviceInfo():
devList = []
cursor = frmsDBconn.cursor()
sql = f"select sn from t_vehicle_device where bind_status = 1 and del_flag = 0;"
cursor.execute(sql)
result = cursor.fetchall()
for item in result:
sn = item[0]
devList.append(sn)
return devList
def getDeviceInfo_pingan():
devList = []
cursor = frmsDBconn.cursor()
sql = "select distinct(dti.sn) from d_vehicle dv, d_track_info dti,d_class dc where dti.vehicleId = dv.vehicleId and dc.classid = dv.classId and dv.status = 0 and dc.vehicleGroupId in (402) AND dti.source = 0 ;"
cursor.execute(sql)
result = cursor.fetchall()
for item in result:
sn = item[0]
devList.append(sn)
return devList
# 高效率的生产者模块
# from confluent_kafka import Producer,Consumer
# p = Producer(
# {
# 'bootstrap.servers': 'qc131:9092',
# 'session.timeout.ms': 30000,
# 'auto.offset.reset': 'earliest',
# 'api.version.request': False,
# 'broker.version.fallback': '0.8.1.1',
# 'group.id': 'python-producer'
# }
# )
class gpsInfo:
def __init__(self, sn="", lng=0.0, lat=0.0, gpsTime=0, speed=0):
self.sn = sn
self.lng = lng
self.lat = lat
self.gpsTime = gpsTime
self.speed = speed
# gps_gpsdata_change,device_state_change,gps_basestation_change,gps_gpsandbs_change
def connect_hbase():
headers = {}
url = "http://haoop-22:2181"
# 线上内网
# url = "http://ld-wz9qs00b91uucde9j-proxy-hbaseue.hbaseue.rds.aliyuncs.com:9190"
transport = THttpClient.THttpClient(url)
headers["ACCESSKEYID"] = "root"
# 密码
headers["ACCESSSIGNATURE"] = "root"
transport.setCustomHeaders(headers)
protocol = TBinaryProtocol.TBinaryProtocolAccelerated(transport)
client = THBaseService.Client(protocol)
transport.open()
return client
# GPS、GPRS最新连接时间
def latestGPSTime(connection, tableName, sn):
gpsData = gpsInfo(sn)
tableInbytes = "default:" + tableName # 表,行,dataFrame,转化输出
tableInbytes = tableInbytes.encode("utf8")
row_start = "05-000" + str(sn)
row_stop = "05-000" + str(sn)
if len(sn) > 10:
row_start = "05-00" + sn
row_stop = "05-00" + sn
scan = TScan(
startRow=row_start.encode("utf8"), stopRow=row_stop.encode("utf8"), limit=1
)
currentResults = connection.getScannerResults(tableInbytes, scan, 1)
try:
a = currentResults[0]
except:
return "nan"
b = str(a).split("TColumnValue")
for val in b:
if "gpsTime" in val:
gpsData.gpsTime = re.search("value=b'(.*)'", val).group(1)
elif "longitude" in val:
gpsData.lng = re.search("value=b'(.*)'", val).group(1)
elif "latitude" in val:
gpsData.lat = re.search("value=b'(.*)'", val).group(1)
elif "speed" in val:
gpsData.speed = re.search("value=b'(.*)'", val).group(1)
return gpsData
def producer_demo(SerializeToString, broker, topic, partition):
try:
producer = KafkaProducer(
bootstrap_servers=[broker],
api_version=(0, 8, 1, 1),
# batch_size=16384*10,linger_ms=500
)
# future = producer.send(topic,value=SerializeToString,partition=partition) # 向分区0发送消息
future = producer.send(topic, value=SerializeToString)
print(f"{broker} {topic} {partition} send {SerializeToString}")
producer.flush()
future.get(timeout=1) # 监控是否发送成功
except KafkaError: # 发送失败抛出kafka_errors
print(traceback.format_exc())
def sendGpsForHbaseLastGps(sn):
connection = connect_hbase()
info = latestGPSTime(connection, "gps_recent", sn)
req = TrackDataReq()
req.devicesn = info.sn
req.facid = "glsx"
req.svrtime = int(datetime.now().timestamp())
gpsdata = req.gpsdata.add()
gpsdata.longitude = int(float(info.lng) * 100000)
gpsdata.latitude = int(float(info.lat) * 100000)
gpsdata.time = int(datetime.now().timestamp())
# gpsdata.time = int(datetime.now().timestamp()-random.randint(0,60*60*24))
gpsdata.speed = int(gpsdata.speed)
gpsdata.direction = 0
gpsdata.alt = 0
gpsdata.valid = "A"
producer_demo(req.SerializeToString(), "qc131:9092", "gps_gpsdata_change", 11)
def getGpsByLatesBsList(sn, type=5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23469"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
rsp = printer.getGpsByLatestBsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
return rsp
except:
traceback.print_exc()
return None
def getLatestBsRecord(sn, type=5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23469"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = printer.getLatestBsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
return rsp
except:
traceback.print_exc()
return None
# 取线上最后位置点和最后基站推送到测试环境上。todo
def SendKafkaForLastGpsAndBsByHdao(sn, broker):
gps = getGpsByLatesBsList(sn)
lbs = getLatestBsRecord(sn)
if sn[0:2] == "16":
send_gpsdata(sn, broker=broker)
send_gps_basestation(sn, broker=broker)
# 公司
# 113.986543
# 22.590440
def send_gpsdata(
sn,
broker="192.168.5.17:9093",
topic="gps_gpsdata_pingan",
partition=0,
battery=0,
lng=0.0,
lat=0.0,
gpstime=0,
valid="A",
):
req = TrackDataReq()
req.devicesn = sn
req.facid = "glsx"
req.svrtime = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
gpsdata = req.gpsdata.add()
# req.longitude = int(114.023952 * 1000000)
# req.latitude = int(22.611863 * 1000000)
gpsdata.longitude = (
int(114.023952 * 1000000 + random.randrange(0, 10000))
if lng == 0
else int(lng * 1000000)
)
gpsdata.latitude = (
int(22.611863 * 1000000 + random.randrange(0, 10000))
if lat == 0
else int(lat * 1000000)
)
# gpsdata.longitude = 113987688
# gpsdata.latitude = 22591266
gpsdata.time = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
# gpsdata.time = int(datetime.now().timestamp()-random.randint(0,60*60*24))
gpsdata.speed = 0
gpsdata.direction = 0
gpsdata.alt = 0
gpsdata.valid = valid
if battery != 0:
req.battery = battery
# producer_demo(req.SerializeToString(), 'qc131:9092', 'gps_gpsdata', 0)
producer_demo(req.SerializeToString(), broker, topic, partition)
def send_gpsdata_random(
sn, broker, topic, partition, leftLng, leftlat, rightLng, rightlat
):
req = TrackDataReq()
req.devicesn = sn
req.facid = "glsx"
req.svrtime = int(datetime.now().timestamp())
gpsdata = req.gpsdata.add()
gpsdata.longitude = int(random.uniform(leftLng, rightLng) * 1000000)
gpsdata.latitude = int(random.uniform(leftlat, rightlat) * 1000000)
gpsdata.time = int(datetime.now().timestamp())
gpsdata.speed = 0
gpsdata.direction = 0
gpsdata.alt = 0
gpsdata.valid = "A"
req.battery = 100
# producer_demo(req.SerializeToString(), 'qc131:9092', 'gps_gpsdata', 0)
producer_demo(req.SerializeToString(), broker, topic, partition)
def sendAlarmForSn(
sn, broker="192.168.5.17:9093", topic="gps_alarm_pingan", partition=0
):
req = AlarmReq()
req.devicesn = sn
req.facid = "bsj"
req.svrtime = int(datetime.now().timestamp())
req.gpsdata.longitude = 116586830
req.gpsdata.latitude = 39642445
req.gpsdata.time = int(datetime.now().timestamp())
req.gpsdata.speed = 0
req.gpsdata.valid = "A"
req.alarmdata.overspeed = 0
req.alarmdata.lowervol = 0
req.alarmdata.blackout = 1
req.alarmdata.flipalarm = 1
req.alarmdata.gpsopen = 0
req.alarmdata.rob = 0
req.alarmdata.info = "ffffffff"
req.alarmdata.demolition = 0
req.voltage = "12V"
# req.alarmdata.lightalarm = 1
# req.history=0
req.history = 0
producer_demo(req.SerializeToString(), broker, topic, partition)
def sendfence_alarm(sn, broker="qc131:9092", topic="gps_fence_alarm", partition=0):
req = TriggerInfoResp()
req.triggerInfo.devicesn = sn
req.triggerInfo.fenceId = 1012354
req.triggerInfo.svcSystemId = 5
if topic == "gps_fence_alarm_neshield":
req.triggerInfo.svcSystemId = 14
req.triggerInfo.triggerType = 1
req.triggerInfo.locInfoType = 1
req.triggerInfo.triggerTime = int(datetime.now().timestamp())
req.triggerInfo.triggerLoc.gpsloc.lng = 113992356
req.triggerInfo.triggerLoc.gpsloc.lat = 22588124
req.triggerInfo.triggerLoc.time = int(datetime.now().timestamp())
req.triggerInfo.triggerLoc.speed = 0
req.triggerInfo.triggerLoc.direction = 0
req.triggerInfo.triggerLoc.alt = 0
req.triggerInfo.triggerLoc.valid = "A"
req.triggerInfo.merchantName = "手动触发报警"
req.triggerInfo.merchantType = 1
req.triggerInfo.enterTime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
req.triggerInfo.outTime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
req.triggerInfo.alarmType = 1
producer_demo(req.SerializeToString(), broker, topic, partition)
# 192.168.5.17:9093 gps_fence_alarm_gl 0 561063061370563 1 10007931 10007931-hgm耀美竟店 "2024-01-04 09:00:00" "2024-01-04 12:00:00" 5000
def sendfence_alarm_remind(
broker,
topic,
partition,
sn,
alarmType,
fenceId,
merchatName,
bTime,
endTime,
mileage,
):
req = TriggerInfoResp()
req.triggerInfo.devicesn = sn
req.triggerInfo.fenceId = fenceId
req.triggerInfo.svcSystemId = fenceId
req.triggerInfo.triggerType = 0
req.triggerInfo.locInfoType = 1
req.triggerInfo.triggerTime = int(datetime.now().timestamp())
req.triggerInfo.triggerLoc.gpsloc.lng = 113992356
req.triggerInfo.triggerLoc.gpsloc.lat = 22588124
req.triggerInfo.triggerLoc.time = int(datetime.now().timestamp())
req.triggerInfo.triggerLoc.speed = 0
req.triggerInfo.triggerLoc.direction = 0
req.triggerInfo.triggerLoc.alt = 0
req.triggerInfo.triggerLoc.valid = "A"
req.triggerInfo.merchantName = merchatName
req.triggerInfo.merchantType = 1
req.triggerInfo.enterTime = bTime
req.triggerInfo.outTime = endTime
req.triggerInfo.alarmType = alarmType
producer_demo(req.SerializeToString(), broker, topic, partition)
def sendDeviceState(sn, broker="qc131:9092", partition=0):
req = DeviceStateReq()
req.devicesn = sn
# 设备状态:1.停止 3.行驶
req.state = 1
req.statebegintime = 1642406662 # int(datetime.now().timestamp())
str = req.SerializeToString()
producer_demo(str, broker, "device_state", partition)
def sendFakeInfo(sn, merchantType, broker="qc131:9092", partition=0):
req = FakeOfflineInfo()
req.devicesn = sn
req.fenceId = 1000001
req.svcSystemId = 1
req.triggerType = 1 # 驶入或驶出(1.驶入 2.驶出)
req.locInfoType = 1 # 定位信息类型(1.gps 2.基站)
req.triggerTime = int(datetime.now().timestamp())
req.triggerLoc.gpsloc.lng = 113987688
req.triggerLoc.gpsloc.lat = 22591266
req.triggerLoc.time = int(datetime.now().timestamp())
req.triggerLoc.speed = 0
req.triggerLoc.direction = 276
req.triggerLoc.alt = 30
req.triggerLoc.valid = "A"
if merchantType == 1:
req.merchantName = "家庭"
else:
req.merchantName = "公司"
req.merchantType = merchantType # 围栏类型(1家庭,2公司)
req.enterTime = "2022-03-30 20:43:16"
req.outTime = "2022-03-30 20:53:16"
req.alarmType = 1 # 流失预警或其他(1.流失预警 3.到店提醒 其它)
req.addr = "深圳市南山区崇文园区1栋"
str = req.SerializeToString()
producer_demo(str, broker, "fence_fake_offline", partition)
def sendblack_abnormal_area_alarm(sn, type=3, broker="qc131:9092", partition=0):
req = abnormalAndBlackRegion()
req.sn = sn
req.aggkey = "GL29527"
req.alarmaddress = "北京市大兴区朱庄村"
req.alarmtime = "2022-10-12 20:27:16"
req.alarmtype = type
req.status = 1 # 当前设备状态 1:已恢复 2:未恢复
req.lng = 116.586830
req.lat = 39.642445
req.leaveTime = "2022-10-13 20:27:16"
req.poiType = "餐饮服务"
str = req.SerializeToString()
if type == 3:
print("type==3")
producer_demo(str, broker, "black_abnormal_area_alarm", partition)
elif type == 2:
print("type==2")
producer_demo(str, broker, "black_abnormal_area_alarm", partition)
else:
print("type must be 2 or 3")
def sendGpsAndBs(
sn,
broker="192.168.5.17:9093",
topic="gps_gpsandbs_pingan",
partition=0,
valid="A",
time=None,
):
req = GPSAndBSReq()
req.devicesn = sn
if time:
req.svrtime = int(datetime.strptime(time, "%Y-%m-%d %H:%M:%S").timestamp())
else:
req.svrtime = int(datetime.now().timestamp())
req.gpsdata.longitude = 111629640
req.gpsdata.latitude = 38257276
if time:
req.gpsdata.time = int(datetime.strptime(time, "%Y-%m-%d %H:%M:%S").timestamp())
else:
req.gpsdata.time = int(datetime.now().timestamp())
req.gpsdata.speed = 0
req.gpsdata.valid = valid
req.gpsdata.direction = 0
req.gpsdata.alt = 0
req.mcc = 460
req.mnc = 0
req.bscnt = 1
# bstdata.lac = 8514 #9472
bstdata = req.bstdata.add()
# bstdata.cellid = 61269 #175267082
bstdata.lac = 18267
bstdata.cellid = 57061
bstdata.signal = 66
req.num = 10
req.voltage = "12V"
str = req.SerializeToString()
# producer_demo(str, 'qc131:9092', 'gps_gpsandbs_pingan', 0)
producer_demo(str, broker, topic, partition)
def send_gps_basestation(
sn,
broker="192.168.5.17:9093",
topic="gps_basestation_pingan",
partition=0,
gpstime=0,
):
req = BaseStReq()
req.devicesn = sn
req.facid = "glsx"
req.svrtime = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
req.mcc = 460
req.mnc = 0
req.time = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
bsData = req.bstdata.add()
# bsData.lac = 32797
# bsData.cellid = 14814
bsData.lac = 18267
bsData.cellid = 57061
bsData.signal = 66
# for i in range(0,4):
bsData = req.bstdata.add()
bsData.lac = 18267
bsData.cellid = 57061
# bsData.lac = 17155
# bsData.cellid = 1592
bsData.signal = 16
bsData = req.bstdata.add()
bsData.lac = 18267
bsData.cellid = 57061
bsData.signal = 15
bsData = req.bstdata.add()
bsData.lac = 18267
bsData.cellid = 57061
bsData.signal = 14
bsData = req.bstdata.add()
bsData.lac = 18267
bsData.cellid = 57061
bsData.signal = 10
# str = req.SerializeToString()
# producer_demo(str, 'qc131:9092', 'gps_basestation_pingan', 0)
producer_demo(req.SerializeToString(), broker, topic, partition)
def send_second_data(sn, broker="qc131:9092", topic="seconddata", partition=0):
req = KafkaSecondData()
req.sn = sn
req.second_type = "1"
req.second_name = "1-test"
req.second_alarm_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
req.second_alarm_address = "深圳市南山区留仙大道3370号南山智园崇文园"
req.second_leave_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
req.second_stay_time = "30"
req.second_id = "1202551"
req.second_stay_longitude = "116.586830"
req.second_stay_latitude = "39.642445"
req.eventTime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
producer_demo(req.SerializeToString(), broker, topic, partition)
def send_enshield_journey(
sn, broker="qc131:9092", topic="e_nshield_journey", partition=0
):
req = neshield_journey_req()
req.sn = sn
req.beginTime = "2020-03-21 08:53:23"
req.beginLng = "118.725543"
req.beginLat = "39.711040"
req.endTime = "2020-03-21 09:04:18"
req.endLng = "118.726725"
req.endLat = "39.709744"
req.mileage = 4302
producer_demo(req.SerializeToString(), broker, topic, partition)
def send_overSpeed(
sn, broker="qc131:9092", topic="track_journey_overspeed", partition=0
):
req = track_journey_overspeed_req()
req.sn = sn
req.beginTime = datetime.fromtimestamp(datetime.now().timestamp() - 86400).strftime(
"%Y-%m-%d %H:%M:%S"
)
req.endTime = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
req.duration = 86400
req.averageSpeed = 90
producer_demo(req.SerializeToString(), broker, topic, partition)
g_count = 0
def send_overSpeed_byhbase(connection, sn, startkey, endkey):
cursor = testConn.cursor()
sql = "insert into t_device_speeding_history(sn,begin_time,end_time,duration,average_speed)values"
tableInbytes = "default:unified_overspeed"
tableInbytes = tableInbytes.encode("utf8")
key = str(sn)
row_start = "05-00000000" + str(sn)
row_stop = "05-00000000" + str(sn)
while len(key) < 18:
key = f"0{key}"
row_start = f"05-{key}-{startkey}"
row_stop = f"05-{key}-{endkey}"
scan = TScan(
startRow=row_start.encode("utf8"), stopRow=row_stop.encode("utf8"), limit=1
)
global g_count
currentResults = connection.getScannerResults(tableInbytes, scan, 9999)
bFrist = True
try:
for a in currentResults:
b = str(a).split("TColumnValue")
averageSpeed = 0
beginTime = ""
duration = 0
endTime = ""
for val in b:
if "averageSpeed" in val:
averageSpeed = re.search("value=b'(.*)'", val).group(1)
# elif 'beginLat' in val:
# beginLat = re.search("value=b'(.*)'", val).group(1)
# elif 'beginLng' in val:
# beginLng = re.search("value=b'(.*)'", val).group(1)
elif "beginTime" in val:
beginTime = re.search("value=b'(.*)'", val).group(1)
elif "duration" in val:
duration = re.search("value=b'(.*)'", val).group(1)
# elif 'endLat' in val:
# elif 'endLng' in val:
elif "endTime" in val:
endTime = re.search("value=b'(.*)'", val).group(1)
# elif 'sn' in val:
# elif 'type' in val:
if bFrist is False:
sql += ","
sql += f"('{sn}','{beginTime}','{endTime}',{duration},{averageSpeed})"
bFrist = False
g_count = g_count + 1
print(g_count)
# req = track_journey_overspeed_req()
# req.sn = sn
# req.beginTime = beginTime
# req.endTime = endTime
# req.duration = duration
# req.averageSpeed = averageSpeed
# producer_demo(req.SerializeToString(), "192.168.5.17:9093", "track_journey_overspeed", int(sn)%32)
try:
cursor.execute(sql)
testConn.commit()
except:
# print(sql)
testConn.rollback()
except:
return "nan"
return
def writeFlameout_ignition_event(userid, sn, broker, topic):
req = EventStateReportReq()
req.userid = 81604091
req.devicesn = sn
req.time = 1656899700
req.svrtime = int(datetime.now().timestamp())
req.longitude = 118726725 # crossGps.m_longitude * 1000000);
req.latitude = 39709744
req.clientType = ClientTerminalType.Value("GPSDevice")
producer_demo(req.SerializeToString(), broker, topic, 0) # int(req.devicesn)%32
def set_gps_alarm_collision(sn, broker, topic, partition, task_id=""):
req = AlarmNotifyReq()
req.devicesn = sn
# req.gpstime = int(datetime.now().timestamp()) #int(datetime.strptime("2022-07-25 13:46:48","%Y-%m-%d %H:%M:%S").timestamp())
req.gpstime = 1704359929
req.longitude = 113988560 # int(116.420536 * 1000000)
req.latitude = 22591316 # int(39.735016 * 1000000)
# req.longitude = int(114.023952 * 1000000)
# req.latitude = int(22.611863 * 1000000)
req.alarmtype = 6 # 1 if topic == "gps_alarm_collision" else 6
req.alarmdata = 1
req.speed = 0
# req.grange = 35.24
# req.accurate = 0.36
# if topic == "gps_alarm_notify":
req.task_id = task_id
producer_demo(
req.SerializeToString(), broker, topic, partition
) # int(req.devicesn)%32
def send_OnekeyHelp(sn, broker, topic, partition, taskId):
req = OnekeyHelp()
req.imei = sn
req.troubletype = "SOS"
req.troubletime = int(datetime.now().timestamp())
req.longitude = 116426835
req.latitude = 39736356
req.task_id = taskId # sn+f"{int(datetime.now().timestamp())}"
producer_demo(req.SerializeToString(), broker, topic, partition)
def send_OneKeyHelpRes(task_id, broker, topic, partition):
req = OneKeyHelpRes()
req.mtype = 2
req.url = (
"https://newvod.didihu.com.cn/sv/688ffb4-183457d8200/688ffb4-183457d8200.mp4"
)
req.task_id = task_id
req.result = "1"
req.video_result = "car"
req.audio_result = "0"
req.yolo_path = "http://img01.glsx.com.cn/collision-detect/invalid/352538107531892-1663318176-6.mp4"
producer_demo(req.SerializeToString(), broker, topic, partition)
kafka_broker_test = "192.168.3.131:9092"
kafka_broker_upload = "192.168.5.17:9093"
def getGpsByLatesBsList(sn, type):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
"HDaoGpsSvc:default -h 192.168.3.101 -p 23469"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
rsp = printer.getGpsByLatestBsRecord(req)
print(rsp[1].gps.gpsTime)
print(rsp)
return rsp[1].gps
except:
traceback.print_exc()
return None
def send_gps_wifi_data(sn, broker, topic, partition, gpstime=0):
req = WifiInfoReq()
req.type = 5
req.devicesn = sn
req.gpstime = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
req.svrtime = int(datetime.now().timestamp()) if gpstime == 0 else gpstime
wifidata = req.data.add()
wifidata.mac = "54:CE:82:0D:96:F0"
wifidata.single = 66
wifidata = req.data.add()
wifidata.mac = "34:85:11:36:19:B2"
wifidata.single = 66
req.mcc = 460
req.mnc = 0
req.bscnt = 2
bsData = req.bstdata.add()
bsData.lac = 2
bsData.cellid = 234
bsData.signal = 66
bsData = req.bstdata.add()
bsData.lac = 18267
bsData.cellid = 57061
bsData.signal = 10
producer_demo(
req.SerializeToString(), broker, topic, partition
) # int(req.devicesn)%32
def add_gps_by_bs(sn):
gps = getGpsByLatesBsList(sn, 5)
if gps is None or gps.lng is None or gps.lat is None:
print("Unable to convert bs to gps")
return None
# if len(gps.lng)==0 or len(gps.lat) == 0:
# print("Unable to convert bs to gps")
# return None
# int(sn)%32
send_gpsdata(
sn,
kafka_broker_test,
"gps_gpsdata",
0,
0,
gps.lng / 1000000.0,
gps.lat / 1000000.0,
gps.gpsTime,
)
def send_gps_resideinfo_gl(sn, kafka_broker_test, topic, partition):
req = FspResp()
req.calcType = 1
req.cycleFspInfo.userMatchInfo.userId = sn
req.cycleFspInfo.userMatchInfo.apType = 11
req.cycleFspInfo.userMatchInfo.addrMatchResult = 1
req.cycleFspInfo.userMatchInfo.registerLocation = "114.025974,22.546054"
# ResideExtendInfo
resideInfos = req.cycleFspInfo.userMatchInfo.resideInfos.add()
resideInfos.location = "114.025974,22.546054"
resideInfos.address = "广联测试地址"
resideInfos.distance = 100
resideInfos.totalStayDuration = 30
resideInfos.totalStayTimes = 30
req.cycleFspInfo.userMatchInfo.status = 0
req.cycleFspInfo.userMatchInfo.beginTime = int(
datetime.strptime("2024-01-01 16:05:22", "%Y-%m-%d %H:%M:%S").timestamp()
)
req.cycleFspInfo.userMatchInfo.endTime = int(
datetime.strptime("2024-01-09 16:05:22", "%Y-%m-%d %H:%M:%S").timestamp()
)
req.cycleFspInfo.userMatchInfo.merchantCode = 44217985
req.cycleFspInfo.userMatchInfo.merchantName = "耀美测试门店"
producer_demo(
req.SerializeToString(), kafka_broker_test, topic, partition
) # int(req.devicesn)%32
# 警情中心
def send_warn_topic(vin, sn):
"""
standno,name,sns,warnlevel,warntime,warnname,warnadvice,riskdetail
LBERCACB8CX364905|赵亚华|4170421141;|3|2023-05-20 03:31:06|有线设备离线|建议核实用车情况,若非人为因素造成离线建议安排检修|2023-03-19 15:09:46,后长时间停留;2023-03-27 03:31:06,后有线设备离线;2023-03-27 03:31:06,有线设备离线
"""
senddata = f"{vin}|赵亚华|{sn}|3|2023-05-20 03:31:06|有线设备离线|建议核实用车情况,若非人为因素造成离线建议安排检修|2023-03-19 15:09:46,后长时间停留;2023-03-27 03:31:06,后有线设备离线;2023-03-27 03:31:06,有线设备离线"
producer_demo(senddata.encode("utf-8"), "kafka-241:9095", "warn_topic", 0)
def send_stayOften(sn, time):
"""
'1500528578' sn,
'广东省深圳市南山区兴海公园' homeaddress,
'113.88208' homelng,
'22.496796' homelat,
'广东省深圳市宝安区飞腾螺丝制造厂' workaddress,
'113.889305' worklng,
'22.727425' worklat,
'2024-03-19 17:00:42' time
"""
req = stayOften()
req.sn = sn
req.homeaddress = "广东省深圳市南山区兴海公园"
req.homelng = "113.88208"
req.homelat = "22.496796"
req.workaddress = "广东省深圳市宝安区飞腾螺丝制造厂"
req.worklng = "113.889305"
req.worklat = "22.727425"
req.time = time #'2024-03-19 17:00:42'
producer_demo(req.SerializeToString(), kafka_broker_test, "HomeLocationInfo", 0)
def send_deviceOfflineIsFalse(sn):
req = deviceOfflineIsFalseOrBuilder()
req.sn = sn
req.vin = "LBERCACB8CX364905"
req.uploadtime = datetime.now().strftime(
"%Y-%m-%d %H:%M:%S"
) # "2024-03-20 17:47:02"
req.datastatus = "0".encode("utf8")
producer_demo(
req.SerializeToString(), kafka_broker_test, "device_offline_is_false", 0
)
def write_hbase(tablename, sn):
hbase_connect = connect_hbase()
# import happybase
# # 连接到HBase服务器
# connection = happybase.Connection(host='192.168.2.22')
# # 使用表,如果表不存在则创建
# table = connection.table(tablename)
# # 插入数据,模拟HBase Shell的put命令
# # 参数分别为:行键,列族:列限定符,值
# table.put(f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}",
# {
# 'info:fstResideDuration': '216655', 'info:fstResideLoc': '106.729400,35.519368',
# 'info:fstResideTimes': '3', 'info:month': f"{datetime.now().strftime('%Y-%m')}",
# 'info:sn': f'{sn}', 'info:sndResideDuration': '76323',
# 'info:sndResideLoc': '106.742784,35.514584', 'info:sndResideTimes': '2',
# 'info:trdResideDuration': '10083', 'info:trdResideLoc': '106.694488,35.532780',
# 'info:trdResideTimes': '2', 'info:type': '05'
# })
# # 关闭连接
# connection.close()
if tablename == "month_reside":
put_request = TPut(
row=f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}",
columnValues=TColumnValue(
family=b"info", qualifier=b"fstResideDuration", value=b"216655"
),
)
hbase_connect.put(tablename, put_request)
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:fstResideDuration","216655"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:fstResideLoc","106.729400,35.519368"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:fstResideTimes","3"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:month",f"{datetime.now().strftime('%Y-%m')}"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:sn",f"{sn}"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:sndResideDuration","76323"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:sndResideLoc","106.742784,35.514584"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:sndResideTimes","2"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:trdResideDuration","10083"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:trdResideLoc","106.694488,35.532780"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:trdResideTimes","2"})
# hbase_connect.put(tablename,{f"05-{sn.rjust(18,'0')}-{datetime.now().strftime('%Y%m')}","info:type","05"})
elif tablename == "unified_stay":
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:beginTime",
"2020-05-26 15:33:01",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:endTime",
"2020-05-26 16:02:03",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:latitude",
"22.950992",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:longitude",
"115.658808",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:sn",
f"{sn}",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:stayDuration",
"1742",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:storageTime",
"2020-05-27 09:49:45",
},
)
hbase_connect.put(
tablename,
{
f"05-{sn.rjust(14,'0')}-{datetime.now().strftime('%Y%m%d%H%M%S')}",
"info:type",
"05",
},
)
# end def
# leftLngLat: 114.084144,22.544716
# rightLngLat: 114.089438,22.549212
snList = ["96230816016", "93230817002"]
m = 8
def fun_gpsandbs(param):
for i in range(100):
sendGpsAndBs(
sn="1700112234",
broker=kafka_broker_test,
topic="gps_gpsandbs_pingan2",
partition=param % 8,
valid="V",
)
m -= 1
if __name__ == "__main__":
# 批量造少量数据
# import threading
# plist = []
# for i in range(8):
# t = threading.Thread(target=fun_gpsandbs,args=(i,)).start()
# plist.append(t)
# while m > 0 :
# time.sleep(1)
# 往hbase写数据,不可用
# write_hbase("month_reside",'1570921400')
# write_hbase("unified_stay",'1570921452')
# 列表中的sn,随机范围内造点
# for sn in snList:
# send_gpsdata_random(sn,kafka_broker_test,'gps_gpsdata',0,113.988821,22.585199,113.994255,22.589695)
# 取表格里的数据造公司的位置点
# df = pd.read_excel("设备.xlsx")
# for i in df.index:
# if pd.isnull(df.loc[i, 'sn']) is False:
# sn = str(df.loc[i, 'sn'])
# # sendGpsAndBs(sn,kafka_broker_test,'gps_gpsandbs')
# send_gpsdata(sn,kafka_broker_test,'gps_gpsdata')
# df = pd.read_excel("352538107575238_行车轨迹.xls")
# for i in df.index:
# send_gpsdata("8705281635", kafka_broker_test, 'gps_gpsdata',1,0,float(df.loc[i,'经度']),float(df.loc[i,'纬度']),
# int(datetime.strptime(f"{df.loc[i,'时间']}","%Y-%m-%d %H:%M:%S").timestamp()))
# print(df.loc[i,'时间'])
# 取表里的没有gps点的设备造数据
# df = pd.read_excel("离线报警报表20221208175510.xlsx")
# df['设备号'] = df['设备号'].astype(str)
# for i in df.columns:
# print(i)
# for i in df.index:
# # if pd.isnull(df.loc[i,'最后Gps时间']) is True:
# send_gpsdata(df.loc[i,'设备号'],kafka_broker_test,'gps_gpsdata',0,0,0,0,gpstime=1669737600)
# 取线上最新位置点
# sendGpsForHbaseLastGps("97111240026")
# for sn in snList:
# send_gpsdata(sn=sn,broker=kafka_broker_test,topic='gps_gpsdata',partition=0,valid='V')
# sendGpsAndBs(sn, kafka_broker_test, 'gps_gpsandbs')
# 从线上获取平安设备的最后位置点推送到测试平安topic
# deviceList = getDeviceInfo_pingan()
# sum = len(deviceList)
# count = 0
# if sum > 0:
# for sn in deviceList:
# count = count + 1
# print(f"{count}/{sum}")
# if sn[0:2] == "16" or sn[0:2] == '93':
# send_gpsdata(sn=sn,broker=kafka_broker_test,topic='gps_gpsdata',lng=113.665105,lat=22.864977,valid='A')
# send_gpsdata(sn=sn,broker=kafka_broker_test,topic='gps_gpsdata_pingan',lng=113.665105,lat=22.864977,valid='A')
# send_gps_basestation(sn, kafka_broker_test, topic='gps_basestation', partition=0)
# send_gps_basestation(sn, kafka_broker_test, topic='gps_basestation_pingan', partition=0)
# else:
# sendGpsAndBs(sn=sn, broker=kafka_broker_test, topic='gps_gpsandbs', partition=0,valid='A')
# sendGpsAndBs(sn=sn, broker=kafka_broker_test, topic='gps_gpsandbs_pingan', partition=0, valid='A')
# 有基站,补gps
# add_gps_by_bs('1620831629')
# sendGpsAndBs(sn='1570921451', broker=kafka_broker_test, topic='gps_gpsandbs',partition=0,valid='A')
# sendGpsAndBs(sn='1700112234', broker=kafka_broker_test, topic='gps_gpsandbs_pingan2',partition=0,valid='V')
# sendGpsAndBs(sn='96312070449', broker=kafka_broker_upload, topic='gps_gpsandbs', partition=17,valid='V')
# sendGpsAndBs(sn='76307260003', broker=kafka_broker_upload, topic='gps_gpsandbs', partition=3,valid='V')
# sendGpsAndBs(sn='96210200001', broker=kafka_broker_upload, topic='gps_gpsandbs_pingan', partition=1,valid='V')
# sendGpsAndBs(sn='76307260003', broker=kafka_broker_upload, topic='gps_gpsandbs_pingan', partition=3,valid='V')
# sendGpsAndBs(sn='96230819110', broker=kafka_broker_test, topic='gps_gpsandbs', partition=0,valid='A',time='2023-09-15 16:23:21')
# sendGpsAndBs(sn='96230819112', broker=kafka_broker_test, topic='gps_gpsandbs', partition=0,valid='A',time='2023-09-15 12:23:21')
# sendGpsAndBs(sn='96230818132', broker=kafka_broker_test, topic='gps_gpsandbs', partition=0,valid='V',time='2023-09-18 10:22:00')
# sendGpsAndBs(sn='91266600002', broker=kafka_broker_test, topic='gps_gpsandbs', partition=0,valid='A',time='2023-11-13 17:15:47')
# sendGpsAndBs(sn='96230816019', broker=kafka_broker_test, topic='gps_gpsandbs_pingan', partition=0, valid='A')
# 模拟GPS
# send_gpsdata(sn="45212100445",broker=kafka_broker_test,topic='gps_gpsdata',lng=113.665105,lat=22.864977,gpstime=1701406905,valid='A')
# send_gpsdata(sn="93210200002",broker=kafka_broker_test,topic='gps_gpsdata',lng=114.080818,lat=22.549684,gpstime=1698038505,valid='A')
# send_gpsdata(sn="93210200002", broker=kafka_broker_test, topic='gps_gpsdata', lng=113.665105, lat=22.864977,gpstime=1698218505, valid='A')
# send_gpsdata(sn="93230817003", broker=kafka_broker_test, topic='gps_gpsdata_pingan', lng=113.665105, lat=22.864977,valid='V')
# send_gpsdata(sn="1620831629",broker=kafka_broker_test,topic='gps_gpsdata',lng=121.395166,lat=42.579883,valid='A',gpstime=1699861099)
# send_gpsdata(sn="96210200001",broker=kafka_broker_test,topic='gps_gpsdata_pingan',lng=113.987220,lat=22.591398,valid='A')
# send_gpsdata("15212060318", kafka_broker_upload, 'gps_gpsdata', 30)
# for sn in snList:
# send_gpsdata(sn, kafka_broker_test, 'gps_gpsdata', 0)
# 基站
# send_gps_basestation("96210200001",kafka_broker_upload,'gps_basestation',1)
# send_gps_basestation("76307260003",kafka_broker_upload,'gps_basestation',3)
# send_gps_basestation("1620831629", kafka_broker_test, 'gps_basestation', 0,gpstime=1699861099)
# send_gps_basestation("93230817004", kafka_broker_test, 'gps_basestation_pingan', 0)
# send_gps_basestation("45212100445", kafka_broker_test, 'gps_basestation', 0)
# wifi
# send_gps_wifi_data("1570921451", kafka_broker_test, "gps_wifi_data", 0)
# sendGpsAndBs("1700112234",kafka_broker_test,'gps_gpsandbs',0)
# 报警,断电,光感
# sendAlarmForSn("1570921451", kafka_broker_test, 'gps_alarm', 0)
# sendAlarmForSn("1610553581",kafka_broker_test,'gps_alarm_pingan',0)
# 十日内反复在状态变化
# send_deviceOfflineIsFalse("1570921451")
# 设备行程
# send_enshield_journey("1570921451", kafka_broker_test, "neshield_journey_new")
# 滴加常住地
# send_gps_resideinfo_gl(561063060087135,kafka_broker_test,'gps_resideinfo_gl',0)
# snlist = ["21400000003"]
# for sn in snlist:
# print(sn)
# timestamp = int(datetime.now().timestamp())
# set_gps_alarm_collision(sn, kafka_broker_test, 'gps_alarm_collision', 0,
# task_id=f"{sn}-{timestamp}-6")
# send_OnekeyHelp(sn, kafka_broker_test, '3rd_device_onekeyhelp', 0, f"{sn}-{timestamp}-6")
# send_OneKeyHelpRes(f"{sn}-{timestamp}-6",kafka_broker_test,'3rd_device_onekeyhelpres',0)
# SOS一键救援
# send_OnekeyHelp('561063061370563',kafka_broker_test,'3rd_device_onekeyhelp',0,"561063061370563-1704359928-6")
# 碰撞事件
# set_gps_alarm_collision('76307260003',kafka_broker_upload,'alarm_collision_evolution',0)
# set_gps_alarm_collision('561063060087135', kafka_broker_test, 'gps_alarm_collision', 0,task_id="561063060087135-1704693492-6")
# set_gps_alarm_collision('8705281658', kafka_broker_test, 'gps_alarm_collision', 0)
# 震动
# set_gps_alarm_collision('561063061370563',kafka_broker_test,'gps_alarm_notify',0,"561063061370563-1704359929-6")
# 记录仪碰撞
# send_OneKeyHelpRes("561063060087135-1704693492-6",kafka_broker_test,'3rd_device_onekeyhelpres',0)
# 围栏 gps_fence_alarm
# sendfence_alarm("1610553581")
# sendfence_alarm("1700000006",'192.168.3.241:9092','gps_fence_alarm_neshield')
# 流失
# sendfence_alarm_remind("192.168.5.17:9093","gps_fence_alarm_gl", 0,
# "561063061370563", 1, 10007931, "10007931-hgm耀美竟店",
# "2024-01-04 09:00:00", "2024-01-04 12:00:00", 5000)
# 到店
# sendfence_alarm_remind("192.168.5.17:9093","gps_fence_alarm_gl", 0,
# "561063061370563", 3, 44211559, "44211559-hgm耀美门店",
# "2024-01-04 09:00:00", "2024-01-04 12:00:00", 5000)
# device_state
# sendDeviceState("1700151515")
# 家庭和工作地,1是家庭,2是公司
# sendFakeInfo('1700112234',2)
# sendFakeInfo('63008100265',2,kafka_broker_upload,0)
# 1黑区,type=2:异常聚集报警 3:新黑区报警
# sendblack_abnormal_area_alarm("1570921451", type=2)
# sendblack_abnormal_area_alarm("1570921451", type=3)
# 二压点报警
# send_second_data('1501204612')
# 给新E盾推送行程数据
# send_enshield_journey('1700112234')
# 推送超速报警
# send_overSpeed('17001122334')
# 推送新e盾的所有有线设备的超速内容
# devList = getDeviceInfo()
# connection = connect_hbase()
# # print(len(devList))
# sum = 0
# for sn in devList:
# sum=sum+1
# send_overSpeed_byhbase(connection,sn,"20220101000000","20220531000000")
# print(f"snList= {sum}/{len(devList)}")
# 点熄火 gps_ignition gps_flameout
# writeFlameout_ignition_event(userid=,sn="561063061370563",broker=kafka_broker_test,topic="edr_ignition")
# writeFlameout_ignition_event(userid=,sn="561063061370563",broker=kafka_broker_upload, topic="edr_flameout")
# 推送警情
# send_warn_topic('LXAS490942B1AA10S','1570921451,')
# 推送预测家庭地址和预测工作地址
# send_stayOften("1570921451", "2024-03-19 17:00:42")
# sendFakeInfo('1570921451',1)
# sendFakeInfo('1570921451',2)
print("end")
def getStayPointRecords(args):
str = """
put 'unified_stay','05-00001570921451-20240319153301','info:beginTime','2024-03-19 15:33:01'
put 'unified_stay','05-00001570921451-20240319153301','info:endTime','2024-03-19 16:02:03'
put 'unified_stay','05-00001570921451-20240319153301','info:latitude','22.950992'
put 'unified_stay','05-00001570921451-20240319153301','info:longitude','115.658808'
put 'unified_stay','05-00001570921451-20240319153301','info:sn','1570921451'
put 'unified_stay','05-00001570921451-20240319153301','info:stayDuration','1740'
put 'unified_stay','05-00001570921451-20240319153301','info:storageTime','2024-03-19 09:49:45'
put 'unified_stay','05-00001570921451-20240319153301','info:type','05'
"""
return str
def getFsp(args):
str = """
put 'month_reside','05-000000001570921451-202403','info:fstResideDuration','216655'
put 'month_reside','05-000000001570921451-202403','info:fstResideLoc','106.729400,35.519368'
put 'month_reside','05-000000001570921451-202403','info:fstResideTimes','3'
put 'month_reside','05-000000001570921451-202403','info:month','2024-03'
put 'month_reside','05-000000001570921451-202403','info:sn','1570921451'
put 'month_reside','05-000000001570921451-202403','info:sndResideDuration','76323'
put 'month_reside','05-000000001570921451-202403','info:sndResideLoc','106.742784,35.514584'
put 'month_reside','05-000000001570921451-202403','info:sndResideTimes','2'
put 'month_reside','05-000000001570921451-202403','info:trdResideDuration','10083'
put 'month_reside','05-000000001570921451-202403','info:trdResideLoc','106.694488,35.532780'
put 'month_reside','05-000000001570921451-202403','info:trdResideTimes','2'
put 'month_reside','05-000000001570921451-202403','info:type','05'
"""
return str
if __name__ == "__main__":
getStayPointRecords()
getFsp()
#!/usr/bin/python
# -*- coding:utf-8 -*-
import sys
import traceback
import pandas as pd
import Ice
Ice.loadSlice("--all -I.. ice/bsd.ice")
Ice.loadSlice("--all -I.. ice/Hdao_gps.ice")
Ice.loadSlice("--all -I.. --underscore ice/district.ice")
Ice.loadSlice("--all -I.. --underscore ice/ipoi.ice")
Ice.loadSlice("--all -I.. --underscore ice/HDao_mile.ice")
Ice.loadSlice("--all -I.. --underscore ice/fsp_online.ice")
import datetime
import FspOnline
import HDaoGps
import HDaoMile
import pymysql
import BaseStationData
import DISTRICT
import POI
fmrsDBConn = pymysql.Connect(
host="192.168.5.24",
port=3306,
user="biz_neshield_tmp",
passwd="TmM6IJAr",
db="neshield",
charset="utf8",
)
env_host = "192.168.3.101"
# env_host = "192.168.5.31"
# env_host = "192.168.5.26"
print("env:", env_host)
def get_distdetail_by_pos(lng, lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"DistrictFinder:default -h {env_host} -p 10008"
)
obj.ice_ping()
printer = DISTRICT.IDistrictFinderPrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
rsp = printer.get_distdetail_by_pos(lng, lat)
print(rsp)
return rsp
except:
traceback.print_exc()
return None
def getGpsByBs(mnc, lac, cellid):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"BsdObjectId:default -h {env_host} -p 10945"
)
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsDataReq()
# bsData = BaseStationData.BsData()
req.bs.mnc = int(mnc)
req.bs.lac = int(lac)
req.bs.cellid = int(cellid)
rsp = printer.GetGpsByBs(req)
print(rsp)
# print(rsp[1].gps.addr)
return rsp[1].gps.addr
except:
traceback.print_exc()
def getGpsByBsList():
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"BsdObjectId:default -h {env_host} -p 10945"
)
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsDataListReq()
bsList = []
# BsData = BaseStationData.BsData()
# BsData.mnc = 0
# BsData.lac = 1
# BsData.cellid = 6
# bsList.append(BsData)
for i in range(6):
BsData = BaseStationData.BsData()
BsData.mnc = 0
BsData.lac = 9278
BsData.cellid = 2
bsList.append(BsData)
req.bsList = bsList
rsp = BaseStationData.BsDataResp()
rsp = printer.GetGpsByBsList(req)
print(rsp)
except:
traceback.print_exc()
def getGpsRecords(sn, starttime, endtime):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23470"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.GpsGetRequest()
req.userID = sn
req.apType = 5
req.extraMapReq = 0
req.startTime = int(
datetime.datetime.strptime(starttime, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.endTime = int(
datetime.datetime.strptime(endtime, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.reqCount = 2000
rsp = printer.getGpsRecords(req)
print(rsp)
except:
traceback.print_exc()
def getGpsByLatestBsRecord(sn, type):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23469"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
rsp = printer.getGpsByLatestBsRecord(req)
print(rsp[1].gps.gpsTime)
print(rsp)
except:
traceback.print_exc()
def getLatestBsRecord(sn, type=5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23470"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = printer.getLatestBsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
except:
traceback.print_exc()
def getLatestGpsRecord(sn, type=5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23470"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestGpsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = printer.getLatestGpsRecord(req)
print(f"sn={sn}")
print(
datetime.datetime.fromtimestamp(int(rsp[1].record.gpsTime)).strftime(
"%Y-%m-%d %H:%M:%S"
)
)
print(rsp)
except:
traceback.print_exc()
def getGpsByBsRecordsOfLatesBs(sn, type, startTime, endTime):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23469"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.BsGetRequest()
req.userID = int(sn)
req.apType = type
req.startTime = int(
datetime.datetime.strptime(startTime, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.endTime = int(
datetime.datetime.strptime(endTime, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.reqCount = -1
rsp = printer.getGpsByBsRecordsOfLatesBs(req)
print(
f"{datetime.datetime.fromtimestamp(rsp[1].gps.gpsTime).strftime('%Y-%m-%d %H:%M:%S')}"
)
print(
f"{datetime.datetime.fromtimestamp(rsp[1].gps.storeTime).strftime('%Y-%m-%d %H:%M:%S')}"
)
print(rsp)
except:
traceback.print_exc()
def getGeoPoiType(lng, lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"BsdObjectId:default -h {env_host} -p 10945"
)
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsPoint()
req.lng = lng
req.lat = lat
rsp = BaseStationData.DaoPoiInfoResp()
rsp = printer.getPoiTypeFromGeo(req)
print(rsp)
except:
traceback.print_exc()
def getDeviceInfoOfRegion(lLng, lLat, rLng, rLat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23479"
)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.RegionData()
req.leftLng = lLng
req.leftLat = lLat
req.rightLng = rLng
req.rightLat = rLat
rsp = printer.getDeviceInfoOfRegion(req)
print(rsp)
except:
traceback.print_exc()
def getDevicesGpsInfo(snList):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"HDaoGpsSvc:default -h {env_host} -p 23470"
)
print(env_host, 23479)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.BatchGpsDevInfoRequest()
req.extraMapReq = 1
req.seqNo = 0 # seqNo%6 6个中保留1个
req.userIds = snList
rsp = printer.getDevicesGpsInfo(req)
print(rsp)
except:
traceback.print_exc()
def ReverseGeocoding2(lng, lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"PoiSearchNear:default -h 192.168.5.31 -p 10081"
)
obj.ice_ping()
printer = POI.IPOISearchNearPrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = POI.geopoint()
req.lng = lng
req.lat = lat
rsp = printer.ReverseGeocoding2(req)
print(rsp)
except:
traceback.print_exc()
def endUserMileStat(sn):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"RtMileStatSvc:default -h {env_host} -p 23472"
)
obj.ice_ping()
printer = HDaoMile.DaoMileServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoMile.MileStatEndRequest()
req.userID = sn
req.apType = 5
req.beginTime = int(
datetime.datetime.strptime(
"2023-09-20 10:48:53", "%Y-%m-%d %H:%M:%S"
).timestamp()
)
req.endTime = int(
datetime.datetime.strptime(
"2023-09-20 11:08:19", "%Y-%m-%d %H:%M:%S"
).timestamp()
)
req.bRetGpsTime = True
rsp = printer.endUserMileStat(req)
print(rsp)
except:
traceback.print_exc()
def getJourneyRecords(sn, bgnDate, endDate):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"RtMileStatSvc:default -h {env_host} -p 23472"
)
obj.ice_ping()
printer = HDaoMile.DaoMileServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoMile.GetJourneyRecordsReq()
req.userID = sn
req.apType = 5
req.bReqAddr = False
req.bgnDate.year = bgnDate[0]
req.bgnDate.month = bgnDate[1]
req.bgnDate.day = bgnDate[2]
req.endDate.year = endDate[0]
req.endDate.month = endDate[1]
req.endDate.day = endDate[2]
req.extraMapReq = 0
rsp = printer.getJourneyRecords(req)
print(rsp)
except:
traceback.print_exc()
def getStayPointRecords(sn, bgnDate, endDate):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"RtMileStatSvc:default -h {env_host} -p 23472"
)
obj.ice_ping()
printer = HDaoMile.DaoMileServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoMile.GetStayPointRecordsReq()
req.userID = sn
req.apType = 5
req.bReqAddr = False
req.bgnDate.year = bgnDate[0]
req.bgnDate.month = bgnDate[1]
req.bgnDate.day = bgnDate[2]
req.endDate.year = endDate[0]
req.endDate.month = endDate[1]
req.endDate.day = endDate[2]
req.periodType = 0
req.minDuration = 0
req.maxDuration = 2000
req.extraMapReq = 0
rsp = printer.getStayPointRecords(req)
print(rsp)
except:
traceback.print_exc()
def GetFsp(sn, bgnDate, endDate):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(
f"FspService:default -h {env_host} -p 30060"
)
obj.ice_ping()
printer = FspOnline.FspServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = FspOnline.FspReq()
req.userId = sn
req.apType = 5
req.beginTime = int(
datetime.datetime.strptime(bgnDate, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.endTime = int(
datetime.datetime.strptime(endDate, "%Y-%m-%d %H:%M:%S").timestamp()
)
req.locInfoType = 1
req.perType = 0
rsp = printer.GetFsp(req)
print(rsp)
except:
traceback.print_exc()
class DeviceInfo:
def __init__(self, sn, count, validCount):
self.sn = sn
self.count = count
self.validCount = validCount
def add_count(self):
self.count += 1
def add_validCount(self):
self.validCount += 1
if __name__ == "__main__":
# snlist = [1510824193, 1510824194, 1510922309, 1510922324, 1510922327, 1510922330, 1510922334, 1510922335, 1510922336, 1510922337, 1510922338, 1510922339, 1510922340, 1510922341, 1510922342, 1510922345, 1510922346, 1510922347, 1510922350, 1510922352, 1510922354, 1510922369, 1510922371, 1510922372, 1510922375, 1510922376, 1510922390, 1510922391, 1510922418, 1510922425, 1510922428, 1510922430, 1510922431, 1510922433, 1510922448, 1510922449, 1510922456, 1510922458, 1510922460, 1510922464, 1510922468, 1510922472, 1510922480, 1510922492, 1510922497, 1510922514, 1510922521, 1510922522, 1510922523, 1510922524, 1510922525, 1510922526, 1510922529, 1510922533, 1510922539, 1510922542, 1510922547, 1510922549, 1510922550, 1510922555, 1510922562, 1510922564, 1510922567, 1510922569, 1510922570, 1510922571, 1510922572, 1510922577, 1510922582, 1510922583, 1510922586, 1510922590, 1510922592, 1510922595, 1510922597, 1510922608, 1510922616, 1510922620, 1510922623, 1510922624, 1510922635, 1510922637, 1510922638, 1510922639, 1510922641, 1510922642, 1510922643, 1510922645, 1510922646, 1510922650, 1510922651, 1510922652, 1510922659, 1510922661, 1510922663, 1510922664, 1510922667, 1510922668, 1510922669]
# snlist = [1190910192,1190614211,1190706000,1190910175,1190614987,1190614359,1190909435,1181127963,1190909126,1190910195,1190112152,1190909426,1190909377,1190429928,1190614984,1190112128,1190909439,1190522172,1190909633,1190624163,1190910026,1190404102,1190429919,1190112136,1190706009,1181127934,1190112131,1190112365,1190910127,1190522602,1190910158,1190706151,1190522604,1190614464,1190110673,1190522007,1190909007,1190706245,1181223028,1190706285,1190107499,1190111898,1190909006,1190404071,1190705407,1190909630,1190706291,1190909084,1180720969,1190706181,1190909635,1190706210,1181031326,1190706174,1181031332,1190705199,1190522526,1180720985,1190706307,1190909274,1190909606,1190705198,1190706170,1190909061,1190614215,1190909197,1190112135,1180720975,1190112150,1190910239,1180720989,1190403860,1190429949,1190706281,1181127927,1190429971,1190624467,1190624191,1190909645,1190706247,1190706225,1190624365,1181127908,1190429940,1190909673,1181127985,1190910321,1190706294,1190706267,1190404895,1190522947,1181127954,1190910185,1190910306,1190706289,1190522997,1190111086,1190706011,1190429030,1190403850,1190909607,1190429976,1180720963,1190112137,1190110665,1181031328,1190706458,1190615144,1181127928,1181127948,1181127901,1190909770,1190429287,1190111939,1190614777,1190910243,1190429290,1190909096,1190909611,1190910346,1190705400,1190706261,1190910297,1190910094,1190910320,1190429925,1190429934,1190112100,1190110664,1190429112,1190111431,1190910393,1190909973,1190112120,1190909617,1190112115,1181127960,1181127953,1190404370,1190112122,1181127989,1190910380,1190615411,1190522030,1190522035,1190909057,1190909726,1190909058,1190429960,1190522278,1181127996,1190910374,1190706265,1190909307,1190404955,1190429959,1190404477,1190112569,1190522577,1190429293,1190705182,1190910426,1190910359,1181127097,1190403662,1190614738,1190112347,1190706226,1190909556,1190909749,1190429936,1190909743,1190910227,1190909745,1190522356,1190910298,1190910230,1190614271,1190910394,1190909904,1180823373,1190522952,1181127994,1190522336,1190522337,1190910343,1190909767,1190522576,1190429234,1190429274,1190910488,1190615397,1190910285,1190614210,1190705936,1190910410,1181127952,1190706172,1190429311,1190910287]
# print(len(snlist))
# getDevicesGpsInfo(snList=snlist)
# startTime = datetime.datetime.now().timestamp()
# print(f"startTime = {startTime}")
# getDeviceInfoOfRegion(113989108,22585025,113994542,22589522)
# endTime = datetime.datetime.now().timestamp()
# print(f"endTime = {endTime}")
# print(f"useTime = {endTime - startTime}")
# endUserMileStat(87207270103)
# 获取最后gps位置数据,
# param: sn,设备类型
# getLatestGpsRecord('561063062799604',11)
getLatestGpsRecord("1570921451")
# 获取gps信息
# getGpsRecords(15212050744,"2024-01-17 00:00:00","2024-01-18 00:00:00")
# 获取里程列表
# getJourneyRecords( 15209030720,[2024,1,1],[2024,1,4])
# GetFsp('1570921451',"2024-03-01 15:11:55","2024-04-30 15:11:59")
getStayPointRecords(1570921451, [2024, 3, 19], [2024, 3, 19])
# getLatestBsRecord('352538107542444',11)
# getLatestBsRecord('96210200001',5)
# import time
# start = time.time()
# getGpsByBs(0,18267,57061)
# print(time.time()-start)
# getGpsByBs(0,18334,46178417)
# sir_map = {}
# deviceInfo = DeviceInfo("15212170590", 0, 0)
# sir_map["15212170590"] = deviceInfo
# with open("deviceinfo_st.txt", 'w') as f:
# for dev in sir_map.values():
# f.write(f"{dev.sn},{dev.count},{dev.validCount}")
# ghc跑的数据-在跑基站转经纬度
# df = pd.read_excel(os.getcwd() + "\\excel\\lastGPSandBs.xlsx")
# for i in df.index:
# addr = getGpsByBs(df.loc[i,'mmc'],df.loc[i,'lac'], df.loc[i,'ci'])
# df.loc[i, '基站地址'] = addr
# df.to_excel(f"\\excel\\lastGPSandBs_re.xlsx",index=False)
# 直接调用bsIcesvr
# getGpsByBsList()
# 通过hdaod调用bsIceSvr获取gps
# getGpsByLatestBsRecord('1610523358',5)
# 获取高德poi类型
# getGeoPoiType(113.991416,22.587527)
# 原始经纬度转地址
# ReverseGeocoding2(117.634416, 38.709333)
# 取一段时间内的最后一个基站转gps
# getGpsByBsRecordsOfLatesBs('1621226935',5,'2023-03-01 00:00:00','2023-03-01 17:00:00')
# 通过经纬度,获取所在省市区
# for file in ["第一设备.xlsx","第二设备.xlsx"]:
# fileName = file[0:file.find('.')]
# fileEx = file[file.find('.')+1:]
# df = pd.read_excel(f"{file}")
# startTime = datetime.datetime.now().timestamp()
# for i in df.index:
# lat = df.loc[i,"activeLat"]
# lng = df.loc[i,"activeLng"]
# # lng = 118.479347
# # lat = 24.659208
# # for i in range(1000):
# # lng += random.randint(-1,1)/10.0
# # lat += random.randint(-1,1)/10.0
# # print(lng,lat)
# data = get_distdetail_by_pos(lng, lat)
# df.loc[i,'province'] = data[1]
# df.loc[i, 'city'] = data[2]
# df.loc[i, 'area'] = data[3]
# endTime = datetime.datetime.now().timestamp()
# df.to_excel(f"{fileName}_re.{fileEx}", index=False)
# print(f"useTime = {endTime - startTime}")
# 获取仲利设备,判断最后位置点是否在行政区内
# startTime = datetime.datetime.now().timestamp()
# cursor = fmrsDBConn.cursor()
# sql = f"select tvd.sn from t_vehicle_device tvd left join t_vehicle tv on tv.id = tvd.vehicle_id left join t_user tu on tu.id = tv.created_by " \
# f"left join t_device td on td.sn = tvd.sn where tu.tenant_id = 44 and tv.del_flag = 0 and tvd.bind_status = 1" \
# f" and tvd.del_flag = 0 and tv.del_flag = 0 and tu.del_flag = 0"
# cursor.execute(sql)
# result = cursor.fetchall()
# print(len(result))
# for i in result:
# sn = i[0]
# getLatestGpsRecord(sn)
# endTime = datetime.datetime.now().timestamp()
# print(f"useTime = {endTime - startTime}")
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!