WO2022116009A1 - Data transmission method and apparatus, and communication device - Google Patents

Data transmission method and apparatus, and communication device Download PDF

Info

Publication number
WO2022116009A1
WO2022116009A1 PCT/CN2020/133158 CN2020133158W WO2022116009A1 WO 2022116009 A1 WO2022116009 A1 WO 2022116009A1 CN 2020133158 W CN2020133158 W CN 2020133158W WO 2022116009 A1 WO2022116009 A1 WO 2022116009A1
Authority
WO
WIPO (PCT)
Prior art keywords
field
tag
byte
value
length
Prior art date
Application number
PCT/CN2020/133158
Other languages
French (fr)
Chinese (zh)
Inventor
吕小强
罗朝明
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202080105087.2A priority Critical patent/CN116615874A/en
Priority to PCT/CN2020/133158 priority patent/WO2022116009A1/en
Publication of WO2022116009A1 publication Critical patent/WO2022116009A1/en

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the embodiments of the present application relate to the field of mobile communication technologies, and in particular, to a data transmission method and apparatus, and a communication device.
  • the data transmitted between the client and the server is encoded and decoded in TLV format.
  • the current TLV format indicates that the TLV structure includes a tag (Tag) field, a length (Length) field and a value (Value) field.
  • a basic data element includes the above three fields, among which, the Tag field is used to describe the label of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data (that is, the attribute of the tag described by the Tag field. value).
  • the efficiency of encoding and decoding is low due to the lack of some control information.
  • Embodiments of the present application provide a data transmission method and apparatus, and a communication device.
  • the first device sends the first signaling to the second device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte (ControlByte) field, a Tag field, and at least one of the following: a Length field and a Value field.
  • ControlByte ControlByte
  • Tag Tag
  • Value Value
  • the second device receives the first signaling sent by the first device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
  • the data transmission device provided by the embodiment of the present application is applied to the first device, and the device includes:
  • a sending unit configured to send a first signaling to the second device, where the data carried in the first signaling is encoded in a first TLV format;
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
  • the data transmission device provided by the embodiment of the present application is applied to the second device, and the device includes:
  • a receiving unit configured to receive the first signaling sent by the first device, where the data carried in the first signaling is encoded in the first TLV format;
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
  • the communication device includes a processor and a memory.
  • the memory is used to store a computer program
  • the processor is used to call and run the computer program stored in the memory to execute the above-mentioned data transmission method.
  • the chip provided by the embodiment of the present application is used to implement the above-mentioned data transmission method.
  • the chip includes: a processor for invoking and running a computer program from the memory, so that the device on which the chip is installed executes the above-mentioned data transmission method.
  • the computer-readable storage medium provided by the embodiment of the present application is used to store a computer program, and the computer program enables a computer to execute the above-mentioned data transmission method.
  • the computer program product provided by the embodiments of the present application includes computer program instructions, and the computer program instructions cause a computer to execute the above-mentioned data transmission method.
  • the computer program provided by the embodiment of the present application when it runs on the computer, causes the computer to execute the above-mentioned data transmission method.
  • the TLV structure (ie the first TLV structure) determined by the new type of TLV format includes a control byte (ControlByte) field, a Tag field , and at least one of the following: Length field, Value field. Since the first TLV structure has a ControlByte field, some control information related to other fields can be described through the ControlByte field, the efficiency of encoding and decoding is improved, and a TLV structure conforming to the application is realized.
  • FIG. 1 is an optional communication architecture diagram provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a data transmission method provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of interaction between a client and a server provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram 1 of the structure and composition of a data transmission device provided by an embodiment of the present application.
  • FIG. 5 is a second schematic diagram of the structure and composition of a data transmission device provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a communication device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the Open Connectivity Foundation defines a client and a server.
  • the server refers to the device that provides resources
  • the client refers to the device that accesses resources.
  • OCF adopts the Representational State Transfer (RESTful) architecture, and uses resources to represent IoT physical devices, as well as the functional services provided by the devices and the status of the devices.
  • the device that provides resources is the server, and the device that accesses resources is the client. end.
  • the client and server defined in OCF are logical functional entities, and a device can be a client, a server, or both a client and a server.
  • the business interaction between the client and the server is realized by performing RESTful operations on resources.
  • the RESTful operations can be Create-Retrieve-Update-Delete-Notify (CRUDN) operations.
  • CRUDN CRUDN
  • the operation can be any one or more of the following operations: Create (Create), Read (Retrieve), Update (Update), Delete (Delete), and Notify (Notify).
  • the client is the initiator of the RESTful operation
  • the server is the responder of the RESTful operation.
  • the client sends a resource operation request to the server, and requests to operate the resources on the server.
  • the server performs the resource operation and returns a response to the client. , the content and description information of the resource are carried in the response.
  • FIG. 1 is an optional communication architecture diagram provided by an embodiment of the present application.
  • the resource is described as a resource model layer, and each resource corresponds to a specific uniform resource identifier (Uniform Resource Identifier, URI), which can be accessed by accessing the resource.
  • URI Uniform Resource Identifier
  • It is the transport protocol layer that transmits resource content and description information. By mapping resource operations to specific transport protocols, the Restful operation of each resource is transformed into an entity message that is transmitted between devices, providing a means for interconnection between devices.
  • the transmission protocol of OCF adopts Constrained Application Protocol (CoAP) to carry resource operations.
  • CoAP Constrained Application Protocol
  • Each CRUDN operation is mapped to a CoAP request message or response message.
  • the method operates on the resources of the server, thereby realizing the transition of the resource state.
  • TLV is a type of Basic Encoding Rule (BER) encoding and complies with the ASN1 standard.
  • the full name of TLV is: Tag (tag)-Length (length)-Value (value).
  • BER Basic Encoding Rule
  • a basic data element includes a tlv triplet, namely Tag-Length-Value.
  • a basic data element includes three fields, namely Tag field, Length field and Value field.
  • the Tag field is used to describe the tag of the data
  • the Length field is used to describe the length of the Value field
  • the Value field is used to describe the Value of the data (ie, the attribute value of the tag described by the Tag field).
  • the technical solutions of the embodiments of the present application propose a TLV format that matches a specific transmission protocol, which is called the first TLV format. It should be noted that the description of the first TLV format can also be replaced by other methods, such as the TLV format , or CTLV format, etc.
  • the client and the server can use the first TLV format to encode and decode the content of the payload (that is, the data carried in the signaling) in the mutual signaling.
  • FIG. 2 is a schematic flowchart of a data transmission method provided by an embodiment of the present application. As shown in FIG. 2 , the data transmission method includes the following steps:
  • Step 201 The first device sends the first signaling to the second device, the second device receives the first signaling sent by the first device, and the data carried in the first signaling is encoded in the first TLV format; wherein, The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
  • the first device is a client
  • the second device is a server.
  • the first signaling is a resource operation request message.
  • the resource operation request message may be, for example, a request message for modifying a service (Server) state.
  • the data carried in the first signaling is encoded in the first TLV format provided by the embodiment of the present application.
  • the server After receiving the resource operation request message, the server decodes the first signaling according to the first TLV format provided in the embodiment of the present application, thereby obtaining data carried in the first signaling, and performs corresponding operations, such as attributes, according to the data Change operation.
  • the first device is a server
  • the second device is a client.
  • the first signaling is a response message.
  • the data carried in the response message is encoded in the first TLV format provided by the embodiment of the present application.
  • the client terminal decodes the first signaling according to the first TLV format provided by the embodiment of the present application, so as to obtain the data carried in the first signaling.
  • the first TLV format in this embodiment of the present application is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
  • the first TLV structure includes a ControlByte field and a Tag field.
  • the first TLV structure includes a ControlByte field, a Tag field and a Value field.
  • the first TLV structure includes a ControlByte field, a Tag field, a Length field and a Value field.
  • the ControlByte field is used to describe the control information of other fields, for example, the control information of the Tag field and/or the control information of the Value field.
  • the control information of the Tag field includes the description of the Tag.
  • the control information of the Value field includes the data type of the Value, and optionally, the length of the Length field and/or the length of the Value field.
  • the Tag field is used to describe the tag of the data.
  • the Length field is used to describe the length of the Value field.
  • the Value field is used to describe the Value of the data (that is, the attribute value corresponding to the tag).
  • the content of the Tag field is 0X12, which means that the tag is temperature.
  • the content of the Value field is 15, which represents the value of the temperature of 15 degrees.
  • the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  • the value of N1 is 1, that is, the length of the ControlByte field is 1 byte.
  • the ControlByte field includes two parts, namely a first part and a second part, wherein the first part may also be called a tagControl part, and the second part may also be called an elementType part.
  • the first part is used to determine the related control information of the Tag field
  • the second part is used to determine the related control information of the Value field.
  • the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  • Bit7-bit5 are the first part of bits.
  • the second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field.
  • Bit4-bit0 is the second part of bits.
  • the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control. Further, the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
  • the description of the Tag is used to determine at least one of the following: the length of the Tag field, the tag type described in the Tag field is an attribute identification tag (iid tag) or an index tag (index tag) or a device identification tag (DeviceID tag) Either the transaction identification tag (ID tag) or the service identification tag (siid tag).
  • the tag type described by the Tag field is, for example: the tag type described by the Tag field is an attribute identification tag (iid tag) or an index tag (index tag).
  • the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field. Further, the second part of bits in the ControlByte field is also used to indicate at least one of the following: the length of the Length field and the length of the Value field. Alternatively, the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
  • Tables 1-1 and 1-2 show the contents indicated by the different values of the first part of the bits (ie Bit7-bit5) in the ControlByte field, and the second part of the bits (ie Bit4) -bit0) indicates the content in the case of different values.
  • the second part of bits is used to indicate that the data type of Value is an 8-bit unsigned integer (uint8) , and there is no Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 1 byte.
  • the second part of the bits is used to indicate that the data type of the Value is an 8-bit signed integer (int8) , and there is no Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 1 byte.
  • the second part of the bits is used to indicate that the data type of Value is a boolean (boolean) type, and the data The value of is false (false), and there is no Length field (it can also be understood that the length of the Length field is 0 bytes) and there is no Value field (it can also be understood that the length of the Value field is 0 bytes).
  • the second part of the bits is used to indicate that the data type of Value is a floating point (float) type, and no The Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 4 bytes.
  • the second part of the bits is used to indicate that the data type of Value is bytes, and the Length The length of the field is 1 byte, and the Value field is variable length.
  • the second part of the bits is used to indicate that the data type of Value is a string (string) type, and the Length
  • the length of the field is 1 byte, and the Value field is variable length.
  • the second part of the bits are used to indicate that the data type of Value is a struct type, and the Length Field and Value fields are variable length.
  • the second part of the bits are used to indicate that the data type of Value is an array type, and the Length field and Value fields are variable length.
  • the second part of the bits (ie Bit4-bit0) in the ControlByte field is 11011
  • the second part of the bit is used to indicate the terminator of the struct
  • the value of Bit5-bit7 is 000 .
  • the second part of the bit is used to indicate the terminator of the array, and the value of Bit5-bit7 is 000 .
  • unsigned integer type signed integer type
  • Boolean type floating point type
  • byte type 0 .
  • String types are reference types.
  • Structure types and array types are container data types.
  • the second part of the bits is used to indicate that the purpose of the data is universal for device access.
  • the second part of the bits is used to indicate that the purpose of the data is for device control, and the tag described in the Tag field
  • the type is iid tag
  • the length of the Tag field is 1 byte.
  • the tag value (that is, the value of the Tag field) is the iid value
  • the value value (that is, the value of the Value field) is the attribute value corresponding to idd.
  • iid is the unique identifier of the attribute, or event, or method within the service.
  • the second part of the bits is used to indicate that the purpose of the data is for device control, and the tag described in the Tag field
  • the type is index tag, and the length of the Tag field is 1 byte.
  • index is used to mark the child element in the struct data type or array data type
  • the tag value ie the value of the Tag field
  • the value value ie the value of the Value field
  • the second part of the bits is used to indicate that the purpose of the data is common for device control.
  • the tag value (that is, the value of the Tag field) is 0x1, which represents the DeviceID tag, and the value value (that is, the value of the Value field) is the deviceID value, where deviceID is an ID that identifies a device.
  • the tag value (that is, the value of the Tag field) is 0x2, which represents the transaction ID tag, and the value value (that is, the value of the Value field) is the transaction ID value.
  • the transaction ID is a group of associated The identifier of the signaling flow.
  • the tag value (that is, the value of the Tag field) is 0x3, which represents the siid tag, and the value value (that is, the value of the Value field) is a siid value with a length of 1 byte.
  • siid is a The ID of the service instance.
  • the tag value (that is, the value of the Tag field) is 0x4, which represents the siid tag, and the value value (that is, the value of the Value field) is the siid value with a length of 2 bytes.
  • siid is a The ID of the service instance.
  • the length of the Tag field is N2 bytes, and N2 is a positive integer.
  • the value of N2 is greater than or equal to 0 and less than or equal to 8, that is, the length of the Tag field is 0-8 bytes.
  • the structure of the byte occupied by the Tag field is shown in Table 2-1 below, where the highest bit (ie bit7) of the byte is the Tag length identification bit, and the lower 7 bits of the byte (ie bit6- bit0) is used to identify the Tag value.
  • the structure of the byte occupied by the Tag field is shown in Table 2-2 below, where all bits (ie, bit7-bit0) of the byte are used to identify the Tag value.
  • the Tag field can occupy one or more bytes.
  • the length and value of the Tag field may be determined through the following scheme.
  • the Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte, and the The value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  • the first value is 0. Specifically, when the value of the Tag length identification bit in a byte is 0, Bit6-bit0 is used to identify the tag value (that is, the value of the Tag field is determined).
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte.
  • Two bytes and a third byte, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, the first word The highest bit in the section is the Tag length identification bit.
  • the second value is 1.
  • the value of the Tag length identification bit in a byte ie, the first byte
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte.
  • Two bytes, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the highest bit in the first byte It is the Tag length identification bit.
  • the second value is 1.
  • the value of the Tag length identification bit of a byte ie, the first byte
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte. Two bytes, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on until the The value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer; the value of the Tag field Determined by the lower 7 bits of each of the first byte to the Mth byte.
  • the second value is 1 and the first value is 0.
  • the Tag length identification bit of a byte that is, the first byte
  • Use bit6-bit0 of each byte to identify the tag value (that is, to determine the value of the Tag field).
  • the Tag field occupies the first byte and the second byte.
  • the Tag length identification bit of the first byte is 1, which means that the first byte followed by a byte (ie, the second byte) also belongs to the Tag field
  • the Tag length identification bit of the second byte is 0, representing The second byte is the last byte occupied by the Tag field.
  • the first half of the binary data, 0000001 corresponds to bit6-bit0 of the first byte
  • the second half, 0000001 corresponds to bit6-bit0 of the second byte.
  • the two parts are combined to identify a tag value of "129". It should be noted that if there are three bytes or more bytes, it can be deduced by analogy.
  • the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: the Tag field
  • the length of the tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
  • the length of the Tag field can be determined directly according to the first part (ie, the tagControl part) in the ControlByte field.
  • the indication content corresponding to the value of the first part in the ControlByte field may be determined with reference to the content shown in Table 1-1 above.
  • the length of the Length field is N3 bytes, and N3 is a positive integer.
  • the value of N3 is greater than or equal to 0 and less than or equal to 8, that is, the length of the Length field is 0-8 bytes.
  • the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the Length field length.
  • the Length field of container data types (such as struct type and array type) is of variable length, so the length can be determined in a variable-length manner.
  • the terminator of a struct or an array may be used to identify the end position of a struct or a struct, so that the length of the Length field is determined according to the end position.
  • the basic data types are, for example, the unsigned integer type (uint), the signed integer type (nit), and the floating point type (float) as shown in Table 2-1.
  • the container data type is, for example, the structure (struct) type shown in Table 2-1, the array (array) type, and the like.
  • the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  • the length of the Value field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the ControlByte The second part of the field is used to indicate the terminator of the container data type.
  • the above technical solutions of the embodiments of the present application provide a novel TLV structure (that is, the first TLV structure).
  • the following Table 4 provides the overall structure of the first TLV structure, where the length of the ControlByte field is It is 1 byte (byte), the length of the Tag field is 0 to 8 bytes, the length of the Length field is 0 to 8 bytes, and the length of the Value field is variable according to the content.
  • ControlByte Tag Length Value 1byte 0-8bytes 0-8bytes lengthen
  • the client and the server can use the first TLV format in the above solution to encode and decode the content of the payload (that is, the data carried in the signaling) in the mutual signaling, thereby improving the encoding and decoding efficiency.
  • FIG. 4 is a schematic structural diagram 1 of a data transmission apparatus provided by an embodiment of the present application, which is applied to a first device. As shown in FIG. 4 , the data transmission apparatus includes:
  • the sending unit 401 is configured to send a first signaling to a second device, where the data carried in the first signaling is encoded in a first TLV format; wherein,
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  • the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  • the value of N1 is 1.
  • the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control.
  • the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
  • the description of the Tag is used to determine at least one of the following
  • the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
  • the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  • the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field.
  • the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  • the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
  • the second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field.
  • the length of the Tag field is N2 bytes, and N2 is a positive integer.
  • the value of N2 is greater than or equal to 0 and less than or equal to 8.
  • the Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte. , and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte and the third byte after the section, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, all The highest bit in the first byte is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte after the section, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the first byte The highest bit is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte after the section if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on , until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer;
  • the value of the field is determined by the lower 7 bits of each of the first byte to the Mth byte.
  • the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: One: The length of the Tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
  • the length of the Length field is N3 bytes, and N3 is a positive integer.
  • the value of N3 is greater than or equal to 0 and less than or equal to 8.
  • the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Length field.
  • the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  • the length of the Value field is determined based on the second part in the ControlByte field
  • the second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  • the Tag field is used to describe the tag of the data
  • the Length field is used to describe the length of the Value field
  • the Value field is used to describe the Value of the data.
  • FIG. 5 is a second schematic structural diagram of a data transmission apparatus provided by an embodiment of the present application, which is applied to a second device. As shown in FIG. 5 , the data transmission apparatus includes:
  • a receiving unit 501 configured to receive a first signaling sent by a first device, where the data carried in the first signaling is encoded in a first TLV format;
  • the first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  • the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  • the value of N1 is 1.
  • the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control.
  • the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
  • the description of the Tag is used to determine at least one of the following:
  • the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
  • the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  • the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field.
  • the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  • the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
  • the second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field.
  • the length of the Tag field is N2 bytes, and N2 is a positive integer.
  • the value of N2 is greater than or equal to 0 and less than or equal to 8.
  • the Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte. , and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte and the third byte after the section, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, all The highest bit in the first byte is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte after the section, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the first byte The highest bit is the Tag length identification bit.
  • the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word.
  • the second byte after the section if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on , until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer;
  • the value of the field is determined by the lower 7 bits of each of the first byte to the Mth byte.
  • the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: One: The length of the Tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
  • the length of the Length field is N3 bytes, and N3 is a positive integer.
  • the value of N3 is greater than or equal to 0 and less than or equal to 8.
  • the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Length field.
  • the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  • the length of the Value field is determined based on the second part in the ControlByte field
  • the second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  • the Tag field is used to describe the tag of the data
  • the Length field is used to describe the length of the Value field
  • the Value field is used to describe the Value of the data.
  • FIG. 6 is a schematic structural diagram of a communication device 600 provided by an embodiment of the present application.
  • the communication device may be a first device or a second device, wherein the first device may be a client or a server, and the second device may be a server or a client.
  • the communication device 600 shown in FIG. 6 includes processing The processor 610, the processor 610 may call and run a computer program from the memory to implement the method in the embodiments of the present application.
  • the communication device 600 may further include a memory 620 .
  • the processor 610 may call and run a computer program from the memory 620 to implement the methods in the embodiments of the present application.
  • the memory 620 may be a separate device independent of the processor 610 , or may be integrated in the processor 610 .
  • the communication device 600 may further include a transceiver 630, and the processor 610 may control the transceiver 630 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by a device.
  • the transceiver 630 may include a transmitter and a receiver.
  • the transceiver 630 may further include antennas, and the number of the antennas may be one or more.
  • the communication device 600 may specifically be the network device in this embodiment of the present application, and the communication device 600 may implement the corresponding processes implemented by the network device in each method in the embodiment of the present application. For the sake of brevity, details are not repeated here. .
  • the communication device 600 may specifically be the mobile terminal/terminal device of the embodiments of the present application, and the communication device 600 may implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
  • FIG. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the chip 700 shown in FIG. 7 includes a processor 710, and the processor 710 can call and run a computer program from a memory, so as to implement the method in this embodiment of the present application.
  • the chip 700 may further include a memory 720 .
  • the processor 710 may call and run a computer program from the memory 720 to implement the methods in the embodiments of the present application.
  • the memory 720 may be a separate device independent of the processor 710 , or may be integrated in the processor 710 .
  • the chip 700 may further include an input interface 730 .
  • the processor 710 may control the input interface 730 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
  • the chip 700 may further include an output interface 740 .
  • the processor 710 can control the output interface 740 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
  • the chip can be applied to the network device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the network device in each method of the embodiment of the present application, which is not repeated here for brevity.
  • the chip can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application.
  • the chip can implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application.
  • the chip can implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application.
  • the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-chip, or a system-on-a-chip, or the like.
  • the processor in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability.
  • each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
  • Embodiments of the present application further provide a computer-readable storage medium for storing a computer program.
  • the computer-readable storage medium can be applied to the network device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the network device in each method of the embodiments of the present application.
  • the computer program enables the computer to execute the corresponding processes implemented by the network device in each method of the embodiments of the present application.
  • the computer-readable storage medium can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application. , and are not repeated here for brevity.
  • Embodiments of the present application also provide a computer program product, including computer program instructions.
  • the computer program product can be applied to the network device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the network device in each method of the embodiments of the present application. Repeat.
  • the computer program product can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application, For brevity, details are not repeated here.
  • the embodiments of the present application also provide a computer program.
  • the computer program can be applied to the network device in the embodiments of the present application, and when the computer program runs on the computer, the computer executes the corresponding processes implemented by the network device in the various methods of the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
  • the computer program may be applied to the mobile terminal/terminal device in the embodiments of the present application, and when the computer program is run on the computer, the mobile terminal/terminal device implements the various methods of the computer program in the embodiments of the present application.
  • the corresponding process for the sake of brevity, will not be repeated here.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory,) ROM, random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Communication Control (AREA)

