简体   繁体   English

5型AIS AIVDM消息中的第二部分/句子真的很重要吗?

[英]Is really important the second part/sentence in a type 5 AIS AIVDM message?

I have an AIS antenna receiving AIVDM sentences since 1 year ago. 从1年前开始,我就有一个AIS天线接收AIVDM句子。

Now I'm starting decoding the sentences using https://github.com/bcl/aisparser and found that type 5 messages has two aivdm sentences that not always come consecutively and usually loss (at least in my case) the second sentence, making the decodification quite more complicated. 现在,我开始使用https://github.com/bcl/aisparser解码句子,发现类型5消息具有两个aivdm句子,它们并不总是连续出现的,并且通常会丢失(至少在我的情况下)第二句话,使得整理工作变得更加复杂。

I've tried to interchange second part sentences to see what happens and if its really important. 我试图交换第二部分的句子,以查看会发生什么以及它是否真的很重要。

For example, if you try these sentences in https://www.maritec.co.za/tools/aisvdmvdodecoding/ : 例如,如果您在https://www.maritec.co.za/tools/aisvdmvdodecoding/中尝试这些句子:

!AIVDM,2,1,0,A,58wt8Ui`g??r21`7S=:22058<v05Htp000000015>8OA;0sk,0*7B
!AIVDM,2,2,0,A,eQ8823mDm3kP00000000000,2*5D
!AIVDM,2,1,6,A,58wt8Ui`g??r21`7S=:22058<v05Htp000000015>8OA;0sk,0*7B
!AIVDM,2,2,6,A,:062paRLOaD,2*79

you'll notice that the only change is that the second pair (the "wrong" one with an "adapted" second part) has a wrong 'destination' so, it really matters to take all the decoding job if you are not interested in the 'destination' field? 您会注意到,唯一的变化是第二对(“错误的”一对带有“适应的”第二部分)具有错误的“目标”,因此, 如果您不感兴趣,那么进行所有解码工作确实很重要。 “目标”字段?

All the best 祝一切顺利

Indeed, it can be tricky to match the corresponding two parts of type 5 messages, but you could rely on this library to do it for you: https://github.com/schwehr/libais 确实,匹配类型5消息的相应两个部分可能很棘手,但是您可以依靠此库为​​您完成此操作: https : //github.com/schwehr/libais

import ais
q = ais.nmea_queue.NmeaQueue()
while True:
    msg = next(your_message_iterator)
    q.put(msg)
    if q.qsize():
        d = q.get().get('decoded', None) 
        # Then do whatever you need with d (store it, print it,...)

With this setting, the result of q.get_size() can be 0 if you are the first part of a type 5 message (or an invalid AIS sequence), or 1 if you added a single-sentence message, or a second-sentence that matches an already present first-sentence. 使用此设置,如果您是5类消息的第一部分(或无效的AIS序列),则q.get_size()的结果可以为0;如果您添加了单句消息或第二句,则q.get_size()的结果可以为1。匹配已经存在的第一句。

Note: To answer your question, you can get the detail of which information is encoded on which bit in the paragraph " Type 5: Static and Voyage Related Data " on https://gpsd.gitlab.io/gpsd/AIVDM.html . 注意:要回答您的问题,您可以在https://gpsd.gitlab.io/gpsd/AIVDM.html上的“ 类型5:静态和航程相关数据 ”段落中获取有关哪些信息编码的详细信息。 This will help you to understand which data is lost if the second message is invalid. 如果第二条消息无效,这将帮助您了解丢失了哪些数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM