A communication method and device

By determining the LCID that meets the preset conditions in LTE V2X and keeping the input parameters consistent when the PDCP entity executes the security algorithm, the packet analysis problem in D2D unicast communication between devices is solved, ensuring the normal communication and communication reliability of the side links.

CN114830719BActive Publication Date: 2025-04-04HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980103097.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-31
Publication Date
2025-04-04
Estimated Expiration
2039-12-31

AI Technical Summary

Technical Problem

In LTE V2X, before D2D unicast communication between devices, PC5 interface signaling connection establishment and secure establishment are required. However, since the sender and the receiver's PDCP entity may use different LCIDs as input parameters of the security algorithm, the receiver cannot correctly parse the sender's data packets, which in turn affects the normal communication of the side link.

Method used

By determining the LCID that meets the preset conditions in the first terminal and parsing the data packet sent by the second terminal based on the LCID after receiving the data packet, it is ensured that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal are consistent when executing the security algorithm.

Benefits of technology

It ensures that the side link between the first terminal and the second terminal can communicate normally, and improves the reliability of the communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114830719B_ABST
    Figure CN114830719B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a communication method and device, which relates to the field of communication technology, and can make the input parameters of the corresponding PDCP entities of the first terminal and the second terminal consistent when executing the security algorithm, ensure that the side link SL can communicate normally, and improve the reliability of communication. The specific scheme is: the first terminal determines the logical channel identifier LCID that meets the preset conditions; the first packet data convergence protocol PDCP entity of the first terminal associates two or more logical channels LCH; the first terminal receives the first data packet from the second terminal; the first PDCP entity of the first terminal parses the first data packet based on the LCID.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a communication method and device. Background Art

[0002] Vehicle to everything (V2X) refers to the interconnection between vehicles and the outside world through devices configured on vehicles and various communication technologies, such as interconnection and communication between vehicles, vehicles and people, vehicles and roadside infrastructure, vehicles and networks, etc. The link for direct communication between V2X user equipment (UE) is the sidelink or sidelink (SL), and the direct communication interface between V2X UEs is the V2X PC5 interface.

[0003] In long term evolution (LTE) V2X, before device to device (D2D) unicast communication, PC5 interface signaling (PC5-S) connection establishment and security establishment must be performed. After the PC5-S connection establishment and security establishment are completed, the subsequent corresponding access stratum (AS) user plane data transmission can be based on the security algorithm negotiated by UE1 and UE2 when the PC5-S connection is established, and the logical channel identifier (LCID) is used as the bearer parameter in the input parameter of the AS layer security algorithm. In order to improve the reliability of service transmission, packet data convergence protocol (PDCP) duplication (PDCP duplication) can be introduced, that is, one PDCP entity is associated with multiple logical channels (logical channels, LCH). Then, when the PDCP entities corresponding to the sending UE and the receiving UE execute the security algorithm, they may use different LCIDs as the input parameters of the security algorithm, which will cause the receiving UE to be unable to correctly parse the data packets sent by the sending UE, resulting in the SL between the sending UE and the receiving UE unable to communicate normally. Summary of the invention

[0004] The embodiments of the present application provide a communication method and apparatus, which can ensure that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal remain consistent when executing the security algorithm, ensure that the side link can communicate normally, and improve the reliability of communication.

[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0006] The first aspect of the embodiment of the present application provides a communication method, which includes: a first terminal determines a logical channel identifier LCID that meets preset conditions; a first packet data convergence protocol PDCP entity of the first terminal associates two or more logical channels LCH; the first terminal receives a first data packet from a second terminal; the first PDCP entity of the first terminal parses the first data packet based on the LCID. Based on this scheme, the first terminal determines an LCID that meets the preset conditions, and after receiving the first data packet, parses the data packet sent by the second terminal based on the LCID that meets the preset conditions. Therefore, after receiving the data packet, the first terminal does not parse the data packet sent by the second terminal based on an LCID at random. Instead, it parses the data packet sent by the second terminal based on the LCID that meets the preset conditions. It can be understood that the LCID that meets the preset conditions determined by the first terminal is the same as the LCID when the second terminal performs security protection on the first data packet. Therefore, it can ensure that the first terminal can normally parse the first data packet based on the LCID that meets the preset conditions, so that the SL between the first terminal and the second terminal can communicate normally. That is, this solution can ensure that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal are consistent when executing the security algorithm, so that the SL between the transmitting and receiving UEs can communicate normally.

[0007] Optionally, the first terminal may determine the LCID that meets the preset conditions based on the LCIDs corresponding to two or more LCHs associated with the first PDCP entity of the first terminal.

[0008] In combination with the first aspect, in a possible implementation, the first data packet is a data packet after the second PDCP entity of the second terminal performs security protection based on the LCID that meets the preset conditions, and the second PDCP entity of the second terminal corresponds to the first PDCP entity of the first terminal. Based on this solution, it can ensure that the LCID when the second terminal performs security protection on the first data packet is consistent with the LCID when the first terminal parses the first data packet, so that the side link between the first terminal and the second terminal can communicate normally.

[0009] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned preset conditions include a first preset condition, and the size of the above-mentioned LCID meets the first preset condition. Based on this scheme, the LCID that meets the preset conditions determined by the first terminal may be an LCID whose size meets the first preset condition. Exemplarily, the LCID that meets the preset conditions determined by the first terminal may be the largest LCID, or the smallest LCID, or the second largest LCID, or the second smallest LCID, etc., among the LCIDs corresponding to two or more LCHs associated with the first PDCP entity of the first terminal. The embodiment of the present application does not limit the specific content of the first preset condition.

[0010] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned first terminal determines the LCID that meets the above-mentioned first preset conditions based on preset rules, and the preset rules are predefined. Based on this scheme, the first terminal can determine the LCID whose size meets the first preset condition based on the predefined rules. Exemplarily, the above-mentioned preset rules may be stipulated by the protocol, that is, the first terminal can determine the LCID that meets the first preset condition based on the rules stipulated by the protocol. For example, the protocol stipulates that the largest LCID among the LCIDs corresponding to the LCH associated with the PDCP is used as the input parameter of the security algorithm of the PDCP entity. Then the first terminal can, based on the rule, determine the largest LCID among the LCIDs corresponding to two or more LCHs associated with the first PDCP entity of the first terminal as the LCID that meets the first preset condition.

[0011] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned method also includes: the above-mentioned first terminal receives first indication information from the second terminal, and the first indication information is used to indicate that the above-mentioned first terminal uses the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the above-mentioned first PDCP entity. Based on this scheme, the first terminal can also receive indication information sent by the second terminal, so that the first terminal can determine the LCID that meets the first preset condition based on the indication information of the second terminal. It should be noted that the granularity indicated by the first indication information can be all PDCP entities of the first terminal, or it can be a certain PDCP entity of the first terminal.

[0012] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned first terminal determines the LCID that meets the above-mentioned first preset conditions based on the above-mentioned first indication information. Based on this scheme, the first terminal can determine the LCID that meets the first preset conditions based on the indication information of the second terminal, so that the LCID that meets the first preset conditions determined by the first terminal is the same as the LCID when the second terminal performs security protection on the first data packet. Therefore, it can be ensured that the first terminal can parse the first data packet normally based on the LCID that meets the preset conditions, so that the SL between the first terminal and the second terminal can communicate normally. Optionally, the first indication information may also include the LCID that meets the first preset conditions determined by the second terminal, and the first indication information is specifically used to instruct the first terminal to use the LCID that meets the first preset conditions determined by the second terminal as the input parameter of the security algorithm of the above-mentioned first PDCP entity.

[0013] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-radio resource control RRC message. Based on this scheme, when the first indication information is carried in the first SLRB configuration information, the first indication information indicates that the PDCP entity corresponding to the SLRB configuration uses the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the first indication information is a certain PDCP entity. Optionally, the above-mentioned first indication information can also be sent separately from the first SLRB configuration information.

[0014] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned LCID that meets the above-mentioned first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the above-mentioned two or more LCHs. Based on this scheme, the first terminal can determine the smallest LCID or the largest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity as the above-mentioned LCID that meets the first preset condition. Optionally, the first terminal can also determine the second smallest LCID or the second largest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity as the above-mentioned LCID that meets the first preset condition, and so on. This application is not limited to this.

[0015] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned preset conditions include a second preset condition, and the LCH configuration parameters corresponding to the above-mentioned LCID meet the second preset condition. Based on this scheme, the LCID that meets the preset conditions determined by the first terminal may be an LCID whose LCH configuration parameters corresponding to the LCID meet the second preset conditions. Exemplarily, the LCID that meets the preset conditions determined by the first terminal may be the LCID corresponding to the LCH with the highest priority among two or more LCHs associated with the first PDCP entity of the first terminal, or may also be the LCID corresponding to the LCH whose other LCH configuration parameters meet the second preset condition. The embodiment of the present application does not limit the specific content of the second preset condition.

[0016] In combination with the first aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned method further includes: the above-mentioned first terminal receives second indication information from the above-mentioned second terminal, the second indication information includes a target LCID, and the second indication information is used to instruct the above-mentioned first terminal to use the target LCID as an input parameter of the security algorithm of the above-mentioned first PDCP entity, and the target LCID is the LCID corresponding to the LCH that meets the above-mentioned second preset condition determined by the above-mentioned second terminal. Based on this scheme, the first terminal can receive the second indication information sent by the second terminal, so that the first terminal determines the LCID that meets the second preset condition based on the second indication information.

[0017] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned first terminal determines the LCID that meets the above-mentioned second preset conditions based on the above-mentioned second indication information. Based on this scheme, the first terminal can use the LCID corresponding to the LCH that meets the above-mentioned second preset conditions determined by the second terminal as the input parameter of the security algorithm of the first PDCP entity of the first terminal based on the second indication information sent by the second terminal, thereby ensuring that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal are consistent when executing the security algorithm, so that the SL between the first terminal and the second terminal can communicate normally.

[0018] In combination with the first aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned second indication information is carried in the second SLRB configuration information, and the second SLRB configuration information is carried in the PC5-RRC message. Based on this scheme, when the second indication information is carried in the second SLRB configuration information, the second indication information indicates that the PDCP entity corresponding to the SLRB configuration information uses the LCID that meets the above-mentioned second preset condition as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the second indication information is a certain PDCP entity. Optionally, the above-mentioned second indication information can also be sent separately from the second SLRB configuration information.

[0019] The second aspect of the embodiment of the present application provides a communication method, which includes: the second terminal determines a logical channel identifier LCID that meets the preset conditions; the second packet data convergence protocol PDCP entity of the second terminal associates two or more logical channels LCH; the second terminal uses the LCID as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet; the second terminal sends the first data packet after security protection to the first terminal; wherein the LCID is an input parameter when the first PDCP entity of the first terminal parses the first data packet, and the first PDCP entity of the first terminal corresponds to the second PDCP entity of the second terminal. Based on this scheme, the second terminal determines the LCID that meets the preset conditions, and uses the LCID as an input parameter of the security algorithm of the second PDCP entity of the second terminal to perform security protection on the first data packet, and the LCID is an input parameter when the first PDCP entity of the first terminal parses the first data packet. Therefore, the scheme can ensure that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal are consistent when executing the security algorithm, so that the SL between the first terminal and the second terminal can communicate normally.

[0020] In conjunction with the second aspect, in a possible implementation, the above-mentioned preset condition includes a first preset condition, and the size of the above-mentioned LCID meets the above-mentioned first preset condition. Based on this solution, the LCID that meets the preset condition determined by the second terminal can be an LCID whose size meets the first preset condition.

[0021] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned second terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned second terminal determines the LCID that meets the above-mentioned first preset conditions based on preset rules, and the preset rules are predefined. Based on this scheme, the first terminal can determine the LCID whose size meets the first preset condition based on the predefined rules. Exemplarily, the above-mentioned preset rules can be specified by the protocol.

[0022] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned second terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned second terminal determines the LCID that meets the above-mentioned first preset condition based on the size of the LCID corresponding to the above-mentioned two or more LCHs. Based on this scheme, the second terminal can also autonomously determine the LCID as an input parameter of the security algorithm of the second PDCP entity based on the size of the LCID corresponding to the two or more LCHs associated with the second PDCP entity.

[0023] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned method further includes: the above-mentioned second terminal receives third indication information from the network device, and the third indication information is used to instruct the above-mentioned second terminal to use the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the above-mentioned second PDCP entity. Based on this scheme, the second terminal can receive the third indication information of the network device, so that the second terminal determines the LCID that meets the first preset condition according to the indication of the network device. For example, the network device instructs the second terminal to use the maximum or minimum LCID as the input parameter of the security algorithm of the above-mentioned second PDCP entity.

[0024] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned second terminal determines the logical channel identifier LCID that meets the preset condition, including: the above-mentioned second terminal determines the LCID that meets the above-mentioned first preset condition based on the above-mentioned third indication information. Based on this scheme, the second terminal determines the LCID that meets the first preset condition based on the third indication information of the network device. For example, the second terminal can determine the maximum or minimum LCID as the LCID that meets the first preset condition based on the third indication information of the network device.

[0025] In combination with the second aspect and the above possible implementation, in another possible implementation, the above third indication information also includes the identification information of the above first terminal. Based on this solution, the network device can instruct the second terminal to use the LCID that meets the first preset condition in the unicast connection communication between the first terminal and the second terminal as the input parameter of the security algorithm of the first PDCP entity.

[0026] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned third indication information is carried in the third sidelink radio bearer SLRB configuration information, and the third SLRB configuration information is carried in the radio resource control RRC message, the system message block SIB or the pre-configuration message. Based on this scheme, the third indication information sent by the network device may be carried in an RRC message, a SIB or a pre-configuration message. In this scheme, the above-mentioned third indication information specifically indicates that the PDCP entity corresponding to the SLRB configuration information uses the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the third indication information is a certain PDCP entity. Optionally, the above-mentioned third indication information may also be sent separately from the third SLRB configuration information.

[0027] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned method further includes: the above-mentioned second terminal sends a first indication message to the above-mentioned first terminal, and the first indication message is used to instruct the above-mentioned first terminal to use the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the first PDCP entity of the above-mentioned first terminal. Based on this scheme, the second terminal can send the first indication message to the first terminal to instruct the first terminal to use one LCID among multiple LCIDs as the input parameter of the security algorithm of the first PDCP entity of the first terminal, thereby ensuring that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal remain consistent when executing the security algorithm.

[0028] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-RRC message. Based on this scheme, when the first indication information is carried in the first SLRB configuration information, the first indication information indicates that the PDCP entity corresponding to the SLRB configuration uses the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the first indication information is a certain PDCP entity. Optionally, the above-mentioned first indication information can also be sent separately from the first SLRB configuration information.

[0029] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned LCID that meets the above-mentioned first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the above-mentioned two or more LCHs. Based on this scheme, the second terminal can determine the smallest LCID or the largest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity as the above-mentioned LCID that meets the first preset condition. Optionally, the second terminal can also determine the second smallest LCID or the second largest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity as the above-mentioned LCID that meets the first preset condition, and so on. This application is not limited to this.

[0030] In combination with the second aspect and the above possible implementation, in another possible implementation, the above preset condition includes a second preset condition, and the LCH configuration parameter corresponding to the above LCID meets the second preset condition. Based on this solution, the LCID that meets the preset condition determined by the second terminal can be the LCID whose LCH configuration parameter corresponding to the LCID meets the second preset condition.

[0031] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned second terminal determines the logical channel identifier LCID that meets the preset conditions, including: the above-mentioned second terminal determines the LCID that meets the above-mentioned second preset conditions based on the LCH configuration parameters of the above-mentioned two or more LCHs. Based on this scheme, the second terminal can autonomously determine the LCID as an input parameter of the security algorithm of the second PDCP entity based on the LCH configuration parameters of two or more LCHs associated with the second PDCP entity. For example, the second terminal can determine to use the LCID corresponding to the LCH with the highest priority as the input parameter of the security algorithm of the second PDCP entity based on the LCH configuration parameters of two or more LCHs associated with the second PDCP entity.

[0032] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned method also includes: the above-mentioned second terminal receives fourth indication information from the network device, the fourth indication information includes a target LCH configuration parameter, and the fourth indication information is used to instruct the above-mentioned second terminal to use the LCID that meets the above-mentioned second preset condition as the input parameter of the security algorithm of the above-mentioned second PDCP entity, and the LCID that meets the above-mentioned second preset condition is the LCID corresponding to the above-mentioned target LCH configuration parameter. Based on this scheme, the second terminal can receive the fourth indication information of the network device, so that the second terminal determines the LCID that meets the second preset condition according to the indication of the network device. For example, the network device instructs the second terminal to use the LCID corresponding to the LCH with the highest priority as the input parameter of the security algorithm of the above-mentioned second PDCP entity. Alternatively, the network device instructs the second terminal to use the LCID corresponding to the LCH associated with the configuration authorization type CG as the input parameter of the security algorithm of the above-mentioned second PDCP entity.

[0033] In combination with the second aspect and the above-mentioned possible implementation, in another possible implementation, the above-mentioned second terminal determines the logical channel identifier LCID that meets the preset condition, including: the above-mentioned second terminal determines the LCID that meets the above-mentioned second preset condition based on the above-mentioned fourth indication information. Based on this scheme, the second terminal determines the LCID that meets the second preset condition based on the fourth indication information of the network device. For example, the second terminal can determine that the LCID corresponding to the LCH with the highest priority is the LCID that meets the second preset condition based on the fourth indication information of the network device.

[0034] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned fourth indication information is carried in the fourth SLRB configuration information, and the fourth SLRB configuration information is carried in an RRC message, a system message block SIB or a pre-configuration message. Based on this scheme, when the fourth indication information is carried in the fourth SLRB configuration information, the fourth indication information sent by the network device specifically instructs the second terminal to use the LCID that meets the above-mentioned second preset condition as the input parameter of the security algorithm of the PDCP entity corresponding to the fourth SLRB configuration information, so that the granularity indicated by the fourth indication information is a certain PDCP entity. Optionally, the above-mentioned fourth indication information can also be sent separately from the fourth SLRB configuration information.

[0035] In combination with the second aspect and the above-mentioned possible implementations, in another possible implementation, the above-mentioned method further includes: the above-mentioned second terminal sends a second indication message to the above-mentioned first terminal, the second indication message includes a target LCID, and the second indication message is used to instruct the above-mentioned first terminal to use the target LCID as an input parameter of a security algorithm of the first PDCP entity of the above-mentioned first terminal, and the target LCID is the LCID corresponding to the LCH that meets the above-mentioned second preset condition determined by the above-mentioned second terminal. Based on this scheme, the second terminal can send a second indication message to the first terminal to instruct the first terminal to use one of the multiple LCIDs as an input parameter of the security algorithm of the first PDCP entity of the first terminal, thereby ensuring that the input parameters of the corresponding PDCP entities of the first terminal and the second terminal remain consistent when executing the security algorithm.

[0036] In combination with the second aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned second indication information is carried in the second SLRB configuration information, and the second SLRB configuration information is carried in the PC5-RRC message. Based on this scheme, when the second indication information is carried in the second SLRB configuration information, the second indication information indicates that the PDCP entity corresponding to the SLRB configuration information uses the LCID that meets the above-mentioned second preset condition as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the second indication information is a certain PDCP entity. Optionally, the above-mentioned second indication information can also be sent separately from the second SLRB configuration information.

[0037] The third aspect of the embodiment of the present application provides a communication method, which includes: the network device determines a preset condition; the network device sends an indication message to the second terminal, and the indication message is used to instruct the second terminal to use the logical channel identifier LCID that meets the preset condition as the input parameter of the security algorithm of the second packet data convergence protocol PDCP entity of the second terminal, and the second PDCP entity of the second terminal is associated with two or more logical channels LCH. Based on this scheme, the network device can determine the content of the preset condition, and send an indication message to the second terminal, instructing the second terminal to use the LCID that meets the preset condition as the input parameter of the security algorithm of the second PDCP entity of the second terminal. It can be understood that in this scheme, the originating UE can determine the LCID as the input parameter of the security algorithm of the PDCP entity of the originating UE based on the indication of the network device. Exemplarily, the network device can be an access network device or a core network device.

[0038] In conjunction with the third aspect, in a possible implementation, the preset condition includes a first preset condition, and the size of the LCID meets the first preset condition; the indication information includes third indication information, and the third indication information is used to indicate that the second terminal uses the LCID that meets the first preset condition as an input parameter of the security algorithm of the second PDCP entity of the second terminal. Based on this solution, the network device can determine the content of the first preset condition based on the size of the LCID.

[0039] In combination with the third aspect and the above possible implementations, in another possible implementation, the above preset condition includes a second preset condition, and the configuration parameters of the LCH corresponding to the above LCID meet the above second preset conditions; the above indication information includes fourth indication information, and the fourth indication information is used to indicate that the above second terminal uses the LCID that meets the second preset condition as an input parameter of the security algorithm of the second PDCP entity of the above second terminal. Based on this solution, the network device can determine the content of the second preset condition based on the LCH configuration parameters.

[0040] In combination with the third aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned fourth indication information also includes a target LCH configuration parameter, and the above-mentioned LCID that meets the above-mentioned second preset condition is the LCID corresponding to the target LCH configuration parameter. Based on this scheme, the network device can also send the target LCH configuration parameter to the second terminal, so that the second terminal determines the LCID corresponding to the target LCH configuration parameter as the input parameter of the security algorithm of the second PDCP entity of the second terminal.

[0041] In combination with the third aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned indication information is carried in the sidelink radio bearer SLRB configuration information, and the SLRB configuration information is carried in the radio resource control RRC message, the system message block SIB or the pre-configuration message. Based on this scheme, the indication information sent by the network device is carried in the SLRB configuration information, and the indication information may be the above-mentioned third indication information or the fourth indication information. In this scheme, the network device may instruct the PDCP entity corresponding to the SLRB configuration information to use the LCID that meets the above-mentioned preset conditions as the input parameter of the security algorithm of the PDCP entity, so that the granularity indicated by the indication information is a certain PDCP entity. Optionally, the above-mentioned indication information may also be sent separately from the SLRB configuration information.

[0042] The fourth aspect of the embodiment of the present application provides a communication method, which includes: the second terminal uses the identifier SLRB ID of the first sidelink radio bearer as an input parameter of the security algorithm to perform security protection on the first data packet; the second terminal sends the first data packet after security protection to the first terminal, and the first data packet carries the above-mentioned first SLRB ID. Based on this scheme, the first terminal uses the first SLRB ID as an input parameter of the security algorithm to perform security protection on the first data packet, and sends the first data packet carrying the first SLRB ID to the second terminal, so that after the second terminal receives the first data packet, it can parse the first data packet based on the first SLRB ID carried in the first data packet. Therefore, the first terminal and the second terminal can use the same SLRB ID as an input parameter to ensure that the data transmission on the SL of the first terminal and the second terminal can be protected by the security algorithm.

[0043] The fifth aspect of the embodiment of the present application provides a communication method, which includes: a first terminal receives a first data packet from a second terminal, and the first data packet carries an identifier SLRB ID of a first sidelink radio bearer; the first terminal parses the first data packet based on the first SLRB ID. Based on this scheme, the second terminal can parse the first data packet sent by the first terminal based on the first SLRB ID carried in the first data packet, so that the second terminal can parse the first data packet normally, ensuring that the data transmission on the SL between the first terminal and the second terminal can be protected by the security algorithm. It can be understood that the first data packet received by the first terminal from the second terminal is a data packet after the second terminal performs security protection based on the first SLRB ID.

[0044] In combination with the fourth aspect or the fifth aspect, in a possible implementation, the first SLRB ID is carried in the header of the first data packet. Based on this solution, by carrying the first SLRB ID in the header of the first data packet, after the first terminal receives the first data packet, it can parse the first data packet based on the first SLRB ID carried in the header of the first data packet, so that the first terminal can know the first SLRB ID of the first data packet when the first data packet is security protected when receiving the first data packet, so that the first terminal can parse the first data packet normally, ensuring that the data transmission on the SL of the first terminal and the second terminal can be protected by the security algorithm. For example, the first SLRB ID can be carried in the PDCP header of the first data packet.

[0045] The sixth aspect of the embodiment of the present application provides a communication method, which includes: the second terminal sends a first message to the first terminal, and the first message carries the identifier SLRB ID of the first sidelink radio bearer; the second terminal receives a second message from the first terminal, and the second message is a message after the first terminal performs security protection based on the first SLRB ID; the second terminal parses the second message based on the first SLRB ID. Based on this scheme, the first SLRB ID is sent to the first terminal in advance by the second terminal, so that the first terminal can perform security protection on the second message based on the first SLRB ID, and ensure that the input parameters of the second terminal for security protection of the second message are consistent with the input parameters of the first terminal for parsing the second message, so that the transmission on the SL of the second terminal and the first terminal can achieve the protection of the security algorithm.

[0046] Optionally, after the second terminal sends the first message carrying the first SLRB ID to the first terminal, the second terminal can also perform security protection on the second message based on the first SLRB, and send the second message after security protection to the first terminal. Based on this solution, after the first terminal receives the second message after security protection, it can perform security analysis on the second message based on the first SLRB carried in the first message.

[0047] The seventh aspect of the embodiment of the present application provides a communication method, which includes: a first terminal receives a first message from a second terminal, the first message carries an identifier SLRB ID of a first sidelink radio bearer; the first terminal performs security protection on the second message based on the first SLRB ID; the first terminal sends the second message after security protection to the second terminal. Based on this scheme, the first terminal receives the first SLRB ID from the first terminal, and performs security protection on the second message based on the first SLRB ID, ensuring that the input parameters of the second terminal for security protection of the second message are consistent with the input parameters of the first terminal for parsing the second message, so that the transmission on the SL of the second terminal and the first terminal can achieve the protection of the security algorithm.

[0048] Optionally, after the first terminal receives the first message carrying the first SLRB ID from the second terminal, it can also receive a second message after security protection from the second terminal, and the first terminal can perform security analysis on the second message after security protection based on the first SLRB carried in the first message. The second message after security protection is a message for which the second terminal performs security protection based on the first SLRB ID.

[0049] In combination with the sixth aspect or the seventh aspect, in a possible implementation, the first message is a PC5-S message, and the second message is a PC5-S message or a PC5-RRC message. Based on this solution, the second message can be a PC5-S message or a PC5-RRC message after the first message, so that the SLRB ID carrying the second message can be sent to the first terminal in advance, so that the first terminal can perform security protection or security analysis on the second message based on the SLRB ID.

[0050] In an eighth aspect of an embodiment of the present application, a communication device is provided, comprising: a processing unit, configured to determine a logical channel identifier LCID that meets preset conditions; a first packet data convergence protocol PDCP entity of the device is associated with two or more logical channels LCH; a transceiver unit, configured to receive a first data packet from a second terminal; and the processing unit, further configured to parse the first data packet based on the LCID.

[0051] Optionally, the above-mentioned processing unit is specifically used to determine the LCID that meets the preset conditions based on the LCIDs corresponding to two or more LCHs associated with the first PDCP entity of the above-mentioned device.

[0052] In combination with the eighth aspect, in a possible implementation method, the above-mentioned first data packet is a data packet after security protection is performed by the second PDCP entity of the second terminal based on the above-mentioned LCID that meets the preset conditions, and the second PDCP entity of the second terminal corresponds to the first PDCP entity of the above-mentioned device.

[0053] In combination with the eighth aspect, in a possible implementation manner, the above-mentioned preset condition includes a first preset condition, and the size of the above-mentioned LCID meets the first preset condition.

[0054] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned first preset condition based on preset rules, and the preset rules are predefined.

[0055] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to receive first indication information from the second terminal, and the first indication information is used to instruct the above-mentioned device to use the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the above-mentioned first PDCP entity.

[0056] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned first preset condition based on the above-mentioned first indication information.

[0057] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-radio resource control RRC message.

[0058] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the LCID that meets the above-mentioned first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the above-mentioned two or more LCHs.

[0059] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned preset condition includes a second preset condition, and the configuration parameters of the LCH corresponding to the above-mentioned LCID meet the above-mentioned second preset condition.

[0060] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to receive second indication information from the above-mentioned second terminal, and the second indication information includes a target LCID. The second indication information is used to instruct the above-mentioned device to use the above-mentioned target LCID as an input parameter of the security algorithm of the above-mentioned first PDCP entity, and the target LCID is the LCID corresponding to the LCH determined by the above-mentioned second terminal that meets the above-mentioned second preset condition.

[0061] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned second preset condition based on the above-mentioned second indication information.

[0062] In combination with the eighth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned second indication information is carried in the second SLRB configuration information, and the second SLRB configuration information is carried in the PC5-RRC message.

[0063] In a ninth aspect of an embodiment of the present application, a communication device is provided, comprising: a processing unit, configured to determine a logical channel identifier LCID that meets preset conditions; a second packet data convergence protocol PDCP entity of the device is associated with two or more logical channels LCH; the processing unit is further configured to use the LCID as an input parameter of a security algorithm of the second PDCP entity to perform security protection on a first data packet; a transceiver unit is configured to send the first data packet after security protection to a first terminal; wherein the LCID is an input parameter when the first PDCP entity of the first terminal parses the first data packet, and the first PDCP entity of the first terminal corresponds to the second PDCP entity of the device.

[0064] In combination with the ninth aspect, in a possible implementation, the above-mentioned preset condition includes a first preset condition, and the size of the above-mentioned LCID meets the above-mentioned first preset condition.

[0065] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned first preset condition based on preset rules, and the preset rules are predefined.

[0066] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned first preset condition based on the size of the LCIDs corresponding to the above-mentioned two or more LCHs.

[0067] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to receive a third indication information from a network device, and the third indication information is used to instruct the above-mentioned device to use the LCID that meets the above-mentioned first preset condition as an input parameter of the security algorithm of the above-mentioned second PDCP entity.

[0068] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned first preset condition based on the above-mentioned third indication information.

[0069] In combination with the ninth aspect and the above-mentioned possible implementation manner, in another possible implementation manner, the above-mentioned third indication information also includes identification information of the above-mentioned first terminal.

[0070] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned third indication information is carried in the third sidelink radio bearer SLRB configuration information, and the third SLRB configuration information is carried in the radio resource control RRC message, the system message block SIB or the pre-configuration message.

[0071] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to send first indication information to the above-mentioned first terminal, and the first indication information is used to instruct the above-mentioned first terminal to use the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the first PDCP entity of the above-mentioned first terminal.

[0072] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-RRC message.

[0073] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the LCID that meets the above-mentioned first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the above-mentioned two or more LCHs.

[0074] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned preset condition includes a second preset condition, and the LCH configuration parameters corresponding to the above-mentioned LCID meet the above-mentioned second preset condition.

[0075] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned second preset condition based on the LCH configuration parameters of the above-mentioned two or more LCHs.

[0076] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to receive a fourth indication information from a network device, and the fourth indication information includes a target LCH configuration parameter. The fourth indication information is used to instruct the above-mentioned device to use the LCID that meets the above-mentioned second preset conditions as the input parameter of the security algorithm of the above-mentioned second PDCP entity, and the LCID that meets the above-mentioned second preset conditions is the LCID corresponding to the target LCH configuration parameter.

[0077] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned processing unit is specifically used to determine the LCID that meets the above-mentioned second preset condition based on the above-mentioned fourth indication information.

[0078] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned fourth indication information is carried in the fourth SLRB configuration information, and the fourth SLRB configuration information is carried in the RRC message, the system message block SIB or the pre-configuration message.

[0079] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned transceiver unit is also used to send second indication information to the above-mentioned first terminal, and the second indication information includes a target LCID. The second indication information is used to instruct the above-mentioned first terminal to use the above-mentioned target LCID as an input parameter of the security algorithm of the first PDCP entity of the above-mentioned first terminal, and the target LCID is the LCID corresponding to the LCH determined by the above-mentioned device that meets the above-mentioned second preset condition.

[0080] In combination with the ninth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned second indication information is carried in the second SLRB configuration information, and the second SLRB configuration information is carried in the PC5-RRC message.

[0081] In the tenth aspect of an embodiment of the present application, a communication device is provided, which includes: a processing unit, used to determine a preset condition; a transceiver unit, used to send an indication message to a second terminal, wherein the indication message is used to instruct the second terminal to use a logical channel identifier LCID that meets the preset condition as an input parameter of a security algorithm of a second packet data convergence protocol PDCP entity of the second terminal, wherein the second PDCP entity of the second terminal is associated with two or more logical channels LCH.

[0082] In combination with the tenth aspect, in a possible implementation method, the above-mentioned preset conditions include a first preset condition, and the size of the above-mentioned LCID meets the first preset condition; the above-mentioned indication information includes third indication information, and the third indication information is used to indicate that the above-mentioned second terminal will use the LCID that meets the above-mentioned first preset condition as the input parameter of the security algorithm of the second PDCP entity of the above-mentioned second terminal.

[0083] In combination with the tenth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned preset conditions include a second preset condition, and the configuration parameters of the LCH corresponding to the above-mentioned LCID meet the second preset condition; the above-mentioned indication information includes fourth indication information, and the fourth indication information is used to indicate that the above-mentioned second terminal will use the LCID that meets the second preset condition as the input parameter of the security algorithm of the second PDCP entity of the above-mentioned second terminal.

[0084] In combination with the tenth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned fourth indication information also includes a target LCH configuration parameter, and the above-mentioned LCID that meets the above-mentioned second preset condition is the LCID corresponding to the target LCH configuration parameter.

[0085] In combination with the tenth aspect and the above-mentioned possible implementation methods, in another possible implementation method, the above-mentioned indication information is carried in the sidelink radio bearer SLRB configuration information, and the SLRB configuration information is carried in the radio resource control RRC message, the system message block SIB or the pre-configuration message.

[0086] In the eleventh aspect of an embodiment of the present application, a communication device is provided, which includes: a processing unit, used to use the identifier SLRB ID of the first side link radio bearer as an input parameter of a security algorithm to perform security protection on a first data packet; a transceiver unit, used to send the above-mentioned first data packet after security protection to a first terminal, wherein the first data packet carries the above-mentioned first SLRB ID.

[0087] The twelfth aspect of an embodiment of the present application provides a communication device, which includes: a transceiver unit for receiving a first data packet from a second terminal, the first data packet including an identifier SLRB ID of a first sidelink radio bearer; and a processing unit for parsing the first data packet based on the first SLRB ID.

[0088] In combination with the eleventh aspect or the twelfth aspect, in a possible implementation manner, the first SLRB ID is carried in a header of the first data packet.

[0089] In the thirteenth aspect of an embodiment of the present application, a communication device is provided, which includes: a transceiver unit, used to send a first message to a first terminal, the first message carrying an identifier SLRB ID of a first sidelink radio bearer; the transceiver unit is also used to receive a second message from the first terminal, the second message is a message after security protection is performed by the first terminal based on the first SLRB ID; a processing unit, used to parse the second message based on the first SLRB ID.

[0090] In the fourteenth aspect of an embodiment of the present application, a communication device is provided, which includes: a transceiver unit, used to receive a first message from a second terminal, wherein the first message carries an identifier SLRB ID of a first sidelink radio bearer; a processing unit, used to perform security protection on the second message based on the first SLRB ID; the above-mentioned transceiver unit is also used to send the second message after security protection to the second terminal.

[0091] In combination with the thirteenth aspect or the fourteenth aspect, in a possible implementation manner, the first message is a PC5-S message, and the second message is a PC5-S message or a PC5-RRC message.

[0092] For the description of the effects of the above-mentioned eighth aspect and various implementation methods of the eighth aspect, reference may be made to the description of the corresponding effects of the first aspect and various implementation methods of the first aspect; for the description of the effects of the above-mentioned ninth aspect and various implementation methods of the ninth aspect, reference may be made to the description of the corresponding effects of the second aspect and various implementation methods of the second aspect; for the description of the effects of the above-mentioned tenth aspect and various implementation methods of the tenth aspect, reference may be made to the description of the corresponding effects of the third aspect and various implementation methods of the third aspect; for the description of the effects of the above-mentioned eleventh aspect and various implementation methods of the eleventh aspect, reference may be made to the description of the corresponding effects of the fourth aspect and various implementation methods of the fourth aspect; for the description of the effects of the above-mentioned twelfth aspect and various implementation methods of the twelfth aspect, reference may be made to the description of the corresponding effects of the fifth aspect and various implementation methods of the fifth aspect; for the description of the effects of the above-mentioned thirteenth aspect and various implementation methods of the thirteenth aspect, reference may be made to the description of the corresponding effects of the sixth aspect and various implementation methods of the sixth aspect; for the description of the effects of the above-mentioned fourteenth aspect and various implementation methods of the fourteenth aspect, reference may be made to the description of the corresponding effects of the seventh aspect and various implementation methods of the seventh aspect, and they will not be repeated here.

[0093] According to a fifteenth aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program code is stored. When the computer program code runs on a processor, the processor executes the communication method described in any one of the above aspects.

[0094] In a sixteenth aspect of the embodiments of the present application, a computer program product is provided, which stores computer software instructions executed by the above-mentioned processor, and the computer software instructions include a program for executing the communication method described in any of the above aspects.

[0095] In the seventeenth aspect of the embodiments of the present application, a communication device is provided, which includes a processor and may also include a transceiver and a memory, wherein the transceiver is used to send and receive information, or to communicate with other network devices; the memory is used to store computer-executable instructions; and the processor is used to execute the computer-executable instructions to implement the communication method described in any of the above aspects.

[0096] In the eighteenth aspect of the embodiments of the present application, a communication device is provided. The device can exist in the form of a chip product. The structure of the device includes a processor and can also include a memory. The memory is used to couple with the processor to store program instructions and data necessary for the device. The processor is used to execute the program instructions stored in the memory to support a terminal device or a network device to execute the communication method described in any of the above aspects.

[0097] In the nineteenth aspect of the embodiments of the present application, a communication device is provided. The device can exist in the form of a chip product. The structure of the device includes a processor and an interface circuit. The processor is used to communicate with other devices through a receiving circuit, so that the device executes the communication method described in any one of the above aspects.

[0098] The twentieth aspect of an embodiment of the present application provides a communication system, including a first terminal and a second terminal, wherein the first terminal is used to execute the communication method described in the first aspect, and the second terminal is used to execute the communication method described in the second aspect.

[0099] In the twenty-first aspect of an embodiment of the present application, a communication system is provided, including a first terminal, a second terminal and a network device, wherein the first terminal is used to execute the communication method described in the first aspect, the second terminal is used to execute the communication method described in the second aspect, and the network device is used to execute the communication method described in the third aspect.

[0100] In the twenty-second aspect of an embodiment of the present application, a communication system is provided, including a first terminal and a second terminal, wherein the second terminal is used to execute the communication method described in the fourth aspect, and the first terminal is used to execute the communication method described in the fifth aspect.

[0101] In the twenty-third aspect of an embodiment of the present application, a communication system is provided, including a first terminal and a second terminal, wherein the second terminal is used to execute the communication method described in the sixth aspect, and the first terminal is used to execute the communication method described in the seventh aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0102] Figure 1 A schematic diagram of a V2X communication scenario provided in an embodiment of the present application;

[0103] Figure 2 A schematic diagram of the structure of a communication device provided in an embodiment of the present application;

[0104] Figure 3 A schematic diagram of PDCP duplication provided in an embodiment of the present application;

[0105] Figure 4 A flow chart of a communication method provided in an embodiment of the present application;

[0106] Figure 5 A flowchart of another communication method provided in an embodiment of the present application;

[0107] Figure 6 A flowchart of another communication method provided in an embodiment of the present application;

[0108] Figure 7A flowchart of another communication method provided in an embodiment of the present application;

[0109] Figure 8 A flowchart of another communication method provided in an embodiment of the present application;

[0110] Fig. 9 A flowchart of another communication method provided in an embodiment of the present application;

[0111] Fig.10 A flowchart of another communication method provided in an embodiment of the present application;

[0112] Fig.11 A schematic diagram of an application in which an SLRB ID is an input parameter of a security algorithm provided in an embodiment of the present application;

[0113] Fig.12 Another application schematic diagram provided in an embodiment of the present application when the SLRB ID is an input parameter of the security algorithm;

[0114] Fig.13 A schematic diagram of the composition of a communication device provided in an embodiment of the present application;

[0115] Fig.14 A schematic diagram of another communication device provided in an embodiment of the present application;

[0116] Fig.15 A schematic diagram of another communication device provided in an embodiment of the present application;

[0117] Fig.16 A schematic diagram of the composition of a first terminal provided in an embodiment of the present application;

[0118] Fig.17 A schematic diagram of the composition of a second terminal provided in an embodiment of the present application;

[0119] Fig.18 A schematic diagram of the composition of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0120] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b and c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order. For example, the "first" in the first terminal and the "second" in the second terminal in the embodiments of the present application are only used to distinguish different terminal devices.

[0121] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0122] The present invention provides a communication method for Figure 1 In the V2X communication scenario shown in Figure 1 As shown, the first terminal and the second terminal communicate via a sidelink (SL), which refers to an auxiliary link in a V2X network. In addition to the auxiliary link, the V2X network also includes an uplink (UL) and a downlink (DL). Exemplarily, V2X communication includes vehicle-to-vehicle communication (V2V), vehicle-to-roadside infrastructure communication (V2I), vehicle-to-people communication (V2P), and vehicle-to-application server communication (V2N). Figure 1In the example, only the V2V communication in which both the first terminal and the second terminal are vehicles is used for illustration, and the specific communication scenario of V2X is not limited in the embodiment of the present application. For example, the first terminal and the second terminal can be mutual communication between vehicle-mounted devices, or communication between a road side unit (RSU) and a vehicle-mounted device and / or a network device (such as a base station device), or communication between a network device (such as a base station device) and a vehicle-mounted device and / or RSU, etc. The network device (can be an LTE base station device or an NR base station device or a base station in a subsequent evolution system. It can be understood that the embodiment of the present application does not limit the specific form of the first terminal and the second terminal, and is only illustrative here. For example, Figure 1 The access network device in the network may be a base station, or a device in a network that provides wireless access.

[0123] Figure 1 The V2X communication architecture shown includes two communication interfaces, namely, the PC5 interface and the Uu interface. The V2X PC5 interface is a direct communication interface between V2X terminals. V2X Uu interface communication is a communication mode in which the sending V2X terminal (e.g., the second terminal) sends V2X data to the access network device (e.g., the base station) through the Uu interface, and then sends it to the V2X application server for processing through the access network device, and then the V2X application server sends it to the access network device, and then sends it to the receiving V2X terminal (e.g., the first terminal) through the access network device. In the V2X Uu interface communication mode, the access network device that forwards the uplink data from the terminal to the server and the access network device that forwards the downlink data sent from the server to the receiving terminal can be the same access network device or different access network devices, which can be determined by the V2X application server.

[0124] Figure 2A communication device provided for an embodiment of the present application, the communication device may be the first terminal or the second terminal in the present application. The communication device may be a vehicle; or it may be an on-board communication device or a on-board terminal installed on a vehicle to assist the vehicle in driving, or a chip in the on-board communication device or the on-board terminal. Among them, the on-board terminal may be a device for realizing a wireless communication function, such as a terminal or a chip that can be used in a terminal, etc. Among them, the terminal may be a user equipment (UE), an access terminal, a terminal unit, a terminal station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a wireless communication device, a terminal agent or a terminal device, etc. in a 5G network or a future evolved public land mobile network (PLMN). The access terminal may be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device or a wearable device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The vehicle-mounted terminal may be mobile or fixed.

[0125] like Figure 2 As shown, the communication device 200 includes at least one processor 201 , a memory 202 , a transceiver 203 , and a communication bus 204 .

[0126] Combine the following Figure 2 The following is a detailed introduction to the components of the communication equipment:

[0127] The processor 201 is the control center of the communication device, and can be a processor or a general term for multiple processing elements. For example, the processor 201 is a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).

[0128] The processor 201 may execute various functions of the communication device by running or executing software programs stored in the memory 202 and calling data stored in the memory 202 .

[0129] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as Figure 2 CPU0 and CPU1 are shown in the figure.

[0130] In a specific implementation, as an embodiment, the communication device may include multiple processors, such as Figure 2 201 and processor 205 shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more communication devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0131] The memory 202 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 202 may exist independently and be connected to the processor 201 via the communication bus 204. The memory 202 may also be integrated with the processor 201.

[0132] The memory 202 is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor 201.

[0133] The transceiver 203 is used to communicate with other communication devices. Of course, the transceiver 203 can also be used to communicate with a communication network, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The transceiver 203 can include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.

[0134] The communication bus 204 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0135] Figure 2 The communication device structure shown in the figure does not constitute a limitation on the communication device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0136] In V2X, before D2D performs unicast communication, PC5-S connection establishment and security establishment must be performed. After the PC5-S connection establishment and security establishment are completed, the subsequent corresponding AS layer data transmission and PC5-S message transmission can be protected based on the security algorithm negotiated by the sending and receiving UE when the PC5-S connection is established.

[0137] When the input of the security algorithm of the AS layer is LCID, PDCP duplication can be introduced to improve the reliability of service transmission. Figure 3 As shown, after the PDCP entity performs security algorithm operations (e.g., integrity protection and encryption operations) on a PDCP packet, it will copy and transmit the PDCP packet to multiple radio link control (RLC) entities. Figure 3 The two RLC entities process the packets independently and transmit them to the medium access control (MAC) layer through two LCHs. For MAC, the packets transmitted by the two RLC entities are two independent packets. The MAC layer cannot identify whether they are data packets transmitted by PDCP duplication. The MAC layer only needs to schedule according to the algorithm. It should be noted that a PDCP entity can also be associated with more RLC entities / LCHs. Figure 3 In the figure, only one PDCP entity is associated with two RLC entities / LCHs as an example for illustration.

[0138] Since LCID is required as an input parameter of the security algorithm when executing the security algorithm, and when PDCPduplication is introduced, a PDCP entity can be associated with multiple LCHs, and the multiple LCHs correspond to different LCIDs. Therefore, when executing the security algorithm, the PDCP entities corresponding to the sender UE and the receiver UE may use different LCIDs as input parameters of the security algorithm, which will cause the receiver UE to be unable to correctly parse the data packet sent by the sender UE, causing the receiver UE to fail to receive data, resulting in the SL between the sender UE and the receiver UE not being able to communicate normally.

[0139] In order to solve the problem that when the PDCP entity of the transmitting and receiving UE is associated with multiple LCHs, it cannot ensure that the input parameters of the transmitting and receiving UE when the corresponding PDCP entity executes the security algorithm are consistent, resulting in SL communication failure. The embodiment of the present application provides a communication method, which can ensure that the input parameters of the transmitting and receiving UE when the corresponding PDCP entity executes the security algorithm remain consistent, ensure that the SL can communicate normally, and improve the reliability of communication.

[0140] Combination Figure 1-Figure 3 ,like Figure 4 As shown, a communication method provided in an embodiment of the present application includes steps S401-S406.

[0141] S401. The second terminal determines a first LCID that meets a preset condition.

[0142] The second PDCP entity of the second terminal is associated with two or more LCHs, and one LCH may correspond to one LCID. The LCID corresponding to each LCH may be allocated by the second terminal or obtained through negotiation between the second terminal and the first terminal.

[0143] Exemplarily, the second terminal may include one or more second PDCP entities, and a second PDCP entity may be associated with two or more LCHs, and the number of LCHs associated with different second PDCP entities may be the same or different. The embodiment of the present application does not limit the number of second PDCP entities included in the second terminal, and the specific number of LCHs associated with each second PDCP entity. When the second terminal includes multiple second PDCP entities, each second PDCP entity may correspond to a first LCID, and the first LCID may be an LCID that meets preset conditions among the LCIDs corresponding to the multiple LCHs associated with the first PDCP, and the first LCID is an input parameter for the second PDCP entity to execute a security algorithm. It should be noted that the first LCID described in the embodiment of the present application is an input parameter for the second PDCP entity to execute a security algorithm, which means that the first LCID is an input parameter when the second PDCP entity executes a security algorithm, and the second PDCP entity may also include other input parameters when executing the security algorithm.

[0144] It should be noted that the LCID is unique within a unicast connection communication. That is to say, within a unicast connection communication where the sender ID and the receiver ID are the same, the LCID corresponding to the LCH associated with the PDCP entity of the sender / receiver is unique. Exemplarily, the sender ID and the receiver ID are layer 2 identifiers L2ID. For example, the second terminal is UE1, the first terminal is UE2, UE1 includes 2 second PDCP entities, one second PDCP entity is associated with 2 LCHs, and the other second PDCP entity is associated with 3 LCHs, UE2 includes 2 first PDCP entities, one first PDCP entity is associated with 2 LCHs, and the other first PDCP entity is associated with 3 LCHs. For example, in the unicast connection communication between UE1 and UE2, the LCIDs corresponding to the 5 LCHs associated with the two second PDCP entities of UE1 are different from each other, and the LCID corresponding to each LCH is unique in the unicast connection communication between UE1 and UE2. It can be understood that the two second PDCP entities of UE1 correspond to the two first PDCP entities of UE2 respectively, and the LCID corresponding to the LCH associated with the second PDCP entity of UE1 is the same as the LCID corresponding to the LCH associated with the first PDCP entity corresponding to the second PDCP entity in UE2.

[0145] Exemplarily, the preset condition may include a first preset condition. The size of the first LCID meets the first preset condition. The first LCID may be an LCID whose size meets the first preset condition among the LCIDs corresponding to two or more LCHs associated with the second PDCP entity of the second terminal.

[0146] Exemplarily, the above-mentioned first preset condition can be the largest LCID, the smallest LCID, the second largest LCID or the second smallest LCID. For example, when the first preset condition is the largest LCID, the first LCID is the largest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity of the second terminal. When the first preset condition is the smallest LCID, the first LCID is the smallest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity of the second terminal. When the first preset condition is the second smallest LCID, the first LCID is the second smallest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity of the second terminal. When the first preset condition is the second largest LCID, the first LCID is the second largest LCID among the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity of the second terminal. The embodiment of the present application does not limit the first preset condition that the size of the first LCID specifically meets. The following embodiment is only illustrated by taking the size of the first LCID as the largest or smallest.

[0147] In a first implementation, the above step S401 may include: the second terminal determines the first LCID that meets the first preset condition based on a preset rule. The preset rule is a predefined rule. For example, the preset rule may be a rule specified by a protocol, and the second terminal may determine the first LCID that meets the first preset condition based on the rule specified by the protocol.

[0148] For example, the protocol may stipulate that the largest LCID or the smallest LCID among the LCIDs corresponding to two or more LCHs associated with the PDCP entity is used as an input parameter of the security algorithm of the PDCP entity. In this implementation, if the second terminal includes multiple second PDCP entities, each second PDCP entity determines the largest LCID or the smallest LCID among the LCIDs corresponding to its associated LCH as the first LCID, and the first LCID is the input parameter of the security algorithm of the second PDCP entity. That is, all second PDCP entities included in the second terminal determine the LCIDs corresponding to their associated LCHs based on the preset rule, and the size of the LCIDs meets the first preset condition.

[0149] It can be understood that in this implementation, the second terminal and the first terminal can both determine to use one of the multiple LCIDs as the input parameter of the security algorithm based on the preset rules specified in the protocol, and the LCIDs of the second terminal and the first terminal correspond one to one, so the second terminal and the first terminal are based on this rule, and when the corresponding PDCP entity executes the security algorithm, the input parameters of the security algorithm are the same. In this implementation, the consistency of the input parameters of the second terminal and the first terminal when the corresponding PDCP entity executes the security algorithm can be ensured without the need for the second terminal and the first terminal to interact with this rule.

[0150] In a second implementation, the above step S401 may include: the second terminal determines the first LCID that meets the first preset condition based on the size of the LCIDs corresponding to the two or more LCHs. Exemplarily, in this implementation, the second terminal may autonomously determine to use one of the multiple LCIDs as an input parameter of the security algorithm based on the size of the LCID.

[0151] In this implementation, the AS layer of the second terminal or the upper layer of the second terminal may determine to use one of the LCIDs corresponding to the multiple LCHs associated with the second PDCP entity as an input parameter of the security algorithm of the second PDCP entity. The above-mentioned AS layer may include one or more of a PDCP layer, an RLC layer, a MAC layer, a physical (physical, PHY) layer, a service data adaptation layer (service data adaptation protocol, SDAP), and a radio resource control (radio resource control, RRC) layer. The upper layer of the second terminal may be a layer above the AS layer of the second terminal, for example, a PC5-S layer of the second terminal or a V2X layer of the second terminal.

[0152] Exemplarily, in this implementation, when the second terminal includes multiple second PDCP entities, the size of the first LCID corresponding to all second PDCP entities in the second terminal can satisfy the same first preset condition. For example, the second terminal can determine the smallest LCID among the LCIDs corresponding to the LCH associated with each second PDCP entity as the first LCID corresponding to the PDCP entity. For another example, the second terminal can also determine the largest LCID among the LCIDs corresponding to the LCH associated with each second PDCP entity as the first LCID corresponding to the PDCP entity.

[0153] Exemplarily, in this implementation, when the second terminal includes multiple second PDCP entities, the sizes of the first LCIDs corresponding to different second PDCP entities in the second terminal may also meet different first preset conditions. For example, the second terminal includes two second PDCP entities, namely PDCP1 and PDCP2. The second terminal may determine the smallest LCID among the LCIDs corresponding to the LCH associated with PDCP1 as the first LCID corresponding to PDCP1, that is, use the smallest LCID among the LCIDs corresponding to the LCH associated with PDCP1 as the input parameter of the security algorithm of PDCP1. Determine the largest LCID among the LCIDs corresponding to the LCH associated with PDCP2 as the first LCID corresponding to PDCP2, that is, use the largest LCID among the LCIDs corresponding to the LCH associated with PDCP2 as the input parameter of the security algorithm of PDCP2. That is, for different second PDCP entities of the second terminal, the size of the first LCID may meet different first preset conditions.

[0154] It should be noted that the embodiment of the present application does not limit whether the first LCIDs corresponding to different second PDCP entities of the second terminal meet the same first preset condition.

[0155] It can be understood that in this implementation, after the second terminal determines that the LCID that meets the first preset condition is determined as the first LCID, it can send an indication message to the first terminal to inform the corresponding first PDCP entity in the first terminal of the LCID that serves as the input parameter of the security algorithm of the first PDCP entity, so as to ensure that the input parameters of the second terminal and the first terminal remain consistent when the corresponding PDCP entities execute the security algorithm.

[0156] In a third implementation, the above step S401 may also include: the second terminal receives a third indication message from the network device, and the third indication message is used to instruct the second terminal to use the LCID that meets the first preset condition as an input parameter of the security algorithm of the second PDCP entity. Correspondingly, the above step S401 includes: the second terminal determines the first LCID that meets the first preset condition based on the third indication message. Exemplarily, the above network device may be an access network device or a core network device, which is not limited in the embodiments of the present application.

[0157] Exemplarily, take the example that the third indication information indicates that the second terminal uses the smallest LCID as the input parameter of the security algorithm of the second PDCP entity. The second terminal can determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with the second PDCP as the LCID that meets the first preset condition based on the third indication information. That is, the second terminal can determine the LCID that meets the first preset condition based on the third indication information of the network device.

[0158] Exemplarily, take the first preset condition of minimum LCID as an example. The third indication information may instruct the second terminal to determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with each second PDCP entity as the input parameter of the security algorithm of the second PDCP entity. The third indication information may also instruct the second terminal to determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with a certain second PDCP entity as the input parameter of the security algorithm of the second PDCP entity. That is, the granularity indicated by the third indication information may be for all second PDCP entities of the second terminal or for a certain second PDCP entity. When the granularity indicated by the third indication information is for a certain second PDCP entity, the size of the first LCID corresponding to different second PDCP entities may meet different first preset conditions.

[0159] Optionally, the third indication information may also include the first LCID. That is, the network device instructs the second terminal through the third indication information to use the first LCID that meets the preset conditions and is determined by the network device as an input parameter of the security algorithm of the second PDCP entity of the second terminal.

[0160] Exemplarily, the third indication information may be carried in the third side link radio bearer (SLRB) configuration information, and the third SLRB configuration information may include one or more of service data adaptation protocol (SDAP) configuration information, PDCP configuration information, radio link control (RLC) configuration information, LCH configuration information, SLRB ID / index, and LCID / LCH index. When the third indication information may be carried in the third SLRB configuration information, the third indication information in the third SLRB configuration information is used to instruct the second terminal to determine the LCID corresponding to two or more LCHs associated with the second PDCP entity corresponding to the SLRB, the LCID whose size meets the first preset condition, as the input parameter of the security algorithm of the second PDCP entity.

[0161] It can be understood that SLRB index is the index corresponding to SLRB configuration information, and LCH index is the index corresponding to LCH configuration.

[0162] Exemplarily, the third SLRB configuration information may be carried in an RRC message, a system information block (SIB) or a pre-configured message.

[0163] Optionally, the third indication information may also include identification information of the first terminal. When the third indication information includes the identification information of the first terminal, the third indication information is specifically used to instruct the second terminal to use the LCID that meets the first preset condition in the unicast connection communication between the second terminal and the first terminal as the input parameter of the security algorithm of the second PDCP entity. It can be understood that in different unicast connection communications of the second terminal, the LCIDs corresponding to the LCHs associated with different PDCP entities of the second terminal may be the same. When the network device instructs the second terminal to use the LCID that meets the first preset condition as the input parameter of the security algorithm of the PDCP entity of the second terminal, it may instruct the second terminal to use the LCID that meets the condition in a certain unicast connection communication as the input parameter of the security algorithm of the PDCP entity of the second terminal. Exemplarily, the identification information of the first terminal may be the source layer 2 identifier (source L2 ID) of the first terminal.

[0164] It is understandable that when the third indication information does not include the identification information of the first terminal, the second terminal may not distinguish whether it is a specific unicast connection when determining the LCID that meets the first preset condition. For example, taking the first preset condition as the smallest LCID as an example, the second terminal may use the smallest LCID among the LCIDs corresponding to the LCH associated with each second PDCP entity of the second terminal in the unicast connection between it and the first terminal as the input parameter for the second PDCP entity to execute the security algorithm. For another example, the second terminal may also use the smallest LCID among the LCIDs corresponding to the LCH associated with each second PDCP entity of the second terminal in the unicast connection between it and the third terminal as the input parameter for the second PDCP entity to execute the security algorithm. That is to say, when determining the first LCID, the second terminal does not distinguish between different unicast connections.

[0165] Exemplarily, the above-mentioned preset condition may include a second preset condition. The LCH configuration parameters corresponding to the above-mentioned first LCID meet the second preset condition. That is, the first LCID may be the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among two or more LCHs associated with the second PDCP entity of the second terminal.

[0166] Exemplarily, the above-mentioned LCH configuration parameters may include one or more of the following parameters: priority of LCH, logical channel identifier LCID, priority bit rate (PBR), bucket size duration (BSD), carrier (allowed carriers), subcarrier spacing (SCS), maximum physical sidelink shared channel (PSSCH) support time (maxPSSCH-duration), configured grant type (configured grant type1 allowed, CG), logical channel group identifier (LCG ID), scheduling request ID (SR ID), etc. For example, the above-mentioned second preset condition may be that LCH has the highest priority. For another example, the above-mentioned second preset condition may also be an LCH associated with a CG or an LCH associated with a certain CG. The embodiment of the present application does not limit the specific parameters contained in the LCH configuration parameters and the specific content of the second preset conditions, which are only exemplified here. It should be understood that the LCH configuration parameters may be in the form of a list or a set, for example, the SCS parameter in an LCH configuration parameter is an SCS list.

[0167] In a fourth implementation, the above step S401 may include: the second terminal determines the first LCID that meets the second preset condition based on a preset rule. The preset rule is a predefined rule. The predefined in this application can be understood as definition, pre-definition, storage, pre-storage, pre-negotiation, pre-configuration, solidification, or pre-burning. For example, the preset rule may be a rule specified in a protocol, and the second terminal may determine the LCID that meets the second preset condition based on the rule specified in the protocol.

[0168] For example, the protocol may stipulate that the LCID corresponding to the LCH with the highest priority among the two or more LCHs associated with the second PDCP entity of the second terminal is used as the input parameter of the security algorithm of the second PDCP entity. In this implementation, if the second terminal includes multiple second PDCP entities, each second PDCP entity uses the LCID corresponding to the LCH with the highest priority among its associated LCHs as the input parameter of the security algorithm of the second PDCP entity. That is, all second PDCP entities included in the second terminal determine, based on the preset rule, the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among its associated LCHs.

[0169] It can be understood that in this implementation, both the second terminal and the first terminal can determine the LCID as the input parameter of the security algorithm based on the preset rules specified in the protocol, and the LCH associated with the PDCP entity of the second terminal corresponds to the LCH associated with the PDCP entity of the first terminal. Therefore, based on this rule, when the corresponding PDCP entities execute the security algorithm, the input parameters of the security algorithm are the same for the second terminal and the first terminal. In this implementation, the consistency of the input parameters of the second terminal and the first terminal when the corresponding PDCP entities execute the security algorithm can be ensured without the need for the second terminal and the first terminal to interact with this rule.

[0170] In a fifth implementation, the above step S401 may include: the second terminal determines the first LCID that meets the second preset condition based on the LCH configuration parameters of two or more LCHs. Exemplarily, in this implementation, the second terminal may autonomously determine the LCID as an input parameter of the security algorithm based on the LCH configuration parameters.

[0171] Exemplarily, in this implementation, when the second terminal includes multiple second PDCP entities, the second terminal may use the LCID corresponding to the LCH that meets the second preset condition in the LCH configuration parameters of the LCH associated with each second PDCP entity as the input parameter of the security algorithm of the second PDCP entity. The second terminal may also use the LCID corresponding to the LCH that meets different second preset conditions in the LCH configuration parameters of the LCH associated with different PDCP entities as the input parameter of the security algorithm of the second PDCP entity. In other words, the LCH configuration parameters of the first LCID corresponding to all second PDCP entities in the second terminal may meet the same second preset condition. The LCH configuration parameters of the first LCID corresponding to different second PDCP entities in the second terminal may also meet different second preset conditions.

[0172] For example, the second terminal may determine the LCID corresponding to the LCH with the highest priority in the LCH configuration parameters of each LCH associated with the second PDCP entity as the first LCID corresponding to the PDCP entity. For another example, the second terminal includes two second PDCP entities, namely PDCP1 and PDCP2. The second terminal may determine the LCID corresponding to the LCH with the highest priority in the configuration parameters of the LCH associated with PDCP1 as the first LCID corresponding to PDCP1, that is, use the LCID corresponding to the LCH with the highest priority in the configuration parameters of the LCH associated with PDCP1 as the input parameter of the security algorithm of PDCP1. Determine the LCID corresponding to the LCH associated with CG in the configuration parameters of the LCH associated with PDCP2 as the first LCID corresponding to PDCP2, that is, use the LCID corresponding to the LCH associated with CG in the configuration parameters of the LCH associated with PDCP2 as the input parameter of the security algorithm of PDCP2.

[0173] It should be noted that the embodiment of the present application does not limit whether the second preset condition met by the first LCID corresponding to different second PDCP entities of the second terminal is the same.

[0174] It can be understood that in this implementation, after the second terminal determines that the LCID that meets the second preset condition is determined as the first LCID, it can send an indication message to the first terminal to inform the corresponding first PDCP entity in the first terminal to use the LCID as the input parameter of the security algorithm of the first PDCP entity, so as to ensure that the input parameters of the second terminal and the first terminal remain consistent when the corresponding PDCP entities execute the security algorithm.

[0175] In the sixth implementation, the above step S401 may also include: the second terminal receives a fourth indication message from the network device, the fourth indication message includes a target LCH configuration parameter, and the fourth indication message is used to instruct the second terminal to use the LCID that meets the second preset condition as the input parameter of the security algorithm of the second PDCP entity, and the LCID that meets the second preset condition is the LCID corresponding to the target LCH configuration parameter. Accordingly, the above step S401 includes: the second terminal determines the first LCID that meets the second preset condition based on the fourth indication message. Exemplarily, the above network device may be an access network device or a core network device, which is not limited in this embodiment of the present application.

[0176] Exemplarily, take the fourth indication information indicating that the second terminal uses the LCID corresponding to the LCH with the highest priority as the input parameter of the security algorithm of the second PDCP entity. The second terminal can determine the LCID corresponding to the LCH with the highest priority among the LCH configuration parameters of two or more LCHs associated with the first PDCP as the LCID that meets the second preset condition based on the fourth indication information. That is, the second terminal can determine the LCID that meets the second preset condition based on the fourth indication information of the network device.

[0177] Exemplarily, take the second preset condition that the LCH has the highest priority as an example. The fourth indication information may instruct the second terminal to determine the LCID corresponding to the LCH with the highest priority among the LCH configuration parameters of two or more LCHs associated with each second PDCP entity as the input parameter of the security algorithm of the second PDCP entity. The fourth indication information may also instruct the second terminal to determine the LCID corresponding to the LCH with the highest priority among the LCH configuration parameters of two or more LCHs associated with a certain second PDCP entity as the input parameter of the security algorithm of the second PDCP entity. That is, the granularity indicated by the fourth indication information may be for all second PDCP entities of the second terminal or for a certain second PDCP entity. When the granularity indicated by the fourth indication information is for a certain second PDCP entity, the LCH configuration parameters of the first LCID corresponding to different second PDCP entities may meet different second preset conditions.

[0178] Exemplarily, the fourth indication information may be carried in the fourth SLRB configuration information, and the fourth SLRB configuration information may include one or more of SDAP configuration information, PDCP configuration information, RLC configuration information, LCH configuration information, SLRB ID / index, and LCID / LCH index. When the fourth indication information is carried in the fourth SLRB configuration information, the fourth indication information in the fourth SLRB configuration information is used to instruct the second terminal to determine the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among the two or more LCHs associated with the second PDCP entity corresponding to the SLRB as the input parameter of the security algorithm of the second PDCP entity.

[0179] Exemplarily, the fourth SLRB configuration information may be carried in an RRC message, SIB or pre-configuration message.

[0180] It can be understood that in this embodiment, the second terminal can determine the LCID that meets the preset conditions through various implementation methods, and the embodiment of the present application does not limit which of the above methods the second terminal uses to determine the LCID that meets the preset conditions.

[0181] S402: The first terminal determines a second LCID that meets a preset condition.

[0182] The first PDCP entity of the first terminal is associated with two or more LCHs. The first PDCP entity of the first terminal corresponds to the second PDCP entity of the second terminal. The LCH associated with the first PDCP entity of the first terminal corresponds to the LCH associated with the second PDCP entity of the second terminal.

[0183] Exemplarily, the preset condition in the above step S402 may be the same as the preset condition in step S401. Therefore, for a corresponding group of PDCP entities in the second terminal and the first terminal, the second LCID that meets the preset condition and is determined by the first terminal in step S402 is the same as the first LCID that meets the preset condition and is determined by the second terminal in step S401. The second LCID that meets the preset condition can be used as an input parameter for the first PDCP entity of the first terminal to execute a security algorithm. In other words, the first LCID determined by the second terminal in step S401 as an input parameter for the security algorithm of the second PDCP entity is the same as the second LCID determined by the first terminal in step S402 as an input parameter for the security algorithm of the first PDCP entity.

[0184] Exemplarily, the above-mentioned preset condition may include a first preset condition. The size of the second LCID meets the first preset condition. The second LCID may be an LCID whose size meets the first preset condition among the LCIDs corresponding to two or more LCHs associated with the first PDCP entity of the first terminal.

[0185] Exemplarily, the above-mentioned first preset condition can be the largest LCID, the smallest LCID, the second largest LCID or the second smallest LCID. For example, when the first preset condition is the largest LCID, the second LCID is the largest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity of the first terminal. When the first preset condition is the smallest LCID, the second LCID is the smallest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity of the first terminal. When the first preset condition is the second smallest LCID, the second LCID is the second smallest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity of the first terminal. When the first preset condition is the second largest LCID, the second LCID is the second largest LCID among the LCIDs corresponding to the two or more LCHs associated with the first PDCP entity of the first terminal. The embodiment of the present application does not limit the first preset condition that the size of the second LCID specifically meets. It should be noted that the first preset condition that the size of the second LCID meets is the same as the first preset condition that the size of the first LCID meets in the aforementioned step.

[0186] In a first implementation, the above step S402 may include: the first terminal determines the second LCID that meets the first preset condition based on a preset rule. The preset rule is a predefined rule. For example, the preset rule may be a rule specified by a protocol, and the first terminal may determine the second LCID that meets the first preset condition based on the rule specified by the protocol.

[0187] For example, the protocol may stipulate that the largest LCID or the smallest LCID among the LCIDs corresponding to two or more LCHs associated with the terminal's PDCP entity is used as an input parameter of the security algorithm of the PDCP entity. In this implementation, if the first terminal includes multiple first PDCP entities, then each first PDCP entity uses the largest LCID or the smallest LCID among the LCIDs corresponding to its associated LCH as an input parameter of the security algorithm of the first PDCP entity. That is, all first PDCP entities included in the first terminal determine, based on the preset rule, the second LCID whose size meets the first preset condition among the LCIDs corresponding to its associated LCH.

[0188] It should be noted that when the protocol stipulates that the maximum or minimum LCID shall be used as the input parameter of the security algorithm, all terminals can, based on this provision, determine the maximum or minimum LCID among the LCIDs corresponding to multiple LCHs associated with the PDCP entity of the terminal as the input parameter of the security algorithm of the PDCP entity.

[0189] It can be understood that in this implementation, the second terminal and the first terminal can determine the LCID as the input parameter of the security algorithm based on the same preset rule specified in the protocol, and the LCIDs of the second terminal and the first terminal correspond one to one. Therefore, based on the rule, when the corresponding PDCP entity executes the security algorithm, the input parameters of the security algorithm are the same for the second terminal and the first terminal. This ensures the consistency of the input parameters of the second terminal and the first terminal when the corresponding PDCP entity executes the security algorithm.

[0190] In a second implementation, the above step S402 may also include: the first terminal receives a first indication message from the second terminal, the first indication message is used to indicate that the first terminal uses the LCID that meets the first preset condition as an input parameter of the security algorithm of the first PDCP entity. Correspondingly, the above step S402 includes: the first terminal determines the second LCID that meets the first preset condition based on the first indication message.

[0191] Exemplarily, take the example that the first indication information indicates that the first terminal uses the smallest LCID as the input parameter of the security algorithm of the first PDCP entity. The first terminal can determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with the second PDCP as the second LCID that meets the first preset condition based on the first indication information. That is, the first terminal can determine the second LCID that meets the first preset condition based on the first indication information of the second terminal.

[0192] Optionally, the first indication information may further include a first LCID, that is, the second terminal directly instructs the first terminal through the first indication information to use the first LCID that meets the preset conditions and is determined by the second terminal as an input parameter of the security algorithm of the first PDCP entity of the first terminal.

[0193] Exemplarily, take the first preset condition of minimum LCID as an example. The above-mentioned first indication information may instruct the first terminal to determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with each first PDCP entity as the input parameter of the security algorithm of the first PDCP entity. The above-mentioned first indication information may also instruct the first terminal to determine the smallest LCID among the LCIDs corresponding to two or more LCHs associated with a certain first PDCP entity as the input parameter of the security algorithm of the first PDCP entity. That is, the granularity indicated by the first indication information may be for all first PDCP entities of the first terminal, or for a certain first PDCP entity. When the granularity indicated by the first indication information is for a certain first PDCP entity, the size of the second LCID corresponding to different first PDCP entities may meet different first preset conditions.

[0194] Exemplarily, the above-mentioned first indication information may be carried in the first SLRB configuration information, and the first SLRB configuration information may include one or more of SDAP configuration information, PDCP configuration information, RLC configuration information, LCH configuration information, SLRB ID / index, and LCID / LCH index. When the first indication information is carried in the first SLRB configuration information, the first indication information in the first SLRB configuration information is used to instruct the first terminal to determine the LCID corresponding to two or more LCHs associated with the first PDCP entity corresponding to the SLRB, and the LCID whose size meets the first preset condition, as the input parameter of the security algorithm of the first PDCP entity.

[0195] Exemplarily, the above-mentioned first SLRB configuration information can be carried in a PC5-RRC message.

[0196] Exemplarily, the above-mentioned preset condition may include a second preset condition. The LCH configuration parameters corresponding to the above-mentioned second LCID meet the second preset condition. That is, the second LCID may be the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among two or more LCHs associated with the first PDCP entity of the first terminal. For the specific content of the LCH configuration parameters and the second preset condition, please refer to the relevant description in step S401, which will not be repeated here.

[0197] In a third implementation, the above step S402 may include: the first terminal determines the second LCID that meets the second preset condition based on a preset rule. The preset rule is a predefined rule. For example, the preset rule may be a rule specified by a protocol, and the first terminal may determine the second LCID that meets the second preset condition based on the rule specified by the protocol.

[0198] For example, the protocol may stipulate that the LCID corresponding to the LCH with the highest priority among two or more LCHs associated with the PDCP entity is used as an input parameter of the security algorithm of the PDCP entity. In this implementation, if the first terminal includes multiple first PDCP entities, then each first PDCP entity uses the LCID corresponding to the LCH with the highest priority among its associated LCHs as an input parameter of the security algorithm of the first PDCP entity. That is, all first PDCP entities included in the first terminal determine, based on the preset rule, the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among its associated LCHs.

[0199] It should be noted that in this implementation, when both the first terminal and the second terminal determine the LCID based on the implementation of the LCH configuration parameters, the LCH configuration parameters of the first terminal are configuration parameters obtained from the second terminal. Therefore, the configuration parameters of the LCH associated with the first PDCP entity of the first terminal are the same as the configuration parameters of the LCH associated with the second PDCP entity of the second terminal. Therefore, when the second terminal and the first terminal determine the LCID as the input parameter of the security algorithm based on the preset rules specified in the protocol, the LCID is the same. This ensures the consistency of the input parameters of the second terminal and the first terminal when the corresponding PDCP entities execute the security algorithm.

[0200] In the fourth implementation, the above step S402 may also include: the first terminal receives a second indication message from the second terminal, the second indication message includes a first LCID, the second indication message is used to instruct the first terminal to use the first LCID as an input parameter of the security algorithm of the first PDCP entity, and the first LCID is the LCID corresponding to the LCH that meets the second preset condition determined by the second terminal. Correspondingly, the above step S402 includes: the first terminal determines the second LCID that meets the second preset condition based on the second indication message. That is, in this implementation, the second terminal can send the first LCID that meets the preset condition determined by the second terminal to the first terminal, and instruct the first terminal to use the first LCID as an input parameter of the security algorithm of the first PDCP entity of the first terminal. That is, the above second LCID is the first LCID.

[0201] Optionally, the second indication information may also include a target LCH configuration parameter, which meets the second preset condition. For example, the second indication information includes that the LCH has the highest priority, and the second indication information may indicate that the first terminal uses the LCID corresponding to the LCH with the highest priority as an input parameter of the security algorithm of the first PDCP entity.

[0202] Exemplarily, take the second preset condition that the LCH has the highest priority as an example. The above second indication information may instruct the first terminal to determine the LCID corresponding to the LCH with the highest priority among the LCH configuration parameters of two or more LCHs associated with each first PDCP entity as the input parameter of the security algorithm of the first PDCP entity. The above second indication information may also instruct the first terminal to determine the LCID corresponding to the LCH with the highest priority among the LCH configuration parameters of two or more LCHs associated with a certain first PDCP entity as the input parameter of the security algorithm of the first PDCP entity. That is, the granularity indicated by the second indication information may be for all first PDCP entities of the first terminal, or for a certain first PDCP entity. When the granularity indicated by the second indication information is a certain first PDCP entity, the LCH configuration parameters of the second LCID corresponding to different first PDCP entities may meet different second preset conditions.

[0203] Exemplarily, the second indication information may be carried in the second SLRB configuration information, and the second SLRB configuration information may include one or more of SDAP configuration information, PDCP configuration information, RLC configuration information, LCH configuration information, SLRB ID / index, and LCID / LCH index. When the second indication information is carried in the second SLRB configuration information, the second indication information in the second SLRB configuration information is used to instruct the first terminal to determine the LCID corresponding to the LCH whose LCH configuration parameters meet the second preset condition among the two or more LCHs associated with the first PDCP entity corresponding to the SLRB as the input parameter of the security algorithm of the first PDCP entity.

[0204] Exemplarily, the above-mentioned second SLRB configuration information can be carried in a PC5-RRC message.

[0205] It is understandable that in this embodiment, the first terminal can determine the LCID that meets the preset conditions through a variety of implementation methods, and the embodiment of the present application does not limit which of the above methods the first terminal uses to determine the LCID that meets the preset conditions. It should be noted that in this embodiment, the second LCID that meets the preset conditions determined by the first terminal is the same as the first LCID that meets the preset conditions determined by the second terminal.

[0206] It should be noted that when the second terminal determines the first LCID based on the preset rules specified in the protocol, the embodiment of the present application does not limit the order of execution of the above steps S401 and S402. For example, S401 can be executed before S402, or after S402, or at the same time as S402. When the second terminal determines the first LCID autonomously, or when the second terminal determines the first LCID based on the indication information of the network device, the above step S402 is executed after step S401.

[0207] It should be noted that, when the second terminal adopts the fifth implementation method or the sixth implementation method to determine the first LCID in the above step S401, the first terminal may adopt the fourth implementation method to determine the second LCID in step S402, or may adopt the second implementation method to determine the second LCID. When the first terminal adopts the second implementation method to determine the second LCID in step S402, the above first indication information includes the first LCID to ensure that the first LCID determined by the second terminal is the same as the second LCID determined by the first terminal.

[0208] S403: The second terminal uses the first LCID as an input parameter of a security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0209] Exemplarily, the second terminal performing security protection on the first data packet may include: a second PDCP entity of the second terminal performing encryption and / or integrity protection on the first data packet.

[0210] Exemplarily, when the preset condition includes the first preset condition, correspondingly, in step S403, the second terminal may use the LCID that meets the first preset condition determined in step S401 as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0211] Exemplarily, when the preset condition includes the second preset condition, correspondingly, in step S403, the second terminal may use the LCID that meets the second preset condition determined in step S401 as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0212] It should be noted that in the embodiment of the present application, the LCID that meets the preset conditions is also an input parameter when the first PDCP entity of the first terminal parses the first data packet. The first PDCP entity of the first terminal corresponds to the second PDCP entity of the second terminal, thereby ensuring that the input parameters of the second terminal and the first terminal are consistent when the corresponding PDCP entities execute the security algorithm, so that the SL between the second terminal and the first terminal can communicate normally.

[0213] It can be understood that in this embodiment, the second terminal can determine the LCID that meets the preset conditions through various implementation methods, and use the LCID that meets the preset conditions as an input parameter for the second PDCP entity of the second terminal to execute a security algorithm to perform security protection on the first data packet.

[0214] S404: The second terminal sends a security-protected first data packet to the first terminal.

[0215] S405: The first terminal receives the first data packet after security protection.

[0216] S406. The first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID.

[0217] Exemplarily, the first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID, including: the first PDCP entity of the first terminal decrypts and / or performs integrity verification on the first data packet based on the second LCID.

[0218] Exemplarily, since the second LCID that meets the preset conditions determined by the first terminal in step S402 is the same as the first LCID that meets the preset conditions determined by the second terminal, when the first PDCP entity of the first terminal in step S406 parses the first data packet based on the second LCID, since the second LCID is the same as the input parameter when the second terminal performs security protection on the first data packet, the first terminal can parse the first data packet normally.

[0219] It should be noted that the present embodiment does not limit the execution order of the above step S402 and steps S403-S405. For example, step S402 can be executed before steps S403-S405, or after steps S403-S405, or at any time between steps S403-S405. Figure 4 Here, only step S402 is performed before steps S403-S405 as an example for illustration.

[0220] It can be understood that in the embodiment of the present application, when the second PDCP entity of the second terminal and the first PDCP entity of the first terminal associate multiple LCHs, the first terminal determines the first LCID that meets the preset conditions through the second terminal, and the first terminal determines the second LCID that meets the same preset conditions, and the first LCID and the second LCID are the same, so that when the corresponding PDCP entities of the second terminal and the first terminal execute the security algorithm, the consistency of the input parameters can be ensured. Therefore, the first terminal can normally parse the security-protected data packets sent by the second terminal, so that the SL between the first terminal and the second terminal can communicate normally.

[0221] Exemplarily, the embodiment of the present application further provides a communication method, which corresponds to the second implementation in the above step S401 and the second implementation in step S402, such as Figure 5 As shown, the method includes steps S501-S508.

[0222] S501. The second terminal determines a first LCID that meets a first preset condition.

[0223] It can be understood that the specific implementation of step S501 can refer to the second implementation of step S401, which will not be repeated here.

[0224] S502: The second terminal sends first indication information to the first terminal.

[0225] The first indication information is used to instruct the first terminal to use the LCID that meets the first preset condition as an input parameter of the security algorithm of the first PDCP entity.

[0226] S503: The first terminal receives first indication information.

[0227] S504. The first terminal determines a second LCID that meets the first preset condition based on the first indication information.

[0228] It can be understood that the specific implementation of step S504 can refer to the second implementation of step S402, which will not be repeated here.

[0229] S505. The second terminal uses the first LCID as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0230] S506: The second terminal sends the security-protected first data packet to the first terminal.

[0231] S507: The first terminal receives the first data packet after security protection.

[0232] S508. The first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID.

[0233] It can be understood that the specific implementation of the above steps S505-S508 can refer to steps S403-S406, which will not be repeated here.

[0234] It should be noted that this embodiment does not limit the execution order of the above steps S502-S504 and steps S505-S507. For example, step S502 can be executed before steps S505-S507, or after steps S505-S507, or at any time between steps S505-S507. Figure 5 It is only taken as an example that steps S502 - S504 are executed before steps S505 - S507 .

[0235] It can be understood that in this embodiment, the second terminal determines the first LCID autonomously based on the size of the LCIDs corresponding to the two or more LCHs associated with the second PDCP entity, and sends a first indication message to the first terminal, instructing the first terminal to use the LCID that meets the first preset condition as the input parameter of the security algorithm of the first PDCP entity, so that the corresponding PDCP entities of the second terminal and the first terminal can ensure the consistency of the input parameters when executing the security algorithm. Therefore, the first terminal can normally parse the security-protected data packets sent by the second terminal, so that the SL between the first terminal and the second terminal can communicate normally.

[0236] Exemplarily, the embodiment of the present application further provides a communication method, which corresponds to the third implementation in the above step S401 and the second implementation in step S402, such as Figure 6 As shown, the method includes steps S601-S611.

[0237] S601: The network device determines a first preset condition.

[0238] Exemplarily, the network device may be an access network device or a core network device, which is not limited in the embodiments of the present application.

[0239] For the relevant content of the first preset condition, please refer to the relevant description in the aforementioned step S401, which will not be repeated here.

[0240] S602: The network device sends third indication information to the second terminal.

[0241] The third indication information is used to instruct the second terminal to use the LCID that meets the first preset condition as an input parameter of the security algorithm of the second PDCP entity.

[0242] The second PDCP entity of the second terminal is associated with two or more logical channels LCH.

[0243] S603: The second terminal receives third indication information.

[0244] S604. The second terminal determines the first LCID that meets the first preset condition based on the third indication information.

[0245] It can be understood that the specific implementation of step S604 can refer to the third implementation in step S401, which will not be repeated here.

[0246] S605: The second terminal sends first indication information to the first terminal.

[0247] The third indication information is used to instruct the first terminal to use the first LCID that meets the first preset condition as an input parameter of the security algorithm of the first PDCP entity.

[0248] S606: The first terminal receives first indication information.

[0249] S607. The first terminal determines a second LCID that meets the first preset condition based on the first indication information.

[0250] It can be understood that the specific implementation of step S607 can refer to the second implementation of step S402, which will not be repeated here.

[0251] S608. The second terminal uses the first LCID as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0252] S609: The second terminal sends the security-protected first data packet to the first terminal.

[0253] S610: A first terminal receives a first data packet after security protection.

[0254] S611. The first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID.

[0255] It can be understood that the specific implementation of the above steps S608-S611 can refer to steps S403-S406, which will not be repeated here.

[0256] It should be noted that this embodiment does not limit the execution order of the above steps S605-S607 and steps S608-S610. For example, step S605 can be executed before steps S608-S610, or after steps S608-S610, or at any time between steps S608-S610. Figure 6 It is only taken as an example that steps S605-S607 are executed before steps S608-S610.

[0257] It can be understood that in this embodiment, the second terminal receives the third indication information sent by the network device, and determines the first LCID that meets the first preset condition based on the third indication information, and sends the first indication information to the first terminal, instructing the first terminal to use the LCID that meets the first preset condition as the input parameter of the security algorithm of the first PDCP entity, so that the corresponding PDCP entities of the second terminal and the first terminal can ensure the consistency of the input parameters when executing the security algorithm. Therefore, the first terminal can normally parse the security-protected data packet sent by the second terminal, so that the SL between the first terminal and the second terminal can communicate normally.

[0258] Exemplarily, the embodiment of the present application further provides a communication method, which corresponds to the fifth implementation in the above step S401 and the fourth implementation in step S402, such as Figure 7 As shown, the method includes steps S701-S708.

[0259] S701. The second terminal determines a first LCID that meets a second preset condition.

[0260] It can be understood that the specific implementation of step S701 can refer to the fifth implementation of step S401, which will not be repeated here.

[0261] S702: The second terminal sends second indication information to the first terminal.

[0262] The second indication information includes a first LCID, and the second indication information is used to instruct the first terminal to use the first LCID as an input parameter of the security algorithm of the first PDCP entity. The first LCID is the LCID corresponding to the LCH that meets the second preset condition determined by the second terminal.

[0263] S703: The first terminal receives second indication information.

[0264] S704. The first terminal determines a second LCID that meets a second preset condition based on the second indication information.

[0265] It can be understood that the specific implementation of step S704 can refer to the fourth implementation in step S402, which will not be repeated here.

[0266] S705. The second terminal uses the first LCID as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0267] S706: The second terminal sends the security-protected first data packet to the first terminal.

[0268] S707: The first terminal receives the first data packet after security protection.

[0269] S708. The first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID.

[0270] It can be understood that the specific implementation of the above steps S705-S708 can refer to steps S403-S406, which will not be repeated here.

[0271] It should be noted that this embodiment does not limit the execution order of the above steps S702-S704 and steps S705-S707. For example, step S702 can be executed before steps S705-S707, or after steps S705-S707, or at any time between steps S705-S707. Figure 7 It is only taken as an example that steps S702 to S704 are executed before steps S705 to S707.

[0272] It can be understood that in this embodiment, the second terminal autonomously determines the first LCID based on the LCH configuration parameters of two or more LCHs associated with the second PDCP entity, and sends a second indication message to the first terminal to instruct the first terminal to use the first LCID as an input parameter of the security algorithm of the first PDCP entity, thereby ensuring the consistency of the input parameters when the corresponding PDCP entities of the second terminal and the first terminal execute the security algorithm. Therefore, the first terminal can normally parse the security-protected data packets sent by the second terminal, so that the SL between the first terminal and the second terminal can communicate normally.

[0273] Exemplarily, the embodiment of the present application further provides a communication method, which corresponds to the sixth implementation in the above step S401 and the fourth implementation in step S402, such as Figure 8 As shown, the method includes steps S801-S811.

[0274] S801. The network device determines a second preset condition.

[0275] Exemplarily, the network device may be an access network device or a core network device, which is not limited in the embodiments of the present application.

[0276] S802. The network device sends fourth indication information to the second terminal.

[0277] The fourth indication information includes a target LCH configuration parameter, and the fourth indication information is used to instruct the second terminal to use the LCID that meets the second preset condition as an input parameter of the security algorithm of the second PDCP entity of the second terminal, and the LCID that meets the second preset condition is the LCID corresponding to the target LCH configuration parameter.

[0278] The second PDCP entity of the second terminal is associated with two or more logical channels LCH.

[0279] S803. The second terminal receives fourth indication information.

[0280] S804. The second terminal determines the first LCID that meets the second preset condition based on the fourth indication information.

[0281] It can be understood that the specific implementation of step S804 can refer to the sixth implementation in step S401, which will not be repeated here.

[0282] S805. The second terminal sends second indication information to the first terminal.

[0283] The second indication information includes a first LCID, and the second indication information is used to instruct the first terminal to use the first LCID as an input parameter of the security algorithm of the first PDCP entity. The first LCID is the LCID corresponding to the LCH that meets the second preset condition determined by the second terminal.

[0284] S806. The first terminal receives second indication information.

[0285] S807. The first terminal determines a second LCID that meets a second preset condition based on the second indication information.

[0286] It can be understood that the specific implementation of step S807 can refer to the fourth implementation in step S402, which will not be repeated here.

[0287] S808. The second terminal uses the first LCID as an input parameter of the security algorithm of the second PDCP entity to perform security protection on the first data packet.

[0288] S809: The second terminal sends a security-protected first data packet to the first terminal.

[0289] S810. The first terminal receives a first data packet after security protection.

[0290] S811. The first PDCP entity of the first terminal parses the security-protected first data packet based on the second LCID.

[0291] It can be understood that the specific implementation of the above steps S808-S811 can refer to steps S403-S406, which will not be repeated here.

[0292] It should be noted that this embodiment does not limit the execution order of the above steps S805-S807 and steps S808-S810. For example, step S805 can be executed before steps S808-S810, or after steps S808-S810, or at any time between steps S808-S810. Figure 8 It is only taken as an example that steps S805-S807 are executed before steps S808-S810.

[0293] It can be understood that in this embodiment, the second terminal receives the fourth indication information sent by the network device, and determines the first LCID that meets the second preset condition based on the fourth indication information, and sends the second indication information to the first terminal, instructing the first terminal to use the first LCID as the input parameter of the security algorithm of the first PDCP entity, so that the corresponding PDCP entities of the second terminal and the first terminal can ensure the consistency of the input parameters when executing the security algorithm. Therefore, the first terminal can normally parse the security-protected data packet sent by the second terminal, so that the SL between the first terminal and the second terminal can communicate normally.

[0294] Exemplarily, when the input parameter of the security algorithm is SLRB ID, PC5-RRC can be used to interact with the SL-Data Radio Bearer (DRB) so that the sending and receiving UEs align the SLRB ID corresponding to the SL-DRB. As for the SL-Signaling Radio Bearer (SRB), most of the SL-SRBs carrying PC5-S messages are sent before the PC5-RRC message, so it may not be possible to let the PDCP entities of the second terminal and the first terminal know the SLRB ID of the SL-SRB through the PC5-RRC message to correctly execute the security algorithm.

[0295] In order to solve the problem that when the input parameter of the security algorithm is SLRB ID, the PDCP entity corresponding to the SL-SRB executes the security protection algorithm, the sending and receiving UE may not be able to obtain the SLRB ID corresponding to the SL-SRB through the PC5-RRC message, resulting in the SL-SRB being unable to support security protection. The present application embodiment provides a communication method, such as Fig. 9 As shown, the method includes steps S901-S904.

[0296] S901. The second terminal uses the first SLRB ID as an input parameter of a security algorithm to perform security protection on a first data packet.

[0297] Exemplarily, the second terminal uses the first SLRB ID as an input parameter of a security algorithm to perform security protection on the first data packet, including: the second terminal uses the first SLRB ID as an input parameter of the security algorithm to encrypt and / or integrity protect the first data packet.

[0298] S902: The second terminal sends a security-protected first data packet to the first terminal.

[0299] The first data packet carries the first SLRB ID.

[0300] Exemplarily, the first data packet carries the first SLRB ID in a header. For example, the first data packet carries the first SLRB ID in a PDCP header.

[0301] S903: The first terminal receives the first data packet after security protection.

[0302] S904: The first terminal parses the first data packet based on the first SLRB ID.

[0303] Exemplarily, since the first data packet carries the first SLRB ID in the header, when the first terminal receives the first data packet to the PDCP layer, it can determine that the input parameter of the security algorithm corresponding to the PDCP entity is the first SLRB ID according to the first SLRB ID carried in the header of the data packet. Thus, the corresponding PDCP entities in the second terminal and the first terminal can use the same SLRB ID as input parameters to ensure that the data transmission on the SL of the second terminal and the first terminal can be protected by the security algorithm.

[0304] It can be understood that the above methods S901-S904 are not only applicable to the security protection of data packets corresponding to SL-SRB, but also applicable to the security protection of data packets corresponding to SL-DRB.

[0305] It can be understood that in this embodiment, the second terminal uses the first SLRB ID as an input parameter of the security algorithm to perform security protection on the first data packet, and sends the first data packet carrying the first SLRB ID to the first terminal, so that after the first terminal receives the first data packet, it can parse the first data packet based on the first SLRB ID carried in the header of the first data packet. Therefore, the second terminal and the first terminal can use the same SLRB ID as an input parameter to ensure that the data transmission on the SL of the second terminal and the first terminal can be protected by the security algorithm.

[0306] In order to solve the problem that when the input parameter of the security algorithm is SLRB ID, the PDCP entity corresponding to the SL-SRB executes the security protection algorithm, the sending and receiving UE may not be able to obtain the SLRB ID corresponding to the SL-SRB through the PC5-RRC message, resulting in the SL-SRB being unable to support security protection. The embodiment of the present application also provides a communication method, such as Fig.10 As shown, the method includes: S1001-S1006.

[0307] S1001. A second terminal sends a first message to a first terminal.

[0308] The first message carries the first SLRB ID.

[0309] Exemplarily, the first message is a PC5-S message. The first SLRB ID is carried in the PC5-S message. The PC5-S message may be a message in the process of establishing a PC5-S connection between the second terminal and the first terminal. The first SLRBID is the SRB ID corresponding to the SRB carrying the second message after the first message.

[0310] Exemplarily, in this embodiment, the SLRB ID information indicating the SRB may directly indicate the SLRBID corresponding to SRBX, or may indicate the SLRB ID corresponding to the LCID, and this embodiment of the present application is not limited to this. The following embodiment is only described by taking the SLRB ID indicating the SRB as the SLRB ID corresponding to SRBX as an example.

[0311] For example, the messages in the PC5-S connection establishment process may include messages 1 to 4. Among them, message 1 is a connection establishment request message sent by the second terminal to the first terminal; message 2 is a security activation command message sent by the first terminal to the second terminal; message 3 is a security activation completion message fed back by the second terminal to the first terminal; message 4 is a PC5-S connection establishment acceptance message fed back by the first terminal to the second terminal.

[0312] For example, SRB0 is used to carry PC5-S messages without security protection (e.g., message 1 in PC5-S connection establishment), SRB1 is used to carry PC5-S messages related to security activation (e.g., messages 2 and 3 in PC5-S connection establishment), SRB2 is used to carry PC5-S messages with security protection (e.g., message 4 in PC5-S connection establishment), and SRB3 is used to carry PC5-RRC messages. The embodiments of the present application do not limit the specific number of SL-SRBs that carry PC5-S messages and PC5-RRC messages, and the specific SRBX that carries each message, which is only an exemplary description.

[0313] It can be understood that the first message can be any message from message 1 to message 4 in the PC5-S connection establishment process. Taking message 1 as the first message, the second message can be a PC5-S message or a PC5-RRC message after message 1.

[0314] For example, Fig.11 As shown, the second terminal can carry the SRB ID corresponding to the SRB of the PC5-S message and PC5-RRC message after the bearer message 1 in message 1, and send the first message to the first terminal. That is, the second terminal can send the SRB ID corresponding to the SRB of the PC5-S message and PC5-RRC message after the bearer message 1 to the first terminal at one time in message 1.

[0315] For example, Fig.12 As shown, the second terminal may also carry the SRB ID corresponding to the SRB carrying message 2 in message 1 and send the first message to the first terminal. That is, the second terminal may only send the SRB ID corresponding to the SRB carrying one or more messages after message 1 to the first terminal.

[0316] The embodiment of the present application does not limit the SRB ID of the specific message carried in the first message and carried after the first message. Fig.11 and Fig.12 This is an illustrative description only.

[0317] S1002. The first terminal receives a first message.

[0318] Exemplarily, the first terminal receives the first message and can obtain the SRB ID corresponding to the SRB carrying the second message.

[0319] S1003. The first terminal performs security protection on the second message based on the first SLRB ID.

[0320] Exemplarily, the first terminal performs security protection on the second message based on the first SLRB ID, including: the first terminal uses the first SLRB ID as an input parameter of a security algorithm to encrypt and / or integrity protect the second message.

[0321] Exemplarily, the second message may be a PC5-S message or a PC5-RRC message. It should be noted that the second message is a message after the first message. That is, the second terminal may send the SRB ID carrying the second message to the first terminal in advance, so that the first terminal may perform security protection on the second message based on the SRB ID carrying the second message.

[0322] For example, when the first message is message 1, the second message may be message 2, message 4 or PC5-RRC message. When the second message is message 2, the first SLRB ID carried in the first message includes the SRB ID corresponding to the SRB carrying message 2. That is, the first SLRB ID carried in message 1 includes SRB1 ID.

[0323] It should be noted that the SRB IDs corresponding to the SRBs carrying the PC5-S message and the PC5-RRC message can be determined entirely by the second terminal, or can be determined jointly by the second terminal and the first terminal (for example, the SRB1 ID is determined by the second terminal, and the SRB2 ID and the SRB3 ID are determined by the first terminal), and this application does not limit this. This implementation is only described by taking the SRB ID corresponding to the SRB carrying the second message as determined by the second terminal as an example.

[0324] S1004. The first terminal sends a security-protected second message to the second terminal.

[0325] S1005. The second terminal receives the second message after security protection.

[0326] S1006. The second terminal parses the second message based on the first SLRB ID.

[0327] Exemplarily, in this embodiment, the first SLRB ID is determined by the second terminal, and the second terminal can parse the security-protected second message sent by the first terminal based on the first SLRB ID.

[0328] In this embodiment, the second terminal sends a first message carrying a first SLRB ID to the first terminal. The first SLRB ID is the SRB ID corresponding to the SRB carrying the second message, so that the first terminal can perform security protection on the second message based on the first SLRB ID. The second terminal receives the second message after security protection from the first terminal, and parses the second message based on the first SLRB ID. That is, in this embodiment, the second terminal sends the first SLRB ID corresponding to the SRB carrying the second message to the first terminal in advance, so that the first terminal learns the input parameters when performing security protection on the second message, thereby ensuring that the input parameters for the first terminal to perform security protection on the second message are consistent with the input parameters when the second terminal parses the second message. Therefore, the transmission on the SL of the second terminal and the first terminal can achieve the protection of the security algorithm.

[0329] Exemplarily, when the second message is message 3 or PC5-RRC message, the first terminal in step S1003 can perform security analysis on the second message based on the first SLRB ID. In this implementation, after the above steps S1001-S1002, the second terminal can also perform security protection on the second message based on the first SLRB, and send the second message after security protection to the first terminal. After the first terminal receives the second message, it can perform security analysis on the second message based on the first SLRB. That is to say, the first SLRB is sent to the first terminal in advance by the second terminal, so that after receiving the second message after security protection, the first terminal can parse the second message based on the first SLRB. For example, Fig.11 As shown, the second terminal carries SRB1 ID, SRB2 ID and SRB3 ID in message 1. The second terminal can perform security protection on message 3 based on SRB1 ID and send the protected message 3 to the first terminal. The first terminal receives message 3 and parses message 3 based on the SRB1 ID carried in message 1.

[0330] It should be noted that when the SRB ID corresponding to the SRB carrying the second message is determined by the first terminal, the first terminal can send the SRB ID corresponding to the SRB carrying the second message to the second terminal in advance, so that the second terminal can perform security protection on the second message based on the SRBID, and ensure that the input parameters of the second terminal for security protection of the second message are consistent with the input parameters of the first terminal for parsing the second message. Therefore, the data transmission on the SL of the second terminal and the first terminal can be protected by the security algorithm.

[0331] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method steps. It is understandable that, in order to realize the above functions, the computer includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of a combination of hardware and computer software. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0332] The embodiment of the present application can divide the computer into functional modules according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0333] In the case of dividing each functional module into corresponding functional modules, Fig.13 A schematic diagram of the structure of a communication device 1300 is shown. The communication device 1300 may be the second terminal in the above embodiment, or may be a chip in the above second terminal. The communication device 1300 includes: a processing unit 1301 and a transceiver unit 1302.

[0334] The processing unit 1301 may execute, for example, Figure 4 S401 and S403 in, or, Figure 5 S501 and S505 in, or, Figure 6 S604 and S608, or, Figure 7 S701 and S705, or, Figure 8 S804 and S808, or, Fig. 9 S901 in, or, Fig.10 S1006 in; the transceiver unit 1302 may execute, for example Figure 4 S404 in, or, Figure 5 S502 and S506 in, or, Figure 6 S603, S605 and S609 in, or, Figure 7 S702 and S706 in, or, Figure 8 S803, S805 and S809 in, or, Fig. 9 S902 in, or, Fig.10 S1001 and S1005 in. It can be understood that the above processing unit 1301 can also send and receive information through the transceiver unit 1302, or be used to communicate with other network elements, and / or be used for other processes of the technology described in this article. Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0335] In the case of dividing each functional module into corresponding functional modules, Fig.14 A schematic diagram of the structure of a communication device 1400 is shown. The communication device 1400 may be the first terminal in the above embodiment, or may be a chip in the above first terminal. The communication device 1400 includes: a processing unit 1401 and a transceiver unit 1402.

[0336] The processing unit 1401 may execute, for example, Figure 4 S402 and S406, or, Figure 5 S504 and S508, or, Figure 6 S607 and S611 in, or, Figure 7 S704 and S708 in, or, Figure 8 S807 and S811 in, or, Fig. 9 S904 in, or, Fig.10 S1003 in; the transceiver unit 1402 may execute, for example Figure 4 S405 in, or Figure 5 S503 and S507, or, Figure 6 S606 and S610 in, or, Figure 7 S703 and S707 in, or, Figure 8 S806 and S810, or, Fig. 9 S903 in, or, Fig.10 S1002 and S1004 in. It can be understood that the above-mentioned processing unit 1401 can also send and receive information through the transceiver unit 1402, or be used to communicate with other network elements, and / or be used for other processes of the technology described in this article. Among them, all relevant contents of each step involved in the above-mentioned method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0337] In the case of dividing each functional module into corresponding functional modules, Fig.15 The structure diagram of a communication device 1500 is shown. The communication device 1500 may be the network device in the above embodiment, or may be a chip in the above network device. The communication device 1500 includes: a processing unit 1501 and a transceiver unit 1502.

[0338] The processing unit 1501 may execute Figure 6 S601 in, or Figure 8 S801 in; the transceiver unit 1502 can execute Figure 6 S602 in or Figure 8 S802 in. It can be understood that the above processing unit 1501 can also send and receive information through the transceiver unit 1502, or be used to communicate with other network elements, and / or be used for other processes of the technology described in this article. Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0339] In the case of an integrated unit, Fig.16 A possible structural diagram of a second terminal involved in the above embodiment is shown. The second terminal 1600 includes: a processor 1601 and a transceiver 1602 .

[0340] The processor 1601 is used to control and manage the actions of the second terminal 1600. For example, the processor 1601 can execute Figure 4 S401 and S403 in, or, Figure 5 S501 and S505 in, or, Figure 6S604 and S608, or, Figure 7 S701 and S705, or, Figure 8 S804 and S808, or, Fig. 9 S901 in, or, Fig.10 S1006 in, and / or other processes for the technology described in this article.

[0341] The transceiver 1602 is used to send and receive information, or to communicate with other network elements. For example, the transceiver 1602 may perform Figure 4 S404 in, or, Figure 5 S502 and S506 in, or, Figure 6 S603, S605 and S609 in, or, Figure 7 S702 and S706 in, or, Figure 8 S803, S805 and S809 in, or, Fig. 9 S902 in, or, Fig.10 S1001 and S1005 in, and / or other processes for the technology described in this article.

[0342] Optionally, the second terminal 1600 may further include a memory 1603, which is used to store program codes and data corresponding to the second terminal 1600 executing any of the communication methods provided above. The memory 1603 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc. The second terminal 1600 may be Figure 2 The communication device shown above Figure 2 All relevant descriptions of the components involved can be found in Fig.16 The functional description of the corresponding components will not be repeated here.

[0343] In the case of an integrated unit, Fig.17 A possible structural diagram of a first terminal 1700 involved in the above embodiment is shown. The first terminal 1700 includes: a processor 1701 and a transceiver 1702 .

[0344] The processor 1701 is used to control and manage the actions of the first terminal 1700. For example, the processor 1701 can execute Figure 4 S402 and S406, or, Figure 5 S504 and S508, or, Figure 6 S607 and S611 in, or, Figure 7 S704 and S708 in, or, Figure 8 S807 and S811 in, or, Fig. 9 S904 in, or, Fig.10 S1003 in, and / or other processes for the technology described in this article.

[0345] The transceiver 1702 is used to send and receive information, or to communicate with other network elements. For example, the transceiver 1702 may perform Figure 4 S405 in, or Figure 5 S503 and S507, or, Figure 6 S606 and S610 in, or, Figure 7 S703 and S707 in, or, Figure 8 S806 and S81O, or, Fig. 9 S903 in, or, Fig.10 S1002 and S1004 in, and / or other processes for the technology described in this article.

[0346] Optionally, the first terminal 1700 may further include a memory 1703, which is used to store program codes and data corresponding to the first terminal 1700 executing any of the communication methods provided above. The memory 1703 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc. The first terminal 1700 may be Figure 2 The communication device shown above Figure 2 All relevant descriptions of the components involved can be found in Fig.17 The functional description of the corresponding components will not be repeated here.

[0347] In the case of an integrated unit, Fig.18 A possible structural diagram of a network device 1800 involved in the above embodiment is shown. The network device 1800 includes: a processor 1801 and a transceiver 1802 .

[0348] The processor 1801 is used to control and manage the actions of the network device 1800. For example, the processor 1801 can execute Figure 6 S601 in, or, Figure 8 S801 in, and / or other processes for the technology described in this article.

[0349] The transceiver 1802 is used to send and receive information, or to communicate with other network elements. For example, the transceiver 1802 can perform Figure 6 S602 in or Figure 8S802 in, and / or other processes for the technology described in this article.

[0350] Optionally, the network device 1800 may further include a memory 1803, which is used to store program codes and data corresponding to the network device 1800 executing any of the communication methods provided above. The memory 1803 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc. The network device 1800 may be Figure 2 The communication device shown above Figure 2 All relevant descriptions of the components involved can be found in Fig.18 The functional description of the corresponding components will not be repeated here.

[0351] The embodiment of the present application also provides a communication device, which includes a processor, and may also include a transceiver and a memory, wherein the transceiver is used to send and receive information, or to communicate with other network elements; the memory is used to store computer-executable instructions; the processor is used to execute the computer-executable instructions to support the terminal device to implement Figures 4 to 10 The communication method in any embodiment.

[0352] The embodiment of the present application also provides a communication device, which includes a processor, and may also include a transceiver and a memory, wherein the transceiver is used to send and receive information, or to communicate with other network elements; the memory is used to store computer-executable instructions; the processor is used to execute the computer-executable instructions to support the network device to implement Figure 6 or Figure 8 The communication method in any embodiment.

[0353] The embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program code. When the processor executes the computer program code, the electronic device executes Figures 4 to 10 The communication method in any embodiment.

[0354] The present application also provides a computer program product, which, when executed on a computer, enables the computer to execute Figures 4 to 10 The communication method in any embodiment.

[0355] The embodiment of the present application also provides a communication device, which can exist in the form of a chip product. The structure of the device includes a processor and an interface circuit. The processor is used to communicate with other devices through a receiving circuit, so that the device executes the above Figures 4 to 10 The communication method in any embodiment.

[0356] The embodiment of the present application also provides a communication system, including a second terminal and a first terminal, wherein the second terminal and the first terminal can execute the above Figures 4 to 10 The communication method in any embodiment.

[0357] The steps of the method or algorithm described in conjunction with the disclosure of the present application may be implemented in hardware or by executing software instructions by a processor. The software instructions may be composed of corresponding software modules, which may be stored in a random access memory (RAM), a flash memory, an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an ASIC. In addition, the ASIC may be located in a core network interface device. Of course, the processor and the storage medium may also exist in a core network interface device as discrete components.

[0358] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this application can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0359] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation methods of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.

Claims

1. A communication method, characterized in that: The method is applied to a first terminal or a chip in the first terminal, and includes: Determine a logical channel identifier LCID that meets a preset condition; associate a first packet data convergence protocol PDCP entity of the first terminal with two or more logical channels LCH; receiving a first data packet from a second terminal, wherein the first data packet is a data packet after security protection is performed by a second PDCP entity of the second terminal based on the LCID that meets the preset condition; The first PDCP entity of the first terminal parses the first data packet based on the LCID.

2. The method according to claim 1, characterized in that The preset condition includes a first preset condition, and the size of the LCID meets the first preset condition.

3. The method according to claim 2, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on a preset rule, an LCID that meets the first preset condition is determined, and the preset rule is predefined.

4. The method according to claim 2, characterized in that: The method further comprises: Receive first indication information from a second terminal, where the first indication information is used to instruct the first terminal to use an LCID that meets the first preset condition as an input parameter of a security algorithm of the first PDCP entity.

5. The method according to claim 4, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on the first indication information, determine the LCID that meets the first preset condition.

6. The method according to claim 4 or 5, characterized in that: The first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-radio resource control RRC message.

7. The method according to any one of claims 2 to 5, characterized in that: The LCID that meets the first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the two or more LCHs.

8. The method according to claim 1, characterized in that The preset condition includes a second preset condition, and the configuration parameters of the LCH corresponding to the LCID meet the second preset condition.

9. The method according to claim 8, characterized in that The method further comprises: Receive second indication information from the second terminal, the second indication information including a target LCID, the second indication information being used to instruct the first terminal to use the target LCID as an input parameter of a security algorithm of the first PDCP entity, the target LCID being an LCID corresponding to the LCH determined by the second terminal to meet the second preset condition.

10. The method according to claim 9, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on the second indication information, determine the LCID that meets the second preset condition.

11. The method according to claim 9 or 10, characterized in that: The second indication information is carried in the second SLRB configuration information, and the second SLRB configuration information is carried in the PC5-RRC message.

12. A communication method, characterized in that: The method is applied to a second terminal or a chip in the second terminal, and includes: Determine a logical channel identifier LCID that meets a preset condition; associate a second packet data convergence protocol PDCP entity of the second terminal with two or more logical channels LCH; Using the LCID as an input parameter of a security algorithm of the second PDCP entity to perform security protection on the first data packet; The first data packet after security protection is sent to the first terminal; wherein the LCID is an input parameter when the first PDCP entity of the first terminal parses the first data packet, and the first PDCP entity of the first terminal corresponds to the second PDCP entity of the second terminal.

13. The method according to claim 12, characterized in that The preset condition includes a first preset condition, and the size of the LCID meets the first preset condition.

14. The method according to claim 13, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on a preset rule, an LCID that meets the first preset condition is determined, and the preset rule is predefined.

15. The method according to claim 13, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on the sizes of the LCIDs corresponding to the two or more LCHs, determine the LCID that meets the first preset condition.

16. The method according to claim 13, characterized in that The method further comprises: Receive third indication information from a network device, where the third indication information is used to instruct the second terminal to use the LCID that meets the first preset condition as an input parameter of the security algorithm of the second PDCP entity.

17. The method according to claim 16, characterized in that The determining of a logical channel identifier LCID that meets a preset condition includes: Based on the third indication information, determine the LCID that meets the first preset condition.

18. The method according to claim 16 or 17, characterized in that The third indication information also includes identification information of the first terminal.

19. The method according to claim 16 or 17, characterized in that The third indication information is carried in the third sidelink radio bearer SLRB configuration information, and the third SLRB configuration information is carried in a radio resource control RRC message, a system message block SIB or a pre-configuration message.

20. The method according to any one of claims 15 to 17, characterized in that The method further comprises: Send first indication information to the first terminal, where the first indication information is used to instruct the first terminal to use the LCID that meets the first preset condition as an input parameter of a security algorithm of a first PDCP entity of the first terminal.

21. The method according to claim 20, characterized in that The first indication information is carried in the first sidelink radio bearer SLRB configuration information, and the first SLRB configuration information is carried in the PC5-RRC message.

22. The method according to any one of claims 13 to 17, characterized in that The LCID that meets the first preset condition is the smallest LCID or the largest LCID among the LCIDs corresponding to the two or more LCHs.

23. A communication method, characterized in that: Applied to a network device or a chip in the network device, the method comprising: Determine the preconditions; An indication message is sent to the second terminal, wherein the indication message is used to instruct the second terminal to use the logical channel identifier LCID that meets the preset conditions as an input parameter of the security algorithm of the second packet data convergence protocol PDCP entity of the second terminal, and the second PDCP entity of the second terminal is associated with two or more logical channels LCH.

24. The method according to claim 23, characterized in that The preset condition includes a first preset condition, and the size of the LCID meets the first preset condition; the indication information includes third indication information, and the third indication information is used to instruct the second terminal to use the LCID that meets the first preset condition as an input parameter of the security algorithm of the second PDCP entity of the second terminal.

25. The method according to claim 23, characterized in that The preset conditions include a second preset condition, and the configuration parameters of the LCH corresponding to the LCID meet the second preset conditions; the indication information includes fourth indication information, and the fourth indication information is used to indicate that the second terminal will use the LCID that meets the second preset conditions as the input parameter of the security algorithm of the second PDCP entity of the second terminal.

26. The method according to claim 25, characterized in that The fourth indication information also includes a target LCH configuration parameter, and the LCID that meets the second preset condition is the LCID corresponding to the target LCH configuration parameter.

27. The method according to any one of claims 23 to 26, characterized in that The indication information is carried in the sidelink radio bearer SLRB configuration information, and the SLRB configuration information is carried in a radio resource control RRC message, a system message block SIB or a pre-configuration message.

28. A communication device, characterized in that: The device comprises: A processor, configured to execute instructions to implement the communication method as described in any one of claims 1 to 27.

29. A communication device, characterized in that: Comprising means for executing the communication method as claimed in any one of claims 1-27.

30. A computer-readable storage medium having computer program code stored therein, characterized in that: When the computer program code runs on a processor, the processor is caused to execute the communication method according to any one of claims 1 to 27.

31. A communication device, characterized in that: The communication device comprises: A transceiver is used to send and receive information or to communicate with other network elements; A processor, configured to execute computer program instructions to implement the communication method as claimed in any one of claims 1 to 27.

32. A computer program product having stored therein computer software instructions executed by a processor, characterized in that: When the computer software instructions are executed on a computer, the computer is caused to perform the communication method according to any one of claims 1 to 27.

33. A communication system, characterized in that: The communication system includes: a first terminal, a second terminal and a network device, the first terminal is used to execute the communication method as described in any one of claims 1-11, the second terminal is used to execute the communication method as described in any one of claims 12-22, and the network device is used to execute the communication method as described in any one of claims 23-27.