CN115967472A - Internet of things terminal object model self-adaptive encoding and decoding method and system - Google Patents
Internet of things terminal object model self-adaptive encoding and decoding method and system Download PDFInfo
- Publication number
- CN115967472A CN115967472A CN202211710112.7A CN202211710112A CN115967472A CN 115967472 A CN115967472 A CN 115967472A CN 202211710112 A CN202211710112 A CN 202211710112A CN 115967472 A CN115967472 A CN 115967472A
- Authority
- CN
- China
- Prior art keywords
- data
- service
- encoding
- object model
- list
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及物联网技术领域,尤其涉及一种物联网终端物模型自适应编解码方法及系统。The present invention relates to the technical field of the Internet of Things, in particular to an adaptive encoding and decoding method and system for an Internet of Things terminal object model.
背景技术Background technique
通常,数据在设备中按数据类型随机存放在某个内存地址,各个数据互不关联;这样的数据不能在网络上直接传输。数据在网络上传输时,需要按特定的规则把一组数据进行序列化操作,转化成可数据的数据报文。编码是指把一组内存数据经过序列化操作转化成网络上可传输的数据报文的过程;反之,把网络上的数据报文经过解序列化操作转化成一组内存数据的过程称为解码。Usually, data is randomly stored in a certain memory address in the device according to the data type, and each data is not related to each other; such data cannot be directly transmitted on the network. When data is transmitted on the network, a set of data needs to be serialized according to specific rules and converted into data packets that can be used. Encoding refers to the process of serializing a set of memory data into data packets that can be transmitted on the network; conversely, the process of deserializing data packets on the network into a set of memory data is called decoding.
对于物联网的上下行数据的编解码,目前常用的方法是根据物模型定义人工编写编解码程序或者根据物模型定义用代码生成工具生成相应的编解码程序,将这部分编解码程序和用户的业务程序集成,编译生成新的可执行程序,再将程序通过特定的烧录工具或者远程升级协议加载到终端上才能适应新的物模型定义;对于已经商用的终端,则要将新的编解码程序和用户程序集成编译成可执行程序后,通过FOTA(FirmwareOver-The-Air,智能空中固件升级)或SOTA(SoftwareOver-The-Air,智能空中软件升级)功能,将终端上的程序进行升级后才能适应新的物模型,如果没有远程升级功能,则无法适应新的物模型。For the encoding and decoding of the uplink and downlink data of the Internet of Things, the current common method is to manually write the encoding and decoding program according to the definition of the object model or use a code generation tool to generate the corresponding encoding and decoding program according to the definition of the object model, and combine this part of the encoding and decoding program with the user's Business program integration, compiling and generating a new executable program, and then loading the program on the terminal through a specific burning tool or remote upgrade protocol to adapt to the new object model definition; for commercial terminals, the new codec must be After the program and user program are integrated and compiled into an executable program, the program on the terminal is upgraded through the FOTA (FirmwareOver-The-Air, intelligent aerial firmware upgrade) or SOTA (SoftwareOver-The-Air, intelligent aerial software upgrade) function In order to adapt to the new physical model, if there is no remote upgrade function, it will not be able to adapt to the new physical model.
发明内容Contents of the invention
本发明所要解决的技术问题是提供一种物联网终端物模型自适应编解码方法及系统,以无需用户另外人工编写生成终端侧的编解码程序即可实现对新的物模型的编解码。The technical problem to be solved by the present invention is to provide a method and system for adaptive encoding and decoding of the terminal object model of the Internet of Things, so as to realize the encoding and decoding of the new object model without the need for the user to manually write and generate the encoding and decoding program on the terminal side.
第一方面,本发明实施例提供了一种物联网终端物模型自适应编解码方法,应用于物联网终端,包括以下步骤:业务初始化:加载物模型定义,从物模型定义中解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表;上行数据编码:对上行数据进行编码;下行指令解码:对下行指令进行解码。In the first aspect, the embodiment of the present invention provides an adaptive encoding and decoding method for an IoT terminal object model, which is applied to an IoT terminal, and includes the following steps: Service initialization: load the object model definition, and parse out the data attributes from the object model definition list, data reporting service list, downlink command service list, and command response service list; uplink data encoding: encode uplink data; downlink command decoding: decode downlink commands.
其进一步技术方案为:所述上行数据编码中的所述上行数据包括上报数据及指令应答数据,所述上行数据编码具体包括:上报数据编码:当检测到上报数据时,根据用户提供的数据上报服务ID及解析获得的所述数据上报服务列表和所述数据属性列表进行数据编码;指令应答数据编码:当检测到指令应答数据时,根据用户提供的指令应答服务ID及解析获得的所述指令应答服务列表和所述数据属性列表进行数据编码。Its further technical solution is: the uplink data in the uplink data encoding includes reporting data and command response data, and the uplink data encoding specifically includes: reporting data encoding: when reporting data is detected, report according to the data provided by the user Service ID and the data reporting service list obtained by analysis and the data attribute list for data encoding; instruction response data encoding: when the instruction response data is detected, respond to the service ID and the instruction obtained by analysis according to the instruction provided by the user The reply service list and the data attribute list perform data encoding.
其进一步技术方案为:所述上报数据编码具体包括:当检测到上报数据时,根据用户提供的数据上报服务ID于所述数据上报服务列表中搜寻对应的数据上报服务项;根据搜寻到的数据上报服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性;根据所述数据上报服务ID和搜寻到的数据属性结合对应的数据属性ID依序进行二进制编码,获得上报数据的二进制数据串。Its further technical solution is: the reporting data encoding specifically includes: when the reporting data is detected, searching for the corresponding data reporting service item in the data reporting service list according to the data reporting service ID provided by the user; The data attribute ID of the data attribute of the reporting service item is searched for the corresponding data attribute in the data attribute list one by one; according to the data reporting service ID and the searched data attribute combined with the corresponding data attribute ID, the binary encoding is sequentially performed , to obtain the binary data string of the reported data.
其进一步技术方案为:所述指令应答数据编码具体包括:当检测到指令应答数据时,根据用户提供的指令应答服务ID于所述指令应答服务列表中搜寻对应的指令应答服务项;根据搜寻到的指令应答服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性;获取指令应答数据中的任务ID,根据任务ID、指令应答服务ID及搜寻到的数据属性结合对应的数据属性ID依序进行二进制编码,获得指令应答数据的二进制数据串。Its further technical solution is: the encoding of the command response data specifically includes: when the command response data is detected, searching for the corresponding command response service item in the command response service list according to the command response service ID provided by the user; The data attribute ID of the data attribute of the command response service item is searched for the corresponding data attribute in the data attribute list one by one; obtain the task ID in the command response data, according to the task ID, command response service ID and the searched data Attributes are combined with corresponding data attribute IDs to perform binary encoding in order to obtain a binary data string of command response data.
其进一步技术方案为:所述下行指令解码具体包括:当检测到所述下行指令时,获取任务ID及下行指令服务ID;根据获得的所述下行指令服务ID于所述下行指令服务列表中搜寻对应的下行指令服务项;根据搜寻到的下行指令服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性;对所述下行指令的二进制数据串根据搜寻到的数据属性结合对应的数据属性ID的顺序进行解码,获得对应的具体数据内容。Its further technical solution is: the decoding of the downlink command specifically includes: when the downlink command is detected, acquiring a task ID and a downlink command service ID; searching in the downlink command service list according to the obtained downlink command service ID The corresponding downlink command service item; according to the data attribute ID of the data attribute of the downlink command service item found, search for the corresponding data attribute in the data attribute list one by one; for the binary data string of the downlink command according to the searched The data attributes of the data are decoded in combination with the order of the corresponding data attribute IDs to obtain the corresponding specific data content.
第二方面,本发明实施例提供了一种物联网终端物模型自适应编解码系统,应用于物联网终端,包括业务初始化模块、编码模块及解码模块,所述业务初始化模块用于加载物模型定义,从物模型定义中解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表;所述编码模块与所述业务初始化模块相连,用于对上行数据进行编码;所述解码模块与所述业务初始化模块相连,用于对下行指令进行解码。In the second aspect, the embodiment of the present invention provides an adaptive encoding and decoding system for an Internet of Things terminal object model, which is applied to an Internet of Things terminal, including a service initialization module, an encoding module, and a decoding module. The service initialization module is used to load the object model Definition, parsing out a list of data attributes, a list of data reporting services, a list of downlink command services and a list of command response services from the definition of the object model; the encoding module is connected to the business initialization module for encoding uplink data; The decoding module is connected with the service initialization module and is used for decoding downlink instructions.
其进一步技术方案为:所述物联网终端物模型自适应编解码系统还包括存储模块,所述存储模块与所述业务初始化模块相连,用于存储所述数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表。Its further technical solution is: the self-adaptive encoding and decoding system of the Internet of Things terminal object model also includes a storage module, the storage module is connected to the service initialization module, and is used to store the data attribute list, data reporting service list, downlink Command service list and command response service list.
其进一步技术方案为:所述上行数据包括上报数据,所述编码模块包括上报数据编码单元,所述上报数据编码单元用于当检测到上报数据时,根据用户提供的数据上报服务ID及解析获得的所述数据上报服务列表和所述数据属性列表进行数据编码。Its further technical solution is: the uplink data includes reported data, the coding module includes a reported data coding unit, and the reported data coding unit is used to report the service ID and analyze the data provided by the user when the reported data is detected. Perform data encoding on the data reporting service list and the data attribute list.
其进一步技术方案为:所述上行数据包括指令应答数据,所述编码模块包括指令应答数据编码单元,所述指令应答数据编码单元用于当检测到指令应答数据时,根据用户提供的指令应答服务ID及解析获得的所述指令应答服务列表和所述数据属性列表进行数据编码。Its further technical solution is: the uplink data includes command response data, the coding module includes a command response data coding unit, and the command response data coding unit is used to respond to the command provided by the user when the command response data is detected. Data encoding is performed on the ID and the command response service list and the data attribute list obtained through parsing.
本发明的有益技术效果在于:本发明一种物联网终端物模型自适应编解码方法通过于物联网终端加载物模型定义以解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,以在物模型发生变化更新且需要上报数据、对平台的下行指令进行处理或应答时,可根据物模型定义解析出的对应列表直接对数据进行编解码,无需用户另外人工编写生成物联网终端的编解码程序即可实现对新的物模型进行编解码,无需重新加载编解码程序的过程,提高工作效率,且避免因物模型变更而必须在运营设备进行在线升级的问题。本发明一种物联网终端物模型自适应编解码系统也具有上述功能。The beneficial technical effects of the present invention are: an adaptive encoding and decoding method of the Internet of Things terminal object model of the present invention is defined by loading the object model of the Internet of Things terminal to parse out the data attribute list, data reporting service list, downlink command service list and command response Service list, so that when the object model changes and updates and needs to report data, process or respond to the platform's downlink instructions, the data can be directly encoded and decoded according to the corresponding list parsed from the object model definition, without the need for users to manually write the generated object The encoding and decoding program of the networked terminal can realize the encoding and decoding of the new object model, without reloading the process of encoding and decoding program, which improves work efficiency and avoids the problem of online upgrade of the operating equipment due to the change of the object model. An adaptive encoding and decoding system for an Internet of Things terminal object model according to the present invention also has the above functions.
附图说明Description of drawings
为了更清楚地说明本发明实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present invention. Ordinary technicians can also obtain other drawings based on these drawings on the premise of not paying creative work.
图1为本发明实施例提供的物联网终端物模型自适应编解码方法的流程示意图;FIG. 1 is a schematic flowchart of an adaptive encoding and decoding method for an IoT terminal object model provided by an embodiment of the present invention;
图2为本发明实施例提供的物联网终端物模型自适应编解码方法的具体流程示意图;FIG. 2 is a schematic flowchart of an adaptive encoding and decoding method for an IoT terminal object model provided by an embodiment of the present invention;
图3为本发明实施例提供的物联网终端物模型自适应编解码方法的第一子流程示意图;3 is a schematic diagram of the first sub-flow of the IoT terminal object model adaptive encoding and decoding method provided by the embodiment of the present invention;
图4为本发明实施例提供的物联网终端物模型自适应编解码方法的第二子流程示意图;FIG. 4 is a schematic diagram of a second sub-flow of the IoT terminal object model adaptive encoding and decoding method provided by an embodiment of the present invention;
图5为本发明实施例提供的物联网终端物模型自适应编解码方法的第三子流程示意图;5 is a schematic diagram of the third sub-flow of the IoT terminal object model adaptive encoding and decoding method provided by the embodiment of the present invention;
图6为本发明实施例提供的物联网终端物模型自适应编解码系统的框架示意图;FIG. 6 is a schematic framework diagram of an adaptive encoding and decoding system for an IoT terminal object model provided by an embodiment of the present invention;
图7为本发明实施例提供的物联网终端物模型自适应编解码系统的具体框架示意图。FIG. 7 is a schematic diagram of a specific framework of an adaptive encoding and decoding system for an IoT terminal object model provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the terms "comprising" and "comprises" indicate the presence of described features, integers, steps, operations, elements and/or components, but do not exclude one or Presence or addition of multiple other features, integers, steps, operations, elements, components and/or collections thereof.
还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terminology used in the description of the present invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the present invention. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural referents unless the context clearly dictates otherwise.
还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be further understood that the term "and/or" used in the description of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
请参阅图1,图1为本发明实施例提供的物联网终端物模型自适应编解码方法的流程示意图,所述物联网终端物模型自适应编解码方法包括以下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of an adaptive encoding and decoding method for an IoT terminal object model provided by an embodiment of the present invention. The adaptive encoding and decoding method for an IoT terminal object model includes the following steps:
步骤S11、业务初始化:于物联网终端加载物模型定义,从物模型定义中解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表。其中,所述数据属性列表中存储的数据项包括通过外部模块采集到的数据。物联网终端可使用TCP协议和CTWING平台进行数据交互,以获取新的物模型定义,以在物模型定义更新变化时,可下载物模型定义进行后续操作。物模型定义是指物模型描述文件。数据报文可包括业务类型标识、对应的服务ID、数据长度及具体数据内容。所述数据属性列表中存储有多个数据属性,每个数据属性包括数据属性ID、数据类型、数据长度、数据上限及数据下限等信息。所述数据上报服务列表中存储有多个数据上报服务项,每个数据上报服务项包括有数据上报服务ID,数据上报服务项还包括其对应的上报服务的具体描述,以便调取应用;所述数据上报服务项包括至少一个数据属性,且所述数据上报服务项的数据属性的数目不大于数据属性列表的长度。所述下行指令服务列表中存储有多个下行指令服务项,每个下行指令服务项包括有下行指令服务ID,下行指令服务项还包括其对应的下行指令服务的具体描述,以便调取应用;所述下行指令服务项可不包括数据属性,也可包括至少一个数据属性,且所述下行指令服务项的数据属性的数目均不大于数据属性列表的长度。所述指令应答服务列表中存储有多个指令应答服务项,每个指令应答服务项包括有指令应答服务ID,指令应答服务项还包括其对应的指令应答服务的具体描述,以便调取应用。所述指令应答服务项可不包括数据属性,也可包括至少一个数据属性,且所述指令应答服务项的数据属性的数目均不大于数据属性列表的长度。所述数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表中存储的信息用于初始化编解码,以便后续根据需求直接获取信息进行编解码操作。Step S11, business initialization: load the object model definition on the IoT terminal, and parse out the data attribute list, data reporting service list, downlink command service list, and command response service list from the thing model definition. Wherein, the data items stored in the data attribute list include data collected by external modules. The IoT terminal can use the TCP protocol and the CTWING platform for data interaction to obtain a new object model definition, so that when the object model definition is updated and changed, the object model definition can be downloaded for subsequent operations. The object model definition refers to the object model description file. The data message may include service type identification, corresponding service ID, data length and specific data content. A plurality of data attributes are stored in the data attribute list, and each data attribute includes information such as a data attribute ID, a data type, a data length, a data upper limit, and a data lower limit. A plurality of data reporting service items are stored in the data reporting service list, each data reporting service item includes a data reporting service ID, and the data reporting service item also includes a specific description of its corresponding reporting service, so as to call the application; The data reporting service item includes at least one data attribute, and the number of data attributes of the data reporting service item is not greater than the length of the data attribute list. The downlink command service list stores a plurality of downlink command service items, each downlink command service item includes a downlink command service ID, and the downlink command service item also includes a specific description of its corresponding downlink command service, so as to call the application; The downlink command service item may not include a data attribute, or may include at least one data attribute, and the number of data attributes of the downlink command service item is not greater than the length of the data attribute list. The command response service list stores a plurality of command response service items, each command response service item includes a command response service ID, and the command response service item also includes a specific description of its corresponding command response service, so as to call the application. The command response service item may not include a data attribute, or may include at least one data attribute, and the number of data attributes of the command response service item is not greater than the length of the data attribute list. The information stored in the data attribute list, data reporting service list, downlink command service list, and command response service list is used to initialize encoding and decoding, so that subsequent information can be directly obtained according to requirements to perform encoding and decoding operations.
步骤S12、上行数据编码:对上行数据进行编码。Step S12. Encoding of uplink data: Encoding the uplink data.
步骤S13、下行指令解码:对下行指令进行解码。Step S13, decoding the downlink instruction: decoding the downlink instruction.
其中,数据在设备中按照数据类型单个随机存储在任一内存地址,编码是值将其中一组内存数据经过序列化操作转化成网络上可传输的数据报文的过程,而解码是指把网络上的数据报文经过解序列化操作转化成一组内存数据的过程。所述物联网终端物模型自适应编解码方法通过于物联网终端加载物模型定义以解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,以在物模型发生变化更新且需要上报数据、对平台的下行指令进行处理或应答时,可根据物模型定义解析出的对应列表直接对数据进行编解码,无需用户另外人工编写生成物联网终端的编解码程序即可实现对新的物模型进行编解码,无需重新加载编解码程序的过程,提高工作效率,且避免因物模型变更而必须在运营设备进行在线升级的问题。Among them, the data is randomly stored in any memory address in the device according to the data type. Encoding is the process of serializing a set of memory data into a data message that can be transmitted on the network. The process of deserializing data packets into a set of memory data. The IoT terminal object model adaptive encoding and decoding method loads the object model definition on the Internet of Things terminal to parse out the data attribute list, data reporting service list, downlink command service list and command response service list, so as to update when the object model changes. And when it is necessary to report data, process or respond to the downlink commands of the platform, the data can be directly encoded and decoded according to the corresponding list parsed from the object model definition, without the need for the user to manually write and generate an encoding and decoding program for the IoT terminal. Encoding and decoding of the new physical model does not require the process of reloading the codec program, which improves work efficiency and avoids the problem of having to perform online upgrades on operating equipment due to physical model changes.
结合图2,具体地,所述上行数据包括上报数据及指令应答数据,所述步骤S12包括:Referring to FIG. 2, specifically, the uplink data includes reporting data and command response data, and the step S12 includes:
步骤S121、上报数据编码:当检测到上报数据时,根据用户提供的数据上报服务ID及解析获得的所述数据上报服务列表和所述数据属性列表进行数据编码。其中,在进行数据上报编码时,上报数据可包括业务类型标识、数据上报服务ID、数据长度及具体数据内容,具体数据内容可根据数据上报服务ID所对应的数据上报服务项的数据属性的预设规则以根据对应的数据属性ID的先后顺序进行编码。例如,在需要上报温湿度数据的业务类型中,业务类型标识可用1个字节的无符号整型数据表示,数据上报服务ID可用2个字节的无符号短整型数据表示,数据长度可用2个字节无符号整型数据表示,温度数据和湿度数据均使用float类型表示,且温度在前,湿度在后。Step S121, coding of reported data: when the reported data is detected, data coding is performed according to the data reporting service ID provided by the user and the data reporting service list and the data attribute list obtained through analysis. Wherein, when performing data reporting coding, the reported data may include business type identification, data reporting service ID, data length and specific data content, and the specific data content may be determined according to the data attribute of the data reporting service item corresponding to the data reporting service ID. The rules are set to be encoded according to the order of the corresponding data attribute IDs. For example, in a service type that needs to report temperature and humidity data, the service type identifier can be represented by 1-byte unsigned integer data, the data reporting service ID can be represented by 2-byte unsigned short integer data, and the data length can be 2-byte unsigned integer data representation, temperature data and humidity data are both represented by float type, and the temperature is in the front, followed by the humidity.
步骤S122、指令应答数据编码:当检测到指令应答数据时,根据用户提供的指令应答服务ID及解析获得的所述指令应答服务列表和所述数据属性列表进行数据编码。Step S122, command response data encoding: when the command response data is detected, perform data encoding according to the command response service ID provided by the user and the command response service list and the data attribute list obtained through analysis.
结合图3,所述步骤S121具体包括:In conjunction with FIG. 3, the step S121 specifically includes:
步骤S1211、当检测到上报数据时,根据用户提供的数据上报服务ID于所述数据上报服务列表中搜寻对应的数据上报服务项。Step S1211 , when the reported data is detected, search for the corresponding data reporting service item in the data reporting service list according to the data reporting service ID provided by the user.
步骤S1212、根据搜寻到的数据上报服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性,以根据搜寻到的数据属性的详细信息获取相应的数据上报服务项所对应的数据上报服务的具体描述。Step S1212, according to the data attribute ID of the data attribute of the searched data reporting service item, search for the corresponding data attribute in the data attribute list one by one, so as to obtain the corresponding data reporting service according to the detailed information of the searched data attribute The specific description of the data reporting service corresponding to the item.
步骤S1213、根据所述数据上报服务ID和搜寻到的数据属性结合对应的数据属性ID依序进行二进制编码,获得上报数据的二进制数据串。Step S1213: Binary encoding is performed sequentially according to the data reporting service ID and the searched data attributes and the corresponding data attribute IDs to obtain a binary data string of the reported data.
其中,所述步骤S1211前还可包括:判断是否存在上报数据,若是,执行步骤S1211。Wherein, before the step S1211, it may further include: judging whether there is data to be reported, and if so, performing step S1211.
结合图4,所述步骤S122具体包括:With reference to FIG. 4, the step S122 specifically includes:
步骤S1221、当检测到指令应答数据时,根据用户提供的指令应答服务ID于所述指令应答服务列表中搜寻对应的指令应答服务项。Step S1221 , when the command response data is detected, search for the corresponding command response service item in the command response service list according to the command response service ID provided by the user.
步骤S1222、根据搜寻到的指令应答服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性,以根据搜寻到的数据属性的详细信息获取相应的指令应答服务项所对应的指令应答服务的具体描述。Step S1222, according to the data attribute ID of the data attribute of the searched command response service item, search for the corresponding data attribute in the data attribute list one by one, so as to obtain the corresponding command response service according to the detailed information of the searched data attribute The specific description of the command response service corresponding to the item.
步骤S1223、获取指令应答数据中的任务ID,根据获得的任务ID、指令应答服务ID及搜寻到的数据属性结合对应的数据属性ID依序进行二进制编码,获得指令应答数据的二进制数据串。其中,任务是指指令所对应的任务。Step S1223: Obtain the task ID in the command response data, and sequentially perform binary encoding according to the obtained task ID, command response service ID and searched data attributes combined with the corresponding data attribute ID, to obtain a binary data string of the command response data. Wherein, the task refers to the task corresponding to the instruction.
结合图5,具体地,所述步骤S13包括:With reference to FIG. 5, specifically, the step S13 includes:
步骤S131、当检测到所述下行指令时,获取任务ID及下行指令服务ID。其中,下行指令是指需要平台下发的指令,任务是指指令所对应的任务。Step S131 , when the downlink command is detected, acquire a task ID and a downlink command service ID. Wherein, the downlink instruction refers to the instruction that needs to be issued by the platform, and the task refers to the task corresponding to the instruction.
步骤S132、根据获得的所述下行指令服务ID于所述下行指令服务列表中搜寻对应的下行指令服务项。Step S132: Search for a corresponding downlink command service item in the downlink command service list according to the obtained downlink command service ID.
步骤S133、根据搜寻到的下行指令服务项的数据属性的数据属性ID逐个依序在所述数据属性列表中搜寻对应的数据属性,以根据搜寻到的数据属性的详细信息获取相应的下行指令服务项所对应的下行指令服务的具体描述。Step S133, according to the data attribute ID of the data attribute of the searched downlink command service item, search for the corresponding data attribute in the data attribute list one by one, so as to obtain the corresponding downlink command service according to the detailed information of the searched data attribute The specific description of the downlink command service corresponding to the item.
步骤S134、对所述下行指令的二进制数据串根据搜寻到的数据属性结合对应的数据属性ID的顺序进行解码,获得对应的具体数据内容。Step S134: Decode the binary data string of the downlink command according to the order of the searched data attribute and the corresponding data attribute ID, to obtain the corresponding specific data content.
其中,所述步骤S131前还可包括:判断是否存在下行指令需要平台进行下发,若是,执行步骤S131。其中,当进行下行指令的解码时,先对数据报文进行预解码,获取1个字节的业务类型标识,当获得的业务类型标识的数据内容所指示的信息中判断该数据内容不是下行指令,则直接丢弃该数据;否则,则该数据内容是下行指令,执行步骤S131。Wherein, before the step S131, it may further include: judging whether there is a downlink instruction that needs to be issued by the platform, and if so, execute step S131. Wherein, when decoding the downlink command, the data message is first pre-decoded to obtain a 1-byte service type identifier, and when the information indicated by the data content of the obtained service type identifier is judged that the data content is not a downlink instruction , the data is directly discarded; otherwise, the data content is a downlink instruction, and step S131 is executed.
请参阅图6,图6为本发明实施例提供的物联网终端物模型自适应编解码系统的框架示意图,所述物联网终端物模型自适应编解码系统应用于物联网终端,且可执行上述物联网终端物模型自适应编解码方法,所述物联网终端物模型自适应编解码系统10包括业务初始化模块11、编码模块12及解码模块13,所述业务初始化模块11用于加载物模型定义,从物模型定义中解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,以可通过业务初始化模块11重新初始化编码模块12和解码模块13;所述编码模块12与所述业务初始化模块相连,用于对上行数据进行编码;所述解码模块13与所述业务初始化模块相连,用于对下行指令进行解码。Please refer to FIG. 6. FIG. 6 is a schematic framework diagram of an IoT terminal object model adaptive encoding and decoding system provided by an embodiment of the present invention. The IoT terminal object model adaptive encoding and decoding system is applied to an IoT terminal and can execute the above-mentioned The Internet of Things terminal object model adaptive encoding and decoding method, the Internet of Things terminal object model adaptive encoding and
其中,所述物联网终端物模型自适应编解码系统10通过设置业务初始化模块11以于物联网终端加载物模型定义以解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,配合编码模块12及解码模块13,以重新初始化编码模块12和解码模块13,在物模型发生变化更新且需要上报数据、对平台的下行指令进行处理或应答时,可根据物模型定义解析出的对应列表直接对数据进行编解码,无需用户另外人工编写生成物联网终端的编解码程序即可实现对新的物模型进行编解码,无需重新加载编解码程序的过程,提高工作效率,且避免因物模型变更而必须在运营设备进行在线升级的问题。Among them, the Internet of Things terminal object model adaptive encoding and
结合图7,具体地,在本实施例中,所述物联网终端物模型自适应编解码系统10还包括存储模块14,所述存储模块14与所述业务初始化模块11相连,用于存储所述数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,以便后续编码模块12和解码模块13进行搜寻操作。Referring to FIG. 7, specifically, in this embodiment, the IoT terminal object model adaptive encoding and
具体地,所述上行数据包括上报数据,所述编码模块12包括上报数据编码单元121,所述上报数据编码单元121用于当检测到上报数据时,根据用户提供的数据上报服务ID及解析获得的所述数据上报服务列表和所述数据属性列表进行数据编码。Specifically, the uplink data includes reported data, and the
具体地,所述上行数据包括指令应答数据,所述编码模块12包括指令应答数据编码单元122,所述指令应答数据编码单元122用于当检测到指令应答数据时,根据用户提供的指令应答服务ID及解析获得的所述指令应答服务列表和所述数据属性列表进行数据编码。Specifically, the uplink data includes command response data, and the
综上所述,本发明一种物联网终端物模型自适应编解码方法通过于物联网终端加载物模型定义以解析出数据属性列表、数据上报服务列表、下行指令服务列表及指令应答服务列表,以在物模型发生变化更新且需要上报数据、对平台的下行指令进行处理或应答时,可根据物模型定义解析出的对应列表直接对数据进行编解码,无需用户另外人工编写生成物联网终端的编解码程序即可实现对新的物模型进行编解码,无需重新加载编解码程序的过程,提高工作效率,且避免因物模型变更而必须在运营设备进行在线升级的问题。本发明一种物联网终端物模型自适应编解码系统也具有上述功能。To sum up, an adaptive encoding and decoding method for an Internet of Things terminal object model in the present invention is defined by an object model loaded on an Internet of Things terminal to parse out a data attribute list, a data reporting service list, a downlink command service list, and a command response service list, When the object model changes and updates and needs to report data, process or respond to the downlink commands of the platform, the data can be directly encoded and decoded according to the corresponding list parsed from the object model definition, without the need for users to manually write and generate IoT terminal The codec program can realize the encoding and decoding of the new object model, without reloading the process of the codec program, improving work efficiency, and avoiding the problem of online upgrade of the operating equipment due to the change of the object model. An adaptive encoding and decoding system for an Internet of Things terminal object model according to the present invention also has the above functions.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the technical scope disclosed in the present invention. Modifications or replacements shall all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211710112.7A CN115967472B (en) | 2022-12-29 | An adaptive coding and decoding method and system for IoT terminal object model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211710112.7A CN115967472B (en) | 2022-12-29 | An adaptive coding and decoding method and system for IoT terminal object model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115967472A true CN115967472A (en) | 2023-04-14 |
CN115967472B CN115967472B (en) | 2025-07-04 |
Family
ID=
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190123959A1 (en) * | 2017-10-24 | 2019-04-25 | Honeywell International Inc. | Systems and methods for adaptive industrial internet of things (iiot) edge platform |
US20200169504A1 (en) * | 2018-11-28 | 2020-05-28 | Nokia Technologies Oy | Systems and methods for encoding and decoding iot messages |
CN111294401A (en) * | 2020-02-10 | 2020-06-16 | 泰华智慧产业集团股份有限公司 | Internet of things equipment access method and device |
CN112291235A (en) * | 2020-10-28 | 2021-01-29 | 泰华智慧产业集团股份有限公司 | Internet of things equipment protocol coding and decoding method and device adaptive to micro-service architecture |
WO2021056586A1 (en) * | 2019-09-29 | 2021-04-01 | 西门子股份公司 | Internet-of-things model-based virtual internet-of-things device generation method and apparatus |
WO2022041279A1 (en) * | 2020-08-31 | 2022-03-03 | Oppo广东移动通信有限公司 | Device management method and apparatus in internet of things, computer device and storage medium |
CN114297215A (en) * | 2021-12-31 | 2022-04-08 | 天翼物联科技有限公司 | Internet of things terminal object model standardization processing method and device, computer equipment and storage medium |
CN114553978A (en) * | 2022-04-24 | 2022-05-27 | 深圳市城市交通规划设计研究中心股份有限公司 | Sensor message data processing method, electronic equipment and storage medium |
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190123959A1 (en) * | 2017-10-24 | 2019-04-25 | Honeywell International Inc. | Systems and methods for adaptive industrial internet of things (iiot) edge platform |
US20200169504A1 (en) * | 2018-11-28 | 2020-05-28 | Nokia Technologies Oy | Systems and methods for encoding and decoding iot messages |
WO2021056586A1 (en) * | 2019-09-29 | 2021-04-01 | 西门子股份公司 | Internet-of-things model-based virtual internet-of-things device generation method and apparatus |
CN114342338A (en) * | 2019-09-29 | 2022-04-12 | 西门子股份公司 | Virtual Internet of things equipment generation method and device based on Internet of things model |
CN111294401A (en) * | 2020-02-10 | 2020-06-16 | 泰华智慧产业集团股份有限公司 | Internet of things equipment access method and device |
WO2022041279A1 (en) * | 2020-08-31 | 2022-03-03 | Oppo广东移动通信有限公司 | Device management method and apparatus in internet of things, computer device and storage medium |
CN112291235A (en) * | 2020-10-28 | 2021-01-29 | 泰华智慧产业集团股份有限公司 | Internet of things equipment protocol coding and decoding method and device adaptive to micro-service architecture |
CN114297215A (en) * | 2021-12-31 | 2022-04-08 | 天翼物联科技有限公司 | Internet of things terminal object model standardization processing method and device, computer equipment and storage medium |
CN114553978A (en) * | 2022-04-24 | 2022-05-27 | 深圳市城市交通规划设计研究中心股份有限公司 | Sensor message data processing method, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
傅启明;高沈钢;: "一种适用于物联网通信的报文编解码组件设计", 企业科技与发展, no. 05, 10 May 2017 (2017-05-10) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4982501B2 (en) | Method and apparatus for compressing / decompressing data for communication with a wireless device | |
CN111324619B (en) | Object updating method, device, equipment and storage medium in micro-service system | |
CN106790206B (en) | The message parsing method and device of operation system | |
CN112988485B (en) | Simulation test methods and devices for power Internet of Things equipment | |
KR20080037450A (en) | Update system and method of software execution module | |
CN111198813A (en) | Interface testing method and device | |
CN111111214B (en) | Game archiving processing method, device and system | |
CN110647316B (en) | Method and device for generating universal business object, computer equipment and storage medium | |
CN113973139B (en) | Message processing method and device | |
CN113556359A (en) | Communication protocol conversion method, device, system and gateway device | |
CN110233842B (en) | Request verification method and related device | |
CN111562907A (en) | Conversion method and system of user-defined interface data | |
CN115329170A (en) | Webpage crawling method, device, equipment and storage medium | |
CN112732265A (en) | Data processing method and related device | |
CN115967472A (en) | Internet of things terminal object model self-adaptive encoding and decoding method and system | |
CN115967472B (en) | An adaptive coding and decoding method and system for IoT terminal object model | |
CN107506474B (en) | Database operation method and device based on object mapping | |
CN111078215A (en) | Software product application method and device, storage medium and electronic equipment | |
CN116886500A (en) | Real-time operation and maintenance method and device of embedded equipment, electronic equipment and storage medium | |
US20110029568A1 (en) | Information processing system, first information processing apparatus, second information processing apparatus, and third information processing apparatus | |
CN102130786A (en) | Method and device for updating single board characteristics | |
US20050216896A1 (en) | Data communication via tanslation map exchange | |
CN113626001A (en) | API dynamic editing method and device based on script | |
CN113409142A (en) | Security trading method, device, system and computer readable storage medium | |
US12216627B2 (en) | Systems and methods for providing a database driver management architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |