GB28181 Smart Helmet Solution Research and Technical Realization

What is a smart helmet?

Smart safety helmet is a kind of safety helmet integrating advanced technology, which can be based on the GB28181 specification, and is suitable for operators in high-risk industries such as railway inspections, electric power, petrochemicals, etc., as well as safety protection in emergency situations such as firefighting and rescue.

Smart helmets usually have the following functions:

  1. Real-time positioning: The built-in GPS positioning module can locate the position of the operator in real time and report it to the command center in time to prevent getting lost or missing.
  2. Wireless communication: The built-in wireless communication module can communicate with the command center to facilitate the contact and coordination between the operator and the command center.
  3. Collision detection: The built-in collision detection module can detect the head impact of the operator in real time, and send an alarm or distress signal in time.
  4. Temperature detection: The built-in temperature detection module can detect the temperature of the working environment in real time to prevent safety problems such as high temperature and heatstroke.
  5. Lighting function: Built-in LED lights can provide lighting for operators to facilitate operations at night or in low-light environments.
  6. Information display: LCD screen or LED display screen is set on the helmet, which can display information such as the location of the operator, communication status, temperature, etc.

Technical realization

Early smart helmets will be based on embedded linux. With the development of this technology, considering the ease of use and other factors, most of the current mainstream smart helmets are implemented on the Android platform. This article takes the Android platform as an example to introduce Next, the core functions that smart helmets need to support.

Let me talk about the technical architecture first:

 

feature design:

  •  [Video format] H.264/H.265 (Android H.265 hardcoded);
  •  [Audio format] G.711 A law, AAC;
  •  [Volume adjustment] Android platform acquisition terminal supports real-time volume adjustment;
  •  [H.264 hard coding] Support H.264 hard coding for specific models;
  •  [H.265 hard coding] Support H.265 hard coding for specific models;
  •  [soft and hard coded parameter configuration] support gop interval, frame rate, bit-rate settings;
  •  [Soft encoding parameter configuration] Support soft encoding profile, soft encoding speed, and variable bit rate settings;
  • Support pure video, audio and video PS package transmission;
  • Support RTP OVER UDP and RTP OVER TCP passive mode (TCP media streaming client);
  • Support signaling channel network transmission protocol TCP/UDP setting;
  • Support registration, cancellation, registration refresh and registration validity setting;
  • Support equipment directory query response;
  • Support heartbeat mechanism, support heartbeat interval, heartbeat detection times setting;
  • Support mobile device location (MobilePosition) subscription and notification;
  • Support voice broadcast;
  • Support voice intercom;
  • Support PTZ control and preset position query;
  •  [Real-time watermark] supports dynamic text watermark, png watermark;
  •  [Mirror] The Android platform supports the real-time mirroring function of the front camera;
  •  [Real-time mute] Support real-time mute/unmute;
  •  [Real-time snapshot] Support real-time snapshot;
  •  [Noise reduction] Supports noise reduction processing, automatic gain, and VAD detection caused by environmental sounds and mobile phone interference;
  •  [Video data docking before external encoding] Support YUV data docking;
  •  [Audio data docking before external encoding] Support PCM docking;
  •  [Video data docking after external encoding] Support external H.264 data docking;
  •  [Audio data docking after external encoding] External AAC data docking;
  •  [Extended recording function] Supports combined use with the recording module, recording related functions.

Take the Android platform GB28181 device access module of Daniu Live SDK as an example. If you need to connect to the GB28181 smart helmet, you need to pay attention to the two parts of signaling and media data. Here is the general design idea:

GBSIPAgentListener is mainly related to GB28181 registration, heartbeat, DevicePosition, etc., such as successful registration, registration timeout, registration network transport layer error, abnormal heartbeat, device position request processing:

public interface GBSIPAgentListener
{
    /*注册成功
    * @param dateString: 服务器日期,用来校准设备端时间,用户自行决定是否校准设备时间
    */
    void ntsRegisterOK(String dateString);

    /*
    *注册超时
    */
    void ntsRegisterTimeout();

    /*
    *注册网络传输层异常
    */
    void ntsRegisterTransportError(String errorInfo);

    /*
    *心跳达到异常次数
    */
    void ntsOnHeartBeatException(int exceptionCount, String lastExceptionInfo);

    /*
     * 设备位置请求, 这个主要用在移动设备位置订阅上
     * @param interval 请求间隔, 单位是毫秒
     */
    void ntsOnDevicePositionRequest(String deviceId, int interval);
}

GBSIPAgentPlayListener mainly deals with Invite, Ack, Bye, etc. of GB28181:

public interface GBSIPAgentPlayListener {

    /*
     *收到s=Play的实时视音频点播
     */
    void ntsOnInvitePlay(String deviceId, SessionDescription sessionDescription);

    /*
     *发送play invite response 异常
     */
    void ntsOnPlayInviteResponseException(String deviceId, int statusCode, String errorInfo);

    /*
     * 收到CANCEL play INVITE请求
     */
    void ntsOnCancelPlay(String deviceId);

    /*
     * 收到Ack
     */
    void ntsOnAckPlay(String deviceId);

    /*
     * 收到Bye
     */
    void ntsOnByePlay(String deviceId);

    /*
     * 不是在收到BYE Message情况下, 终止Play
     */
    void ntsOnTerminatePlay(String deviceId);

    /*
     * Play会话对应的对话终止, 一般不会出发这个回调,目前只有在响应了200K, 但在64*T1时间后还没收到ACK,才可能会出发
    收到这个, 请做相关清理处理
    */
    void ntsOnPlayDialogTerminated(String deviceId);
}

GBSIPAgentAudioBroadcastListener is mainly related to GB28181 voice broadcast processing. If you have voice broadcast related needs, you can refer to the demo example to realize:

public interface GBSIPAgentAudioBroadcastListener {

    /*
     *收到语音广播通知
     */
    void ntsOnNotifyBroadcastCommand(String fromUserName, String fromUserNameAtDomain, String sn, String sourceID, String targetID);

    /*
     *需要准备接受语音广播的SDP内容
     */
    void ntsOnAudioBroadcast(String commandFromUserName, String commandFromUserNameAtDomain, String sourceID, String targetID);

    /*
     *音频广播, 发送Invite请求异常
     */
    void ntsOnInviteAudioBroadcastException(String sourceID, String targetID, String errorInfo);

    /*
     *音频广播, 等待Invite响应超时
     */
    void ntsOnInviteAudioBroadcastTimeout(String sourceID, String targetID);

    /*
     *音频广播, 收到Invite消息最终响应
     */
    void ntsOnInviteAudioBroadcastResponse(String sourceID, String targetID, int statusCode, SessionDescription sessionDescription);

    /*
     * 音频广播, 收到BYE Message
     */
    void ntsOnByeAudioBroadcast(String sourceID, String targetID);


    /*
     * 不是在收到BYE Message情况下, 终止音频广播
     */
    void ntsOnTerminateAudioBroadcast(String sourceID, String targetID);
}

GBSIPAgentDeviceControlListener is mainly related to GB28181 device control, such as remote start and PTZ control:

public interface GBSIPAgentDeviceControlListener {

    /*
     * 收到远程启动控制命令
     */
    void ntsOnDeviceControlTeleBootCommand(String deviceId, String teleBootValue);

    /*
    * 云台控制
     */
    void ntsOnDeviceControlPTZCmd(String deviceId, String typeValue);
}

GBSIPAgentQueryCommandListener is mainly for GB28181 query commands, such as preset position query:

public interface GBSIPAgentQueryCommandListener {

    /*
     * 设备预置位查询
     */
    void ntsOnDevicePresetQueryCommand(String fromUserName, String fromUserNameAtDomain, String sn, String deviceId);
}

GBSIPAgentTalkListener mainly deals with GB28181 voice intercom:

public interface GBSIPAgentTalkListener {
    /*
     *收到s=Talk 语音对讲
     */
    void ntsOnInviteTalk(String deviceId, SessionDescription sessionDescription);

    /*
     *发送talk invite response 异常
     */
    void ntsOnTalkInviteResponseException(String deviceId, int statusCode, String errorInfo);

    /*
     * 收到CANCEL Talk INVITE请求
     */
    void ntsOnCancelTalk(String deviceId);

    /*
     * 收到Ack
     */
    void ntsOnAckTalk(String deviceId);

    /*
     * 收到Bye
     */
    void ntsOnByeTalk(String deviceId);

    /*
     * 不是在收到BYE Message情况下, 终止Talk
     */
    void ntsOnTerminateTalk(String deviceId);

    /*
     * Talk会话对应的对话终止, 一般不会出发这个回调,目前只有在响应了200K, 但在64*T1时间后还没收到ACK,才可能会出发
    收到这个, 请做相关清理处理
    */
    void ntsOnTalkDialogTerminated(String deviceId);
}

Summarize

In addition to signaling interaction, media data encoding and transmission will not be described here. The GB28181 smart helmet is a helmet that integrates a variety of advanced technologies, which can provide operators with real-time positioning, wireless communication, collision detection, temperature detection, lighting functions and information display, etc. efficiency.

Guess you like

Origin blog.csdn.net/renhui1112/article/details/132093800