CODING METHOD AND APPARATUS

Information

  • Patent Application
  • 20250038884
  • Publication Number
    20250038884
  • Date Filed
    October 14, 2024
    5 months ago
  • Date Published
    January 30, 2025
    a month ago
Abstract
A sending device may determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission. k is an integer greater than or equal to 2. The sending device may perform systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits. The sending device may send the to-be-transmitted bits.
Description
TECHNICAL FIELD

This application relates to the field of wireless communication technologies, and in particular, to a coding method and an apparatus.


BACKGROUND

In the field of communication technologies, a communication device (for example, a terminal device or a base station) may perform channel coding by using a polar code. Currently, polar coding gradually becomes a mainstream coding scheme. A sending device may perform polar code encoding on information bits. The sending device punctures or shortens encoded bits, modulates the bits, and sends the bits to a receiving device through channel transmission. The receiving device may perform polar code decoding on received codewords.


Based on a separate source and channel coding (SSCC) solution, an existing communication system using a cellular communication technology, a wireless communication technology (Wi-Fi), or the like first performs source coding or compression processing on to-be-sent source data, performs channel coding on compressed data, and adds redundancy, to improve reliability of information transmission. To make full use of source redundancy at a physical layer and improve transmission performance, joint source and channel coding (JSCC) is a solution that can implement both source compression and channel protection. Compared with SSCC, JSCC has significant performance gains in short code scenarios.


However, polar codes used in an existing system are non-systematic codes, and cannot support coding and retransmission in JSCC.


SUMMARY

This application provides a coding method and an apparatus, to effectively use a probability distribution feature of to-be-coded source bits, and improve transmission performance.


According to a first aspect, an encoding method is provided. The method may be performed by a sending device, or may be performed by a chip having a function similar to that of a sending device. It may be understood that the sending device may be a network device or a terminal device. In the method, the sending device may determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission. k is an integer greater than or equal to 2. The sending device may perform systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits. The sending device may send the to-be-transmitted bits. In a possible case, when the length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1, that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission. In another possible case, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


Based on the solution, bits in a retransmission phase are encoded through systematic polar encoding, so that a probability distribution feature of to-be-coded source bits is effectively used, and retransmission performance is improved.


In a possible implementation, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission include elements in R′k-1.


Based on the solution, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, it may be considered that a quantity of non-transmitted bits in the (k-1)th transmission can meet a requirement of a quantity of to-be-retransmitted bits in the kth transmission. Therefore, coding complexity can be reduced without changing a length of the mother code.


In a possible implementation, the sending device may determine a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission. The first bits include source bits, cyclic redundancy check CRC bits, and frozen bits. The sending device performs rate matching on the mother code in the kth transmission, to obtain a location index set Rk that is of non-transmitted bits in the kth transmission and that is in the mother code in the kth transmission. The sending device determines the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.


Based on the solution, the sending device can determine the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission, so that the sending device can determine locations of the to-be-transmitted bits in the mother code in the kth transmission.


In a possible implementation, elements included in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission.


In an example, the location index set that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission is src′k-1=srck-1+Nm,k-1. A location index set that is of PC bits in the (k-1)th transmission and that is in the mother code in the kth transmission is pc′k-1=pck-1+Nm,k-1, a location index set that is of the frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission is frz′k-1=frzk-1+Nm,k-1, the location index set that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission is R′k-1=Rk-1+Nm,k-1, and a location index set that is of the CRC bits in the (k-1)th transmission and that is in the mother code in the kth transmission is chk′k-1=chkk-1+Nm,k-1.


In another example, src′k-1=srck-1+Nm,k/2, pc,k-1=pck-1+Nm,k/2·frz′k-1=frzk-1+Nm,k/2, R′k-1=Rk-1+Nm,k/2, and chk′k-1=chkk-1+Nm,k/2.


Based on the solution, the sending device can update the location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the kth transmission, so that the first bits in the (k-1)th transmission occupy location indexes with higher bit reliability.


In a possible implementation, the sending device determines a first union set of a location index set in the mother code in the (k-1)th transmission, src′k-1, and the location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission. The sending device determines a first difference set between the first union set and Rk. The sending device sorts location indexes in the first difference set in descending order of bit reliability. The sending device selects top-ranked NS location indexes as srck. Optionally, the sending device selects top-ranked location indexes that satisfy Gk(Δsrck, frz′k-1)=o as srck. Gk represents a polar matrix of a polar code whose length is Nm,k, and Δsrck=srck/src′k-1.


Based on the solution, the sending device can select NS most reliable location indexes as srck.


In a possible implementation, the sending device uses a difference set between src′k-1 and srck as a location index set Δpck of target parity check PC bits in the kth transmission. The sending device uses a union set of a location index set pc′k-1, that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission. The sending device uses a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk. Location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1.


Based on the solution, the sending device can determine locations of the to-be-transmitted bits in the mother code in the kth transmission, to send the to-be-transmitted bits.


In a possible implementation, the sending device determines a second union set of a location index set in the mother code in the (k-1)th transmission and R′k-1. The sending device determines a second difference set between the second union set and Rk. The sending device sorts location indexes in the second difference set in descending order of bit reliability. The sending device selects top-ranked NPC location indexes as a location index set Δsrck of target source bits in the kth transmission. The sending device selects lower-ranked NPC location indexes in src′k-1 as a location index set Δpck of target PC bits in the kth transmission. The sending device determines a difference set between src′k-1 and Δpck. The sending device uses a union set of Δsrck and the difference set between src′k-1 and Δpck as srck. Optionally, the sending device may select top-ranked NPC location indexes that satisfy Gk(Δsrck, frz′k-1)=o as Δsrck.


Based on the solution, the sending device can select NPC most reliable location indexes as location indexes that are of source bits newly added in the kth transmission and that are in the mother code.


In a possible implementation, the sending device uses a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk. Location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1.


Based on the solution, the sending device can determine locations of the to-be-transmitted bits in the mother code in the kth transmission, to send the to-be-transmitted bits.


In a possible implementation, the rate matching includes shortening or puncturing.


Based on the solution, the sending device can determine the non-transmitted bits in a shortening or puncturing manner, and further determine the location index set that is of the non-transmitted bits and that is in the mother code in the kth transmission.


In a possible implementation, a value of a bit corresponding to an element in Δsrck is the same as a value of a bit corresponding to an element in Δpck.


Based on the solution, the sending device can perform one-to-one check on bits corresponding to elements in Δsrck and bits corresponding to elements in Δpck. According to a second aspect, a decoding method is provided. The method may be performed by a receiving device, or may be performed by a chip having a function similar to that of a receiving device. It may be understood that the receiving device may be a network device or a terminal device. In the method, the receiving device receives to-be-transmitted bits in a kth transmission from a sending device. The receiving device may decode the to-be-transmitted bits. In a possible case, when a length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1 that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission. In another possible case, when a length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission include elements in R′k-1.


In a possible implementation, the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission is determined based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.


In a possible implementation, elements included in a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission. The first bits include source bits, cyclic redundancy check CRC bits, and frozen bits.


In a possible implementation, the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission is top-ranked NS location indexes in a first difference set. The first difference set is a difference set between a first union set and Rk, and the first union set is a union set of a location index set in the mother code in the (k-1)th transmission, src′k-1, and the location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1, frzk is determined based on a difference set between a location index set in the mother code in the kth transmission and a location index set pck of PC bits in a first transmission to the kth transmission, srck, Rk, and a location index set chkk of CRC bits in the kth transmission. pck is determined based on a difference set between src′k-1 and srck and a location index set pc′k-1 that is of PC bits in the first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, srck is determined based on a union set of a difference set between src′k-1 and a location index set Δpck of target PC bits in the kth transmission and a location index set Δsrck of target source bits in the kth transmission. Δpck includes lower-ranked NPC location indexes in src′k-1, Δsrck includes top-ranked NPC location indexes in a second difference set. The second difference set is a difference set between a second union set and Rk. The second union set is a union set of the location index set in the mother code in the (k-1)th transmission and R′k-1.


In a possible implementation, location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1, frzk is determined based on a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission.


In a possible implementation, the rate matching includes shortening or puncturing.


In a possible implementation, a value of a bit corresponding to an element in Δsrck is the same as a value of a bit corresponding to an element in Δpck.


According to a third aspect, an embodiment of this application provides a communication apparatus. The apparatus may be a sending device, or may be a chip or a module used in a sending device. The apparatus has a function of implementing any implementation method of the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules or units corresponding to the function.


According to a fourth aspect, an embodiment of this application provides a communication apparatus. The apparatus may be a receiving device, or may be a chip or a module used in a receiving device. The apparatus has a function of implementing any implementation method of the second aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules or units corresponding to the function.


According to a fifth aspect, this application provides a communication apparatus, including a processor, where the processor is coupled to a memory, the memory is configured to store a computer program or instructions, and the processor is configured to execute the computer program or the instructions, to perform the implementation methods in the first aspect and the second aspect. The memory may be located inside or outside the apparatus. There is one or more processors.


According to a sixth aspect, this application provides a communication apparatus, including: a processor and an interface circuit, where the interface circuit is configured to communicate with another apparatus, and the processor is configured to perform the implementation methods in the first aspect and the second aspect.


According to a seventh aspect, a communication apparatus is provided. The apparatus includes a logic circuit and an input/output interface.


In a design, the logic circuit is configured to determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission, and perform systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits. The input/output interface is configured to output the to-be-transmitted bits.


In a design, the input/output interface is configured to input to-be-transmitted bits in a kth transmission from a sending device. The logic circuit is configured to decode the to-be-transmitted bits.


According to an eighth aspect, this application provides a communication system, including: a communication apparatus configured to perform the implementation method in the first aspect, and a communication apparatus configured to perform the implementation method in the second aspect.


According to a ninth aspect, this application further provides a chip system, including: a processor, configured to implement the implementation methods in the first aspect and the second aspect.


According to a tenth aspect, this application further provides a computing program product, including computer-executable instructions. When the computer-executable instructions are run on a computer, the implementation methods in the first aspect and the second aspect are implemented.


According to an eleventh aspect, this application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the computer program or the instructions are run on a computer, the implementation methods in the first aspect and the second aspect are implemented.


For technical effects that can be achieved in the second aspect to the eleventh aspect, refer to technical effects that can be achieved in each design in the first aspect. Details are not described herein again.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a diagram of a communication system according to an embodiment of this application;



FIG. 2A shows a polar-based JSCC solution according to an embodiment of this application;



FIG. 2B shows a polar-based retransmission solution according to an embodiment of this application;



FIG. 3 is a diagram of an architecture of an encoding method according to an embodiment of this application;



FIG. 4 is an example flowchart of an encoding method according to an embodiment of this application;



FIG. 5A is a diagram of location indexes of source bits and CRC bits according to an embodiment of this application;



FIG. 5B is a diagram of encoding in a retransmission phase according to an embodiment of this application;



FIG. 6 is a diagram of encoding in a retransmission phase according to an embodiment of this application;



FIG. 7 is a diagram of a decoding manner according to an embodiment of this application;



FIG. 8 is a diagram of a communication apparatus according to an embodiment of this application;



FIG. 9 is a diagram of a communication apparatus according to an embodiment of this application;



FIG. 10 is a diagram of a communication apparatus according to an embodiment of this application; and



FIG. 11 is a diagram of a communication apparatus according to an embodiment of this application.





DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

The technical solutions provided in embodiments of this application are explained and described below with reference to the accompanying drawings.


Embodiments of this application may be applied to a plurality of fields in which polar coding is used, for example, the data storage field, the optical network communication field, and the wireless communication field. The wireless communication field may include but is not limited to a 5G communication system, a future communication system (for example, a 6G communication system), a satellite communication system, a narrowband-internet of things (NB-IoT) system, a global system for mobile communications (GSM), an enhanced data rates for GSM evolution (EDGE) system, a wideband code division multiple access (WCDMA) system, a code division multiple access 2000 (CDMA2000) system, a time division-synchronous code division multiple access (TD-SCDMA) system, a long term evolution (LTE) system, and three major application scenarios of a 5G mobile communication system: eMBB, ultra-reliable low-latency communication (URLLC), and massive machine-type communications (mMTC).


With reference to FIG. 1, the following describes a communication system to which an encoding method and a decoding method provided in embodiments of this application are applicable. Refer to FIG. 1. The communication system 100 includes a sending device 101 and a receiving device 102. The sending device 101 may be a network device or a terminal device, and the receiving device 102 may be a network device or a terminal device. Optionally, when the sending device 101 is a network device, the receiving device 102 may be a terminal device. When the receiving device 102 is a network device, the sending device 101 may be a terminal device.


The sending device 101 may include an encoder. The sending device 101 may perform systematic polar encoding on source bits via the encoder, and output an encoded codeword. The encoded codeword may be transmitted on a channel to the receiving device 102 after being rate matched, interleaved, and modulated. The receiving device 102 may include a decoder. The receiving device 102 may receive and demodulate a signal from the sending device 101. The receiving device 102 may decode the received signal via the decoder.


The terminal device in this application includes a device that provides a voice and/or data connectivity for a user. The terminal device includes a device that provides a voice for the user, includes a device that provides data connectivity for the user, or includes a device that provides a voice and data connectivity for the user. For example, the terminal device may include a handheld device having a wireless connection function or a processing device connected to a wireless modem. The terminal device may include user equipment (UE), a wireless terminal device, a mobile terminal device, a device-to-device (D2D) communication terminal device, a vehicle-to-everything (V2X) terminal device, a machine-to-machine/machine-type communications (M2M/MTC) terminal device, an internet of things (IoT) terminal device, a subscriber unit, a subscriber station, a mobile station, a remote station, an access point (AP), a remote terminal device, an access terminal device, a user terminal device, a user agent, a user device, a satellite, an unmanned aerial vehicle, a balloon, an aircraft, or the like. For example, the terminal device may include a mobile phone (or referred to as a “cellular” phone), a computer having a mobile terminal device, or a portable, pocket-sized, hand-held, or a computer-embedded mobile apparatus. For example, it may be a device such as a personal communication service (PCS) phone, a cordless telephone set, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, or a personal digital assistant (PDA). The terminal device may alternatively include a limited device, for example, a device with relatively low power consumption, a device with a limited storage capability, or a device with a limited computing capability. For example, the terminal device includes an information sensing device such as a barcode, radio frequency identification (RFID), a sensor, a global positioning system (GPS), or a laser scanner. By way of example, and not limitation, in embodiments of this application, the terminal device may alternatively be a wearable device. The wearable device may also be referred to as a wearable intelligent device, an intelligent wearable device, or the like, and is a general term for wearable devices developed by intelligently designing everyday wearing by applying a wearable technology. If the various terminal devices described above are located in a vehicle (for example, placed in the vehicle or installed in the vehicle), the terminal devices may be all considered as vehicle-mounted terminal devices. For example, the vehicle-mounted terminal devices are also referred to as on-board units (OBU).


The network device in this application includes, for example, an access network (AN) device, such as a base station (for example, an access point), and may be a device that is in an access network and that communicates with a wireless terminal device over an air interface through one or more cells. Alternatively, the network device is, for example, a road side unit (RSU) in a vehicle-to-everything (V2X) technology. The network device may include an evolved NodeB (NodeB or eNB or e-NodeB) in a long term evolution (LTE) or long term evolution-advanced (LTE-A) system, or may include a next generation NodeB (gNB) in an evolved packet core (EPC), a 5th generation mobile communication technology (5G), a new radio (NR) system (also referred to as an NR system for short), or may include a central unit (CU) and a distributed unit (DU) in a cloud access network (Cloud RAN) system, a satellite, an unmanned aerial vehicle, a balloon, an aircraft, or the like. This is not limited in embodiments of this application.


Based on a separate source and channel coding (SSCC) solution, an existing communication system using a cellular communication technology, a wireless communication technology (Wi-Fi), or the like first performs source coding or compression processing on to-be-sent source data, performs channel coding on compressed data, and adds redundancy, to improve reliability of information transmission. The source coding is usually completed at an application layer, and the channel coding is usually completed at a physical layer. Traditional source coding, such as source coding for pictures, videos, voices, and texts, is not error-resistant. Therefore, channel coding needs to be performed at the physical layer in combination with a mechanism such as retransmission, so that a receiving end completes error-free recovery of bits transmitted at the physical layer. For the physical layer, channel coding and transmission are mainly performed on bit streams obtained through conventional source coding. It is assumed that ideal source coding has been completed at an upper layer, and an approximately equal sequence is obtained. Generally, only a lossless transmission mode is supported. However, in actual application, some data that is not fully compressed, for example, control information from a link layer or the physical layer, to-be-fed-back channel state information, and some upper-layer application data, may be processed at the physical layer.


To make full use of source redundancy at the physical layer and improve transmission performance, joint source and channel coding (JSCC) is a solution that can implement both source compression and channel protection. Compared with SSCC, JSCC has significant performance gains in short code scenarios. Moreover, JSCC can support more possible transmission modes, such as lossy transmission. In addition, JSCC can flexibly control distortion of reconstructed data at the receiving end, and can adapt to different application requirements.



FIG. 2A describes a systematic polar code-based JSCC solution. In this procedure, a transmitting end may perform systematic polar encoding on to-be-coded bits. To implement a specific compression function, the transmitting end performs a puncturing operation on system bits in encoded bits. In other words, the transmitting end may send only check bits. The transmitting end modulates punctured bits, and sends the punctured bits to a receiving end through a channel. The receiving end may obtain the check bits through demodulation. The receiving end may perform systematic polar decoding based on the check bits and probability distribution information of the to-be-coded bits. The probability distribution information of the to-be-coded bits may be determined by the receiving end in a preset manner. A manner in which the receiving end obtains the probability distribution information of the to-be-coded bits is not limited in this application.


It can be seen from FIG. 2A that, in the systematic polar code-based JSCC solution, only a transmission mode during initial transmission is provided, and there is no corresponding retransmission design. To switch between a lossy transmission mode and a lossless transmission mode more effectively, retransmission is also an important scenario for JSCC.



FIG. 2B describes a polar code-based retransmission solution. It can be seen from FIG. 2B that, in an initial transmission phase, a transmitting end may perform polar code encoding on information bits and frozen bits. The transmitting end punctures and modulates encoded bits, and sends the bits to a receiving end through a channel. In a retransmission phase, the transmitting end may sort bit reliability based on an extended mother code. In the extended mother code, there are non-transmitted bits in the initial transmission phase. Bits whose bit reliability ranks top in the bits may be used to transmit information bits with lower bit reliability in the initial transmission phase. The information bits with lower bit reliability may be used as PC bits for one-to-one check. It can be seen from FIG. 2B that, the one-to-one check may be understood as that the PC bits are compared with corresponding information bits with lower bit reliability in the initial transmission phase, so that values of the PC bits and values of the corresponding information bits are the same. The transmitting end may perform polar code encoding on the one-to-one checked bits. The transmitting end may puncture and modulate the bits on which the polar code encoding is performed, and sends the bits to the receiving end through the channel. The receiving end may perform joint decoding based on the one-to-one checked PC bits and the bits received in the initial transmission phase.


In the procedure shown in FIG. 2B, the polar code-based retransmission solution is described. However, polar codes are non-systematic codes, and cannot support coding and retransmission in JSCC.


In view of this, an embodiment of this application provides an encoding method. In the method, bits in a retransmission phase are encoded through systematic polar encoding, so that a probability distribution feature of to-be-coded source bits is effectively used, and retransmission performance is improved.



FIG. 3 is a diagram of an architecture of an encoding method according to an embodiment of this application. A system architecture to which the encoding method provided in this embodiment of this application is applied is shown in FIG. 3. A sending device may select an encoding mode and a parameter based on sparseness of physical layer (PHY) data. When determining that the to-be-transmitted PHY data is sparse, the sending device may select a JSCC mode for encoding, to effectively use redundant information in the PHY data and improve overall transmission performance. The PHY data being sparse may be considered as that a probability distribution p0 of 0 or a probability distribution p1 of 1 is far away from 0.5, for example, less than 0.3 or greater than 0.7. The sending device may add CRC to a transport block (TB) of the PHY data, split, in the selected JSCC mode, the TB with the CRC added into code blocks (CBs), and add CRC to the split CBs. The sending device may perform physical layer coding and rate matching on the CBs with the CRC added. The sending device may perform the physical layer coding in the JSCC mode. The sending device may splice the CBs obtained through the rate matching, scramble the spliced CBs, perform modulation, layer mapping, antenna mapping, and resource mapping on the scrambled CBs, and send the CBs to a receiving device. Optionally, the sending device may add hybrid automatic repeat request (HARQ) information to the CBs with the CRC added, and perform the physical layer coding and the rate matching based on the information.



FIG. 4 is an example flowchart of an encoding method according to an embodiment of this application. The method may include the following operations.


S401: A sending device determines a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission.


k may be an integer greater than or equal to 1. For example, k may be equal to 1, 2, or 3. Optionally, k may be an integer greater than or equal to 2. It may be understood that k needs to be less than a predefined or preset maximum quantity of transmissions.


In an example, it may be considered that k being 1 indicates an initial transmission phase. In the initial transmission phase, the sending device may set the length Nc of the to-be-transmitted bits and a length Ns of source bits. In this case, the sending device may determine that a length of bits obtained through rate matching is Nk=Ns+Nc. The sending device may obtain a length Nm,k=2[log2(Nk)] of a mother code M1 in the initial transmission phase based on Nk, where [·] represents a rounding up operation. In the formula, the subscript k is equal to 1.


In another example, it may be considered that k being an integer greater than or equal to 2 indicates a retransmission phase. In the retransmission phase, the sending device may set the length NRT,k of the to-be-transmitted bits. In the retransmission phase, the to-be-transmitted bits may also be referred to as to-be-retransmitted bits. To distinguish between an initial transmission phase and the retransmission phase, the to-be-transmitted bits are referred to as to-be-retransmitted bits below. A length of bits in the kth transmission before the rate matching is Σ=i=2kNRT,k+Nc. It may be understood that in different retransmission phases, NRT,k may be the same or may be different. Whether NRT,k is the same may be negotiated by the sending device and the receiving device, or may be predefined in a protocol, or may be indicated by the sending device to the receiving device. The sending device may determine that a length of bits obtained through rate matching is Nk=Ns+Nci=2kNRRT,k. For example, when k=2, the length of the bits obtained through the rate matching is Nk=Ns+Nc+NRT,2. The sending device may obtain a length Nm,k=2[log 2(Nk)] of a mother code Mk in the kth transmission based on Nk.


S402: The sending device performs systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits.


It should be noted that, in the initial transmission phase and the retransmission phase, processes in which the sending device performs systematic polar encoding on the to-be-coded bits in the kth transmission are different. The following separately describes Case 1 and Case 2.


Case 1: Initial Transmission Phase.

In a possible implementation, the sending device may determine locations that are of the to-be-coded bits in the kth transmission and that are in the mother code M1 in the first transmission. The to-be-coded bits in the kth transmission may include non-transmitted bits, source bits, CRC bits, and frozen bits.


In an example, the sending device performs rate matching on the mother code M1, to determine a location index set R1 that is of non-transmitted bits in the first transmission and that is in the mother code M1 in the first transmission. For example, the sending device may puncture or shorten the mother code M1. It may be understood that a rate matching manner of the sending device is not limited in this embodiment of this application. For example, the sending device may puncture the mother code M1 in a sequential puncturing manner or a bit-reversal puncturing manner. For another example, the sending device may shorten the mother code M1 in a sequential shortening manner or a bit-reversal shortening manner.


The non-transmitted bits may be understood as bits that are punctured or shortened after the sending device performs the rate matching on the mother code M1. For example, the non-transmitted bits may include punctured bits shown in FIG. 2B. The sending device may determine, through the rate matching, the location index set R1 that is of the non-transmitted bits and that is in the mother code M1 in the first transmission. For example, it can be seen from FIG. 2B that the location index set R1 that is of the non-transmitted bits and that is in the mother code M1 in the first transmission may include a location index set of the punctured bits.


Optionally, the sending device may set elements in the location index set R1 that is of the non-transmitted bits and that is in the mother code M1 in the first transmission as frozen bits. Such frozen bits are non-sent frozen bits. In other words, the sending device may set bit values of bits corresponding to the elements in R1 to 0.


In another example, refer to FIG. 5A. In the initial transmission phase, the sending device may determine, from the mother code M1 in the first transmission, a location index set src1 of source bits and a location index set chk1 of CRC bits. The location index set src1 of the source bits precedes the location index set chk1 of the CRC bits. FIG. 5A is used as an example. Elements in the location index set chk1 of the CRC bits occupy rear location indexes in the mother code M1. For example, a start location index of the bits in the mother code M1 is 0, a quantity of CRC bits is 4, and the length of the to-be-coded bits is 32. It may be considered that the elements in the location index set chk1 of the CRC bits include a location index 31, a location index 30, a location index 29, and a location index 28. However, location indexes included in elements in the location index set src1 of the source bits start from a location index 27, and a quantity of elements included in the location index set src1 of the source bits is the same as a quantity of source bits.


An example in which a start index of the location indexes in FIG. 5A is 0 is used as an example. It may be understood that the start index of the location indexes may alternatively be 1. This is not limited in this application.


In still another example, the sending device may determine, from the mother code M1, a location index set frz1 of frozen bits. It should be noted that such frozen bits are to-be-sent frozen bits that do not include the foregoing non-transmitted bits that are set to the frozen bits “o”. It can be seen from FIG. 5A that elements in the location index set frz1 of the to-be-sent frozen bits include location indexes of bits other than the elements included in a location index set R1 of the non-transmitted bits, a location index set chk1 of the CRC bits, and a location index set src1 of the source bits.


In another possible implementation, the sending device may encode the to-be-coded bits based on the foregoing determined location index set. The sending device may assign the to-be-coded bits to corresponding location indexes one by one based on location indexes that are of the to-be-coded bits and that are in the mother code M1. For example, the sending device may assign the source bits to bits corresponding to elements included in src1. Refer to FIG. 5B. In an encoding process, the sending device may convert the to-be-transmitted bits into a to-be-sent Nm,1-dimensional row vector. As shown in FIG. 5B, x1 is the to-be-sent Nm,1-dimensional row vector, and x1(a) represents bits corresponding to a set a in the vector x1. For example, x1(src1) represents source bits in the vector x1. u1 shown in FIG. 5B is a Nm,1-dimensional row vector, and is an intermediate quantity in a systematic polar encoding process. u1(a) represents bits corresponding to a set a in the vector u1. For example, u1(src1) represents an intermediate quantity corresponding to locations of source bits in the vector u1, and element locations in the vector x1(src1) are in one-to-one correspondence with element locations in the vector u1(src1).


It should be noted that the sending device may perform CRC check. x1(chk1)=check(x1(src1)) (corresponding to {circle around (1)} in FIG. 5B). It can be seen from FIG. 5B that the CRC check may be performed on x1(chk1) by using elements in x1(src1), and check represents a check function. It should be noted that a CRC check manner is not limited in this embodiment of this application.


After the CRC check, the sending device may perform preprocessing transformation on the vector x1 to obtain u1. During the preprocessing transformation, u1(info1)=[x1(info1)−u1(frz1+R1)*G1(frz1+R1, info1)]*G1(info1)−1 (corresponding to {circle around (2)} in FIG. 5B).


u1(frz1+R1) indicates preset values of frozen bits, for example, all the values are o. info1=src1+chk1, indicating an information bit set, and corresponding to a system bit of a systematic polar code. The set operation “+” indicates calculating a union set. G1 represents a polar matrix of a polar code whose length is Nm,1, G1(a, b) represents a row of a set a corresponding to the polar matrix G1 and a column of a set b corresponding to the polar matrix G1, and G1(a) represents the row and a column of the set a corresponding to the polar matrix G1.


After the preprocessing transformation, the sending device may perform polarization transformation (corresponding to {circle around (3)} in FIG. 5B) on the vector u1, to obtain encoded frozen bits. During the polarization transformation, x1(frz1+R1)=u1(info1)*G1(infok, frz1+R1)+u1(frz1+R1)*G1(frz1+R1).


After {circle around (1)} to {circle around (3)}, the sending device completes encoding of the to-be-coded bits. The sending device may send the encoded bits to the receiving device based on a rate matching result. The sending device punctures the source bits based on a compression configuration.


Case 2: Retransmission Phase.

In a possible implementation, in the retransmission phase, the length Nm,k of the mother code Mk in the kth transmission may be the same as or different from a length Nm,k-1 of a mother code Mk-1 in a (k-1)th transmission.


In a possible implementation, when the length NRT,k of the to-be-retransmitted bits in the kth transmission is greater than a length of non-transmitted bits in the (k-1)th transmission, the length Nm,k of the mother code Mk in the kth transmission is different from the length Nm,k-1 of the mother code Mk-1, in the (k-1)th transmission. The sending device may determine locations that are of the to-be-coded bits and that are in the mother code Mk in the kth transmission. The to-be-coded bits may include non-transmitted bits, source bits, CRC bits, and frozen bits. Optionally, the to-be-coded bits in the retransmission phase may further include PC bits.


Based on the solution, when the length of the to-be-retransmitted bits NRT,k in the kth transmission is greater than the length of the non-transmitted bits in the (k-1)th transmission, it may be considered that a quantity of non-transmitted bits in the (k-1)th transmission does not meet a requirement of a quantity of to-be-retransmitted bits in the kth transmission. Therefore, the length of the mother code is changed, so that the sending device performs an encoding operation.


In an example, the sending device may determine a location index set that is of first bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission. The first bits include non-transmitted bits, source bits, CRC bits, and frozen bits. In a possible case, elements included in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code Mk-1 in the (k-1)th transmission and a length Nm,k-1 of the mother code Mk-1 in the (k-1)th transmission. For example, a location index set that is of source bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission is src′k-1=srck-1+Nm,k-1. A location index set that is of PC bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission is pc′k-1=pck-1+Nm,k-1, a location index set that is of frozen bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission is frz′k-1=frzk-1+Nm,k-1, a location index set that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission is R′k-1=Rk-1+Nm,k-1, and a location index set that is of CRC bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission is chk′k-1=chkk-1+Nm,k-1.


In another possible case, because the length Nm,k of the mother code Mk in the kth transmission is twice the length Nm,k-1 of the mother code Mk-1 in the (k-1)th transmission, it may be considered that a half of the length Nm,k of the mother code Mk in the kth transmission is the length Nm,k-1 of the mother code Mk-1 in the (k-1)th transmission. Therefore, elements included in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code Mk in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code Mk-1 in the (k-1)th transmission and the half of the length Nm,k of the mother code Mk in the kth transmission. For example, src′k-1=srck-1+Nm,k/2·pck-1=pck-1+Nm,k/2, frz′k-1=frzk-1+Nm,k/2, R′k-1=Rk-1+Nm,k/2, and chk′k-1=chkk-1+Nm,k/2.


It may be understood that, in the formula, ak-1 may be considered as a location index set that is of the set a and that is in the mother code Mk-1 in the (k-1)th transmission. For example, Rk-1 is a location index set that is of the non-transmitted bits and that is in the mother code Mk-1 in the (k-1)th transmission.


It should be noted that when k=2, pck-1 and pc′k-1 are empty sets.


In another example, the sending device may perform rate matching on the mother code Mk in the kth transmission, to obtain a location index set Rk that is of non-transmitted bits in the kth transmission and that is in the mother code Mk in the kth transmission. For example, the sending device may puncture or shorten the mother code Mk. Puncturing is used as an example. The sending device calculates, based on Nm,k and Nk, a length Nm,k−Nk of bits that currently need to be punctured. In this case, the sending device may obtain, based on a currently selected puncturing scheme and txk-1=src′k-1+pc′k-1+frz′k-1+chk′k-1, the location index set Rk=fpunc(Nm,k-Nk+n)/txk-1 of the non-transmitted bits in the kth transmission, where n is a non-negative integer satisfying |Rk|=Nm,k−Nk, fpunc(m) represents a function for obtaining m puncturing location sets, and |·| represents an operation for calculating a quantity of elements in the set.


Shortening is used as an example. Rk=fshort(Nm,k-Nk+n)/txk-1, and fshort(m) represents a function for obtaining m shortening location sets.


In still another example, the sending device may determine srck based on src′k-1, R′k-1, Nm,k, and Rk. It may be understood that manners of determining srck by the sending device include Manner 1 and Manner 2, which are separately described below.


Manner 1: The sending device may select NS most reliable location indexes from a set [Δ+src′k-1+R′k-1)/Rk] as srck. Δ={1, 2, . . . , Nm,k/2} is a location index set newly added to the mother code in the kth transmission. It may be understood that Δ is determined based on a location index set that is of the mother code in the (k-1)th transmission and that is in the mother code in the kth transmission.


The sending device may determine srck in the set. [Δ+src′k-1+R′k-1)/Rk]. “/” may represent a difference set operation of the set. For example, the sending device may sort location indexes included in the set [Δ+src′k-1+R′k-1)/Rk] in descending order of bit reliability. The sending device may select top-ranked NS location indexes that satisfy Gk(Δsrck, frz′k-1)=o as srck. Gk represents a polar matrix of a polar code whose length is Nm,k, and Δsrck=srck/src′k-1.


It should be noted that the sorting in descending order of bit reliability in Manner 1 is merely an example. The sending device may alternatively sort the location indexes included in the set in ascending order of bit reliability. This is not limited in this application. When the sending device sorts the location indexes included in the set [Δ+src′k-1+R′k-1)/Rk] in ascending order of bit reliability, the sending device may select lower-ranked NS location indexes that satisfy Gk(Δsrck, frz′k-1)=o as srck, where Δsrck=srck/src′k-1.


Based on the solution, the sending device can select NS most reliable location indexes from the set as [(Δ+src′k-1+R′k-1)/Rk] as srck, so that performance of the kth transmission can be improved, and a decoding success rate can be improved.


Optionally, the sending device may determine pck based on srck. For example, the sending device may obtain target PC bits, referred to as Δpck, where Δpck=src′k-1/srck. The sending device may combine a location index set pc′k-1 that is of PC bits in the first transmission to the (k-1)th transmission and that is in the mother code Mk in the kth transmission with the location index set Δpck of the target PC bits in the kth transmission, to obtain the location index set pck that is of the PC bits and that is in the mother code Mk. In other words, pck=pc′k-1+Δpck. Optionally, bits corresponding to elements included in Δpck are used for one-to-one check with bits corresponding to elements included in Δsrck.


It may be understood that the location index set of the PC bits in the first transmission is an empty set. pc′k-1 may be considered as the location index set that is of the PC bits in the (k-1)th transmission and that is in the mother code Mk. Because the PC bits in the (k-1)th transmission also include PC bits in the first transmission to a (k-2)th transmission, pc′k-1 may also be considered as the location index set that is of the PC bits in the first transmission to the (k-1)th transmission and that is in the mother code Mk in the kth transmission.


Based on the solution, the sending device can determine pck based on srck, so that the sending device can perform PC check on newly added source bits based on the PC bits.


Manner 2: The sending device may determine srck in a set [Δ+R′k-1)/Rk].


The sending device may determine a preset quantity NPC of PC bits. The sending device may select, from the set [Δ+R′k-1)/Rk], NPC most reliable location indexes satisfying Gk(Δsrck, frz′k-1)=o as location indexes Δsrck of newly added source bits in the kth transmission. For example, the sending device may sort elements in the set in descending order of bit reliability. The sending device may select NPC location indexes that rank higher and that satisfy Gk(Δsrck, frz′k-1)=o as Δsrck.


It should be noted that the sending device sorts elements in the set [Δ+R′k-1)/Rk] in descending order of bit reliability is merely shown as an example. Alternatively, the sending device may sort the elements in the set [Δ+R′k-1)/Rk] in ascending order of bit reliability. Details are not described herein again.


The sending device may select NPC most unreliable location indexes from src′k-1 as a location index set Δpck of target PC bits. In this case, srck=src′k-1/Δpck+Δsrck, where pCk=Δpck+pc′k-1. It may be understood that bits corresponding to elements included in Δpck are used for one-to-one check with bits corresponding to elements included in Δsrck.


Based on Manner 2, the sending device can determine the location indexes of the source bits and the PC bits in the kth transmission.


In a possible case, the sending device may determine a location index set frzk that is of the frozen bits and that is in the mother code Mk in the kth transmission. frzk={1, 2, . . . , Nm,k}/(srck+pck+Rk+chkk).


In a possible implementation, the sending device may encode the to-be-coded bits based on the foregoing determined location index set. The sending device may assign the to-be-coded bits to the corresponding location indexes. Refer to FIG. 6. In an encoding process, the sending device may convert the to-be-transmitted bits into a to-be-sent Nm,k-dimensional row vector. As shown in FIG. 6, xk is the to-be-sent Nm,k-dimensional row vector, and xk(a) represents bits corresponding to a set a in the vector xk. uk shown in FIG. 6 is a Nm,k-dimensional row vector, and is an intermediate quantity in a systematic polar encoding process. uk(a) represents bits corresponding to a corresponding set a in the vector uk.


It should be noted that the sending device may perform CRC check. xk(chkk)=check(xk(srck)) (corresponding to {circle around (1)} in FIG. 6). A CRC check manner is not limited in this embodiment of this application.


After the CRC check, the sending device may perform one-to-one check, in other words, one-to-one PC check xk(Δpck)=xk(Δsrck) (corresponding to {circle around (2)} in FIG. 6), on PC bits and source bits in the vector Xk. The formula may be understood as: comparing, in a one-to-one manner based on the determined location index set Δpck of the target PC bits and the location index set Δsrck of the newly added source bits and in a sequence of elements in Δpck and Δsrck, bit values corresponding to the elements included in Δpck with bit values corresponding to the elements included in Δsrck, so that values of the checked bits are the same in a one-to-one manner.


After the one-to-one check, the sending device may perform preprocessing transformation on the vector xk to obtain uk. During the preprocessing transformation, uk(infok)=[xk(infok)−uk(frzk+Rk)*Gk(frzk+Rk, infok)]*Gk(infok)−1 (corresponding to {circle around (3)} in FIG. 6). uk(frzk+Rk) indicates preset values of frozen bits, for example, all the values are o. infok=srck+chkk, indicating an information bit set, and corresponding to a system bit of a systematic polar code.


After the preprocessing transformation, the sending device may perform polarization transformation (corresponding to {circle around (4)} in FIG. 6) on the vector uk. During the polarization transformation, xk(frzk+Rk)=uk(infok)*Gk(infok, frzk+Rk)+uk(frzk+Rk)*Gk(frzk+Rk).


It should be noted that, due to a property of a systematic code, it can be ensured that neither the source bits nor the CRC bits that have been sent in the initial transmission phase and that are in the vector xk change. In other words, xk(src1,k)=x1(src1) and xk(chk1,k)=x1(chk1). src1,k and chk1,k respectively represent location index sets that are of the source bits and the CRC bits in the initial transmission phase and that are in the kth transmission.


In addition, the part of frozen bits that have been sent in the initial transmission phase in the vector xk does not change, that is, the vector xk(frz1,k)=x1(frz1). frz1,k represents a location index set of the frozen bits that have been sent in the initial transmission phase and that is in the kth transmission.


After {circle around (1)} to {circle around (4)}, the sending device can complete encoding of the to-be-coded bits in the retransmission phase, and the sending device may send the encoded to-be-transmitted bits to the receiving device based on a rate matching result. The sending device punctures the source bits based on a compression configuration.


In another possible implementation, when the length NRT,k of the to-be-retransmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in the (k-1)th transmission, the length Nm,k of the mother code Mk in the kth transmission is the same as the length Nm,k-1 of the mother code Mk-1, in the (k-1)th transmission. Locations of to-be-transmitted bits in the mother code Mk in the kth transmission are the same as locations of to-be-transmitted bits in the mother code Mk-1 in the (k-1)th transmission. The sending device may encode the to-be-coded bits in the manner shown in FIG. 5B. Details are not described herein again.


Optionally, when the length NRT,k of the to-be-retransmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, the sending device may alternatively determine the locations of the to-be-transmitted bits in the kth transmission in the manner of determining the locations of the to-be-transmitted bits in the mother code Mk when the length NRT,k of the to-be-retransmitted bits in the kth transmission is greater than the length of the non-transmitted bits in the (k-1)th transmission. Details are not described herein again.


Based on the solution, when the length of the to-be-retransmitted bits NRT,k in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, it may be considered that a quantity of non-transmitted bits in the (k-1)th transmission can meet a requirement of a quantity of to-be-retransmitted bits in the kth transmission. Therefore, coding complexity can be reduced without changing the length of the mother code.


S403: The sending device sends the to-be-transmitted bits.


Correspondingly, the receiving device receives the to-be-transmitted bits.


In a possible case, the to-be-transmitted bits in the initial transmission phase may include other bits than the non-transmitted bits and the punctured source bits. It can be seen from FIG. 5B that the to-be-transmitted bits in the initial transmission phase may include the frozen bits and the CRC bits. In other words, the sending device may send the encoded frozen bits and the encoded CRC bits to the receiving device.


In another possible case, the to-be-transmitted bits in the retransmission phase vary with the length of the mother code. In an example, the to-be-transmitted bits may be bits with highest reliability in the non-transmitted bits in the (k-1)th transmission. For example, the non-transmitted bits in the (k-1)th transmission may be punctured bits or shortened bits. The sending device may sort the non-transmitted bits in descending order of bit reliability, and select NRT,k bits whose reliability ranks higher as the to-be-transmitted bits. It may be understood that the sending device may sort the non-transmitted bits in ascending order of bit reliability. Details are not described herein again.


In another example, location indexes of the to-be-transmitted bits may be determined based on Δpck, frzk, and frz′k-1. For example, a location index set of the to-be-transmitted bits includes elements in Δpck and frzk/frz′k-1. In other words, the to-be-transmitted bits include bits corresponding to the elements in Δpck and frzk/frz′k-1.


The following separately describes a puncturing-based systematic polar encoding method and a shortening-based systematic polar encoding method by using Example 1 and Example 2.


Example 1: Puncturing-Based Systematic Polar Encoding Method

The following uses an example in which initial transmission is performed by using a code (14, 10). A code length is 14, 10 information bits include eight source bits and two CRC bits, and a length of frozen bits is 4. All the eight source bits are punctured, and six bits are actually sent, including two CRC bits and four frozen bits. A length of a mother code corresponding to the code is 16, and a length for puncturing is 2. Assuming that the sending device performs bit-reversal puncturing, R1={1, 9}. It is assumed that a bit reliability order of location indexes that are of the remaining bits and that are in the mother code in the initial transmission phase in ascending order is 2, 3, 5, 4, 6, 7, 10, 11, 13, 8, 12, 14, 15, and 16. The sending device obtains that src1={6, 7, 8, 10, 11, 12, 13, 14}, chk1={15, 16}, and frz1={2, 3, 4, 5} based on the bit reliability order.


In a first retransmission, that is, k=2, it is assumed that a quantity of retransmitted bits is NRT,2=8. In this case, in the first retransmission, the length Nm,2 of the mother code is 32. The length for puncturing is 10. The sending device determines location index sets that are of source bits, non-transmitted bits, CRC bits, and frozen bits in the initial transmission phase and that are in the mother code in the first retransmission. R′1={17, 25}, where src′1={22, 23, 24, 26, 27, 28, 29, 30}, chk′1={31, 32}, frz′1={18, 19, 20, 21}, and pc′1={ }. The sending device may determine a newly added location index set Δ={1, 2, . . . , 16} of the mother code. In this way, the sending device may determine a location index set tx1={18, 19, . . . , 24, 26, 27, . . . , 32} that is of bits sent in the initial transmission phase and that is in the mother code in the first retransmission.


The sending device performs bit-reversal puncturing, to obtain a puncturing location index set {1, 3, 5, 9, 13, 17, 19, 21, 25, 29}. 19, 21, and 29 have been present in tx1. The sending device may determine that R2=fpunc(10+5)/tx1={1, 3, 5, 7, 9, 11, 13, 15, 17, 25}.


The sending device may determine a set [(Δ+src′1+R′1)/R2]={2, 4, 6, 8, 10, 12, 14, 16, 22, 23, 24, 26, 27, 28, 29, 30}. The sending device sorts the elements in the set in ascending order of bit reliability, and a sorting result is 2, 4, 6, 10, 8, 12, 14, 22, 23, 26, 27, 29, 16, 24, 28, 30. The sending device selects eight most reliable elements from the result as a location index set src2={16, 23, 24, 26, 27, 28, 29, 30} of the source bits. The sending device may determine that pc2=src′1/src2={22}, and Δsrc2=src2/src′1={16}.


The sending device may determine that frz2={1, 2, . . . , 32}/(src2+pc2+R2+chk2)={2, 4, 6, 8, 10, 12, 14, 18, 19, 20, 21}. The sending device encodes to-be-coded bits, and sends the to-be-transmitted bits. Location indexes of the to-be-transmitted bits include pc2={22} and frz2/frz′1={2, 4, 6, 8, 10, 12, 14}.


Example 2: Shortening-Based Systematic Polar Encoding Method

The following uses an example in which initial transmission is performed by using a code (14, 10). A code length is 14, 10 information bits include eight source bits and two CRC bits, and a length of frozen bits is 4. It is assumed that all the eight source bits are punctured, and six bits are actually sent, including two CRC bits and four frozen bits. A length of a mother code corresponding to the code is 16, and a length for shortening is 2. If the sending device performs bit-reversal shortening, R1={8, 16}. It is assumed that a bit reliability order of location indexes that are of the remaining bits and that are in the mother code in the initial transmission phase in ascending order is 1, 2, 3, 5, 9, 4, 6, 7, 10, 11, 13, 12, 14, 15. The sending device obtains that src1={4, 6, 7, 9, 10, 11, 12, 13}, chk1={14, 15}, and frz1={1, 2, 3, 5} based on the bit reliability order.


In a first retransmission, that is, k=2, it is assumed that a quantity of retransmitted bits is NRT,2=8. In this case, in the first retransmission, the length Nm,2 of the mother code is 32. The length for puncturing is 10. The sending device determines location index sets that are of source bits, non-transmitted bits, CRC bits, and frozen bits in the initial transmission phase and that are in the mother code in the first retransmission. src′1={20, 22, 23, 25, 26, 27, 28, 29}, frz′1={17, 18, 19, 21}, R′1={24, 32}, chk′1={30, 31}, and pc′1={ }. The sending device may determine a newly added location index set Δ={1, 2, . . . , 16} of the mother code. In this way, the sending device may determine a location index set tx1={17, 18, . . . , 23, 25, 26, . . . , 31} that is of bits sent in the initial transmission phase and that is in the mother code in the first retransmission.


The sending device performs bit-reversal shortening, to obtain a shortening set {14, 30, 4, 20, 12, 28, 8, 24, 16, 32}. 20, 28, and 30 have been present in tx1. The sending device may determine that R2=fshort(10+5)/tx1={2, 4, 6, 8, 10, 12, 14, 16, 24, 32}.


The sending device may determine a set [(Δ+src′1+R′1)/R2]={1, 3, 5, 7, 9, 11, 13, 15, 20, 22, 23, 25, 26, 27, 28, 29}. The sending device sorts the elements in the set [(Δ+src′1+R′1)/R2] in ascending order of bit reliability, and a sorting result is 1, 3, 5, 9, 7, 11, 13, 25, 20, 15, 22, 23, 26, 27, 29, 28. The sending device selects eight most reliable elements from the result as a location index set src2={15, 20, 22, 23, 26, 27, 28, 29} of the source bits. The sending device may determine that pc2=src′1/src2={25}, and Δsrc2=src2/src′1={15}.


The sending device may determine that frz2={1, 2, . . . , 32}/(src2+pc2+R2+chk2)={1, 3, 5, 7, 9, 11, 13, 17, 18, 19, 21}. The sending device encodes to-be-coded bits, and sends the to-be-transmitted bits. Location indexes of the to-be-transmitted bits include pc2={25} and frz2/frz′1={1, 3, 5, 7, 9, 11, 13}.


Optionally, the embodiment shown in FIG. 4 may further include the following S404.


S404: The receiving device performs systematic polar decoding on the to-be-transmitted bits in the kth transmission.


In a possible implementation, the receiving device may decode the received to-be-transmitted bits. In a possible case, in the initial transmission phase, all the source bits are punctured, and soft information (LLR)=log(p0/p1) of the source bits is obtained. log(p0/p1) is prior information of a probability distribution. LLRs of the frozen bits and the CRC bits are obtained through demodulation. For other punctured bits than the source bits, LLR=o, and for shortened bits, LLR=∞. The sending device may input corresponding LLRs in the to-be-transmitted bits to a decoder, to decode the to-be-transmitted bits. In another possible case, in the retransmission phase, for the source bits, LLR=log(p0/p1). For the PC bits LLR=LLRch+log(p0/p1). LLRch is soft information obtained through demodulation, and log(p0/p1) is prior information of a probability distribution. LLRs of the frozen bits and the CRC bits are obtained through demodulation. For other punctured bits than the source bits, LLR=o, and for shortened bits, LLR=o or ∞. It should be noted that a value of the LLR of the shortened bits is determined based on a polarization relationship. The sending device may input corresponding LLRs in the to-be-transmitted bits to a decoder, to decode the to-be-transmitted bits.


In another possible implementation, in a shortening mode, locations of the shortened bits after retransmission may not be regular enough. As a result, LLRs corresponding to locations of some shortened bits cannot be determined in the initialization phase, and can be reset to w only after decoding is performed at specific locations. It is assumed that a code (7, 5) is obtained after the initial transmission and the first retransmission, and a length of a mother code corresponding to the code is 8, including three source bits, two CRC bits, two sent frozen bits, and one shortened frozen bit. Refer to FIG. 7. The sending device may initialize LLRs of the bits before decoding. The source bits are initialized by using probability distribution information, and both the CRC bits and the sent frozen bits are initialized by using LLRch obtained through demodulation. Because a polarized shortened bit is obtained by performing an exclusive OR operation on the shortened bit and a source bit at a location 8, a value of the shortened bit is uncertain. Therefore, the LLR of the shortened bit is initialized to o. As the decoding is performed, when the decoding is performed on a bit at a location directly connected to the shortened bit, that is, the source bit at the location 8, the LLR of the shortened bit may be uniquely determined by a preset value of the shortened bit. It is assumed that the value of the shortened bit is 0. Therefore, the shortening bit may be directly set to ∞ or a large value.


It should be noted that, a main difference between a source-aware CC mode and the JSCC mode is that the source bits are not compressed during encoding, and only partial probability distribution information is used during decoding, improving decoding performance. In other words, initialization of the LLR of the source bits during decoding includes two parts: demodulation information during reception and the probability distribution information. For the source bits, LLR=LLRch+log(p0/p1). When p1=p0=0.5 or the receiving device does not send the probability distribution information of the data, the source-aware CC mode may directly fall back to channel coding with systematic polar codes used. When the to-be-transmitted bits sent in the kth retransmission phase are selected, newly added source bits whose reliability ranks higher are directly sent, and source bits with low bit reliability that are sent in the (k-1)th transmission phase are directly used as newly added PC bits.


The following uses an example in which initial transmission is performed by using a code (14, 10). A code length is 14, 10 information bits include eight source bits and two CRC bits, a length of frozen bits is 4, and 14 bits are actually sent. A length of a mother code corresponding to the code is 16, and a length for puncturing is 2. Assuming that the sending device performs bit-reversal puncturing, R1={1, 9}. It is assumed that a bit reliability order of location indexes that are of the remaining bits and that are in the mother code in the initial transmission phase in ascending order is 2, 3, 5, 4, 6, 7, 10, 11, 13, 8, 12, 4, 15, 16. The sending device obtains that src1={6, 7, 8, 10, 11, 12, 13, 14}, chk1={15, 16}, and frz1={2, 3, 4, 5} based on the bit reliability order.


In a first retransmission, that is, k=2, it is assumed that a quantity of retransmitted bits is NRT,2=8. In this case, in the first retransmission, the length of the mother code is 32. The length for puncturing is 10. The sending device determines location index sets that are of source bits, non-transmitted bits, CRC bits, and frozen bits in the initial transmission phase and that are in the mother code in the first retransmission. src′1={22, 23, 24, 26, 27, 28, 29, 30}, frz′1={18, 19, 20, 21}, R′1={17, 25}, chk′1={31, 32}, and pc′1={ }. The sending device may determine a newly added location index set Δ={1, 2, . . . , 16} of the mother code. In this way, the sending device may determine a location index set tx1={18, 19, . . . , 24, 26, 27, . . . , 32} that is of bits sent in the initial transmission phase and that is in the mother code in the first retransmission.


The sending device performs bit-reversal puncturing, to obtain a puncturing location index set {1, 3, 5, 9, 13, 17, 19, 21, 25, 29}. 19, 21, and 29 have been present in tx1. The sending device may determine that R2=fpunc(10+5)/tx1={1, 3, 5, 7, 9, 11, 13, 15, 17, 25}.


The sending device may determine a set [(Δ+src′1+R′1)/R2]={2, 4, 6, 8, 10, 12, 14, 16, 22, 23, 24, 26, 27, 28, 29, 30}. The sending device sorts the elements in the set [(Δ+src′1+R′1)/R2] in ascending order of bit reliability, and a sorting result is 2, 4, 6, 10, 8, 12, 14, 22, 23, 26, 27, 29, 16, 24, 28, 30. The sending device selects eight most reliable elements from the result as a location index set src2={16, 23, 24, 26, 27, 28, 29, 30} of the source bits. The sending device may determine that pc2=src′1/src2={22}, and Δsrc2=src2/src′1={16}.


The sending device may determine that frz2={1, 2, . . . , 32}/(src2+pc2+R2+chk2)={2, 4, 6, 8, 10, 12, 14, 18, 19, 20, 21}. The sending device encodes to-be-coded bits, and sends the to-be-transmitted bits. Location indexes of the to-be-transmitted bits include Δsrc2={16} and frz2/frz′1={2, 4, 6, 8, 10, 12, 4}.


Based on the concept of the foregoing embodiments, refer to FIG. 8. An embodiment of this application provides a communication apparatus 800. The apparatus 800 includes a processing unit 801 and a transceiver unit 802. The apparatus 800 may be a sending device, a device used in a sending device, or an apparatus that can support a sending device in performing an encoding method. Alternatively, the apparatus 800 may be a receiving device, a device used in a receiving device, or an apparatus that can support a receiving device in performing an encoding method.


The transceiver unit may also be referred to as a transceiver module, a transceiver, a transceiver machine, a transceiver apparatus, or the like. The processing unit may also be referred to as a processor, a processing board, a processing unit, a processing apparatus, or the like. Optionally, a component that is in the transceiver unit and that is configured to implement a receiving function may be considered as a receiving unit. It should be understood that the transceiver unit is configured to perform a sending operation and a receiving operation on a sending device side or a receiving device side in the foregoing method embodiments, and a component that is in the transceiver unit and that is configured to implement a sending function is considered as a sending unit. In other words, the transceiver unit includes a receiving unit and a sending unit. When the apparatus 800 is used in a sending device, the sending unit included in the transceiver unit 802 of the apparatus 800 is configured to perform a sending operation on the sending device side, for example, send to-be-transmitted bits. The sending unit may send the to-be-transmitted bits to a receiving device. When the apparatus 800 is used in a receiving device, the receiving unit included in the transceiver unit 802 of the apparatus 800 is configured to perform a receiving operation on the receiving device side, for example, receive to-be-transmitted bits. The receiving unit may receive the to-be-transmitted bits from a sending device.


In addition, it should be noted that, if the apparatus is implemented by using a chip/chip circuit, the transceiver unit may be an input/output circuit and/or a communication interface, and perform an input operation (corresponding to the foregoing receiving operation) and an output operation (corresponding to the foregoing sending operation); and the processing unit is an integrated processor, a microprocessor, or an integrated circuit.


The following describes in detail an implementation in which the apparatus 800 is used in a sending device or a receiving device.


For example, operations performed by the units of the apparatus 800 when the apparatus 800 is used in the sending device are described in detail.


The processing unit 801 is configured to determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission. k is an integer greater than or equal to 2. The processing unit 801 is further configured to perform systematic polar encoding on to-be-coded bits to obtain the to-be-transmitted bits. The transceiver unit 802 is configured to send the to-be-transmitted bits. When the length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1 that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission. When the length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


In a design, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission include elements in R′k-1.


In a design, the processing unit 801 is further configured to: determine a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission, where the first bits include source bits, cyclic redundancy check CRC bits, and frozen bits; perform rate matching on the mother code in the kth transmission, to obtain a location index set Rk that is of non-transmitted bits in the kth transmission and that is in the mother code in the kth transmission; and determine the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.


In a design, elements included in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission.


In a design, when determining srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk, the processing unit 801 is configured to: determine a first union set of a location index set in the mother code in the (k-1)th transmission, src′k-1 and the location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission; determine a first difference set between the first union set and Rk; sort location indexes in the first difference set in descending order of bit reliability; and select top-ranked NS location indexes as srck.


In a design, the processing unit 801 is further configured to: use a difference set between src′k-1 and srck as a location index set Δpck of target parity check PC bits in the kth transmission; use a union set of a location index set pc′k-1 that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; and use a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, where location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1.


In a design, when determining srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk, the processing unit 801 is configured to: determine a second union set of a location index set in the mother code in the (k−1)th transmission and R′k-1; determine a second difference set between the second union set and Rk; sort location indexes in the second difference set in descending order of bit reliability; select top-ranked NPC location indexes as a location index set Δsrck of target source bits in the kth transmission; select lower-ranked NPC location indexes in src′k-1 as a location index set Δpck of target PC bits in the kth transmission; determine a difference set between src′k-1 and Δpck; and use a union set of Δsrck and the difference set between src′k-1 and Δpck as srck.


In a design, the processing unit 801 is further configured to: use a union set of a location index set pc′k-1, that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; and use a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, where location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1.


In a design, the rate matching includes shortening or puncturing.


In a design, a value of a bit corresponding to an element in Δsrck is the same as a value of a bit corresponding to an element in Δpck.


For example, operations performed by the units of the apparatus 800 when the apparatus 800 is used in the receiving device are described in detail.


The transceiver unit 802 is configured to receive to-be-transmitted bits in a kth transmission from the sending device. The processing unit 801 is configured to decode to-be-transmitted bits. In a possible case, when a length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1, that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission. In another possible case, when a length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k-1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission include elements in R′k-1.


In a possible implementation, the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission is determined based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.


In a possible implementation, elements included in a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission. The first bits include source bits, cyclic redundancy check CRC bits, and frozen bits.


In a possible implementation, the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission is top-ranked NS location indexes in a first difference set. The first difference set is a difference set between a first union set and Rk, and the first union set is a union set of a location index set in the mother code in the (k-1)th transmission, src′k-1, and the location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1, frzk is determined based on a difference set between a location index set in the mother code in the kth transmission and a location index set pck of PC bits in a first transmission to the kth transmission, srck, Rk, and a location index set chkk of CRC bits in the kth transmission. pck is determined based on a difference set between src′k-1 and srck and a location index set pc′k-1 that is of PC bits in the first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission.


In a possible implementation, srck is determined based on a union set of a difference set between src′k-1 and a location index set Δpck of target PC bits in the kth transmission and a location index set Δsrck of target source bits in the kth transmission. Δpck includes lower-ranked NPC location indexes in src′k-1. Δsrck includes top-ranked NPC location indexes in a second difference set. The second difference set is a difference set between a second union set and Rk. The second union set is a union set of the location index set in the mother code in the (k-1)th transmission and R′k-1.


In a possible implementation, location indexes of the to-be-transmitted bits include elements in Δpck and in a difference set between frzk and frz′k-1. frzk is determined based on a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission.


In a possible implementation, the rate matching includes shortening or puncturing.


In a possible implementation, a value of a bit corresponding to an element in Δsrck is the same as a value of a bit corresponding to an element in Δpck.


Based on the concept of the foregoing embodiments, as shown in FIG. 9, an embodiment of this application provides a communication apparatus 900. The communication apparatus 90o includes a processor 910. Optionally, the communication apparatus 900 may further include a memory 920, configured to store instructions executed by the processor 910, or store input data required by the processor 910 to run the instructions, or store data generated after the processor 910 runs the instructions. The processor 910 can implement, by using the instructions stored in the memory 920, the method shown in the foregoing method embodiments.


Based on the concept of the foregoing embodiments, as shown in FIG. 10, an embodiment of this application provides a communication apparatus 1000. The communication apparatus 1000 may be a chip or a chip system. Optionally, in this embodiment of this application, the chip system may include a chip, or may include a chip and another discrete component.


The communication apparatus 1000 may include at least one processor 1010. The processor 1010 is coupled to a memory. Optionally, the memory may be located inside or outside the apparatus. For example, the communication apparatus 1000 may further include at least one memory 1020. The memory 1020 stores a necessary computer program, configuration information, a computer program or instructions, and/or data for implementing any one of the foregoing embodiments. The processor 1010 may execute the computer program stored in the memory 1020, to complete the method in any one of the foregoing embodiments.


The coupling in this embodiment of this application may be an indirect coupling or a communication connection between apparatuses, units, or modules in an electrical form, a mechanical form, or another form, and is used for information exchange between the apparatuses, the units, or the modules. The processor 1010 and the memory 1020 may operate cooperatively. In embodiments of this application, a specific connection medium among the transceiver 1030, the processor 1010, and the memory 1020 is not limited.


The communication apparatus 1000 may further include a transceiver 1030, and the communication apparatus 1000 may perform information exchange with another device by using the transceiver 1030. The transceiver 1030 may be a circuit, a bus, a transceiver, or any other apparatus that can be configured to exchange information, or is referred to as a signal transceiver unit. As shown in FIG. 10, the transceiver 1030 includes a transmitter 1031, a receiver 1032, and an antenna 1033. In addition, when the communication apparatus 1000 is a chip type apparatus or circuit, the transceiver in the communication apparatus 1000 may alternatively be an input/output circuit and/or a communication interface, and may input data (or is referred to as receiving data) and output data (or is referred to as sending data). The processor is an integrated processor, a microprocessor, or an integrated circuit, and the processor may determine output data based on input data.


In a possible implementation, the communication apparatus 1000 may be used in a sending device. The communication apparatus 1000 may be a sending device, or may be an apparatus that can support a sending device in implementing functions of the sending device in any one of the foregoing embodiments. The memory 1020 stores a necessary computer program, a computer program or instructions, and/or data for implementing the functions of the sending device in any one of the foregoing embodiments. The processor 1010 may execute the computer program stored in the memory 1020, to complete the method performed by the sending device in any one of the foregoing embodiments. When the communication apparatus 1000 is used in a sending device, the transmitter 1031 in the communication apparatus 1000 may be configured to send to-be-transmitted bits through the antenna 1033.


In another possible implementation, the communication apparatus 1000 may be used in a receiving device. The communication apparatus 1000 may be a receiving device, or may be an apparatus that can support a receiving device in implementing functions of the receiving device in any one of the foregoing embodiments. The memory 1020 stores a necessary computer program, a computer program or instructions, and/or data for the implementing functions of the receiving device in any one of the foregoing embodiments. The processor 1010 may execute the computer program stored in the memory 1020, to complete the method performed by the receiving device in any one of the foregoing embodiments. When the communication apparatus 1000 is used in a receiving device, the receiver 1032 in the communication apparatus 1000 may be configured to receive to-be-transmitted bits through the antenna 1033.


The communication apparatus 1000 provided in this embodiment may be used in the sending device to complete the method performed by the sending device, or may be used in the receiving device to complete the method performed by the receiving device. Therefore, for technical effects that can be achieved by this embodiment, refer to the foregoing method embodiments. Details are not described herein again.


In this embodiment of this application, the processor may be a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or another programmable logic device, a discrete gate, a transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logical block diagrams disclosed in embodiments of this application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed with reference to embodiments of this application may be directly performed by a hardware processor, or may be performed by using a combination of hardware in the processor and a software module.


In embodiments of this application, the memory may be a non-volatile memory, for example, a hard disk drive (HDD) or a solid-state drive (SSD), or may be a volatile memory, for example, a random access memory (RAM). Alternatively, the memory may be any other medium that can be configured to carry or store expected program code in a form of an instruction or a data structure and that can be accessed by a computer, but is not limited thereto. The memory in this embodiment of this application may alternatively be a circuit or any other apparatus that can implement a storage function, and is configured to store a computer program, a computer program or instructions, and/or data.


Based on the foregoing embodiments, refer to FIG. 11. An embodiment of this application further provides another communication apparatus 1100, including: an input/output interface 1110 and a logic circuit 1120, where the input/output interface 1110 is configured to receive code instructions and transmit the code instructions to the logic circuit 1120; and the logic circuit 1120 is configured to run the code instructions to perform the method performed by the sending device or the receiving device in any one of the foregoing embodiments.


The following describes in detail an operation performed when the communication apparatus is used in the sending device or the receiving device.


In an optional implementation, the communication apparatus 1100 may be used in the sending device, to perform the foregoing method performed by the sending device, for example, the foregoing method performed by the sending device in the embodiment shown in FIG. 4. The logic circuit 1120 is configured to determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission, and perform systematic polar encoding on to-be-coded bits based on the mother code, to obtain the to-be-transmitted bits. The input/output interface 1110 is configured to output the to-be-transmitted bits.


In another optional implementation, the communication apparatus 1100 may be used in the receiving device, to perform the foregoing method performed by the receiving device, for example, the foregoing method performed by the receiving device in the method embodiment shown in FIG. 4. The input/output interface 1110 is configured to input to-be-transmitted bits in a kth transmission from the sending device. The logic circuit 1120 is configured to decode the to-be-transmitted bits.


The communication apparatus 1100 provided in this embodiment may be used in the sending device to perform the method performed by the sending device, or may be used in the receiving device to complete the method performed by the receiving device. Therefore, for technical effects that can be achieved by this embodiment, refer to the foregoing method embodiments. Details are not described herein again.


Based on the foregoing embodiments, an embodiment of this application further provides a communication system. The system includes at least one communication apparatus used in a sending device and at least one communication apparatus used in a receiving device. For technical effects that can be achieved by this embodiment, refer to the foregoing method embodiments. Details are not described herein again.


Based on the foregoing embodiments, an embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the instructions are executed, the method performed by the sending device or the method performed by the receiving device in any one of the foregoing embodiments is implemented. The computer-readable storage medium may include: any medium that can store program code, like a USB flash drive, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disc.


Based on the foregoing embodiments, this application further provides a computing program product, including computer-executable instructions. When the computer-executable instructions are run on a computer, the method performed by the sending device or the method performed by the receiving device in any one of the foregoing embodiments is implemented.


To implement functions of the communication apparatuses in FIG. 8 and FIG. 11, an embodiment of this application further provides a chip, including a processor, configured to support the communication apparatus in implementing the functions of the sending device or the receiving device in the foregoing method embodiments. In a possible design, the chip is connected to a memory, or the chip includes a memory. The memory is configured to store a computer program or instructions and data that are necessary for the communication apparatus.


A person skilled in the art should understand that embodiments of this application may be provided as a method, a system, or a computer program product. Therefore, this application may use a form of hardware only embodiments, software only embodiments, or embodiments with a combination of software and hardware. In addition, this application may use a form of a computer program product that is implemented on one or more computer-usable storage media (including but not limited to a disk memory, a CD-ROM, an optical memory, and the like) that include computer-usable program code.


This application is described with reference to the flowcharts and/or block diagrams of the method, the device (system), and the computer program product according to embodiments of this application. It should be understood that a computer program or instructions may be used to implement each procedure and/or each block in the flowcharts and/or the block diagrams and a combination of a procedure and/or a block in the flowcharts and/or the block diagrams. The computer program or instructions may be provided for a general-purpose computer, a dedicated computer, an embedded processor, or a processor of another programmable data processing device to generate a machine, so that the instructions executed by the computer or the processor of another programmable data processing device generate an apparatus for implementing a specific function in one or more procedures in the flowcharts and/or in one or more blocks in the block diagrams.


The computer program or instructions may alternatively be stored in a computer-readable memory that can instruct the computer or the another programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate an artifact that includes an instruction apparatus. The instruction apparatus implements a specified function in one or more procedures in the flowcharts and/or in one or more blocks in the block diagrams.


The computer program or instructions may alternatively be loaded onto the computer or the another programmable data processing device, so that a series of operation steps are performed on the computer or the another programmable device to generate computer-implemented processing. Therefore, the instructions executed on the computer or the another programmable device provide steps for implementing a specific function in one or more procedures in the flowcharts and/or in one or more blocks in the block diagrams.


Apparently, a person skilled in the art may make various modifications and variations to embodiments of this application without departing from the scope of embodiments of this application. In this case, this application is intended to cover these modifications and variations of embodiments of this application provided that they fall within the scope of protection defined by the following claims and their equivalent technologies.

Claims
  • 1. An encoding method, comprising: determining, by a sending device, a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission, wherein k is an integer greater than or equal to 2;performing, by the sending device, systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits; andsending, by the sending device, the to-be-transmitted bits, whereinwhen the length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1, that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission; orwhen the length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.
  • 2. The method according to claim 1, further comprising: determining, by the sending device, a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission, wherein the first bits comprise source bits, cyclic redundancy check (CRC) bits, and frozen bits;performing, by the sending device, rate matching on the mother code in the kth transmission, to obtain a location index set Rk that is of non-transmitted bits in the kth transmission and that is in the mother code in the kth transmission; anddetermining, by the sending device, the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.
  • 3. The method according to claim 2, wherein elements comprised in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission.
  • 4. The method according to claim 2, wherein the determining, by the sending device, srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk comprises: determining, by the sending device, a first union set of a location index set in the mother code in the (k-1)th transmission, src′k-1, and the location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission;determining, by the sending device, a first difference set between the first union set and Rk;sorting, by the sending device, location indexes in the first difference set in descending order of bit reliability; andselecting, by the sending device, top-ranked NS location indexes higher as srck.
  • 5. The method according to claim 4, further comprising: using, by the sending device, a difference set between src′k-1 and srck as a location index set Δpck of target parity check (PC) bits in the kth transmission;using, by the sending device, a union set of a location index set pc′k-1 that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; andusing, by the sending device, a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, whereinlocation indexes of the to-be-transmitted bits comprise elements in Δpck and in a difference set between frzk and frz′k-1.
  • 6. The method according to claim 2, wherein the determining, by the sending device, srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk comprises: determining, by the sending device, a second union set of a location index set in the mother code in the (k-1)th transmission and R′k-1;determining, by the sending device, a second difference set between the second union set and Rk;sorting, by the sending device, location indexes in the second difference set in descending order of bit reliability;selecting, by the sending device, top-ranked NPC location indexes as a location index set Δsrck of target source bits in the kth transmission;selecting, by the sending device, lower-ranked NPC location indexes in src′k-1 as a location index set Δpck of target PC bits in the kth transmission;determining, by the sending device, a difference set between src′k-1 and Δpck; andusing, by the sending device, a union set of Δsrck and the difference set between src′k-1 and Δpck as srck.
  • 7. The method according to claim 6, further comprising: using, by the sending device, a union set of a location index set pc′k-1, that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; andusing, by the sending device, a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, whereinlocation indexes of the to-be-transmitted bits comprise elements in Δpck and in a difference set between frzk and frz′k-1.
  • 8. The method according to claim 2, wherein the rate matching comprises shortening or puncturing.
  • 9. The method according to claim 6, wherein a value of a bit corresponding to an element in Δsrck is the same as a value of a bit corresponding to an element in Δpck.
  • 10. The method according to claim 1, wherein when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k−1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission comprise elements in R′k-1.
  • 11. A decoding method, comprising: receiving, by a receiving device, to-be-transmitted bits in a kth transmission from a sending device; anddecoding, by the receiving device, the to-be-transmitted bits, whereinwhen a length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1 that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission; orwhen a length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in a mother code in the kth transmission is determined based on a location index set R′k-1 that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.
  • 12. The method according to claim 11, wherein when the length of the to-be-transmitted bits in the kth transmission is less than or equal to the length of the non-transmitted bits in the (k−1)th transmission, elements in the location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission comprise elements in R′k-1.
  • 13. A communication apparatus, comprising at least one processor, wherein the at least one processor is coupled to a memory; and the at least one processor is configured to execute a computer program or instructions stored in the memory, to: determine a mother code in a kth transmission based on a length of to-be-transmitted bits in the kth transmission, wherein k is an integer greater than or equal to 2;perform systematic polar encoding on to-be-coded bits in the kth transmission based on the mother code, to obtain the to-be-transmitted bits; andsend the to-be-transmitted bits, whereinwhen the length of the to-be-transmitted bits in the kth transmission is greater than a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set srck that is of source bits in the kth transmission and that is in the mother code in the kth transmission, a location index set frz′k-1 that is of frozen bits in the (k-1)th transmission and that is in the mother code in the kth transmission, and a location index set frzk that is of frozen bits in the kth transmission and that is in the mother code in the kth transmission; orwhen the length of the to-be-transmitted bits in the kth transmission is less than or equal to a length of non-transmitted bits in a (k-1)th transmission, a location index set that is of the to-be-transmitted bits and that is in the mother code in the kth transmission is determined based on a location index set R′k-1, that is of the non-transmitted bits in the (k-1)th transmission and that is in the mother code in the kth transmission.
  • 14. The apparatus according to claim 13, wherein the at least one processor is further configured to: determine a location index set that is of first bits in the (k-1)th transmission and that is in the mother code in the kth transmission, wherein the first bits comprise source bits, cyclic redundancy check (CRC) bits, and frozen bits;perform rate matching on the mother code in the kth transmission, to obtain a location index set Rk that is of non-transmitted bits in the kth transmission and that is in the mother code in the kth transmission; anddetermine the location index set srck that is of the source bits in the kth transmission and that is in the mother code in the kth transmission based on a location index set src′k-1 that is of the source bits in the (k-1)th transmission and that is in the mother code in the kth transmission, R′k-1, the mother code in the kth transmission, a mother code in the (k-1)th transmission, and Rk.
  • 15. The apparatus according to claim 14, wherein elements comprised in the location index set that is of the first bits in the (k-1)th transmission and that is in the mother code in the kth transmission are a sum of location indexes that are of the first bits in the (k-1)th transmission and that are in the mother code in the (k-1)th transmission and a length of the mother code in the (k-1)th transmission.
  • 16. The apparatus according to claim 14, wherein when determining srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk, the at least one processor is configured to: determine a first union set of a location index set in the mother code in the (k-1)th transmission, src′k-1, and the location index set R′k-1, that is of the non-transmitted bits in the (k−1)th transmission and that is in the mother code in the kth transmission;determine a first difference set between the first union set and Rk;sort location indexes in the first difference set in descending order of bit reliability; andselect top-ranked NS location indexes as srck.
  • 17. The apparatus according to claim 16, wherein the at least one processor is further configured to: use a difference set between src′k-1 and srck as a location index set Δpck of target parity check (PC) bits in the kth transmission;use a union set of a location index set pc′k-1 that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; anduse a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, whereinlocation indexes of the to-be-transmitted bits comprise elements in Δpck and in a difference set between frzk and frz′k-1.
  • 18. The apparatus according to claim 14, wherein when determining srck based on src′k-1, R′k-1, the mother code in the kth transmission, the mother code in the (k-1)th transmission, and Rk, the at least one processor is configured to: determine a second union set of a location index set in the mother code in the (k-1)th transmission and R′k-1;determine a second difference set between the second union set and Rk;sort location indexes in the second difference set in descending order of bit reliability;select top-ranked NPC location indexes as a location index set Δsrck of target source bits in the kth transmission;select lower-ranked NPC location indexes in src′k-1 as a location index set Δpck of target PC bits in the kth transmission;determine a difference set between src′k-1 and Δpck; anduse a union set of Δsrck and the difference set between src′k-1 and Δpck as srck.
  • 19. The apparatus according to claim 18, wherein the at least one processor is further configured to: use a union set of a location index set pc′k-1, that is of PC bits in a first transmission to the (k-1)th transmission and that is in the mother code in the kth transmission and Δpck as a location index set pck of PC bits in the first transmission to the kth transmission; anduse a difference set between a location index set in the mother code in the kth transmission and pck, srck, Rk, and a location index set chkk of CRC bits in the kth transmission as frzk, whereinlocation indexes of the to-be-transmitted bits comprise elements in Δpck and in a difference set between frzk and frz′k-1.
  • 20. The apparatus according to claim 14, wherein the rate matching comprises shortening or puncturing.
Priority Claims (1)
Number Date Country Kind
202210397609.1 Apr 2022 CN national
CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Patent Application No. PCT/CN2023/081390, filed on Mar. 14, 2023, which claims priority to Chinese Patent Application No. 202210397609.1, filed on Apr. 15, 2022. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.

Continuations (1)
Number Date Country
Parent PCT/CN2023/081390 Mar 2023 WO
Child 18914973 US