Abstract

Embodiments of the present application provide a data transmission method and apparatus, and a communication device. The method comprises: a first device sends first signaling to a second device, data carried in the first signaling being encoded in a first TLV format; wherein the first TLV format is used for determining a first TLV structure, and the first TLV structure comprises a control byte field, a tag field, and at least one of a length field and a value field.

Description

一种数据传输方法及装置、通信设备A data transmission method and device, and communication equipment 技术领域technical field
本申请实施例涉及移动通信技术领域,具体涉及一种数据传输方法及装置、通信设备。The embodiments of the present application relate to the field of mobile communication technologies, and in particular, to a data transmission method and apparatus, and a communication device.
背景技术Background technique
客户端与服务端之间传输的数据采用TLV格式进行编码和解码。目前的TLV格式指出TLV结构包括标签(Tag)字段、长度(Length)字段和取值(Value)字段。一个基本的数据元就包括以上三个字段,其中,Tag字段用于描述数据的标签,Length字段用于描述Value字段的长度,Value字段用于描述数据的Value(即Tag字段描述的标签的属性值)。采用上述TLV格式进行编码和解码时,由于缺少一些控制信息,导致编码和解码的效率较低。The data transmitted between the client and the server is encoded and decoded in TLV format. The current TLV format indicates that the TLV structure includes a tag (Tag) field, a length (Length) field and a value (Value) field. A basic data element includes the above three fields, among which, the Tag field is used to describe the label of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data (that is, the attribute of the tag described by the Tag field. value). When the above-mentioned TLV format is used for encoding and decoding, the efficiency of encoding and decoding is low due to the lack of some control information.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种数据传输方法及装置、通信设备。Embodiments of the present application provide a data transmission method and apparatus, and a communication device.
本申请实施例提供的数据传输方法,包括:The data transmission method provided by the embodiment of the present application includes:
第一设备向第二设备发送第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,The first device sends the first signaling to the second device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节(ControlByte)字段、Tag字段、以及以下至少之一:Length字段、Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte (ControlByte) field, a Tag field, and at least one of the following: a Length field and a Value field.
本申请实施例提供的数据传输方法,包括:The data transmission method provided by the embodiment of the present application includes:
第二设备接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,The second device receives the first signaling sent by the first device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括ControlByte字段、Tag字段、以及以下至少之一:Length字段、Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
本申请实施例提供的数据传输装置,应用于第一设备,所述装置包括:The data transmission device provided by the embodiment of the present application is applied to the first device, and the device includes:
发送单元,用于向第二设备发送第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,a sending unit, configured to send a first signaling to the second device, where the data carried in the first signaling is encoded in a first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括ControlByte字段、Tag字段、以及以下至少之一:Length字段、Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
本申请实施例提供的数据传输装置,应用于第二设备,所述装置包括:The data transmission device provided by the embodiment of the present application is applied to the second device, and the device includes:
接收单元,用于接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,a receiving unit, configured to receive the first signaling sent by the first device, where the data carried in the first signaling is encoded in the first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括ControlByte字段、Tag字段、以及以下至少之一:Length字段、Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
本申请实施例提供的通信设备,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,执行上述的数据传输方法。The communication device provided by the embodiments of the present application includes a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the above-mentioned data transmission method.
本申请实施例提供的芯片,用于实现上述的数据传输方法。The chip provided by the embodiment of the present application is used to implement the above-mentioned data transmission method.
具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行上述的数据传输方法。Specifically, the chip includes: a processor for invoking and running a computer program from the memory, so that the device on which the chip is installed executes the above-mentioned data transmission method.
本申请实施例提供的计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述的数据传输方法。The computer-readable storage medium provided by the embodiment of the present application is used to store a computer program, and the computer program enables a computer to execute the above-mentioned data transmission method.
本申请实施例提供的计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述的数据传输方法。The computer program product provided by the embodiments of the present application includes computer program instructions, and the computer program instructions cause a computer to execute the above-mentioned data transmission method.
本申请实施例提供的计算机程序,当其在计算机上运行时,使得计算机执行上述的数据传输 方法。The computer program provided by the embodiment of the present application, when it runs on the computer, causes the computer to execute the above-mentioned data transmission method.
通过上述技术方案,提出了一种新型的TLV格式(即第一TLV格式),通过该新型的TLV格式确定出的TLV结构(即第一TLV结构)包括控制字节(ControlByte)字段、Tag字段、以及以下至少之一:Length字段、Value字段。由于第一TLV结构具有ControlByte字段,因而可以通过该ControlByte字段描述一些其他字段相关的控制信息,提高了编码和解码的效率,实现了一种符合应用的TLV结构。Through the above technical solution, a new type of TLV format (ie the first TLV format) is proposed, and the TLV structure (ie the first TLV structure) determined by the new type of TLV format includes a control byte (ControlByte) field, a Tag field , and at least one of the following: Length field, Value field. Since the first TLV structure has a ControlByte field, some control information related to other fields can be described through the ControlByte field, the efficiency of encoding and decoding is improved, and a TLV structure conforming to the application is realized.
附图说明Description of drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:
图1是本申请实施例提供的一种可选的通信架构图;FIG. 1 is an optional communication architecture diagram provided by an embodiment of the present application;
图2是本申请实施例提供的数据传输方法的流程示意图;2 is a schematic flowchart of a data transmission method provided by an embodiment of the present application;
图3是本申请实施例提供的客户端与服务端交互的示意图;3 is a schematic diagram of interaction between a client and a server provided by an embodiment of the present application;
图4是本申请实施例提供的数据传输装置的结构组成示意图一;4 is a schematic diagram 1 of the structure and composition of a data transmission device provided by an embodiment of the present application;
图5是本申请实施例提供的数据传输装置的结构组成示意图二;FIG. 5 is a second schematic diagram of the structure and composition of a data transmission device provided by an embodiment of the present application;
图6是本申请实施例提供的一种通信设备示意性结构图;FIG. 6 is a schematic structural diagram of a communication device provided by an embodiment of the present application;
图7是本申请实施例的芯片的示意性结构图。FIG. 7 is a schematic structural diagram of a chip according to an embodiment of the present application.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。Hereinafter, the present application will be described in detail with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. Obviously, the described embodiments are some, but not all, embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence.
为便于理解本申请实施例的技术方案,以下对本申请实施例涉及到的相关技术进行说明。In order to facilitate the understanding of the technical solutions of the embodiments of the present application, the related technologies involved in the embodiments of the present application are described below.
Figure PCTCN2020133158-appb-000001
通信架构
Figure PCTCN2020133158-appb-000001
Communication Architecture
开放互联基金会(Open Connectivity Foundation,OCF)定义了客户端和服务端,服务端是指提供资源的设备,客户端是指访问资源的设备。The Open Connectivity Foundation (OCF) defines a client and a server. The server refers to the device that provides resources, and the client refers to the device that accesses resources.
OCF采用表述状态转移(Representational State Transfer,RESTful)架构,通过资源来表述物联网实体设备,以及设备提供的功能服务和设备的状态等信息,提供资源的设备是服务端,访问资源的设备是客户端。OCF中定义的客户端和服务端是逻辑功能实体,一个设备可以是客户端、或服务端、或既是客户端又是服务端。OCF adopts the Representational State Transfer (RESTful) architecture, and uses resources to represent IoT physical devices, as well as the functional services provided by the devices and the status of the devices. The device that provides resources is the server, and the device that accesses resources is the client. end. The client and server defined in OCF are logical functional entities, and a device can be a client, a server, or both a client and a server.
客户端和服务端的业务交互是通过对资源进行RESTful操作来实现的,RESTful操作可以是创建-读取-更新-删除-通知(Create-Retrieve-Update-Delete-Notify,CRUDN)操作,显然,CRUDN操作可以是以下任意一种或多种操作:创建(Create)、读取(Retrieve)、更新(Update)、删除(Delete)、通知(Notify)。客户端是RESTful操作的发起方,服务端是RESTful操作的响应方,客户端向服务端发送资源操作请求,请求对服务端上的资源进行操作,服务端执行资源操作,并向客户端返回响应,响应中携带资源的内容及描述信息。The business interaction between the client and the server is realized by performing RESTful operations on resources. The RESTful operations can be Create-Retrieve-Update-Delete-Notify (CRUDN) operations. Obviously, CRUDN The operation can be any one or more of the following operations: Create (Create), Read (Retrieve), Update (Update), Delete (Delete), and Notify (Notify). The client is the initiator of the RESTful operation, and the server is the responder of the RESTful operation. The client sends a resource operation request to the server, and requests to operate the resources on the server. The server performs the resource operation and returns a response to the client. , the content and description information of the resource are carried in the response.
图1是本申请实施例提供的一种可选的通信架构图,对资源的描述为资源模型层,每个资源对应一个特定的统一资源标识符(Uniform Resource Identifier,URI),可通过访问资源的URI来访问这个资源,另外每个资源具有支持Restful操作的相应接口。传输资源内容及描述信息的是传输协议层,通过把资源操作映射到具体的传输协议中,使每个资源的Restful操作转变为实体消息在设备间传递,为设备间的互联互通提供手段。FIG. 1 is an optional communication architecture diagram provided by an embodiment of the present application. The resource is described as a resource model layer, and each resource corresponds to a specific uniform resource identifier (Uniform Resource Identifier, URI), which can be accessed by accessing the resource. URI to access this resource, and each resource has a corresponding interface that supports Restful operations. It is the transport protocol layer that transmits resource content and description information. By mapping resource operations to specific transport protocols, the Restful operation of each resource is transformed into an entity message that is transmitted between devices, providing a means for interconnection between devices.
OCF的传输协议采用受限应用协议(Constrained Application Protocol,CoAP)承载资源操作,每个CRUDN操作都映射为CoAP的请求消息或响应消息,客户端可以通过CoAP中的GET、POST、DELETE这三种方法对服务端的资源进行操作,从而实现资源状态的转换。The transmission protocol of OCF adopts Constrained Application Protocol (CoAP) to carry resource operations. Each CRUDN operation is mapped to a CoAP request message or response message. The method operates on the resources of the server, thereby realizing the transition of the resource state.
Figure PCTCN2020133158-appb-000002
TLV
Figure PCTCN2020133158-appb-000002
TLV
客户端与服务端之间传输的数据采用TLV格式进行编码和解码。TLV属于基本编码规则(Basic  Encoding Rule,BER)编码的一种,遵从ASN1标准。TLV的全称为:Tag(标签)-Length(长度)-Value(值)。在IS-IS数据通信领域中,一个基本的数据元包括tlv三元数组,即Tag-Length-Value,也可以理解为,一个基本的数据元包括三个字段,即Tag字段、Length字段和Value字段。其中,Tag字段用于描述数据的标签,Length字段用于描述Value字段的长度,Value字段用于描述数据的Value(即Tag字段描述的标签的属性值)。The data transmitted between the client and the server is encoded and decoded in TLV format. TLV is a type of Basic Encoding Rule (BER) encoding and complies with the ASN1 standard. The full name of TLV is: Tag (tag)-Length (length)-Value (value). In the field of IS-IS data communication, a basic data element includes a tlv triplet, namely Tag-Length-Value. It can also be understood that a basic data element includes three fields, namely Tag field, Length field and Value field. The Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data (ie, the attribute value of the tag described by the Tag field).
本申请实施例的技术方案提出一种与特定传输协议相匹配的TLV格式,称之为第一TLV格式,需要说明的是,第一TLV格式的描述也可以被替换成其他方式,例如TLV格式,或者CTLV格式等。客户端和服务端可以在相互交互的信令中使用该第一TLV格式对负载的内容(即信令中承载的数据)进行编解码。The technical solutions of the embodiments of the present application propose a TLV format that matches a specific transmission protocol, which is called the first TLV format. It should be noted that the description of the first TLV format can also be replaced by other methods, such as the TLV format , or CTLV format, etc. The client and the server can use the first TLV format to encode and decode the content of the payload (that is, the data carried in the signaling) in the mutual signaling.
图2是本申请实施例提供的数据传输方法的流程示意图,如图2所示,所述数据传输方法包括以下步骤:FIG. 2 is a schematic flowchart of a data transmission method provided by an embodiment of the present application. As shown in FIG. 2 , the data transmission method includes the following steps:
步骤201:第一设备向第二设备发送第一信令,第二设备接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括ControlByte字段、Tag字段、以及以下至少之一:Length字段、Value字段。Step 201: The first device sends the first signaling to the second device, the second device receives the first signaling sent by the first device, and the data carried in the first signaling is encoded in the first TLV format; wherein, The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
在本申请一可选方式中,参照图3,所述第一设备为客户端,所述第二设备为服务端。所述第一信令为资源操作请求消息,这里,资源操作请求消息例如可以是修改服务(Server)状态请求消息。第一信令中承载的数据采用本申请实施例提供的第一TLV格式进行编码。服务端收到资源操作请求消息后,根据本申请实施例提供的第一TLV格式对第一信令进行解码,从而获得第一信令中承载的数据,根据该数据执行相应的操作,例如属性变更操作。In an optional manner of the present application, referring to FIG. 3 , the first device is a client, and the second device is a server. The first signaling is a resource operation request message. Here, the resource operation request message may be, for example, a request message for modifying a service (Server) state. The data carried in the first signaling is encoded in the first TLV format provided by the embodiment of the present application. After receiving the resource operation request message, the server decodes the first signaling according to the first TLV format provided in the embodiment of the present application, thereby obtaining data carried in the first signaling, and performs corresponding operations, such as attributes, according to the data Change operation.
在本申请另一可选方式中,参照图3,所述第一设备为服务端,所述第二设备为客户端。所述第一信令为应答消息。应答消息中承载的数据采用本申请实施例提供的第一TLV格式进行编码。客户端收到应答消息后,根据本申请实施例提供的第一TLV格式对第一信令进行解码,从而获得第一信令中承载的数据。In another optional manner of the present application, referring to FIG. 3 , the first device is a server, and the second device is a client. The first signaling is a response message. The data carried in the response message is encoded in the first TLV format provided by the embodiment of the present application. After receiving the response message, the client terminal decodes the first signaling according to the first TLV format provided by the embodiment of the present application, so as to obtain the data carried in the first signaling.
本申请实施例中的第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括ControlByte字段、Tag字段、以及以下至少之一:Length字段、Value字段。The first TLV format in this embodiment of the present application is used to determine a first TLV structure, where the first TLV structure includes a ControlByte field, a Tag field, and at least one of the following: a Length field and a Value field.
在一可选方式中,所述第一TLV结构包括ControlByte字段和Tag字段。In an optional manner, the first TLV structure includes a ControlByte field and a Tag field.
在一可选方式中,所述第一TLV结构包括ControlByte字段、Tag字段和Value字段。In an optional manner, the first TLV structure includes a ControlByte field, a Tag field and a Value field.
在一可选方式中,所述第一TLV结构包括ControlByte字段、Tag字段、Length字段和Value字段。In an optional manner, the first TLV structure includes a ControlByte field, a Tag field, a Length field and a Value field.
本申请实施例中,所述ControlByte字段用于描述其他字段的控制信息,例如Tag字段的控制信息和/或Value字段的控制信息。其中,Tag字段的控制信息包括Tag的说明。Value字段的控制信息包括Value的数据类型,可选地,还包括Length字段的长度和/或Value字段的长度。In this embodiment of the present application, the ControlByte field is used to describe the control information of other fields, for example, the control information of the Tag field and/or the control information of the Value field. Wherein, the control information of the Tag field includes the description of the Tag. The control information of the Value field includes the data type of the Value, and optionally, the length of the Length field and/or the length of the Value field.
本申请实施例中,所述Tag字段用于描述数据的标签。In this embodiment of the present application, the Tag field is used to describe the tag of the data.
本申请实施例中,所述Length字段用于描述Value字段的长度。In this embodiment of the present application, the Length field is used to describe the length of the Value field.
本申请实施例中,所述Value字段用于描述数据的Value(即标签对应的属性值)。In this embodiment of the present application, the Value field is used to describe the Value of the data (that is, the attribute value corresponding to the tag).
在一个示例中,Tag字段的内容为0X12,代表标签为温度(temperature)。Value字段的内容为15,代表温度的取值为15度(15degree)。In one example, the content of the Tag field is 0X12, which means that the tag is temperature. The content of the Value field is 15, which represents the value of the temperature of 15 degrees.
以下对上述方案中的各个字段进行详细描述。Each field in the above scheme is described in detail below.
(一)ControlByte字段(1) ControlByte field
本申请实施例中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。在一可选方式中,所述N1的取值为1,即所述ControlByte字段的长度为1个字节。In the embodiment of the present application, the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer. In an optional manner, the value of N1 is 1, that is, the length of the ControlByte field is 1 byte.
本申请实施例中,所述ControlByte字段包括两个部分,即第一部分和第二部分,其中,第一部分也可以称为tagControl部分,第二部分也可以称为elementType部分。其中,第一部分用于确定Tag字段的相关控制信息,第二部分用于确定Value字段的相关控制信息。In this embodiment of the present application, the ControlByte field includes two parts, namely a first part and a second part, wherein the first part may also be called a tagControl part, and the second part may also be called an elementType part. The first part is used to determine the related control information of the Tag field, and the second part is used to determine the related control information of the Value field.
在一可选方式中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。例如:Bit7-bit5为第一部分比特。所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。例如Bit4-bit0为第二部分比特。In an optional manner, the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field. For example: Bit7-bit5 are the first part of bits. The second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field. For example, Bit4-bit0 is the second part of bits.
本申请实施例中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。进一步,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。这里,所述Tag的说明用于确定以下至少之一:Tag字段的长度、 Tag字段所描述的标签类型为属性标识标签(iid tag)或者索引标签(index tag)或者设备标识标签(DeviceID tag)或者事务标识标签(ID tag)或者服务标识标签(siid tag)。In the embodiment of the present application, the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control. Further, the first part of bits in the ControlByte field is also used to indicate the description of the Tag. Here, the description of the Tag is used to determine at least one of the following: the length of the Tag field, the tag type described in the Tag field is an attribute identification tag (iid tag) or an index tag (index tag) or a device identification tag (DeviceID tag) Either the transaction identification tag (ID tag) or the service identification tag (siid tag).
需要说明的是,Tag字段所描述的标签类型例如是:Tag字段描述的标签类型为属性标识标签(iid tag)或者索引标签(index tag)。It should be noted that the tag type described by the Tag field is, for example: the tag type described by the Tag field is an attribute identification tag (iid tag) or an index tag (index tag).
本申请实施例中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。进一步,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。或者,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。In this embodiment of the present application, the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field. Further, the second part of bits in the ControlByte field is also used to indicate at least one of the following: the length of the Length field and the length of the Value field. Alternatively, the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
在一个示例中,以下表1-1和表1-2给出了ControlByte字段中的第一部分比特(即Bit7-bit5)的不同取值情况下所指示的内容,以及第二部分比特(即Bit4-bit0)的不同取值情况下所指示的内容。In an example, the following Tables 1-1 and 1-2 show the contents indicated by the different values of the first part of the bits (ie Bit7-bit5) in the ControlByte field, and the second part of the bits (ie Bit4) -bit0) indicates the content in the case of different values.
Figure PCTCN2020133158-appb-000003
Figure PCTCN2020133158-appb-000003
Figure PCTCN2020133158-appb-000004
Figure PCTCN2020133158-appb-000004
表1-1Table 1-1
Figure PCTCN2020133158-appb-000005
Figure PCTCN2020133158-appb-000005
表1-2Table 1-2
以下结合上述表1-1和表1-2对ControlByte字段中的第一部分比特(即Bit7-bit5)和第二部分比特(即Bit4-bit0)如何进行信息指示进行举例说明。The following is an example to illustrate how the first part of bits (ie Bit7-bit5) and the second part of bits (ie Bit4-bit0) in the ControlByte field perform information indication with reference to Table 1-1 and Table 1-2 above.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为00000的情况下,该第二部分比特用于指示Value的数据类型为8位无符号整型(uint8),且无Length字段(也可以理解为Length字段的长度为0个字节),Value字段的长度为1个字节。In an example, when the value of the second part of bits (ie Bit4-bit0) in the ControlByte field is 00000, the second part of bits is used to indicate that the data type of Value is an 8-bit unsigned integer (uint8) , and there is no Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 1 byte.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为00100的情况下,该第二部分比特用于指示Value的数据类型为8位有符号整型(int8),且无Length字段(也可以理解为Length字段的长度为0个字节),Value字段的长度为1个字节。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 00100, the second part of the bits is used to indicate that the data type of the Value is an 8-bit signed integer (int8) , and there is no Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 1 byte.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为01000的情况下,该第二部分比特用于指示Value的数据类型为布尔(boolean)类型,且该数据的取值为假(false),且无Length字段(也可以理解为Length字段的长度为0个字节)以及无Value字段(也可以理解为Value字段的长度为0个字节)。In an example, when the value of the second part of the bits (ie, Bit4-bit0) in the ControlByte field is 01000, the second part of the bits is used to indicate that the data type of Value is a boolean (boolean) type, and the data The value of is false (false), and there is no Length field (it can also be understood that the length of the Length field is 0 bytes) and there is no Value field (it can also be understood that the length of the Value field is 0 bytes).
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为01010的情况下,该第二部分比特用于指示Value的数据类型为浮点(float)型,且无Length字段(也可以理解为Length字段的长度为0个字节),Value字段的长度为4个字节。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 01010, the second part of the bits is used to indicate that the data type of Value is a floating point (float) type, and no The Length field (it can also be understood that the length of the Length field is 0 bytes), and the length of the Value field is 4 bytes.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为10000的情况下,该第二部分比特用于指示Value的数据类型为字节(bytes)型,且Length字段的长度为1个字节,Value字段为可变长度。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 10000, the second part of the bits is used to indicate that the data type of Value is bytes, and the Length The length of the field is 1 byte, and the Value field is variable length.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为10100的情况下,该第二部分比特用于指示Value的数据类型为字符串(string)类型,且Length字段的长度为1个字节,Value字段为可变长度。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 10100, the second part of the bits is used to indicate that the data type of Value is a string (string) type, and the Length The length of the field is 1 byte, and the Value field is variable length.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为11001的情况下,该第二部分比特用于指示Value的数据类型为结构体(struct)类型,且Length字段和Value字段为可变长度。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 11001, the second part of the bits are used to indicate that the data type of Value is a struct type, and the Length Field and Value fields are variable length.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为11010的情况下,该第二部分比特用于指示Value的数据类型为数组(array)类型,且Length字段和Value字段为可变长度。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 11010, the second part of the bits are used to indicate that the data type of Value is an array type, and the Length field and Value fields are variable length.
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为11011的情况下,该第二部分比特用于指示struct的结束符,且Bit5-bit7的取值为000。In an example, when the value of the second part of the bits (ie Bit4-bit0) in the ControlByte field is 11011, the second part of the bit is used to indicate the terminator of the struct, and the value of Bit5-bit7 is 000 .
在一个示例中,ControlByte字段中的第二部分比特(即Bit4-bit0)的取值为11100的情况下,该第二部分比特用于指示array的结束符,且Bit5-bit7的取值为000。In an example, when the value of the second part of the bit (ie Bit4-bit0) in the ControlByte field is 11100, the second part of the bit is used to indicate the terminator of the array, and the value of Bit5-bit7 is 000 .
需要说明的是,上述无符号整型、有符号整型、布尔类型、浮点型、字节型属于基本数据类型。字符串类型属于引用类型。结构体类型和数组类型属于容器数据类型。It should be noted that the above-mentioned unsigned integer type, signed integer type, Boolean type, floating point type, and byte type belong to basic data types. String types are reference types. Structure types and array types are container data types.
在一个示例中,ControlByte字段中的第一部分比特(即Bit7-bit5)的取值为001的情况下,该第二部分比特用于指示数据的用途为设备接入通用。In an example, when the value of the first part of the bits (ie, Bit7-bit5) in the ControlByte field is 001, the second part of the bits is used to indicate that the purpose of the data is universal for device access.
在一个示例中,ControlByte字段中的第一部分比特(即Bit7-bit5)的取值为010的情况下,该第二部分比特用于指示数据的用途为设备控制用,且Tag字段所描述的标签类型为iid tag,Tag字段的长度为1个字节。对于这种情况,tag值(即Tag字段的取值)为iid值,value值(即Value字段的取值)为idd对应的属性值。这里,iid为服务内属性、或者事件、或者方法的唯一标识。In an example, when the value of the first part of the bits (ie Bit7-bit5) in the ControlByte field is 010, the second part of the bits is used to indicate that the purpose of the data is for device control, and the tag described in the Tag field The type is iid tag, and the length of the Tag field is 1 byte. In this case, the tag value (that is, the value of the Tag field) is the iid value, and the value value (that is, the value of the Value field) is the attribute value corresponding to idd. Here, iid is the unique identifier of the attribute, or event, or method within the service.
在一个示例中,ControlByte字段中的第一部分比特(即Bit7-bit5)的取值为100的情况下,该第二部分比特用于指示数据的用途为设备控制用,且Tag字段所描述的标签类型为index tag,Tag字段的长度为1个字节。对于这种情况,index使用于struct数据类型或者array数据类型中子元素的标记,tag值(即Tag字段的取值)为index值,value值(即Value字段的取值)为index标记的子元素的值。In an example, when the value of the first part of the bits (ie Bit7-bit5) in the ControlByte field is 100, the second part of the bits is used to indicate that the purpose of the data is for device control, and the tag described in the Tag field The type is index tag, and the length of the Tag field is 1 byte. In this case, index is used to mark the child element in the struct data type or array data type, the tag value (ie the value of the Tag field) is the index value, and the value value (ie the value of the Value field) is the child of the index mark. the value of the element.
在一个示例中,ControlByte字段中的第一部分比特(即Bit7-bit5)的取值为110的情况下,该第二部分比特用于指示数据的用途为设备控制通用。In an example, when the value of the first part of the bits (ie, Bit7-bit5) in the ControlByte field is 110, the second part of the bits is used to indicate that the purpose of the data is common for device control.
在一个示例中,对于设备控制通用来说,参照表1-2,又细分了四种情况,每种情况的用途均可以称为设备控制用。对于第一种情况来说,tag值(即Tag字段的取值)为0x1,代表DeviceID标签,value值(即Value字段的取值)为deviceID值,这里,deviceID为标识一个设备的ID。对于第二种情况来说,tag值(即Tag字段的取值)为0x2,代表事务ID标签,value值(即Value字段的取值)为事务ID值,这里,事务ID为一组相关联的信令流的标识。对于第三种情况来说,tag值(即Tag字段的取值)为0x3,代表siid标签,value值(即Value字段的取值)为1个字节长度的siid值,这里,siid为一个服务实例的标识。对于第四种情况来说,tag值(即Tag字段的取值)为0x4,代表siid标签,value值(即Value字段的取值)为2个字节长度的siid值,这里,siid为一个服务实例的标识。In an example, for the general purpose of device control, referring to Table 1-2, four situations are further subdivided, and the purpose of each situation can be called device control. For the first case, the tag value (that is, the value of the Tag field) is 0x1, which represents the DeviceID tag, and the value value (that is, the value of the Value field) is the deviceID value, where deviceID is an ID that identifies a device. For the second case, the tag value (that is, the value of the Tag field) is 0x2, which represents the transaction ID tag, and the value value (that is, the value of the Value field) is the transaction ID value. Here, the transaction ID is a group of associated The identifier of the signaling flow. For the third case, the tag value (that is, the value of the Tag field) is 0x3, which represents the siid tag, and the value value (that is, the value of the Value field) is a siid value with a length of 1 byte. Here, siid is a The ID of the service instance. For the fourth case, the tag value (that is, the value of the Tag field) is 0x4, which represents the siid tag, and the value value (that is, the value of the Value field) is the siid value with a length of 2 bytes. Here, siid is a The ID of the service instance.
(二)Tag字段(2) Tag field
本申请实施例中,所述Tag字段的长度为N2个字节,N2为正整数。在一可选方式中,所述N2的取值大于等于0且小于等于8,即所述Tag字段的长度为0-8个字节。In the embodiment of the present application, the length of the Tag field is N2 bytes, and N2 is a positive integer. In an optional manner, the value of N2 is greater than or equal to 0 and less than or equal to 8, that is, the length of the Tag field is 0-8 bytes.
在一个示例中,Tag字段占据的字节的结构如下表2-1所示,其中,该字节的最高位(即bit7)为Tag长度标识位,该字节的低7位(即bit6-bit0)用于标识Tag值。In an example, the structure of the byte occupied by the Tag field is shown in Table 2-1 below, where the highest bit (ie bit7) of the byte is the Tag length identification bit, and the lower 7 bits of the byte (ie bit6- bit0) is used to identify the Tag value.
Figure PCTCN2020133158-appb-000006
Figure PCTCN2020133158-appb-000006
表2-1table 2-1
在另一个示例中,Tag字段占据的字节的结构如下表2-2所示,其中,该字节的全部比特位(即bit7-bit0)用于标识Tag值。In another example, the structure of the byte occupied by the Tag field is shown in Table 2-2 below, where all bits (ie, bit7-bit0) of the byte are used to identify the Tag value.
Figure PCTCN2020133158-appb-000007
Figure PCTCN2020133158-appb-000007
表2-2Table 2-2
Tag字段可以占据一个或者多个字节。本申请实施例中,Tag字段的长度和取值,可以通过以下方案来确定。The Tag field can occupy one or more bytes. In this embodiment of the present application, the length and value of the Tag field may be determined through the following scheme.
方案一)所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。Scheme 1) The Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte, and the The value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
在一可选方式中,所述第一值为0。具体地,当一个字节中的Tag长度标识位的取值为0,则使用Bit6-bit0来标识tag值(即确定Tag字段的取值)。In an optional manner, the first value is 0. Specifically, when the value of the Tag length identification bit in a byte is 0, Bit6-bit0 is used to identify the tag value (that is, the value of the Tag field is determined).
方案二)所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。Scheme 2) The Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte. Two bytes and a third byte, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, the first word The highest bit in the section is the Tag length identification bit.
在一可选方式中,所述第二值为1。具体地,当一个字节(即第一字节)中的Tag长度标识位的取值为1,则表示紧跟该字节后的两个字节也属于Tag字段,且使用后面两个字节的全部比特位来标识tag值(即确定Tag字段的取值)。需要说明的是,第一字节中的bit6-bit0不使用。In an optional manner, the second value is 1. Specifically, when the value of the Tag length identification bit in a byte (ie, the first byte) is 1, it means that the two bytes immediately following the byte also belong to the Tag field, and the following two words are used. All bits of the section are used to identify the tag value (that is, to determine the value of the Tag field). It should be noted that bit6-bit0 in the first byte is not used.
方案三)所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。Scheme 3) The Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte. Two bytes, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the highest bit in the first byte It is the Tag length identification bit.
在一可选方式中,所述第二值为1。具体地,当一个字节(即第一字节)的Tag长度标识位的 取值为1,则表示使用紧跟该字节后的一个字节也属于Tag字段,且使用第一字节的bit6-bit0和后一个字节的bit7-bit0来标识tag值(即确定Tag字段的取值)。In an optional manner, the second value is 1. Specifically, when the value of the Tag length identification bit of a byte (ie, the first byte) is 1, it means that the use of a byte immediately following the byte also belongs to the Tag field, and the use of the first byte of bit6-bit0 and bit7-bit0 of the next byte to identify the tag value (that is, to determine the value of the Tag field).
方案四)所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。Scheme 4) The Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first byte after the first byte. Two bytes, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on until the The value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer; the value of the Tag field Determined by the lower 7 bits of each of the first byte to the Mth byte.
在一可选方式中,所述第二值为1,所述第一值为0。具体地,当一个字节(即第一字节)的Tag长度标识位为1,则表示紧跟该字节后的一个字节(即第二字节)也属于Tag字段;如果第二字节的Tag长度标识位也为1,则表示紧跟该字节后的一个字节(即第三字节)也属于Tag字段,以此类推,直到第M字节的Tag长度标识位为0,则该第M字节为Tag字段占据的最后一个字节。使用每一个字节的bit6-bit0来标识tag值(即确定Tag字段的取值)。In an optional manner, the second value is 1 and the first value is 0. Specifically, when the Tag length identification bit of a byte (that is, the first byte) is 1, it means that a byte (that is, the second byte) immediately following the byte also belongs to the Tag field; if the second word If the Tag length identification bit of the section is also 1, it means that the byte immediately following the byte (ie, the third byte) also belongs to the Tag field, and so on, until the Tag length identification bit of the Mth byte is 0 , the Mth byte is the last byte occupied by the Tag field. Use bit6-bit0 of each byte to identify the tag value (that is, to determine the value of the Tag field).
以Tag字段占两个字节为例,以下表3给出了Tag字段占据第一字节和第二字节。其中,第一字节的Tag长度标识位为1,代表第一字节后紧跟一个字节(即第二字节)也属于Tag字段,第二字节的Tag长度标识位为0,代表第二字节为Tag字段占据的最后一个字节。使用第一字节的bit6-bit0和第二字节的bit6-bit0来标识tag值(即确定Tag字段的取值)为:00000010000001(二进制)=129(十进制)。其中,二进制数据中的前半部分0000001对应于第一字节的bit6-bit0,后半部分0000001对应于第二字节的bit6-bit0,两部分组合一起后标识一个tag值为“129”。需要说明的是,如果有三个字节或者更多数目的字节可以以此类推。Taking the Tag field occupying two bytes as an example, the following Table 3 shows that the Tag field occupies the first byte and the second byte. Among them, the Tag length identification bit of the first byte is 1, which means that the first byte followed by a byte (ie, the second byte) also belongs to the Tag field, and the Tag length identification bit of the second byte is 0, representing The second byte is the last byte occupied by the Tag field. Using bit6-bit0 of the first byte and bit6-bit0 of the second byte to identify the tag value (that is, to determine the value of the Tag field) is: 00000010000001 (binary)=129 (decimal). The first half of the binary data, 0000001, corresponds to bit6-bit0 of the first byte, and the second half, 0000001, corresponds to bit6-bit0 of the second byte. The two parts are combined to identify a tag value of "129". It should be noted that if there are three bytes or more bytes, it can be deduced by analogy.
Figure PCTCN2020133158-appb-000008
Figure PCTCN2020133158-appb-000008
表3table 3
方案五)所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为iid tag或者index tag或者DeviceID tag或者事务ID tag或者siid tag。Scheme 5) The length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: the Tag field The length of the tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
对于方案五)来说,可以直接根据ControlByte字段中的第一部分(即tagControl部分)来确定Tag字段的长度。具体可以参照以上表1-1所示的内容来确定ControlByte字段中的第一部分的取值所对应的指示内容。For scheme 5), the length of the Tag field can be determined directly according to the first part (ie, the tagControl part) in the ControlByte field. Specifically, the indication content corresponding to the value of the first part in the ControlByte field may be determined with reference to the content shown in Table 1-1 above.
(三)Length字段(3) Length field
本申请实施例中,所述Length字段的长度为N3个字节,N3为正整数。在一可选方式中,所述N3的取值大于等于0且小于等于8,即所述Length字段的长度为0-8个字节。In the embodiment of the present application, the length of the Length field is N3 bytes, and N3 is a positive integer. In an optional manner, the value of N3 is greater than or equal to 0 and less than or equal to 8, that is, the length of the Length field is 0-8 bytes.
本申请实施例中,对于某些数据类型(例如基本数据类型)来说,Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。In this embodiment of the present application, for some data types (such as basic data types), the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the Length field length.
需要说明的是,容器数据类型(如struct类型、array类型)的Length字段是可变长度,因此可以使用变长的方式来确定其长度。在一可选方式中,可以使用struct或者array的结束符来标识一个struct或者struct的结束位置,从而根据该结束位置确定Length字段的长度。It should be noted that the Length field of container data types (such as struct type and array type) is of variable length, so the length can be determined in a variable-length manner. In an optional manner, the terminator of a struct or an array may be used to identify the end position of a struct or a struct, so that the length of the Length field is determined according to the end position.
需要说明的是,基本数据类型例如是表2-1所示的无符号整型(uint),有符号整型(nit),浮点型(float)等。容器数据类型例如是表2-1所示的结构体(struct)类型,数组(array)类型等。It should be noted that the basic data types are, for example, the unsigned integer type (uint), the signed integer type (nit), and the floating point type (float) as shown in Table 2-1. The container data type is, for example, the structure (struct) type shown in Table 2-1, the array (array) type, and the like.
(四)Value字段(4) Value field
本申请实施例中,所述Value字段的长度为N4个字节,N4的取值为正整数。In this embodiment of the present application, the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
本申请实施例中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。In this embodiment of the present application, the length of the Value field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the ControlByte The second part of the field is used to indicate the terminator of the container data type.
本申请实施例的上述技术方案,提供了一种新型的TLV结构(即第一TLV结构),在一个示例中,以下表4给出了第一TLV结构的总体结构,其中,ControlByte字段的长度为1个字节(byte),Tag字段的长度为0至8个字节,Length字段的长度为0至8个字节,Value字段根据内容为可变长度。The above technical solutions of the embodiments of the present application provide a novel TLV structure (that is, the first TLV structure). In an example, the following Table 4 provides the overall structure of the first TLV structure, where the length of the ControlByte field is It is 1 byte (byte), the length of the Tag field is 0 to 8 bytes, the length of the Length field is 0 to 8 bytes, and the length of the Value field is variable according to the content.
ControlByteControlByte TagTag LengthLength ValueValue
1byte1byte 0-8bytes0-8bytes 0-8bytes0-8bytes 变长lengthen
表4Table 4
客户端和服务端可以在相互交互的信令中使用上述方案中的第一TLV格式对负载的内容(即信令中承载的数据)进行编解码,从而提高编解码效率。The client and the server can use the first TLV format in the above solution to encode and decode the content of the payload (that is, the data carried in the signaling) in the mutual signaling, thereby improving the encoding and decoding efficiency.
图4是本申请实施例提供的数据传输装置的结构组成示意图一,应用于第一设备,如图4所示,所述数据传输装置包括:FIG. 4 is a schematic structural diagram 1 of a data transmission apparatus provided by an embodiment of the present application, which is applied to a first device. As shown in FIG. 4 , the data transmission apparatus includes:
发送单元401,用于向第二设备发送第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,The sending unit 401 is configured to send a first signaling to a second device, where the data carried in the first signaling is encoded in a first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
在一可选方式中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。In an optional manner, the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
在一可选方式中,所述N1的取值为1。In an optional manner, the value of N1 is 1.
在一可选方式中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。In an optional manner, the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control.
在一可选方式中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。In an optional manner, the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
在一可选方式中,所述Tag的说明用于确定以下至少之一In an optional manner, the description of the Tag is used to determine at least one of the following
Tag字段的长度;The length of the Tag field;
Tag字段所描述的标签类型为iid tag或者index tag或者DeviceID tag或者事务ID tag或者siid tag。The tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
在一可选方式中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。In an optional manner, the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
在一可选方式中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。In an optional manner, the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field.
在一可选方式中,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。In an optional manner, the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
在一可选方式中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。In an optional manner, the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
在一可选方式中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。In an optional manner, the second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field.
在一可选方式中,所述Tag字段的长度为N2个字节,N2为正整数。In an optional manner, the length of the Tag field is N2 bytes, and N2 is a positive integer.
在一可选方式中,所述N2的取值大于等于0且小于等于8。In an optional manner, the value of N2 is greater than or equal to 0 and less than or equal to 8.
在一可选方式中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。In an optional manner, the Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte. , and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte and the third byte after the section, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, all The highest bit in the first byte is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte after the section, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the first byte The highest bit is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte after the section, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on , until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer; The value of the field is determined by the lower 7 bits of each of the first byte to the Mth byte.
在一可选方式中,所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag 字段的长度、Tag字段所描述的标签类型为iid tag或者index tag或者DeviceID tag或者事务ID tag或者siid tag。In an optional manner, the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: One: The length of the Tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
在一可选方式中,所述Length字段的长度为N3个字节,N3为正整数。In an optional manner, the length of the Length field is N3 bytes, and N3 is a positive integer.
在一可选方式中,所述N3的取值大于等于0且小于等于8。In an optional manner, the value of N3 is greater than or equal to 0 and less than or equal to 8.
在一可选方式中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。In an optional manner, the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Length field.
在一可选方式中,所述Value字段的长度为N4个字节,N4的取值为正整数。In an optional manner, the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
在一可选方式中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,In an optional manner, the length of the Value field is determined based on the second part in the ControlByte field,
所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
在一可选方式中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。In an optional manner, the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data.
本领域技术人员应当理解,本申请实施例的上述数据传输装置的相关描述可以参照本申请实施例的数据传输方法的相关描述进行理解。Those skilled in the art should understand that the relevant description of the above-mentioned data transmission apparatus in the embodiment of the present application can be understood with reference to the relevant description of the data transmission method in the embodiment of the present application.
图5是本申请实施例提供的数据传输装置的结构组成示意图二,应用于第二设备,如图5所示,所述数据传输装置包括:FIG. 5 is a second schematic structural diagram of a data transmission apparatus provided by an embodiment of the present application, which is applied to a second device. As shown in FIG. 5 , the data transmission apparatus includes:
接收单元501,用于接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,A receiving unit 501, configured to receive a first signaling sent by a first device, where the data carried in the first signaling is encoded in a first TLV format; wherein,
所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
在一可选方式中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。In an optional manner, the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
在一可选方式中,所述N1的取值为1。In an optional manner, the value of N1 is 1.
在一可选方式中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。In an optional manner, the first part of the bit in the ControlByte field is used to indicate that the purpose of the data is one of the following: general for device access, general for device control, and general for device control.
在一可选方式中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。In an optional manner, the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
在一可选方式中,所述Tag的说明用于确定以下至少之一:In an optional manner, the description of the Tag is used to determine at least one of the following:
Tag字段的长度;The length of the Tag field;
Tag字段所描述的标签类型为iid tag或者index tag或者DeviceID tag或者事务ID tag或者siid tag。The tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
在一可选方式中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。In an optional manner, the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
在一可选方式中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。In an optional manner, the second part of bits in the ControlByte field is used to indicate the data type of the Value described in the Value field.
在一可选方式中,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。In an optional manner, the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
在一可选方式中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。In an optional manner, the second part of bits in the ControlByte field is also used to indicate: the terminator of the container data type.
在一可选方式中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。In an optional manner, the second part of bits in the ControlByte field is the lower 5 bits in the ControlByte field.
在一可选方式中,所述Tag字段的长度为N2个字节,N2为正整数。In an optional manner, the length of the Tag field is N2 bytes, and N2 is a positive integer.
在一可选方式中,所述N2的取值大于等于0且小于等于8。In an optional manner, the value of N2 is greater than or equal to 0 and less than or equal to 8.
在一可选方式中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。In an optional manner, the Tag field occupies the first byte, and if the value of the highest bit in the first byte is the first value, it means that the Tag field only occupies the first byte. , and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte and the third byte after the section, and the value of the Tag field is determined by all bits in the second byte and all bits in the third byte; wherein, all The highest bit in the first byte is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为 Tag长度标识位。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte after the section, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, the first byte The highest bit is the Tag length identification bit.
在一可选方式中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。In an optional manner, the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also occupies the first word. The second byte after the section, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte, and so on , until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is a positive integer; The value of the field is determined by the lower 7 bits of each of the first byte to the Mth byte.
在一可选方式中,所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为iid tag或者index tag或者DeviceID tag或者事务ID tag或者siid tag。In an optional manner, the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, and the description of the Tag is used to determine at least one of the following: One: The length of the Tag field, the tag type described by the Tag field is iid tag or index tag or DeviceID tag or transaction ID tag or siid tag.
在一可选方式中,所述Length字段的长度为N3个字节,N3为正整数。In an optional manner, the length of the Length field is N3 bytes, and N3 is a positive integer.
在一可选方式中,所述N3的取值大于等于0且小于等于8。In an optional manner, the value of N3 is greater than or equal to 0 and less than or equal to 8.
在一可选方式中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。In an optional manner, the length of the Length field is determined based on the second part in the ControlByte field, and the second part in the ControlByte field is used to indicate the length of the Length field.
在一可选方式中,所述Value字段的长度为N4个字节,N4的取值为正整数。In an optional manner, the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
在一可选方式中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,In an optional manner, the length of the Value field is determined based on the second part in the ControlByte field,
所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
在一可选方式中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。In an optional manner, the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data.
本领域技术人员应当理解,本申请实施例的上述数据传输装置的相关描述可以参照本申请实施例的数据传输方法的相关描述进行理解。Those skilled in the art should understand that the relevant description of the above-mentioned data transmission apparatus in the embodiment of the present application can be understood with reference to the relevant description of the data transmission method in the embodiment of the present application.
图6是本申请实施例提供的一种通信设备600示意性结构图。该通信设备可以是第一设备,也可以是第二设备,其中,第一设备可以是客户端或者服务端,第二设备可以是服务端或者客户端,图6所示的通信设备600包括处理器610,处理器610可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。FIG. 6 is a schematic structural diagram of a communication device 600 provided by an embodiment of the present application. The communication device may be a first device or a second device, wherein the first device may be a client or a server, and the second device may be a server or a client. The communication device 600 shown in FIG. 6 includes processing The processor 610, the processor 610 may call and run a computer program from the memory to implement the method in the embodiments of the present application.
可选地,如图6所示,通信设备600还可以包括存储器620。其中,处理器610可以从存储器620中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in FIG. 6 , the communication device 600 may further include a memory 620 . The processor 610 may call and run a computer program from the memory 620 to implement the methods in the embodiments of the present application.
其中,存储器620可以是独立于处理器610的一个单独的器件,也可以集成在处理器610中。The memory 620 may be a separate device independent of the processor 610 , or may be integrated in the processor 610 .
可选地,如图6所示,通信设备600还可以包括收发器630,处理器610可以控制该收发器630与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。Optionally, as shown in FIG. 6 , the communication device 600 may further include a transceiver 630, and the processor 610 may control the transceiver 630 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by a device.
其中,收发器630可以包括发射机和接收机。收发器630还可以进一步包括天线,天线的数量可以为一个或多个。Among them, the transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of the antennas may be one or more.
可选地,该通信设备600具体可为本申请实施例的网络设备,并且该通信设备600可以实现本申请实施例的各个方法中由网络设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 600 may specifically be the network device in this embodiment of the present application, and the communication device 600 may implement the corresponding processes implemented by the network device in each method in the embodiment of the present application. For the sake of brevity, details are not repeated here. .
可选地,该通信设备600具体可为本申请实施例的移动终端/终端设备,并且该通信设备600可以实现本申请实施例的各个方法中由移动终端/终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 600 may specifically be the mobile terminal/terminal device of the embodiments of the present application, and the communication device 600 may implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
图7是本申请实施例的芯片的示意性结构图。图7所示的芯片700包括处理器710,处理器710可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。FIG. 7 is a schematic structural diagram of a chip according to an embodiment of the present application. The chip 700 shown in FIG. 7 includes a processor 710, and the processor 710 can call and run a computer program from a memory, so as to implement the method in this embodiment of the present application.
可选地,如图7所示,芯片700还可以包括存储器720。其中,处理器710可以从存储器720中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in FIG. 7 , the chip 700 may further include a memory 720 . The processor 710 may call and run a computer program from the memory 720 to implement the methods in the embodiments of the present application.
其中,存储器720可以是独立于处理器710的一个单独的器件,也可以集成在处理器710中。The memory 720 may be a separate device independent of the processor 710 , or may be integrated in the processor 710 .
可选地,该芯片700还可以包括输入接口730。其中,处理器710可以控制该输入接口730与其他设备或芯片进行通信,具体地,可以获取其他设备或芯片发送的信息或数据。Optionally, the chip 700 may further include an input interface 730 . The processor 710 may control the input interface 730 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
可选地,该芯片700还可以包括输出接口740。其中,处理器710可以控制该输出接口740与其他设备或芯片进行通信,具体地,可以向其他设备或芯片输出信息或数据。Optionally, the chip 700 may further include an output interface 740 . The processor 710 can control the output interface 740 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
可选地,该芯片可应用于本申请实施例中的网络设备,并且该芯片可以实现本申请实施例的各个方法中由网络设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the network device in the embodiment of the present application, and the chip can implement the corresponding processes implemented by the network device in each method of the embodiment of the present application, which is not repeated here for brevity.
可选地,该芯片可应用于本申请实施例中的移动终端/终端设备,并且该芯片可以实现本申请实 施例的各个方法中由移动终端/终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the chip can implement the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application. For brevity, here No longer.
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-chip, or a system-on-a-chip, or the like.
应理解,本申请实施例的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the above memory is an example but not a limitative description, for example, the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。Embodiments of the present application further provide a computer-readable storage medium for storing a computer program.
可选的,该计算机可读存储介质可应用于本申请实施例中的网络设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由网络设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the network device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the network device in each method of the embodiments of the present application. For brevity, here No longer.
可选地,该计算机可读存储介质可应用于本申请实施例中的移动终端/终端设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由移动终端/终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application. , and are not repeated here for brevity.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。Embodiments of the present application also provide a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的网络设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由网络设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the network device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the network device in each method of the embodiments of the present application. Repeat.
可选地,该计算机程序产品可应用于本申请实施例中的移动终端/终端设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由移动终端/终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the mobile terminal/terminal device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the mobile terminal/terminal device in each method of the embodiments of the present application, For brevity, details are not repeated here.
本申请实施例还提供了一种计算机程序。The embodiments of the present application also provide a computer program.
可选的,该计算机程序可应用于本申请实施例中的网络设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由网络设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the network device in the embodiments of the present application, and when the computer program runs on the computer, the computer executes the corresponding processes implemented by the network device in the various methods of the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
可选地,该计算机程序可应用于本申请实施例中的移动终端/终端设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由移动终端/终端设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program may be applied to the mobile terminal/terminal device in the embodiments of the present application, and when the computer program is run on the computer, the mobile terminal/terminal device implements the various methods of the computer program in the embodiments of the present application. The corresponding process, for the sake of brevity, will not be repeated here.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤, 能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,)ROM、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory,) ROM, random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (101)

  1. 一种数据传输方法,所述方法包括:A data transmission method, the method comprising:
    第一设备向第二设备发送第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,The first device sends the first signaling to the second device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
    所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  2. 根据权利要求1所述的方法,其中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。The method according to claim 1, wherein the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  3. 根据权利要求2所述的方法,其中,所述N1的取值为1。The method according to claim 2, wherein the value of N1 is 1.
  4. 根据权利要求3所述的方法,其中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。The method according to claim 3, wherein the first part of the bits in the ControlByte field is used to indicate that the usage of the data is one of the following: general for device access, general for device control, and general for device control.
  5. 根据权利要求4所述的方法,其中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。The method according to claim 4, wherein the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
  6. 根据权利要求5所述的方法,其中,所述Tag的说明用于确定以下至少之一:The method of claim 5, wherein the description of the Tag is used to determine at least one of the following:
    Tag字段的长度;The length of the Tag field;
    Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  7. 根据权利要求4至6中任一项所述的方法,其中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。The method according to any one of claims 4 to 6, wherein the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  8. 根据权利要求3至7中任一项所述的方法,其中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。The method according to any one of claims 3 to 7, wherein the second part of bits in the ControlByte field is used to indicate the data type of the Value described by the Value field.
  9. 根据权利要求8所述的方法,其中,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。The method according to claim 8, wherein the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  10. 根据权利要求8所述的方法,其中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。The method according to claim 8, wherein the second part of bits in the ControlByte field is further used to indicate: the terminator of the container data type.
  11. 根据权利要求8至10中任一项所述的方法,其中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。The method according to any one of claims 8 to 10, wherein the second part of the bits in the ControlByte field are the lower 5 bits in the ControlByte field.
  12. 根据权利要求1至11中任一项所述的方法,其中,所述Tag字段的长度为N2个字节,N2为正整数。The method according to any one of claims 1 to 11, wherein the length of the Tag field is N2 bytes, and N2 is a positive integer.
  13. 根据权利要求12所述的方法,其中,所述N2的取值大于等于0且小于等于8。The method according to claim 12, wherein the value of N2 is greater than or equal to 0 and less than or equal to 8.
  14. 根据权利要求12或13所述的方法,其中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 12 or 13, wherein the Tag field occupies a first byte, and if the value of the highest bit in the first byte is a first value, it means that the Tag field only occupies The first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  15. 根据权利要求12或13所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 12 or 13, wherein the Tag field occupies at least a first byte, and if the value of the highest bit in the first byte is a second value, it means that the Tag field also Occupies the second byte and the third byte after the first byte, and the value of the Tag field passes through all bits in the second byte and all bits in the third byte The bit is determined; wherein, the highest bit in the first byte is the Tag length identification bit.
  16. 根据权利要求12或13所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 12 or 13, wherein the Tag field occupies at least a first byte, and if the value of the highest bit in the first byte is a second value, it means that the Tag field also Occupies the second byte after the first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, The highest bit in the first byte is the Tag length identification bit.
  17. 根据权利要求12或13所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。The method according to claim 12 or 13, wherein the Tag field occupies at least a first byte, and if the value of the highest bit in the first byte is a second value, it means that the Tag field also Occupies the second byte after the first byte, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte. byte, and so on, until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is A positive integer; the value of the Tag field is determined by the lower 7 bits of each byte from the first byte to the Mth byte.
  18. 根据权利要求12或13所述的方法,其中,所述Tag字段的长度基于所述ControlByte 字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The method according to claim 12 or 13, wherein the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, the description of the Tag It is used to determine at least one of the following: the length of the Tag field, and the tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  19. 根据权利要求1至18中任一项所述的方法,其中,所述Length字段的长度为N3个字节,N3为正整数。The method according to any one of claims 1 to 18, wherein the length of the Length field is N3 bytes, and N3 is a positive integer.
  20. 根据权利要求19所述的方法,其中,所述N3的取值大于等于0且小于等于8。The method according to claim 19, wherein the value of N3 is greater than or equal to 0 and less than or equal to 8.
  21. 根据权利要求19或20所述的方法,其中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。The method of claim 19 or 20, wherein the length of the Length field is determined based on a second part of the ControlByte field, the second part of the ControlByte field being used to indicate the length of the Length field.
  22. 根据权利要求1至21中任一项所述的方法,其中,所述Value字段的长度为N4个字节,N4的取值为正整数。The method according to any one of claims 1 to 21, wherein the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  23. 根据权利要求22所述的方法,其中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,The method of claim 22, wherein the length of the Value field is determined based on the second portion of the ControlByte field,
    所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  24. 根据权利要求1至23中任一项所述的方法,其中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。The method according to any one of claims 1 to 23, wherein the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data .
  25. 一种数据传输方法,所述方法包括:A data transmission method, the method comprising:
    第二设备接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,The second device receives the first signaling sent by the first device, and the data carried in the first signaling is encoded in the first TLV format; wherein,
    所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  26. 根据权利要求25所述的方法,其中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。The method according to claim 25, wherein the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  27. 根据权利要求26所述的方法,其中,所述N1的取值为1。The method according to claim 26, wherein the value of N1 is 1.
  28. 根据权利要求27所述的方法,其中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。The method according to claim 27, wherein the first part of the bits in the ControlByte field is used to indicate that the usage of the data is one of the following: general for device access, general for device control, and general for device control.
  29. 根据权利要求28所述的方法,其中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。The method according to claim 28, wherein the first part of bits in the ControlByte field is also used to indicate the description of the Tag.
  30. 根据权利要求29所述的方法,其中,所述Tag的说明用于确定以下至少之一:The method of claim 29, wherein the description of the Tag is used to determine at least one of the following:
    Tag字段的长度;The length of the Tag field;
    Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  31. 根据权利要求28至30中任一项所述的方法,其中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。The method according to any one of claims 28 to 30, wherein the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  32. 根据权利要求27至31中任一项所述的方法,其中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。The method according to any one of claims 27 to 31, wherein the second part of bits in the ControlByte field is used to indicate the data type of the Value described by the Value field.
  33. 根据权利要求32所述的方法,其中,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。The method according to claim 32, wherein the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  34. 根据权利要求32所述的方法,其中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。The method according to claim 32, wherein the second part of bits in the ControlByte field is further used to indicate: the terminator of the container data type.
  35. 根据权利要求32至34中任一项所述的方法,其中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。The method according to any one of claims 32 to 34, wherein the second part of the bits in the ControlByte field are the lower 5 bits in the ControlByte field.
  36. 根据权利要求25至35中任一项所述的方法,其中,所述Tag字段的长度为N2个字节,N2为正整数。The method according to any one of claims 25 to 35, wherein the length of the Tag field is N2 bytes, and N2 is a positive integer.
  37. 根据权利要求36所述的方法,其中,所述N2的取值大于等于0且小于等于8。The method according to claim 36, wherein the value of N2 is greater than or equal to 0 and less than or equal to 8.
  38. 根据权利要求36或37所述的方法,其中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 36 or 37, wherein the Tag field occupies a first byte, and if the value of the highest bit in the first byte is a first value, it means that the Tag field only occupies The first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  39. 根据权利要求36或37所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和 第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 36 or 37, wherein the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also Occupies the second byte and the third byte after the first byte, and the value of the Tag field passes through all bits in the second byte and all bits in the third byte The bit is determined; wherein, the highest bit in the first byte is the Tag length identification bit.
  40. 根据权利要求36或37所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The method according to claim 36 or 37, wherein the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also Occupies the second byte after the first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, The highest bit in the first byte is the Tag length identification bit.
  41. 根据权利要求36或37所述的方法,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。The method according to claim 36 or 37, wherein the Tag field occupies at least the first byte, and if the value of the highest bit in the first byte is the second value, it means that the Tag field also Occupies the second byte after the first byte, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte. byte, and so on, until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is A positive integer; the value of the Tag field is determined by the lower 7 bits of each byte from the first byte to the Mth byte.
  42. 根据权利要求36或37所述的方法,其中,所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The method according to claim 36 or 37, wherein the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, the description of the Tag It is used to determine at least one of the following: the length of the Tag field, and the tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  43. 根据权利要求25至42中任一项所述的方法,其中,所述Length字段的长度为N3个字节,N3为正整数。The method according to any one of claims 25 to 42, wherein the length of the Length field is N3 bytes, and N3 is a positive integer.
  44. 根据权利要求43所述的方法,其中,所述N3的取值大于等于0且小于等于8。The method according to claim 43, wherein the value of N3 is greater than or equal to 0 and less than or equal to 8.
  45. 根据权利要求43或44所述的方法,其中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。The method of claim 43 or 44, wherein the length of the Length field is determined based on a second part of the ControlByte field, the second part of the ControlByte field being used to indicate the length of the Length field.
  46. 根据权利要求25至45中任一项所述的方法,其中,所述Value字段的长度为N4个字节,N4的取值为正整数。The method according to any one of claims 25 to 45, wherein the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  47. 根据权利要求46所述的方法,其中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,The method of claim 46, wherein the length of the Value field is determined based on the second portion of the ControlByte field,
    所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  48. 根据权利要求25至47中任一项所述的方法,其中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。The method according to any one of claims 25 to 47, wherein the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data .
  49. 一种数据传输装置,应用于第一设备,所述装置包括:A data transmission apparatus, applied to a first device, the apparatus comprising:
    发送单元,用于向第二设备发送第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,a sending unit, configured to send a first signaling to the second device, where the data carried in the first signaling is encoded in a first TLV format; wherein,
    所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  50. 根据权利要求49所述的装置,其中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。The apparatus according to claim 49, wherein the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  51. 根据权利要求50所述的装置,其中,所述N1的取值为1。The apparatus according to claim 50, wherein the value of N1 is 1.
  52. 根据权利要求51所述的装置,其中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。The apparatus according to claim 51, wherein the first part of the bits in the ControlByte field is used to indicate that the usage of the data is one of the following: general for device access, general for device control, and general for device control.
  53. 根据权利要求52所述的装置,其中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。The apparatus according to claim 52, wherein the first part of the bits in the ControlByte field is further used to indicate the description of the Tag.
  54. 根据权利要求53所述的装置,其中,所述Tag的说明用于确定以下至少之一:The apparatus of claim 53, wherein the description of the Tag is used to determine at least one of the following:
    Tag字段的长度;The length of the Tag field;
    Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  55. 根据权利要求52至54中任一项所述的装置,其中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。The apparatus according to any one of claims 52 to 54, wherein the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  56. 根据权利要求51至55中任一项所述的装置,其中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。The apparatus according to any one of claims 51 to 55, wherein the second part of bits in the ControlByte field is used to indicate the data type of the Value described by the Value field.
  57. 根据权利要求56所述的装置,其中,所述ControlByte字段中的第二部分比特还用于指 示以下至少之一:Length字段的长度、Value字段的长度。The apparatus according to claim 56, wherein the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  58. 根据权利要求56所述的装置,其中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。The apparatus according to claim 56, wherein the second part of bits in the ControlByte field is further used to indicate: the terminator of the container data type.
  59. 根据权利要求56至58中任一项所述的装置,其中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。The apparatus according to any one of claims 56 to 58, wherein the second part of the bits in the ControlByte field are the lower 5 bits in the ControlByte field.
  60. 根据权利要求49至59中任一项所述的装置,其中,所述Tag字段的长度为N2个字节,N2为正整数。The apparatus according to any one of claims 49 to 59, wherein the length of the Tag field is N2 bytes, and N2 is a positive integer.
  61. 根据权利要求60所述的装置,其中,所述N2的取值大于等于0且小于等于8。The device according to claim 60, wherein the value of N2 is greater than or equal to 0 and less than or equal to 8.
  62. 根据权利要求60或61所述的装置,其中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。The apparatus according to claim 60 or 61, wherein the Tag field occupies a first byte, and if the value of the highest bit in the first byte is a first value, it means that the Tag field only occupies The first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  63. 根据权利要求60或61所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The apparatus according to claim 60 or 61, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte and the third byte after the first byte, and the value of the Tag field passes through all bits in the second byte and all bits in the third byte The bit is determined; wherein, the highest bit in the first byte is the Tag length identification bit.
  64. 根据权利要求60或61所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The apparatus according to claim 60 or 61, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte after the first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, The highest bit in the first byte is the Tag length identification bit.
  65. 根据权利要求60或61所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。The apparatus according to claim 60 or 61, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte after the first byte, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte. byte, and so on, until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is A positive integer; the value of the Tag field is determined by the lower 7 bits of each byte from the first byte to the Mth byte.
  66. 根据权利要求60或61所述的装置,其中,所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The apparatus according to claim 60 or 61, wherein the length of the Tag field is determined based on a first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, the description of the Tag It is used to determine at least one of the following: the length of the Tag field, and the tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  67. 根据权利要求49至66中任一项所述的装置,其中,所述Length字段的长度为N3个字节,N3为正整数。The apparatus according to any one of claims 49 to 66, wherein the length of the Length field is N3 bytes, and N3 is a positive integer.
  68. 根据权利要求67所述的装置,其中,所述N3的取值大于等于0且小于等于8。The device according to claim 67, wherein the value of N3 is greater than or equal to 0 and less than or equal to 8.
  69. 根据权利要求67或68所述的装置,其中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。The apparatus of claim 67 or 68, wherein the length of the Length field is determined based on a second part of the ControlByte field, the second part of the ControlByte field being used to indicate the length of the Length field.
  70. 根据权利要求49至69中任一项所述的装置,其中,所述Value字段的长度为N4个字节,N4的取值为正整数。The apparatus according to any one of claims 49 to 69, wherein the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  71. 根据权利要求70所述的装置,其中,所述Value字段的长度基于所述ControlByte字段中的第二部分确定,The apparatus of claim 70, wherein the length of the Value field is determined based on the second portion of the ControlByte field,
    所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  72. 根据权利要求49至71中任一项所述的装置,其中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。The apparatus according to any one of claims 49 to 71, wherein the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data .
  73. 一种数据传输装置,应用于第二设备,所述装置包括:A data transmission apparatus, applied to a second device, the apparatus comprising:
    接收单元,用于接收第一设备发送的第一信令,所述第一信令中承载的数据采用第一TLV格式进行编码;其中,a receiving unit, configured to receive the first signaling sent by the first device, where the data carried in the first signaling is encoded in the first TLV format; wherein,
    所述第一TLV格式用于确定第一TLV结构,所述第一TLV结构包括控制字节ControlByte字段、标签Tag字段、以及以下至少之一:长度Length字段、取值Value字段。The first TLV format is used to determine a first TLV structure, where the first TLV structure includes a control byte ControlByte field, a tag Tag field, and at least one of the following: a Length field and a Value field.
  74. 根据权利要求73所述的装置,其中,所述ControlByte字段的长度为N1个字节,所述N1的取值为正整数。The apparatus according to claim 73, wherein the length of the ControlByte field is N1 bytes, and the value of N1 is a positive integer.
  75. 根据权利要求74所述的装置,其中,所述N1的取值为1。The apparatus of claim 74, wherein the value of N1 is 1.
  76. 根据权利要求75所述的装置,其中,所述ControlByte字段中的第一部分比特用于指示所述数据的用途为以下之一:设备接入通用、设备控制用、设备控制通用。The apparatus according to claim 75, wherein the first part of bits in the ControlByte field is used to indicate that the usage of the data is one of the following: general for device access, general for device control, and general for device control.
  77. 根据权利要求76所述的装置,其中,所述ControlByte字段中的第一部分比特还用于指示Tag的说明。The apparatus according to claim 76, wherein the first part of the bits in the ControlByte field is further used to indicate the description of the Tag.
  78. 根据权利要求77所述的装置,其中,所述Tag的说明用于确定以下至少之一:The apparatus of claim 77, wherein the description of the Tag is used to determine at least one of the following:
    Tag字段的长度;The length of the Tag field;
    Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  79. 根据权利要求76至78中任一项所述的装置,其中,所述ControlByte字段中的第一部分比特为所述ControlByte字段中的高3位比特。The apparatus according to any one of claims 76 to 78, wherein the first part of the bits in the ControlByte field are the upper 3 bits in the ControlByte field.
  80. 根据权利要求75至79中任一项所述的装置,其中,所述ControlByte字段中的第二部分比特用于指示Value字段所描述的Value的数据类型。The apparatus according to any one of claims 75 to 79, wherein the second part of bits in the ControlByte field is used to indicate the data type of the Value described by the Value field.
  81. 根据权利要求80所述的装置,其中,所述ControlByte字段中的第二部分比特还用于指示以下至少之一:Length字段的长度、Value字段的长度。The apparatus according to claim 80, wherein the second part of bits in the ControlByte field is further used to indicate at least one of the following: the length of the Length field and the length of the Value field.
  82. 根据权利要求80所述的装置,其中,所述ControlByte字段中的第二部分比特还用于指示:容器数据类型的结束符。The apparatus according to claim 80, wherein the second part of bits in the ControlByte field is further used to indicate: the terminator of the container data type.
  83. 根据权利要求80至82中任一项所述的装置,其中,所述ControlByte字段中的第二部分比特为所述ControlByte字段中的低5位比特。The apparatus according to any one of claims 80 to 82, wherein the second part of the bits in the ControlByte field are the lower 5 bits in the ControlByte field.
  84. 根据权利要求73至83中任一项所述的装置,其中,所述Tag字段的长度为N2个字节,N2为正整数。The apparatus according to any one of claims 73 to 83, wherein the length of the Tag field is N2 bytes, and N2 is a positive integer.
  85. 根据权利要求84所述的装置,其中,所述N2的取值大于等于0且小于等于8。The device of claim 84, wherein the value of N2 is greater than or equal to 0 and less than or equal to 8.
  86. 根据权利要求84或85所述的装置,其中,所述Tag字段占据第一字节,若所述第一字节中的最高位的取值为第一值,则表示所述Tag字段仅占据所述第一字节,且所述Tag字段的取值通过所述第一字节中的低7位确定;其中,所述第一字节中的最高位为Tag长度标识位。The apparatus according to claim 84 or 85, wherein the Tag field occupies a first byte, and if the value of the highest bit in the first byte is a first value, it means that the Tag field only occupies The first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte; wherein, the highest bit in the first byte is the Tag length identification bit.
  87. 根据权利要求84或85所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节和第三字节,且所述Tag字段的取值通过所述第二字节中的全部比特位和所述第三字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The device according to claim 84 or 85, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte and the third byte after the first byte, and the value of the Tag field passes through all bits in the second byte and all bits in the third byte The bit is determined; wherein, the highest bit in the first byte is the Tag length identification bit.
  88. 根据权利要求84或85所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,且所述Tag字段的取值通过所述第一字节中的低7位和所述第二字节中的全部比特位确定;其中,所述第一字节中的最高位为Tag长度标识位。The apparatus according to claim 84 or 85, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte after the first byte, and the value of the Tag field is determined by the lower 7 bits in the first byte and all the bits in the second byte; wherein, The highest bit in the first byte is the Tag length identification bit.
  89. 根据权利要求84或85所述的装置,其中,所述Tag字段至少占据第一字节,若所述第一字节中的最高位的取值为第二值,则表示所述Tag字段还占据所述第一字节之后的第二字节,若所述第二字节的最高位的取值为第二值,则表示所述Tag字段还占据所述第二字节之后的第三字节,以此类推,直到所述Tag字段占据的第M字节中的最高位的取值为第一值,将该第M字节作为所述Tag字段占据的最后一个字节,M为正整数;所述Tag字段的取值通过所述第一字节至所述第M字节中的每个字节中的低7位确定。The device according to claim 84 or 85, wherein the Tag field occupies at least a first byte, and if the highest bit in the first byte is a second value, it means that the Tag field still has a second value. Occupies the second byte after the first byte, if the value of the highest bit of the second byte is the second value, it means that the Tag field also occupies the third byte after the second byte. byte, and so on, until the value of the highest bit in the Mth byte occupied by the Tag field is the first value, the Mth byte is taken as the last byte occupied by the Tag field, and M is A positive integer; the value of the Tag field is determined by the lower 7 bits of each byte from the first byte to the Mth byte.
  90. 根据权利要求84或85所述的装置,其中,所述Tag字段的长度基于所述ControlByte字段中的第一部分确定,所述ControlByte字段中的第一部分用于指示Tag的说明,所述Tag的说明用于确定以下至少之一:Tag字段的长度、Tag字段所描述的标签类型为属性标识标签iid tag或者索引标签index tag或者设备标识标签DeviceID tag或者事务标识标签ID tag或者服务标识标签siid tag。The apparatus according to claim 84 or 85, wherein the length of the Tag field is determined based on the first part in the ControlByte field, and the first part in the ControlByte field is used to indicate the description of the Tag, the description of the Tag It is used to determine at least one of the following: the length of the Tag field, and the tag type described by the Tag field is an attribute identification tag iid tag or an index tag index tag or a device identification tag DeviceID tag or a transaction identification tag ID tag or a service identification tag siid tag.
  91. 根据权利要求73至90中任一项所述的装置,其中,所述Length字段的长度为N3个字节,N3为正整数。The apparatus according to any one of claims 73 to 90, wherein the length of the Length field is N3 bytes, and N3 is a positive integer.
  92. 根据权利要求91所述的装置,其中,所述N3的取值大于等于0且小于等于8。The device according to claim 91, wherein the value of N3 is greater than or equal to 0 and less than or equal to 8.
  93. 根据权利要求91或92所述的装置,其中,所述Length字段的长度基于所述ControlByte字段中的第二部分确定,所述ControlByte字段中的第二部分用于指示Length字段的长度。The apparatus of claim 91 or 92, wherein the length of the Length field is determined based on a second part of the ControlByte field, the second part of the ControlByte field being used to indicate the length of the Length field.
  94. 根据权利要求73至93中任一项所述的装置,其中,所述Value字段的长度为N4个字节,N4的取值为正整数。The apparatus according to any one of claims 73 to 93, wherein the length of the Value field is N4 bytes, and the value of N4 is a positive integer.
  95. 根据权利要求94所述的装置,其中,所述Value字段的长度基于所述ControlByte字段 中的第二部分确定,The apparatus of claim 94, wherein the length of the Value field is determined based on the second part in the ControlByte field,
    所述ControlByte字段中的第二部分用于指示基本数据类型的Value字段的长度;或者,所述ControlByte字段中的第二部分用于指示容器数据类型的结束符。The second part of the ControlByte field is used to indicate the length of the Value field of the basic data type; or, the second part of the ControlByte field is used to indicate the terminator of the container data type.
  96. 根据权利要求73至95中任一项所述的装置,其中,所述Tag字段用于描述数据的标签,所述Length字段用于描述Value字段的长度,所述Value字段用于描述数据的Value。The apparatus according to any one of claims 73 to 95, wherein the Tag field is used to describe the tag of the data, the Length field is used to describe the length of the Value field, and the Value field is used to describe the Value of the data .
  97. 一种通信设备,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求1至24中任一项所述的方法,或者权利要求25至48中任一项所述的方法。A communication device, comprising: a processor and a memory, the memory is used to store a computer program, the processor is used to call and run the computer program stored in the memory, and execute the computer program according to any one of claims 1 to 24. , or the method of any one of claims 25 to 48.
  98. 一种芯片,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1至24中任一项所述的方法,或者权利要求25至48中任一项所述的方法。A chip, comprising: a processor for invoking and running a computer program from a memory, so that a device equipped with the chip executes the method according to any one of claims 1 to 24, or claims 25 to 48 The method of any of the above.
  99. 一种计算机可读存储介质,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至24中任一项所述的方法,或者权利要求25至48中任一项所述的方法。A computer-readable storage medium for storing a computer program that causes a computer to perform the method of any one of claims 1 to 24, or the method of any one of claims 25 to 48 .
  100. 一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行如权利要求1至24中任一项所述的方法,或者权利要求25至48中任一项所述的方法。A computer program product comprising computer program instructions that cause a computer to perform the method of any one of claims 1 to 24, or the method of any one of claims 25 to 48.
  101. 一种计算机程序,所述计算机程序使得计算机执行如权利要求1至24中任一项所述的方法,或者权利要求25至48中任一项所述的方法。A computer program that causes a computer to perform the method of any one of claims 1 to 24, or the method of any one of claims 25 to 48.
PCT/CN2020/133158 2020-12-01 2020-12-01 Data transmission method and apparatus, and communication device WO2022116009A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080105087.2A CN116615874A (en) 2020-12-01 2020-12-01 Data transmission method and device and communication equipment
PCT/CN2020/133158 WO2022116009A1 (en) 2020-12-01 2020-12-01 Data transmission method and apparatus, and communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/133158 WO2022116009A1 (en) 2020-12-01 2020-12-01 Data transmission method and apparatus, and communication device

Publications (1)

Publication Number Publication Date
WO2022116009A1 true WO2022116009A1 (en) 2022-06-09

Family

ID=81852864

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133158 WO2022116009A1 (en) 2020-12-01 2020-12-01 Data transmission method and apparatus, and communication device

Country Status (2)

Country Link
CN (1) CN116615874A (en)
WO (1) WO2022116009A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179580A (en) * 2007-12-12 2008-05-14 北京北方烽火科技有限公司 Method for implementing encoding/decoding of WiMAX system information
CN102090001A (en) * 2008-10-30 2011-06-08 华为技术有限公司 Optical network terminal management and control interface over ethernet
CN102739505A (en) * 2011-04-06 2012-10-17 中兴通讯股份有限公司 Method and system for controlling virtual channel flow in data center network
US20130077626A1 (en) * 2011-09-23 2013-03-28 Avaya Inc. Separation of edge and routing/control information for multicast over shortest path bridging
CN110086763A (en) * 2013-06-25 2019-08-02 谷歌有限责任公司 Structural network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179580A (en) * 2007-12-12 2008-05-14 北京北方烽火科技有限公司 Method for implementing encoding/decoding of WiMAX system information
CN102090001A (en) * 2008-10-30 2011-06-08 华为技术有限公司 Optical network terminal management and control interface over ethernet
CN102739505A (en) * 2011-04-06 2012-10-17 中兴通讯股份有限公司 Method and system for controlling virtual channel flow in data center network
US20130077626A1 (en) * 2011-09-23 2013-03-28 Avaya Inc. Separation of edge and routing/control information for multicast over shortest path bridging
CN110086763A (en) * 2013-06-25 2019-08-02 谷歌有限责任公司 Structural network

Also Published As

Publication number Publication date
CN116615874A (en) 2023-08-18

Similar Documents

Publication Publication Date Title
US9286249B2 (en) USB device communication method, device and system wherein a human interface device (HID) descriptor and report are added to a driver of USB device
US8099115B2 (en) TCP over SMS
WO2015081786A1 (en) Method and apparatus for implementing subscription notification
WO2021013046A1 (en) Communication method and network card
TWI794260B (en) Method, device and equipment for determining transmission block size
WO2017000915A1 (en) Multicast transmission method, information extraction method and corresponding terminal and device
CN111352889A (en) Equipment management method, equipment, device and medium based on MCTP (Multi-port technology protocol)
WO2022042235A1 (en) Data packet sending method and apparatus, data packet processing method and apparatus, device, and data packet
WO2013127108A1 (en) Method and device for saving short message
WO2020038443A1 (en) Bridging communication method and device
WO2021197141A1 (en) Service processing method and apparatus, and device and storage medium
US20220358070A1 (en) Pcie-based data transmission method and apparatus
WO2021147045A1 (en) Pcie-based data transmission method and apparatus
JP7282895B2 (en) Data retransmission decoding method, device, system and communication device
WO2022022234A1 (en) Bluetooth data packet processing method and communication device
WO2022116009A1 (en) Data transmission method and apparatus, and communication device
CN116204487A (en) Remote data access method and device
WO2019144619A1 (en) Rpc communication method and system, and device
WO2023050045A1 (en) Data transmission method, apparatus and system
WO2021036189A1 (en) Rdma data sending and receiving methods, electronic device and readable storage medium
TWI645698B (en) Data transmitting apparatus, data receiving apparatus and method thereof
CN111385069A (en) Data transmission method and computer equipment
WO2020221033A1 (en) Method for managing remote storage device by means of management device
CN109428861A (en) Network communication method and equipment
WO2018202151A1 (en) Communication method and communication device

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202080105087.2

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20963857

Country of ref document: EP

Kind code of ref document: A1