Message processing method, message encoding and decoding method and device, equipment and medium

By introducing a second cell with byte aligned bytes into the message data structure, the problem of low cell granularity encoding and decoding efficiency under Unaligned PER encoding is solved, and a more efficient encoding and decoding process is achieved.

CN120150896APending Publication Date: 2025-06-13VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311697173.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-11
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

When using Unaligned PER for message encoding, the encoding and decoding efficiency of cell granularity is low, mainly due to the increase in bit operations caused by byte dislocation, which consumes a large amount of computing resources and increases delay.

Method used

By introducing a second cell for byte alignment into the message data structure, it is positioned in front of the first cell, thereby avoiding bit operations on the first cell during encoding and decoding, and encoding and decoding is directly performed at the beginning of the byte.

Benefits of technology

It improves the encoding and decoding efficiency of cell granularity, reduces bit operations during the encoding and decoding process, and reduces the consumption and delay of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120150896A_ABST
    Figure CN120150896A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method, a message encoding and decoding method and device, equipment and a medium, and belongs to the technical field of communication, and the message processing method comprises the steps that first equipment carries out message processing on a first message based on a non-aligned compression encoding rule Unaligned PER; wherein the first message comprises a first cell and a second cell, the second cell is in front of the first cell, and the second cell is used for enabling the first cell to be coded or decoded under the condition that bytes are aligned.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technologies, and particularly relates to a message processing method, a message encoding and decoding method, an apparatus, a device, and a medium. Background Art

[0002] When encoding a message based on the Unaligned Compression Encoding Rule, although the maximum compression encoding can be achieved, due to a large number of byte misalignments, the encoding and decoding efficiency of cell granularity will be reduced. Summary of the Invention

[0003] Embodiments of this application provide a message processing method, a message encoding and decoding method, an apparatus, a device, and a medium, which can solve the problem of low encoding and decoding efficiency of cell granularity caused by using Unaligned PER.

[0004] In a first aspect, a message processing method is provided, which is executed by a first device. The method includes:

[0005] The first device processes a first message based on the Unaligned Compression Encoding Rule Unaligned PER.

[0006] Wherein, the first message includes a first cell and a second cell, the second cell is in front of the first cell, and the second cell is used to enable the first cell to be encoded or decoded in a byte-aligned manner.

[0007] In a second aspect, a message encoding method is provided, which is executed by an encoding device. The method includes:

[0008] The encoding device encodes a first message by using the Unaligned Compression Encoding Rule and a first method.

[0009] Wherein, the first method includes:

[0010] When there is a byte misalignment in the code stream obtained by encoding the cell in front of the first cell, byte-align the code stream;

[0011] Encode the first cell at the byte start of the byte-aligned code stream;

[0012] Wherein, the first message includes at least the first cell and the cell in front of the first cell.

[0013] In a third aspect, a message decoding method is provided, which is executed by a decoding device. The method includes:

[0014] The decoding device decodes the encoded first message by using the decoding rule corresponding to Unaligned PER and a third method.

[0015] Among them, the third method includes:

[0016] Before starting to decode the first encoded cell, skip decoding the target bitstream;

[0017] Among them, the first encoded message is encoded based on the unaligned compression coding rule, and the first encoded message includes the target bitstream, the first encoded cell, and other encoded cells. The target bitstream is used to byte-align the bitstream obtained by encoding other cells in front of the first cell in the first message.

[0018] In a fourth aspect, a message processing device is provided, which is applied to a first device. The device includes:

[0019] A message processing module, configured to perform message processing on a first message based on the unaligned compression coding rule Unaligned PER;

[0020] Among them, the first message includes a first cell and a second cell. The second cell is in front of the first cell, and the second cell is used to enable the first cell to be encoded or decoded in a byte-aligned manner.

[0021] In a fifth aspect, a message encoding device is provided, which is applied to an encoding device. The device includes:

[0022] A message encoding module, configured to perform message encoding on a first message using the unaligned compression coding rule and a first method;

[0023] Among them, the first method includes:

[0024] When there is a byte misalignment in the bitstream obtained by encoding the cells in front of the first cell, byte-align the bitstream;

[0025] At the byte start of the byte-aligned bitstream, encode the first cell;

[0026] Among them, the first message includes at least the first cell and the cells in front of the first cell.

[0027] In a sixth aspect, a message decoding device is provided, which is applied to a decoding device. The device includes:

[0028] A message decoding module, configured to perform message decoding on the encoded first message using the decoding rule corresponding to Unaligned PER and the third method;

[0029] Among them, the third method includes:

[0030] Before starting to decode the first encoded cell, skip decoding the target bitstream;

[0031] Among them, the first encoded message is encoded based on non-aligned compression encoding rules, and the first encoded message includes the target bitstream, the first encoded cell, and other encoded cells. The target bitstream is used to byte-align the bitstream obtained by encoding other cells in the first message that are in front of the first cell.

[0032] In a seventh aspect, a communication device is provided. The communication device includes a processor and a memory. The memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, it implements the steps of the message processing method described in the first aspect, or implements the steps of the message encoding method described in the second aspect, or implements the steps of the message decoding method described in the third aspect.

[0033] In an eighth aspect, a readable storage medium is provided. A program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, it implements the steps of the message processing method described in the first aspect, or implements the steps of the message encoding method described in the second aspect, or implements the steps of the message decoding method described in the third aspect.

[0034] In a ninth aspect, a wireless communication system is provided, including: an encoding device and a decoding device. The encoding device can be used to execute the steps of the message encoding method described in the second aspect, and the decoding device can be used to execute the steps of the message decoding method described in the third aspect.

[0035] In a tenth aspect, a chip is provided. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run a program or instruction to implement the steps of the message processing method described in the first aspect, or implement the steps of the message encoding method described in the second aspect, or implement the steps of the message decoding method described in the third aspect.

[0036] In an eleventh aspect, a computer program / program product is provided. The computer program / program product is stored in a storage medium. The program / program product is executed by at least one processor to implement the steps of the message processing method described in the first aspect, or implement the steps of the message encoding method described in the second aspect, or implement the steps of the message decoding method described in the third aspect.

[0037] In the embodiment of the present application, the data structure adopted by the first message includes a second cell for implementing byte alignment, and the second cell is located in front of the first cell in the data structure. When the Unaligned PER is used to process the first message, the cells in front of the first cell are byte-aligned after encoding due to the existence of the second cell, so that the first cell can be encoded and decoded at the beginning of the byte. Therefore, the bit operation on the first cell in the encoding and decoding process can be omitted, and the encoding and decoding efficiency of the first cell (i.e., cell granularity) can be improved. Description of the Drawings

[0038] Figure 1 is a block diagram of a wireless communication system to which the embodiment of the present application can be applied;

[0039] Figure 2 is a schematic diagram of a code stream obtained by encoding a ULInformationTransfer message in the related art;

[0040] Figure 3 is a flowchart of an implementation of a message processing method in the embodiment of the present application;

[0041] Figure 4 is a schematic diagram of a code stream obtained by encoding a ULInformationTransfer message after optimizing the data structure in the embodiment of the present application;

[0042] Figure 5 is a flowchart of an implementation of a message encoding method in the embodiment of the present application;

[0043] Figure 6 is a flowchart of an implementation of a message decoding method in the embodiment of the present application;

[0044] Figure 7 is a block diagram of the structure of a message processing device in the embodiment of the present application;

[0045] Figure 8 is a block diagram of the structure of a message encoding device in the embodiment of the present application;

[0046] Figure 9 is a block diagram of the structure of a message decoding device in the embodiment of the present application;

[0047] Figure 10 is a block diagram of the structure of a communication device in the embodiment of the present application;

[0048] Figure 11 is a schematic diagram of the hardware structure of a terminal device in the embodiment of the present application;

[0049] Figure 12It is a schematic diagram of the hardware structure of a network device in an embodiment of the present application. Detailed implementation manners

[0050] Next, the technical solutions in the embodiments of the present application will be clearly described with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0051] The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first" and "second" are usually of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "or" in the present application means at least one of the connected objects. For example, "A or B" covers three scenarios, namely, Scenario 1: including A and not including B; Scenario 2: including B and not including A; Scenario 3: including both A and B. The character " / " generally indicates an "or" relationship between the associated objects before and after.

[0052] The term "indication" in the present application can be either a direct indication (or an explicit indication) or an indirect indication (or an implicit indication). Among them, a direct indication can be understood as that the sender clearly tells the receiver specific information, operations to be performed, or request results, etc. in the sent indication; an indirect indication can be understood as that the receiver determines the corresponding information according to the indication sent by the sender, or makes a judgment and determines the operations to be performed or request results, etc. according to the judgment result.

[0053] It should be noted that the technology described in the embodiments of this application is not limited to Long Term Evolution (LTE) / LTE-Advanced (LTE-A) systems, but can also be used in other wireless communication systems, such as Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Frequency Division Multiple Access (FDMA), Orthogonal Frequency Division Multiple Access (OFDMA), Single-carrier Frequency-Division Multiple Access (SC-FDMA), or other systems. The terms "system" and "network" in the embodiments of this application are often used interchangeably, and the described technology can be used in the above-mentioned systems and radio technologies, as well as in other systems and radio technologies. The following description describes the New Radio (NR) system for example purposes, and the NR term is used in most of the following descriptions, but these technologies can also be applied to systems other than the NR system, such as the 6th Generation (6 th Generation, 6G) communication system.

[0054] Figure 1A block diagram of a wireless communication system to which embodiments of the present application can be applied is shown. The wireless communication system includes a terminal 11 and a network-side device 12. Among them, the terminal 11 can be a mobile phone, a tablet personal computer, a laptop computer, a notebook computer, a personal digital assistant (PDA), a handheld computer, a netbook, an ultra-mobile personal computer (UMPC), a mobile internet device (MID), an augmented reality (AR), a virtual reality (VR) device, a robot, a wearable device, a flight vehicle, a vehicle user equipment (VUE), a shipborne device, a pedestrian user equipment (PUE), a smart home (home appliances with wireless communication functions, such as refrigerators, TVs, washing machines or furniture, etc.), a game console, a personal computer (PC), a teller machine or a self-service machine, etc. Wearable devices include: smart watches, smart bracelets, smart earphones, smart glasses, smart jewelry (smart bracelets, smart bracelets, smart rings, smart necklaces, smart anklets, smart ankle chains, etc.), smart wristbands, smart clothing, etc. Among them, the vehicle user equipment can also be referred to as a vehicle terminal, a vehicle controller, a vehicle module, a vehicle component, a vehicle chip or a vehicle unit, etc. It should be noted that the specific type of the terminal 11 is not limited in the embodiments of the present application. The network-side device 12 can include an access network device or a core network device. Among them, the access network device can also be referred to as a radio access network (RAN) device, a radio access network function or a radio access network unit. The access network device can include a base station, a wireless local area network (WLAN) access point (AP) or a wireless fidelity (WiFi) node, etc.Among them, the base station can be referred to as Node B (NB), Evolved Node B (eNB), the next generation Node B (gNB), New Radio Node B (NR Node B), access point, Relay Base Station (RBS), Serving Base Station (SBS), Base Transceiver Station (BTS), radio base station, radio transceiver, Basic Service Set (BSS), Extended Service Set (ESS), home Node B (HNB), home evolved Node B, Transmission Reception Point (TRP), or some other suitable term in the art. As long as the same technical effect is achieved, the base station is not limited to specific technical terms. It should be noted that in the embodiments of the present application, only the base station in the NR system is taken as an example for introduction, and the specific type of the base station is not limited.

[0055] To facilitate the understanding of the technical solutions provided in the present application, the following briefly describes the main technical concepts involved in the embodiments of the present application.

[0056] I. Abstract Syntax Notation One (ASN.1) Encoding Rules

[0057] In order to enable the structural relationship of structured data in a high-level language to be transmitted over the network and restored at the destination, the following several data serialization methods have emerged in history: ASN.1, eXtensible Markup Language (XML), JavaScript Object Notation (JSON), etc.

[0058] ASN.1 is a standard of the International Organization for Standardization (ISO) or the International Telecommunication Union Telecommunication Standardization Sector (ITU-T). It describes a data format for representing, encoding, transmitting, and decoding data, and provides a complete set of formal formats for describing the structure of objects. ASN.1 itself only defines the abstract syntax for representing information, but does not limit the method of its encoding. Various ASN.1 encoding rules provide the transfer syntax (specific representation) of the values of the data whose abstract syntax is described by ASN.1.

[0059] The standard ASN.1 encoding rules include Basic Encoding Rules (BER), Canonical Encoding Rules (CER), Distinguished Encoding Rules (DER), Packed Encoding Rules (PER), and eXtensible Markup Language Encoding Rules (XER, also known as XML Encoding Rules).

[0060] Among them, PER can be divided into two cases: Aligned Packed Encoding Rules (APER) and Unaligned Packed Encoding Rules (UPER, also known as Unaligned PER). The key difference between the two is that APER encoding requires an 8-bit alignment operation for the encoding of each cell (also known as the data format) when encoding a message, that is, padding with 0s at the high or low bits is required; UPER encoding only performs an 8-bit alignment operation after all cell encodings are completed when encoding a message.

[0061] II. Encoding of Information of OCTET STRING Type by Unaligned PER

[0062] Taking the UL Information Transfer message in the related technology as an example, the data format it adopts is as follows:

[0063]

[0064]

[0065]

[0066] The related technology adopts Unaligned PER coding. According to the above analysis, when encoding to dedicated NAS-Message, the previously encoded cells occupy 9 bits. That is, there are 7 bits remaining in the second octet (hereinafter simply referred to as byte) for the subsequent encoded content. When encoding dedicated NAS-Message, first, one or two bytes are occupied to represent the length of the dedicated NAS-Message byte stream (corresponding to the data from the second bit position (Bit 1) at Oct 2 to the first bit position (Bit 0) at Oct 4 in the code stream shown in Figure 2 , and then the byte stream content of dedicated NAS-Message is encoded (corresponding to the data from the second bit position (Bit 1) at Oct 4 to the first bit position (Bit 0) at Oct 2004 in the code stream shown in Figure 2 ).

[0067] It should be noted that the storage system stores data in units of bytes. Since there are 7 bits remaining in the second byte, both the information representing the length of the dedicated NAS-Message byte stream and the byte stream content of dedicated NAS-Message need to perform bit operations (i.e., shift left by 7 bits) during encoding.

[0068] Taking the dedicated NAS-Message byte stream length as 2000 and the information (Len of dedicated NAS-Message) describing the byte stream length occupying two bytes after encoding as an example, as Figure 2As shown, in the bitstream obtained by encoding the ULInformationTransfer message, the data from the second bit position (Bit 1) at Oct 2 to the first bit position (Bit 0) at the 4th octet (Oct 4) is the encoded Len of dedicatedNAS-Message. The data from the second bit position (Bit 1) at Oct 4 to the first bit position (Bit 0) at the 2004th octet (Oct 2004) is the byte stream content of the encoded dedicatedNAS-Message. The data after Bit 0 at Oct 2004 is the encoded cell or padding bits following the dedicatedNAS-Message (i.e., the padding bits filled during the octet alignment operation after encoding all the data of the ULInformationTransfer message).

[0069] In the related art, taking the 4th Generation mobile communication technology (4G) or 5th Generation mobile communication technology (5G) system as an example, in the 4G / 5G system, protocols such as Radio Resource Control (RRC) and Long Term Evolution Positioning Protocol (LPP) use Unaligned PER to encode the corresponding messages, that is, all RRC messages or LPP messages are encoded using Unaligned PER. Although Unaligned PER can achieve maximum compression encoding, when encoding and decoding some specific types of cells, the encoding and decoding efficiency of Unaligned PER will be significantly reduced.

[0070] Taking the OCTET STRING type dedicatedNAS-Message as an example, as Figure 2 shown, the byte stream length of the dedicatedNAS-Message is 2000 bytes. When encoding and decoding this cell based on Unaligned PER, since it is necessary to shift this cell bit by bit (i.e., shift left by 7 bits), at least 2000 bit operations need to be performed.

[0071] In practical applications, the byte stream length of cells of the OCTET STRING type such as dedicated NAS-Message (especially cells of the OCTET STRING type in the 3GPP protocol) is usually large (it can reach several thousand bytes). When the codec encodes and decodes cells of the OCTET STRING type based on Unaligned PER, a large number of bit operations are required, resulting in extremely low encoding and decoding efficiency for such cells, greatly consuming the computing resources of related nodes and increasing the latency. Moreover, with the introduction of features such as 6G data plane and the transmission of artificial intelligence (AI) models, in the future, it may be necessary to transmit a large number of cells of the OCTET STRING type through RRC messages, LPP messages, or new protocols, which will also greatly consume the computing resources of related nodes and increase the latency.

[0072] It should be noted that since the Aligned PER encoder performs byte alignment when encoding each cell, if the related technology adopts Aligned PER, the problem of low encoding and decoding efficiency at the cell granularity can be solved. However, since byte alignment is also performed when encoding other cells, the encoded code stream is larger, and more wireless resources will be consumed when transmitting over the wireless interface. This is why the related technology adopts Unaligned PER encoding instead of Aligned PER. Therefore, there is an urgent need for a solution that can improve the encoding and decoding efficiency at the cell granularity under the Unaligned PER encoding method.

[0073] In view of the problems existing in the related technology, this application provides a message processing method, a message encoding and decoding method, a device, a device, and a medium, which improve the encoding and decoding efficiency of the first cell (i.e., cell granularity) under the Unaligned PER encoding method by optimizing the data structure or encoding rules adopted by the message.

[0074] In the first aspect of the embodiments of this application, a message processing method is provided. This method is executed by a first device. Refer to Figure 3 As shown, it is a flowchart of the implementation of a message processing method provided by the embodiments of this application. This method may include the following steps:

[0075] Step S101: The first device processes the first message based on the non-aligned compression encoding rule Unaligned PER.

[0076] Among them, the first message includes a first cell and a second cell. The second cell is in front of the first cell. The second cell is used to enable the first cell to be encoded or decoded in byte alignment. The first device can be a terminal device or a network device. For example, the first device can be Figure 1 the terminal 11 or the network side device 12 in Figure 1 . For the examples of the terminal 11 and the network side device 12, please refer to the previous text and will not be elaborated here.

[0077] In specific implementation, according to actual requirements, the cell (also called data format) whose encoding and decoding efficiency needs to be improved can be determined as the first cell. For example, the cell with the cell structure of byte stream type (such as the above dedicated NAS-Message, or the cell of OCTET STRING type) can be determined as the first cell. By encoding and decoding the first cell in byte alignment, encoding, decoding, storage and other processing operations can be realized on this cell at the byte granularity, eliminating a large number of bit operations generated by shifting the first cell bit by bit during the encoding and decoding process. Therefore, the encoding and decoding efficiency of the first cell can be greatly improved.

[0078] After determining the first cell whose encoding and decoding efficiency needs to be improved, the data structure containing the first cell can be optimized. According to the lengths occupied by the encoded cells in front of the first cell in this data structure, with the goal of enabling the first cell to be encoded and decoded in byte alignment, determine the target length that the second cell should occupy after encoding. Design the second cell according to this target length and insert the designed second cell in front of the first cell in this data structure to obtain the optimized data structure.

[0079] When the first device encodes or decodes the message (i.e., the above first message) described by using this optimized data structure, by means of the filling effect of the second cell in the first message on the code stream obtained by encoding the cells in front of the first cell, the first device can encode or decode the first cell at the beginning of the byte. For example, directly copy and store and encode and decode the code stream obtained by encoding the first cell in units of bytes, thereby reducing or eliminating the bit operations in the encoding and decoding process of the first cell and realizing the improvement of the encoding and decoding efficiency of the first cell.

[0080] In some embodiments, the first device processes the first message based on the non-aligned compression encoding rule UnalignedPER, including at least one of the following:

[0081] When the first device is an encoding device, the first message is encoded based on Unaligned PER. For example, the first device can encode the first message according to the traditional or optimized encoding rules corresponding to Unaligned PER. This embodiment does not limit the specific encoding rules corresponding to the Unaligned PER used to encode the first message;

[0082] When the first device is a decoding device, the first message is decoded based on the decoding rules corresponding to Unaligned PER. For example, the first device can decode the first message according to the traditional or optimized decoding rules corresponding to Unaligned PER. This embodiment does not limit the specific decoding rules corresponding to the Unaligned PER used to decode the first message.

[0083] As can be seen from the above steps, the data structure adopted by the first message includes a second cell for implementing byte alignment, and this second cell is located in front of the first cell in this data structure. When using Unaligned PER to process the first message, the cells in front of the first cell are in a byte-aligned state after encoding due to the existence of the second cell, so that the first cell can be encoded and decoded at the beginning of the byte. Thus, the bit operation on the first cell in the encoding and decoding process can be omitted, and the encoding and decoding efficiency of the first cell (i.e., cell granularity) can be improved.

[0084] The above message processing method will be further described below in conjunction with Embodiment 1.

[0085] Embodiment 1

[0086] When optimizing the data structure required to encode and decode the first cell, according to the bit length (which needs to be fixed) filled for byte alignment of other cells, the second cell is designed as a cell that occupies a fixed length (this fixed length is determined according to the fixed bit length filled for byte alignment of other cells) after encoding, and the designed second cell is inserted in front of the first cell in this data structure to obtain the optimized data structure.

[0087] It can be understood that the above other cells are the cells in the data structure before optimization that are located in front of the first cell, that is, the cells other than the second cell in the first message that are located in front of the first cell; this embodiment mainly optimizes the data structure with an unchanged byte stream length of the other cells included to ensure that the second cell pre-inserted into this data structure can always fill the bytes not fully occupied after actual encoding of the other cells.

[0088] In some embodiments, the above first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format. In this embodiment, by optimizing the data structure of ASN.1 based on the above second cell, the encoding and decoding efficiency of the first cell carried in the relevant messages in the protocol (i.e., the first protocol) applied to the optimized data structure of ASN.1 can be effectively improved.

[0089] Optionally, the above first protocol may be a 3GPP protocol such as a radio resource control protocol applying ASN.1, or a positioning protocol (such as the LPP protocol), or a data plane protocol (such as a potential 6G data plane protocol), or the first protocol may also be any communication protocol applying ASN.1.

[0090] In some embodiments, the second cell is an obligatory cell (i.e., a cell that must appear (mandatory present) and be encoded when encoding a message), so as to ensure that the length actually occupied by the second cell in the encoded message is fixed, that is, to avoid the variable length of the second cell actually occupied in the encoded message due to the non-obligatory nature of the second cell (i.e., the second cell can be selected to be encoded (present) or not encoded (absent) when encoding a message), resulting in a situation where the cells before the first cell cannot be byte-aligned after encoding (such as the encoded first message does not contain the second cell so that the occupied length is zero).

[0091] In some embodiments, the cell with a fixed length after encoding (i.e., the second cell) can be designed in the following two embodiments. Among them, the fixed length occupied by the designed second cell after encoding and the total length occupied by the above other cells after encoding should be a positive integer multiple of 8-bit length, thereby ensuring that the newly added second cell in the data structure can enable the first cell to be encoded or decoded at the beginning of the byte (i.e., in the case of byte alignment).

[0092] Embodiment 1: Design the second cell as a bit string with the above fixed length after encoding.

[0093] Taking Figure 2 the code stream obtained by encoding the ULInformationTransfer message shown as an example, determine dedicatedNAS-Message as the first cell, that is, determine the representation information of the byte stream length of dedicatedNAS-Message (Len of dedicatedNAS-Message) and the byte stream content as the data required to encode the first cell. From Figure 2It can be known that the fixed bit length required for byte alignment of other cells is 7 bit lengths. Therefore, the second cell can be designed as a bit string with a fixed length of 7 bit lengths (or 15 bit lengths, or 23 bit lengths, etc.) after encoding. This ensures that the newly added second cell in the data structure can achieve byte alignment for the code stream obtained by encoding the above-mentioned other cells. Among them, the value of each bit in the second cell carried by the first message can be determined according to actual needs, such as randomly determined or determined according to the information to be indicated.

[0094] Embodiment 2: The second cell is designed as an integer type with a fixed upper and lower value range, and the fixed upper and lower value range is determined according to the fixed length.

[0095] In this embodiment, considering that there is a strong correlation between the upper and lower value range of the integer type and the length occupied after encoding the integer type, the second cell can be designed as an integer type with a fixed upper and lower value range according to the fixed length required after encoding the second cell. Taking the fixed length required after encoding the second cell as 7 bit lengths as an example, the second cell can be designed as an integer type with a fixed upper and lower value range of 0 to 127. This ensures that the newly added second cell in the data structure can achieve byte alignment for the code stream obtained by encoding the above-mentioned other cells. Among them, the specific value of the second cell carried by the first message within this fixed upper and lower value range can be determined according to actual needs, such as randomly determined or determined according to the information to be indicated.

[0096] In some embodiments, the fixed length required after encoding the above-mentioned second cell can be further restricted to: a length greater than 0 bits and less than 8 bits. Thus, on the premise of ensuring that the second cell can achieve byte alignment for the code stream obtained by encoding the above-mentioned other cells, the length occupied after encoding the second cell can be minimized as much as possible, and thus the length occupied after encoding the first message can be minimized as much as possible.

[0097] It can be understood that in addition to being used for byte alignment of the above-mentioned other cells, the above-mentioned second cell can also be used as a reserved cell (or called a spare cell, or called a dummy cell) for future expansion. That is, the above-mentioned second cell can be given a meaning in the future to indicate other information to save overhead. The present application embodiment does not specifically limit the name description of such cells that can be used for future expansion.

[0098] Taking the reserved cell (i.e., the second cell) designed by using the above-mentioned Embodiment 1 and having a fixed length after encoding (such as 7-bit length) as an example, the second cell is a bit string with a length of 7 bits after encoding, and this bit string contains bits available for extension, namely reserved bits, or spare bits, or dummy bits. After optimizing the data structure adopted by the above ULInformationTransfer message based on this second cell, some data formats in the obtained optimized data structure are represented as follows:

[0099]

[0100]

[0101] Taking the reserved cell (i.e., the second cell) designed by using the above-mentioned Embodiment 2 and having a fixed length after encoding (such as 7-bit length) as an example, the second cell is of integer type with a fixed upper and lower value range of 0 to 127. After optimizing the data structure adopted by the above ULInformationTransfer message based on this second cell, some data formats in the obtained optimized data structure are represented as follows:

[0102]

[0103] See, for example Figure 4 In the code stream obtained by encoding the ULInformationTransfer message with the optimized data structure as shown, by filling the remaining bits at Oct 2 with the second cell designed by using the above-mentioned Embodiment 1 or 2 after encoding, the first cell can be encoded or decoded starting from the beginning of the byte (i.e., from the Bit 0 position at Oct 3). Thus, a large number of bit operations on this first cell during the encoding and decoding processes can be avoided, and a significant improvement in the encoding and decoding efficiency of this first cell can be achieved.

[0104] It should be noted that the reserved bits in the related art are mainly placed at the end of the message to make the length of the message reach a certain fixed length, while the reserved bits in the embodiments of the present application are not placed at the end of the message, but are placed before the first cell as the second cell during the design stage of the data structure, so as to enable the cells before the first cell to be byte-aligned when using Unaligned PER encoding, so that the first cell can be encoded or decoded in a byte-aligned manner, thereby reducing or avoiding bit operations during the encoding and decoding processes of the first cell, and thus improving the encoding and decoding efficiency of the first cell.

[0105] In some embodiments, in the optimized data structure, the second cell is the first n cells of the first cell, where n is a positive integer. Preferably, n is 1, that is, the second cell is the previous cell of the first cell, which facilitates determining the length of the second cell for byte alignment.

[0106] Taking the second cell being the previous cell of the first cell as an example, when the first device encodes and decodes a message (i.e., the first message) using the optimized data structure, the second cell, after being encoded, exactly fills the bytes that are not fully occupied after the encoding of the cells in front of the second cell (i.e., other cells). This enables the first cell to be encoded or decoded at the beginning of a byte (i.e., enables the first cell to be encoded or decoded in the case of byte alignment), thereby avoiding bit operations that occur when all the data of the first cell is shifted bit by bit because part of the data of the first cell needs to be moved from the bytes not fully occupied after the encoding of other cells to the beginning of the next byte during the encoding and decoding process of the first cell.

[0107] It should be noted that the message processing method based on data structure optimization provided in the embodiments of the present application mainly improves the encoding and decoding efficiency of the first cell when there are remaining bits in the last byte of the code stream obtained after encoding the cells in front of the first cell, and the remaining bits occupy a fixed length, and the entire implementation process does not require modifying the encoding and decoding rules.

[0108] To improve applicability, in the second aspect of the embodiments of the present application, a message encoding method is provided. This method is executed by an encoding device. Refer to Figure 5 As shown, it is a flowchart of the implementation of a message encoding method provided in the embodiments of the present application. This method may include the following steps:

[0109] Step S201: The encoding device encodes the first message using a non-aligned compression encoding rule and a first method.

[0110] Among them, the first method includes:

[0111] When there is byte misalignment in the code stream obtained by encoding the cells in front of the first cell, byte alignment is performed on the code stream;

[0112] At the beginning of the byte of the byte-aligned code stream, the first cell is encoded;

[0113] Among them, the first message at least includes the first cell and the cells in front of the first cell. The first cell can be determined according to actual requirements. For example, a cell structured as a byte stream type cell (such as the dedicatedNAS-Message mentioned above, or a cell of OCTET STRING type) can be determined as the first cell; the encoding device can be a terminal device or a network device. For example, the encoding device can be Figure 1 the terminal 11 or the network side device 12 in Figure 1 . For the examples of the terminal 11 and the network side device 12, reference can be made to the previous text and will not be elaborated here.

[0114] In specific implementation, a first method is introduced to optimize the non-aligned compression coding rule. During the process of the encoding device using the optimized non-aligned compression coding rule to encode the first message, when the encoding of the cells in front of the first cell is completed, based on the above first method, it will additionally detect whether the code stream obtained by the current encoding (that is, the code stream obtained by encoding the cells in front of the first cell) is byte-aligned. When the code stream obtained by the current encoding is byte-unaligned, the code stream is first byte-aligned, and then the first cell is encoded at the byte start of the byte-aligned code stream. Thus, the encoding device actively byte-aligns the code stream obtained by encoding the cells in front of the first cell to ensure that the first cell can be encoded in a byte-aligned manner, thereby avoiding bit operations caused by shifting the first cell, and thus improving the encoding efficiency of the first cell.

[0115] In some embodiments, to improve the processing efficiency, if the encoding device detects that the code stream obtained by encoding the cells in front of the first cell is already byte-aligned, the byte-alignment step can be skipped, and the first cell can be directly encoded at the byte start of the byte-aligned code stream.

[0116] In some embodiments, the encoding device can first determine the first length required to byte-align the above code stream, and fill the above code stream with bits that satisfy the first length to byte-align the above code stream.

[0117] For example, if there is 1 bit remaining in the last byte of the code stream obtained by encoding the cells in front of the first cell, the encoder can determine the 1-bit length (or a 9-bit length, etc.) as the first length (that is, the first length can be the remaining bit length of the currently obtained code stream, or the sum of an integer multiple of 8-bit length and the remaining bit length of the currently obtained code stream), and automatically fill the code stream with bits that satisfy the first length (such as filling 1 0 bit to the code stream). The specific value of the filled bits is not limited in this embodiment.

[0118] As can be seen from the above steps, by optimizing the traditional non-aligned compression coding rule, the coding device can actively perform byte alignment on the code stream obtained by coding the cells before the first cell, so as to avoid or reduce the bit operations of the first cell during the coding process, thereby improving the coding efficiency of the first cell. Moreover, compared with the method of optimizing the data structure, the embodiment of the present application adopts the method of optimizing the coding rule to improve the coding efficiency, enabling the coding device to flexibly perform byte alignment according to the actual situation of the code stream obtained by coding (that is, the encoder can automatically fill in as many bits as there are remaining bits in the last byte of the code stream obtained by coding for byte alignment), which can avoid the limitation brought by pre-determining the fixed length occupied after the second cell is coded during the data structure design stage, so that the message coding method provided in this embodiment can be further applied to messages with variable-length cells in front of the first cell, thereby improving the applicability of the method.

[0119] The above message coding method will be further described below in conjunction with Embodiment 2.

[0120] Embodiment 2

[0121] The coding device determines whether to use the above first method for message coding according to the following two embodiments. When it is determined to use the above first method for message coding, the coding device will first perform byte alignment on the code stream obtained by coding the cells before the first cell, and then start coding the first cell; when it is determined not to use the above first method for message coding, the coding device can use the traditional non-aligned compression coding rule to code the first message, that is, perform byte alignment only after all cells in the first message are coded.

[0122] In some embodiments, the above first message belongs to the message in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format. By using the above first method to code the first message, the enhancement of the coding rule of the ASN.1 protocol (i.e., the first protocol) is realized.

[0123] Optionally, the above first protocol may be a 3GPP protocol such as a radio resource control protocol applying ASN.1, or a positioning protocol (such as the LPP protocol), or a data plane protocol (such as a potential 6G data plane protocol), or the first protocol may be any communication protocol applying ASN.1.

[0124] Example 1: The coding device determines whether to use the above first method for message coding according to the first indication information.

[0125] In this embodiment, the first indication information may be a message directly indicating whether the encoding device uses the above-mentioned first method for message encoding. For example, the first indication information may directly indicate whether the encoding device uses the above-mentioned first method for message encoding through different bit values (such as 0 and 1). The first indication information may also be a message indirectly indicating whether the encoding device uses the above-mentioned first method for message encoding. For example, the first indication information may indicate which encoding rule or method (such as using UNALIGNED PER optimized based on the first method, or using UNALIGNED PER optimized based on other methods, or using traditional UNALIGNED PER or APER, etc.) the encoding device needs to use for message encoding through the identifiers of different encoding methods. The encoding device further determines whether to use the above-mentioned first method for message encoding according to the received identifier of the encoding method.

[0126] In some embodiments, before receiving the above-mentioned first indication information, the encoding device determines not to use the above-mentioned first method for message encoding and uses a second method for message encoding. The second method is to encode only using UNALIGNED PER, that is, the encoding device uses traditional UNALIGNED PER to encode the message before receiving the first indication information; after receiving the first indication information, the encoding device determines to use the above-mentioned first method for message encoding and uses UNALIGNED PER and the above-mentioned first method for message encoding, that is, the encoding device uses the encoding rule of UNALIGNED PER optimized based on the first method to encode the message after receiving the first indication information, so as to improve the encoding efficiency of the first cell.

[0127] In some embodiments, the above-mentioned first indication information is configured by a network device. For example, the network device may configure (or send) the first indication information to a terminal device to indicate that the terminal device uses the above-mentioned first method for message encoding when acting as an encoding device. The network device may also configure the first indication information for itself (such as a network management device sending the first indication information to a base station) to indicate that it uses the above-mentioned first method for message encoding when acting as an encoding device.

[0128] In some embodiments, when the encoding device is a terminal device, the encoding device reports to the network device whether it supports a first capability. The first capability is the capability to perform byte alignment on the encoded code stream before encoding the first cell. According to the first capability reported by the terminal device, the network device can know whether the terminal device has the capability to execute the encoding rule of UNALIGNED PER optimized based on the above-mentioned first method. Subsequently, the network device can perform an operation of configuring the first indication information for the terminal device.

[0129] Optionally, the first indication information is configured by the network device according to the first capability reported by the terminal device. The network device may, when determining that the terminal device supports the first capability, use the first indication information to instruct the terminal device to perform message encoding in the first manner, thereby ensuring the normal execution of message encoding.

[0130] Embodiment 2: The encoding device determines whether to perform message encoding in the first manner according to the protocol convention.

[0131] In this embodiment, it may be agreed in a protocol that adopts the Unaligned PER encoding rule (such as the 3GPP protocol or other protocols that adopt ASN.1) whether to perform message encoding in the first manner. For example, relevant agreements may be added to a certain 3GPP protocol to agree to perform message encoding in the first manner for all OCTET STRING type cells in this protocol, so as to improve the encoding efficiency.

[0132] In some embodiments, the protocol agrees to perform message encoding in the first manner for all types or some types of messages in the first protocol (the above first message belongs to the messages in the first protocol). For example, in a certain 3GPP protocol (such as the RRC protocol, LPP protocol, data plane protocol, etc.), it may be agreed to perform message encoding in the first manner for all types of messages in this 3GPP protocol (such as all messages carrying OCTET STRING type cells) to improve the encoding efficiency of the first cells carried by all types of messages in this 3GPP protocol, or it may be agreed to perform message encoding in the first manner for some types of messages in this 3GPP protocol to specifically improve the encoding efficiency of the first cells carried by some types of messages in this 3GPP protocol; or

[0133] The protocol agrees to perform message encoding in the first manner for the first cells with specific marks. For example, it may be agreed to perform message encoding in the first manner for OCTET STRING type cells with specific marks (such as dedicatedNAS-Message and other cells with a longer byte stream length), and perform message encoding in the second manner for OCTET STRING type cells without the specific mark (such as other OCTET STRING type cells with a shorter byte stream length), so as to greatly improve the encoding efficiency; or

[0134] The protocol agrees to perform message encoding in the first manner for the sub-cells in the first cells with specific marks. For example, by performing message encoding in the first manner for the sub-cells with a longer byte stream length in the first cells with specific marks, the encoding efficiency of the first cells can be greatly improved.

[0135] Exemplarily, taking the example of using a special annotation method to specifically mark the dedicated NAS - Message, the dedicated NAS - Message after the specific marking can be expressed as:

[0136] ULInformationTransfer - IEs::= SEQUENCE {

[0137] dedicatedNAS - Message DedicatedNAS - Message OPTIONAL, --Aligned / / By adding the annotation of "--Aligned" to the dedicated NAS - Message, it indicates that the dedicated NAS - Message is the first cell with a specific mark.

[0138] Similarly, the annotation of "--Aligned" can also be added to other types of cells or sub - cells of other types of cells to indicate that the other type of cell or sub - cell of the other type of cell is the first cell with a specific mark or the sub - cell of the first cell with a specific mark.

[0139] In some embodiments, when the protocol stipulates that the first cell with a specific mark or the sub - cell in the first cell is encoded by the first method for message encoding, before the encoding device starts encoding the first cell without the specific mark or the sub - cell in the first cell, it is determined not to perform byte alignment on the encoded bitstream. That is, at this time, the encoding device can use the traditional Unaligned PER encoding rule (such as the second method above) for message encoding to avoid additional byte alignment steps.

[0140] In the third aspect of the embodiments of the present application, a message decoding method is provided. This method is executed by a decoding device. Refer to Figure 6 As shown, it is a flowchart of the implementation of a message decoding method provided by the embodiments of the present application. This method may include the following steps:

[0141] Step S301: The decoding device decodes the encoded first message using the decoding rule corresponding to Unaligned PER and the third method for message decoding.

[0142] Among them, the third method includes:

[0143] Before starting to decode the encoded first cell, skip decoding the target bitstream;

[0144] Among them, the encoded first message is encoded based on a non-aligned compression encoding rule. The encoded first message includes the target code stream, the encoded first cell, and other encoded cells. The target code stream is used to perform byte alignment on the code stream obtained by encoding other cells in the first message that are in front of the first cell. The first cell can be determined according to actual requirements. For example, a cell with a byte stream length greater than a set value (such as the above dedicatedNAS-Message) can be determined as the first cell, or a cell with a byte length that is a positive integer multiple of 8 bit lengths (such as a cell of the OCTET STRING type above) can be determined as the first cell. The decoding device can be a terminal device or a network device. For example, the encoding device can be Figure 1 Terminal 11 or network side device 12 in Figure 1 . For examples of Terminal 11 and network side device 12, reference can be made to the foregoing, and details are not elaborated herein.

[0145] In a specific implementation, after encoding the first message through the message encoding method described in the second aspect of the embodiments of the present application, the encoding device transmits the encoded first message to the decoding device. The decoding device receives the encoded first message, and during the process of decoding the encoded first message, detects the target code stream (i.e., the bit stream of the first length filled by the encoding device described in the second aspect of the embodiments of the present application) filled by the encoding device in the encoded first message, and in the case of detecting the target code stream, skips decoding of the target code stream (which usually does not contain valid data content) to ensure decoding efficiency.

[0146] In some embodiments, when the decoding device finishes decoding the encoded third cell, it determines whether the currently to-be-decoded code stream in the code stream of the encoded first message is at the byte start, where the third cell includes the cells in the first message that are in front of the first cell.

[0147] If the currently to-be-decoded code stream is not at the byte start, it indicates that the currently to-be-decoded code stream contains the target code stream filled by the encoding device. And according to the message encoding method described in the second aspect of the embodiments of the present application, the target code stream is the code stream before the next byte of the currently to-be-decoded code stream, and the encoded first cell corresponds to the next byte (or the next byte and its subsequent bytes) of the currently to-be-decoded code stream. Therefore, the decoding device jumps to the byte start of the next byte of the currently to-be-decoded code stream for decoding to skip decoding of the target code stream and start decoding of the encoded first cell.

[0148] If the current bitstream to be decoded starts with a byte, it indicates that the current bitstream to be decoded does not contain the target bitstream filled in by the encoding device additionally (that is, the bitstream obtained by encoding the cells before the first encoded cell is byte-aligned, or the case where the first method for message encoding is not used). At this time, the decoding device decodes from the byte start of the current bitstream to be decoded.

[0149] As can be seen from the above steps, by optimizing the traditional non-aligned compression encoding rule, the encoding device can actively byte-align the bitstream obtained by encoding the cells before the first cell, and encode the first cell at the start of the byte. As a result, the decoding device can correspondingly decode the first cell at the start of the byte, thereby avoiding or reducing bit operations during the decoding process of the first cell to improve the decoding efficiency of the first cell. Moreover, by skipping the target bitstream filled in by the encoding device for additional byte alignment, the decoding device can ensure the decoding efficiency of the first message.

[0150] The above message decoding method will be further described below in conjunction with Embodiment 3.

[0151] Embodiment 3

[0152] The decoding device determines whether to use the above third method for message decoding according to the following two embodiments. When it is determined to use the above third method for message decoding, the decoding device skips decoding the target bitstream during the process of decoding the encoded first message. When it is determined not to use the above third method for message decoding, the decoding device can use the decoding rule corresponding to the traditional non-aligned compression encoding rule to perform message decoding on the encoded first message, that is, it does not detect and skip the target bitstream.

[0153] In some embodiments, the above first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format. By using the above third method to decode the encoded first message, the enhancement of the decoding rule of the ASN.1 protocol (i.e., the first protocol) is realized.

[0154] Optionally, the above first protocol can be a 3GPP protocol such as a radio resource control protocol applying ASN.1, or a positioning protocol (such as the LPP protocol), or a data plane protocol (such as a potential 6G data plane protocol), or the first protocol can be any communication protocol applying ASN.1.

[0155] Example 1: The decoding device determines whether to use the above third method for message decoding according to the second indication information.

[0156] In this embodiment, the second indication information may be a message directly indicating whether the decoding device uses the above-mentioned third method for message decoding. For example, the second indication information may directly indicate whether the decoding device uses the above-mentioned third method for message decoding through different bit values (such as 0 and 1). The second indication information may also be a message indirectly indicating whether the decoding device uses the above-mentioned third method for message decoding. For example, the second indication information may indicate which decoding rule or method the decoding device needs to use (such as using the decoding rule corresponding to the UNALIGNED PER optimized based on the third method, or using the decoding rule corresponding to the UNALIGNED PER optimized based on other methods, or using the decoding rule corresponding to the traditional UNALIGNED PER or APER, etc.) for message decoding through the identifier of different decoding methods. The decoding device further determines whether to use the above-mentioned third method for message decoding according to the received identifier of the decoding method.

[0157] In some embodiments, before receiving the above-mentioned second indication information, the decoding device determines not to use the above-mentioned third method for message decoding and uses a fourth method for message decoding. The fourth method is to use only the decoding rule corresponding to the UNALIGNED PER for decoding, that is, the decoding device uses the decoding rule corresponding to the traditional UNALIGNED PER to decode the message before receiving the second indication information; after receiving the second indication information, the decoding device determines to use the above-mentioned third method for message decoding and uses the decoding rule corresponding to the UNALIGNED PER and the above-mentioned third method for message decoding, that is, the decoding device uses the decoding rule corresponding to the UNALIGNED PER optimized based on the third method to decode the message after receiving the first indication information to ensure the decoding efficiency.

[0158] In some embodiments, the above-mentioned second indication information is configured by the network device. For example, the network device may configure (or send) the second indication information to the terminal device to indicate that the terminal device uses the above-mentioned third method for message decoding when acting as a decoding device. The network device may also configure the second indication information for itself (such as the network management device sending the second indication information to the base station) to indicate that it uses the above-mentioned third method for message decoding when acting as a decoding device.

[0159] In some embodiments, when the decoding device is a terminal device, the decoding device reports to the network device whether it supports a second capability, where the second capability is the ability to skip decoding of the target bitstream before starting to decode the encoded first cell. Based on the second capability reported by the terminal device, the network device can know whether the terminal device has the ability to execute the decoding rules corresponding to the optimized Unaligned PER based on the above third method. Subsequently, the network device can perform operations such as removing or adding the second capability to the terminal device.

[0160] Optionally, the second indication information is configured by the network device based on the second capability reported by the terminal device. When the network device determines that the terminal device supports the second capability, it can then use the second indication information to instruct the terminal device to perform message decoding using the third method, thereby ensuring the normal execution of message decoding.

[0161] Embodiment 2: The decoding device determines whether to perform message decoding using the above third method according to the protocol agreement.

[0162] In this embodiment, it can be agreed in the protocol of the Unaligned PER encoding rule (such as the 3GPP protocol or other protocols using ASN.1) whether to perform message decoding using the above third method. For example, relevant agreements can be added to a certain 3GPP protocol to agree to perform message decoding using the above third method for all OCTET STRING type cells in the protocol, so as to improve the encoding efficiency.

[0163] In some embodiments, the protocol agreement is to perform message decoding using the third method for all types or some types of encoded messages in the first protocol (the above first message belongs to the messages in the first protocol). For example, in a certain 3GPP protocol (such as the RRC protocol, LPP protocol, data plane protocol, etc.), it can be agreed to perform message decoding using the third method for all types of encoded messages in the 3GPP protocol (such as all messages carrying OCTET STRING type cells) to ensure the decoding efficiency of all types of messages in the 3GPP protocol, or it can also be agreed to perform message decoding using the third method for some types of encoded messages in the 3GPP protocol to specifically ensure the decoding efficiency of some types of messages in the 3GPP protocol; or

[0164] The protocol stipulates that the third method is used to decode the encoded fourth cell (i.e., the first cell with a specific tag). For example, it can be stipulated that the third method is used to decode the encoded cell of OCTET STRING type with a specific tag (such as dedicatedNAS - Message), and the fourth method is used to decode the encoded cell of OCTET STRING type without the specific tag; or

[0165] The protocol stipulates that the third method is used to decode the encoded first sub - cell (i.e., the sub - cell in the first cell with a specific tag). For example, it can be stipulated that the third method is used to decode the sub - cell with a longer byte stream length in the encoded first cell with a specific tag to ensure the decoding efficiency.

[0166] In some embodiments, when the protocol stipulates that the third method is used to decode the encoded fourth cell or the encoded first sub - cell, before the decoding device starts to decode the encoded fifth cell (i.e., the first cell without the specific tag) or the encoded second sub - cell (i.e., the sub - cell in the first cell without the specific tag), it determines not to skip the decoding of the target code stream; that is, at this time, the decoding device can use the decoding rules corresponding to the traditional Unaligned PER (such as the fourth method above) to decode the message, so as to avoid the additional target code stream detection and skipping steps.

[0167] For the message processing method, message encoding method, and message decoding method provided in the embodiments of the present application, the execution subject can be a message processing device, a message encoding device, and a message decoding device. In the embodiments of the present application, taking the message processing device, message encoding device, and message decoding device as examples to execute the message processing method, message encoding method, and message decoding method respectively, the message processing device, message encoding device, and message decoding device provided in the embodiments of the present application are described.

[0168] Fourthly, an embodiment of the present application provides a message processing device, which can be applied to a first device, such as Figure 7 As shown, the message processing device 100 includes:

[0169] A message processing module 101, configured to perform message processing on a first message based on the non - aligned compression encoding rule Unaligned PER;

[0170] Wherein, the first message includes a first cell and a second cell, the second cell is in front of the first cell, and the second cell is used to enable the first cell to be encoded or decoded in byte alignment.

[0171] Optionally, the second cell is a cell that occupies a fixed length after encoding, and the fixed length is determined according to the fixed bit length required for byte alignment of other cells, where the other cells are cells other than the second cell that are in front of the first cell in the first message.

[0172] Optionally, the second cell is a bit string that occupies the fixed length after encoding.

[0173] Optionally, the second cell is of an integer type with a fixed upper and lower value range, and the fixed upper and lower value range is determined according to the fixed length.

[0174] Optionally, the fixed length is: a length greater than 0 bits and less than 8 bits.

[0175] Optionally, the second cell is the cell immediately preceding the first cell.

[0176] Optionally, the second cell is an obligatory cell.

[0177] Optionally, the second cell is a reserved cell, or a spare cell, or a dummy cell.

[0178] Optionally, the type of the first cell is OCTET STRING type.

[0179] Optionally, the first message belongs to a message in a first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

[0180] Optionally, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol that applies ASN.1, or any communication protocol that applies ASN.1.

[0181] Optionally, the 3GPP protocol is a Radio Resource Control (RRC) protocol, or a positioning protocol, or a data plane protocol.

[0182] Optionally, the first device is a terminal device or a network device.

[0183] Optionally, the message processing module 101 includes at least one of the following:

[0184] A first message processing sub-module, configured to, when the first device is an encoding device, perform message encoding on the first message based on Unaligned PER;

[0185] A second message processing sub-module, configured to, when the first device is a decoding device, perform message decoding on the first message based on the decoding rule corresponding to Unaligned PER.

[0186] The message processing device provided by the embodiments of the present application can implement each process implemented by the message processing method embodiments described in the first aspect and achieve the same technical effects. To avoid repetition, details are not described here again.

[0187] Fifthly, the embodiments of the present application provide a message encoding device, which can be applied to an encoding device, such as Figure 8 As shown, the message encoding device 200 includes:

[0188] A message encoding module 201, configured to perform message encoding on a first message using a non-aligned compression encoding rule and a first method;

[0189] Wherein, the first method includes:

[0190] When there is a byte misalignment in the code stream obtained by encoding the cells in front of the first cell, byte-align the code stream;

[0191] Encode the first cell at the byte start of the byte-aligned code stream;

[0192] Wherein, the first message includes at least the first cell and the cells in front of the first cell.

[0193] Optionally, the step of byte-aligning the code stream in the first method includes:

[0194] Determine a first length required for padding the code stream for byte alignment, and pad the code stream with bits satisfying the first length.

[0195] Optionally, the device further includes:

[0196] A first encoding module 202, configured to determine whether to perform message encoding using the first method based on first indication information or protocol convention.

[0197] Optionally, the first encoding module 202 includes:

[0198] A first encoding sub-module, configured to perform message encoding using a second method before the encoding device receives the first indication information, and the second method is to perform encoding only using Unaligned PER;

[0199] A second encoding sub-module, configured to perform message encoding using Unaligned PER and the first method after the encoding device receives the first indication information.

[0200] Optionally, the protocol convention performs message encoding using the first method for all types or some types of messages in a first protocol; or

[0201] The protocol stipulates that the first message encoding method is adopted for the first cell with a specific tag; or

[0202] The protocol stipulates that the first message encoding method is adopted for the sub - cells in the first cell with a specific tag;

[0203] Wherein, the first message belongs to the messages in the first protocol.

[0204] Optionally, when the protocol stipulates that the first message encoding method is adopted for the first cell with the specific tag or the sub - cells in the first cell, the device further includes:

[0205] A second encoding module 203, configured to determine not to perform byte alignment on the encoded code stream before starting to encode the first cell without the specific tag or the sub - cells in the first cell.

[0206] Optionally, the first indication information is configured by a network device.

[0207] Optionally, when the encoding device is a terminal device, the device further includes:

[0208] A first capability reporting module 204, configured to report to the network device whether it supports a first capability, where the first capability is the capability of performing byte alignment on the encoded code stream before starting to encode the first cell.

[0209] Optionally, the first indication information is configured by the network device according to the first capability reported by the terminal device.

[0210] Optionally, the type of the first cell is OCTET STRING type.

[0211] Optionally, the first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

[0212] Optionally, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol that applies ASN.1, or any communication protocol that applies ASN.1.

[0213] Optionally, the 3GPP protocol is a radio resource control protocol, or a positioning protocol, or a data plane protocol.

[0214] Optionally, the encoding device is a terminal device or a network device.

[0215] The message encoding device provided by the embodiment of the present application can implement each process implemented by the message encoding method embodiment described in the second aspect and achieve the same technical effects. To avoid repetition, it will not be elaborated here.

[0216] Sixth aspect, the embodiment of the present application provides a message decoding device, which can be applied to a decoding device, such as Figure 9 As shown, the message decoding device 300 includes:

[0217] A message decoding module 301, configured to perform message decoding on the encoded first message using the decoding rules corresponding to Unaligned PER and a third method;

[0218] Wherein, the third method includes:

[0219] Before starting to decode the encoded first cell, skip decoding the target code stream;

[0220] Wherein, the encoded first message is encoded based on an unaligned compression coding rule, and the encoded first message includes the target code stream, the encoded first cell, and other encoded cells, and the target code stream is used to byte-align the code stream obtained by encoding other cells in front of the first cell in the first message.

[0221] Optionally, the step of skipping decoding the target code stream before starting to decode the encoded first cell in the third method includes:

[0222] When the decoding of the encoded third cell is completed, determine whether the currently to-be-decoded code stream in the code stream of the encoded first message is at the byte start, and the third cell includes the cells in front of the first cell in the first message;

[0223] If the currently to-be-decoded code stream is not at the byte start, jump to the byte start of the next byte of the currently to-be-decoded code stream for decoding;

[0224] If the currently to-be-decoded code stream is at the byte start, start decoding from the byte start of the currently to-be-decoded code stream.

[0225] Optionally, the device further includes:

[0226] A first decoding module 302, configured to determine whether to perform message decoding using the third method based on the second indication information or protocol convention.

[0227] Optionally, the first decoding module 302 includes:

[0228] The first decoding sub-module is used to perform message decoding in a fourth manner before the decoding device receives the second indication information, and the fourth manner is to perform decoding only according to the decoding rules corresponding to Unaligned PER;

[0229] The second decoding sub-module is used to perform message decoding according to the decoding rules corresponding to Unaligned PER and the third manner after the decoding device receives the second indication information.

[0230] Optionally, the protocol agreement performs message decoding on all types or some types of encoded messages in the first protocol in the third manner; or

[0231] The protocol agreement performs message decoding on the encoded fourth cell in the third manner; or

[0232] The protocol agreement performs message decoding on the encoded first sub-cell in the third manner;

[0233] Wherein, the first message belongs to the message in the first protocol, the fourth cell is the first cell with a specific mark, and the first sub-cell is the sub-cell in the first cell with a specific mark.

[0234] Optionally, in the case where the protocol agreement performs message decoding on the encoded fourth cell or the encoded first sub-cell in the third manner, the device further includes:

[0235] The second decoding module 303 is used to determine not to skip the decoding of the target code stream before starting to decode the encoded fifth cell or the encoded second sub-cell;

[0236] Wherein, the fifth cell is the first cell without the specific mark, and the second sub-cell is the sub-cell in the first cell without the specific mark.

[0237] Optionally, the second indication information is configured by the network device.

[0238] Optionally, in the case where the decoding device is a terminal device, the device further includes:

[0239] The second capability reporting module 304 is used to report to the network device whether it supports the second capability, and the second capability is the capability of skipping the decoding of the target code stream before starting to decode the encoded first cell.

[0240] Optionally, the second indication information is configured by the network device according to the second capability reported by the terminal device.

[0241] Optionally, the type of the first cell is OCTET STRING type.

[0242] Optionally, the first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

[0243] Optionally, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol that applies ASN.1, or any communication protocol that applies ASN.1.

[0244] Optionally, the 3GPP protocol is a radio resource control protocol, or a positioning protocol, or a data plane protocol.

[0245] Optionally, the decoding device is a terminal device or a network device.

[0246] The message decoding device provided by the embodiments of the present application can implement each process implemented by the message decoding method embodiments described in the third aspect and achieve the same technical effects. To avoid repetition, details are not described herein again.

[0247] The message processing device, message encoding device, and message decoding device in the embodiments of the present application can be an electronic device, such as an electronic device with an operating system, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the terminal can include, but is not limited to, the types of the terminal 11 listed above, and other devices can be a server, a Network Attached Storage (NAS), etc. The embodiments of the present application do not make specific limitations.

[0248] As Figure 10 shown, the embodiments of the present application further provide a communication device 1000, including a processor 1001 and a memory 1002. A program or instruction that can run on the processor 1001 is stored on the memory 1002. The communication device 1000 can be a terminal or a network device. When the program or instruction is executed by the processor 1001, it can implement each step of the message processing method embodiments described in the first aspect above, or implement each step of the message encoding method embodiments described in the second aspect above, or implement each step of the message decoding method embodiments described in the third aspect above, and can achieve the same technical effects. To avoid repetition, details are not described herein again.

[0249] The embodiments of the present application further provide a terminal device, including a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the steps in the message processing method embodiment as described in the first aspect, or implement the steps in the message encoding method embodiment as described in the second aspect, or implement the steps in the message decoding method embodiment as described in the third aspect. This terminal device embodiment corresponds to the above-mentioned first device-side method embodiment, or encoding device-side method embodiment, or decoding device-side method embodiment. Each implementation process and implementation manner of the above method embodiments can be applied to this terminal device embodiment and can achieve the same technical effect. Specifically, Figure 11 It is a schematic diagram of the hardware structure of a terminal device for implementing an embodiment of the present application.

[0250] The terminal device 1100 includes, but is not limited to, at least some components such as a radio frequency unit 1101, a network module 1102, an audio output unit 1103, an input unit 1104, a sensor 1105, a display unit 1106, a user input unit 1107, an interface unit 1108, a memory 1109, and a processor 1110.

[0251] Those skilled in the art can understand that the terminal device 1100 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 1110 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 11 The structure of the terminal device shown does not limit the terminal device. The terminal device may include more or fewer components than shown, or combine some components, or have different component arrangements, which will not be elaborated here.

[0252] It should be understood that in the embodiments of the present application, the input unit 1104 may include a graphics processing unit (GPU) 11041 and a microphone 11042. The graphics processor 11041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1106 may include a display panel 11061, and the display panel 11061 may be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 1107 includes at least one of a touch panel 11071 and other input devices 11072. The touch panel 11071 is also called a touch screen. The touch panel 11071 may include two parts: a touch detection device and a touch controller. The other input devices 11072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.

[0253] In the embodiment of the present application, after the radio frequency unit 1101 receives the downlink data from the network device, it can transmit the data to the processor 1110 for processing. In addition, the radio frequency unit 1101 can send the uplink data to the network-side device. Generally, the radio frequency unit 1101 includes, but is not limited to, an antenna, an amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc.

[0254] The memory 1109 can be used to store software programs or instructions and various data. The memory 1109 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1109 can include a volatile memory or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 1109 in the embodiment of the present application includes, but is not limited to, these and any other suitable types of memories.

[0255] The processor 1110 may include one or more processing units. Optionally, the processor 1110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and applications, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 1110.

[0256] An embodiment of the present application further provides a network device, including a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the steps of the message processing method embodiment described in the first aspect, or implement the steps of the message encoding method embodiment described in the second aspect, or implement the steps of the message decoding method embodiment described in the third aspect. This network device embodiment corresponds to the above-mentioned first device-side method embodiment, or encoding device-side method embodiment, or decoding device-side method embodiment. Each implementation process and implementation manner of the above method embodiments can be applied to this network device embodiment and can achieve the same technical effect.

[0257] Specifically, an embodiment of the present application further provides a network device. As Figure 12 shown, the network device 1200 includes: an antenna 121, a radio frequency device 122, a baseband device 123, a processor 124, and a memory 125. The antenna 121 is connected to the radio frequency device 122. In the uplink direction, the radio frequency device 122 receives information through the antenna 121 and sends the received information to the baseband device 123 for processing. In the downlink direction, the baseband device 123 processes the information to be sent and sends it to the radio frequency device 122. The radio frequency device 122 processes the received information and then sends it out through the antenna 121.

[0258] The method executed by the network device in the above embodiments can be implemented in the baseband device 123, and the baseband device 123 includes a baseband processor.

[0259] The baseband device 123 may include, for example, at least one baseband board, and a plurality of chips are provided on the baseband board. As Figure 12 shown, one of the chips is, for example, a baseband processor, which is connected to the memory 125 through a bus interface to call the programs in the memory 125 and execute the operations of the network device shown in the above method embodiments.

[0260] The network device may further include a network interface 126, and this interface is, for example, a Common Public Radio Interface (CPRI).

[0261] Specifically, the network device 1200 in the embodiment of the present invention further includes: instructions or programs stored on the memory 125 and executable on the processor 124. The processor 124 calls the instructions or programs in the memory 125 to execute the methods executed by the modules in the message processing device described in the fourth aspect, or execute the methods executed by the modules in the message encoding device described in the fifth aspect, or execute the methods executed by the modules in the message decoding device described in the sixth aspect, and achieves the same technical effect. To avoid repetition, it will not be elaborated here.

[0262] The embodiments of the present application further provide a readable storage medium, on which a program or instructions are stored. When the program or instructions are executed by a processor, the various processes of the message processing method embodiments described in the first aspect above, or the various processes of the message encoding method embodiments described in the second aspect above, or the various processes of the message decoding method embodiments described in the third aspect above are implemented, and the same technical effects can be achieved. To avoid repetition, they will not be elaborated here.

[0263] Wherein, the processor is the processor in the communication device, network device or terminal device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks or optical discs, etc. In some examples, the readable storage medium may be a non-transitory readable storage medium.

[0264] The embodiments of the present application further provide a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run a program or instructions to implement the various processes of the message processing method embodiments described in the first aspect above, or the various processes of the message encoding method embodiments described in the second aspect above, or the various processes of the message decoding method embodiments described in the third aspect above, and the same technical effects can be achieved. To avoid repetition, they will not be elaborated here.

[0265] 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, system chip, chip system or system-on-chip.

[0266] The embodiments of the present application further provide a computer program / program product, which is stored in a storage medium. The computer program / program product is executed by at least one processor to implement the various processes of the message processing method embodiments described in the first aspect above, or the various processes of the message encoding method embodiments described in the second aspect above, or the various processes of the message decoding method embodiments described in the third aspect above, and the same technical effects can be achieved. To avoid repetition, they will not be elaborated here.

[0267] The embodiments of the present application further provide a wireless communication system, including: an encoding device and a decoding device. The encoding device can be used to execute the steps of the message encoding method described in the second aspect, and the decoding device can be used to execute the steps of the message decoding method described in the third aspect.

[0268] It should be noted that in this document, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0269] From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of a computer software product plus a necessary general hardware platform, and of course, can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes several instructions for causing a terminal or a network-side device to execute the methods described in various embodiments of the present application.

[0270] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms of embodiments without departing from the purpose of the present application and the scope protected by the claims. These embodiments are all within the protection scope of the present application.

Claims

1. A message processing method, characterized in that, the method includes: The first device processes the first message based on the Unaligned PER (Unaligned Packetized Encapsulation of RSVP) compression coding rule; wherein, the first message includes a first cell and a second cell, the second cell is in front of the first cell, and the second cell is used to enable the first cell to be encoded or decoded in byte alignment.

2. The method according to claim 1, characterized in that, the second cell is a cell that occupies a fixed length after encoding, and the fixed length is determined according to the fixed bit length required for byte alignment of other cells, and the other cells are the cells in the first message that are in front of the first cell and other than the second cell.

3. The method according to claim 2, characterized in that, the second cell is a bit string that occupies the fixed length after encoding.

4. The method according to claim 2, characterized in that, the second cell is an integer type with a fixed upper and lower value range, and the fixed upper and lower value range is determined according to the fixed length.

5. The method according to any one of claims 2-4, characterized in that, the fixed length is: a length greater than 0 bits and less than 8 bits.

6. The method according to any one of claims 1-5, characterized in that, the second cell is the cell before the first cell.

7. The method according to any one of claims 1-6, characterized in that, the second cell is an optional cell.

8. The method according to any one of claims 1-7, characterized in that, the second cell is a reserved cell, or a spare cell, or a dummy cell.

9. The method according to any one of claims 1-8, characterized in that, the type of the first cell is OCTET STRING type.

10. The method according to any one of claims 1-9, characterized in that, the first message belongs to the message in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

11. The method according to claim 10, characterized in that, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol applying ASN.1, or any communication protocol applying ASN.

1.

12. The method according to claim 11, characterized in that, the 3GPP protocol is a Radio Resource Control (RRC) protocol, or a positioning protocol, or a data plane protocol.

13. The method according to any one of claims 1-12, characterized in that, the first device is a terminal device or a network device.

14. The method according to any one of claims 1-13, characterized in that, the first device processes the first message based on the Unaligned PER compression coding rule, including at least one of the following: When the first device is an encoding device, encoding the first message based on Unaligned PER; When the first device is a decoding device, the first message is decoded based on the decoding rules corresponding to Unaligned PER.

15. A message encoding method, characterized in that, the method includes: An encoding device encodes a first message using an unaligned compression encoding rule and a first method; wherein, the first method includes: When there is a byte misalignment in the code stream obtained by encoding the cell before the first cell, byte-align the code stream; Encode the first cell at the byte start of the byte-aligned code stream; wherein, the first message includes at least the first cell and the cells before the first cell.

16. The method according to claim 15, characterized in that, The byte-aligning of the code stream includes: Determine the first length required to pad the code stream for byte alignment, and pad the code stream with bits that satisfy the first length.

17. The method according to claim 15 or 16, characterized in that, the method further includes: The encoding device determines whether to use the first method for message encoding based on first indication information or protocol convention.

18. The method according to claim 17, characterized in that, The encoding device determines whether to use the first method for message encoding based on first indication information or protocol convention, including: Before receiving the first indication information, the encoding device encodes the message using a second method, and the second method is to encode only using Unaligned PER; After receiving the first indication information, the encoding device encodes the message using Unaligned PER and the first method.

19. The method according to claim 17, characterized in that, The protocol convention encodes all types or some types of messages in the first protocol using the first method; or The protocol convention encodes the first cell with a specific tag using the first method; or The protocol convention encodes the sub-cells in the first cell with a specific tag using the first method; wherein, the first message belongs to the messages in the first protocol.

20. The method according to claim 19, characterized in that, When the protocol convention encodes the first cell with the specific tag or the sub-cells in the first cell using the first method, the method further includes: Before starting to encode the first cell without the specific tag or the sub-cells in the first cell, the encoding device determines not to byte-align the encoded code stream.

21. The method according to claim 17, characterized in that, The first indication information is configured by a network device.

22. The method according to claim 21, characterized in that, When the encoding device is a terminal device, the method further includes: The encoding device reports to the network device whether it supports a first capability, where the first capability is the ability to perform byte alignment on the encoded bitstream before starting to encode the first cell.

23. According to the method described in claim 22, wherein, the first indication information is configured by the network device according to the first capability reported by the terminal device.

24. According to the method described in any one of claims 15 - 23, wherein, the type of the first cell is OCTETSTRING type.

25. According to the method described in any one of claims 15 - 24, wherein, the first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

26. According to the method described in claim 25, wherein, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol that applies ASN.1, or any communication protocol that applies ASN.

1.

27. According to the method described in claim 26, wherein, the 3GPP protocol is the Radio Resource Control protocol, or the positioning protocol, or the data plane protocol.

28. According to the method described in any one of claims 15 - 27, wherein, the encoding device is a terminal device or a network device.

29. A method for message decoding, wherein, the method includes: the decoding device decodes the encoded first message using the decoding rules corresponding to Unaligned PER and a third method; wherein, the third method includes: before starting to decode the encoded first cell, skipping the decoding of the target bitstream; wherein, the encoded first message is encoded based on the non - aligned compression encoding rule, and the encoded first message includes the target bitstream, the encoded first cell, and other encoded cells, and the target bitstream is used to perform byte alignment on the bitstream obtained by encoding other cells in front of the first cell in the first message.

30. According to the method described in claim 29, wherein, the step of skipping the decoding of the target bitstream before starting to decode the encoded first cell includes: when the decoding of the encoded third cell is completed, determining whether the currently to - be - decoded bitstream in the bitstream of the encoded first message is at the byte start, where the third cell includes the cells in front of the first cell in the first message; if the currently to - be - decoded bitstream is not at the byte start, then jumping to the byte start of the next byte of the currently to - be - decoded bitstream for decoding; if the currently to - be - decoded bitstream is at the byte start, then starting to decode from the byte start of the currently to - be - decoded bitstream.

31. According to the method described in claim 29 or 30, wherein, the method further includes: the decoding device determines whether to use the third method for message decoding based on the second indication information or protocol convention.

32. According to the method described in claim 31, wherein, The decoding device determines whether to perform message decoding using the third method based on the second indication information or protocol convention, including: Before receiving the second indication information, the decoding device performs message decoding using a fourth method, where the fourth method is to perform decoding only using the decoding rules corresponding to Unaligned PER; After receiving the second indication information, the decoding device performs message decoding using the decoding rules corresponding to Unaligned PER and the third method.

33. The method according to claim 31 or 32, wherein, the protocol convention performs message decoding using the third method for all types or some types of encoded messages in the first protocol; or the protocol convention performs message decoding using the third method for the encoded fourth cell; or the protocol convention performs message decoding using the third method for the encoded first sub-cell; wherein, the first message belongs to the messages in the first protocol, the fourth cell is the first cell with a specific marker, and the first sub-cell is the sub-cell in the first cell with a specific marker.

34. The method according to claim 33, wherein, when the protocol convention performs message decoding using the third method for the encoded fourth cell or the encoded first sub-cell, the method further includes: Before starting to decode the encoded fifth cell or the encoded second sub-cell, the decoding device determines not to skip decoding of the target bitstream; wherein, the fifth cell is the first cell without the specific marker, and the second sub-cell is the sub-cell in the first cell without the specific marker.

35. The method according to any one of claims 31-34, wherein, the second indication information is configured by the network device.

36. The method according to claim 35, wherein, when the decoding device is a terminal device, the method further includes: The decoding device reports to the network device whether it supports a second capability, where the second capability is the ability to skip decoding of the target bitstream before starting to decode the encoded first cell.

37. The method according to claim 36, wherein, the second indication information is configured by the network device according to the second capability reported by the terminal device.

38. The method according to any one of claims 29-37, wherein, the type of the first cell is OCTETSTRING type.

39. The method according to any one of claims 29-38, wherein, the first message belongs to the messages in the first protocol, and the first protocol uses Abstract Syntax Notation One (ASN.1) to describe the message format.

40. The method according to any one of claims 39, wherein, the first protocol is the 3rd Generation Partnership Project (3GPP) protocol applying ASN.1, or any communication protocol applying ASN.

1.

41. The method according to claim 40, wherein, The 3GPP protocol is a radio resource control protocol, or a positioning protocol, or a data plane protocol.

42. The method according to any one of claims 29-41, characterized in that the decoding device is a terminal device or a network device.

43. A message processing device, characterized in that applied to a first device, the device includes: a message processing module for performing message processing on a first message based on the Unaligned PER (Unaligned Packetized Encapsulation of RSVP) coding rule; wherein, the first message includes a first cell and a second cell, the second cell is in front of the first cell, and the second cell is used to enable the first cell to be encoded or decoded in byte alignment.

44. The message processing device according to claim 43, characterized in that the second cell is a cell that occupies a fixed length after encoding, and the fixed length is determined according to the fixed bit length required for byte alignment of other cells, and the other cells are the cells in the first message that are in front of the first cell and other than the second cell.

45. A message encoding device, characterized in that applied to an encoding device, the device includes: a message encoding module for encoding a first message using the Unaligned PER coding rule and a first method; wherein, the first method includes: when there is byte misalignment in the code stream obtained by encoding the cells in front of the first cell, performing byte alignment on the code stream; encoding the first cell at the byte start of the byte-aligned code stream; wherein, the first message includes at least the first cell and the cells in front of the first cell.

46. The message encoding device according to claim 45, characterized in that the message encoding module is used for: determining a first length required for byte alignment of the code stream, and padding the code stream with bits that meet the first length.

47. A message decoding device, characterized in that applied to a decoding device, the device includes: a message decoding module for decoding an encoded first message using the decoding rule corresponding to Unaligned PER and a third method; wherein, the third method includes: skipping the decoding of the target code stream before starting to decode the encoded first cell; wherein, the encoded first message is encoded based on the Unaligned PER coding rule, and the encoded first message includes the target code stream, the encoded first cell, and the encoded other cells, and the target code stream is used for byte alignment of the code stream obtained by encoding the other cells in the first message that are in front of the first cell.

48. The message decoding device according to claim 47, characterized in that the message decoding module is used for: when decoding of the encoded third cell is completed, determining whether the currently to-be-decoded code stream in the code stream of the encoded first message is at the byte start, and the third cell includes the cells in the first message that are in front of the first cell; If the current bitstream to be decoded is not at the beginning of a byte, skip to the beginning of the next byte of the current bitstream to be decoded and perform decoding; If the current bitstream to be decoded is at the beginning of a byte, perform decoding starting from the beginning of the byte of the current bitstream to be decoded.

49. A communication device, characterized in that, it includes a processor and a memory, the memory stores programs or instructions that can run on the processor, and when the programs or instructions are executed by the processor, the steps of the message processing method according to any one of claims 1 to 14 are implemented, or the steps of the message encoding method according to any one of claims 15 to 28 are implemented, or the steps of the message decoding method according to any one of claims 29 to 42 are implemented.

50. A readable storage medium, characterized in that, the readable storage medium stores programs or instructions, and when the programs or instructions are executed by a processor, the steps of the message processing method according to any one of claims 1 to 14 are implemented, or the steps of the message encoding method according to any one of claims 15 to 28 are implemented, or the steps of the message decoding method according to any one of claims 29 to 42 are implemented.