Patent Description:
In a security mechanism of a narrowband internet of things (NarrowBand Internet of Things, NB-IoT), the following provides protection for security of an air interface in a UP mode: Encryption and integrity protection are performed on a non-access stratum (Non Access Stratum, NAS); encryption and integrity protection are performed on a control plane of an access stratum (Access Stratum, AS), and encryption is performed on a user plane of the access stratum. The encryption and the integrity protection on the AS are implemented in the packet data convergence protocol (Packet Data Convergence Protocol, PDCP) through radio resource control (Radio Resource Control, RRC) negotiation and key generation.

In the NB-IoT system, when a key of a base station is updated, the current system can only release a terminal first. When downlink data arrives, the terminal is paged for access, or when uplink data arrives, the terminal actively initiates access. The key is updated by configuring a new key in an access process. A specific process is as follows: The base station sends an RRC connection release message to user equipment (user equipment, UE), and the UE releases an RRC connection based on the connection release message. When receiving a paging message sent by the base station or when there is data that needs to be uploaded, the UE sends a random access preamble to the base station, to trigger a random access process. In the random access process, the UE receives an RRC security configuration command sent by the base station, where the RRC security configuration command carries the new key configured by the base station. The UE returns an RRC security configuration complete message to the base station based on the updated key. In a process of continuing to complete an RRC connection, the UE performs data encryption, decryption, and integrity protection based on the updated key.

However, in the foregoing solution, the UE releases the connection, and waits until the UE is paged or there is data to be uploaded, to negotiate the new key in the random access process. In a key update process, the UE is disconnected for a relatively long time, and because the key needs to be updated, a large quantity of radio resources on a network side may be wasted for paging the UE.

<CIT> provides a method for updating a key in a dual connection communication environment. The method comprises sending a first RRC connection reconfiguration message to a UE to notify the UE to execute key updating and to release the secondary cell group (SCG) associated with a secondary eNB (SeNB) when the key updating is carried out.

Embodiments of this application provide a key update method, a device, and a storage medium, to resolve a problem, in a current key update method, that UE is disconnected for a relatively long time, and a relatively large quantity of radio resources on a network side may be wasted for paging. The technical improvement is achieved by the solution provided in accordance with the claims.

The following aspects are useful for understanding the application.

A first aspect of this application provides a key update method, where the method includes:.

In a specific implementation, the first indication is a first cause value, the first message includes a release cause information element, and a value of the release cause information element is the first cause value.

In a specific implementation, the initiating access to the network device to obtain a new security configuration includes:.

In a specific implementation, the first message further includes indication information used to indicate whether there is downlink data.

In a specific implementation, the method further includes:
indicating, to the network device when initiating the access to the network device, that an access cause is that the key is to be updated.

In a specific implementation, the first message is an RRC connection release message.

A second aspect of this application provides a key update method, where the method includes:.

In a specific implementation, the accepting access initiated by the UE in response to the first indication, to send a security configuration to the UE includes:.

In a specific implementation, the method further includes:
receiving an access cause of the access, where the access cause is that the key is to be updated.

A third aspect of this application provides a key update method, including:.

In a specific implementation, the security configuration includes a next hop chaining count NCC value and a security algorithm.

In a specific implementation, the obtaining a new key based on the security configuration includes:.

In a specific implementation, the method further includes:
generating, based on the eNB key KeNB* and/or the security algorithm, an RRC encryption key and a data encryption key that are related to an encryption algorithm.

In a specific implementation, the method further includes:
sending a connection message to the network device based on the new key.

In a specific implementation, the method further includes:
indicating, to the network device in a connection process, that a connection cause is that a key is to be updated.

A fourth aspect of this application provides a key update method, where the method includes:.

In a specific implementation, the security configuration includes an NCC value and/or a security algorithm.

In a specific implementation, the method further includes:
receiving an indication that the UE indicates, to the network device in a connection process, that an access cause is that a key is to be updated.

A fifth aspect of this application provides a key update method, where the method includes:.

In a specific implementation, the obtaining the new key based on the security configuration includes:.

In a specific implementation, the first message is an RRC connection reconfiguration message, and the second message is an RRC connection reconfiguration complete message.

A sixth aspect of this application provides a key update method, where the method includes:.

A seventh aspect of this application provides user equipment, including:.

Optionally, the first indication is a first cause value, the first message includes a release cause information element, and a value of the release cause information element is the first cause value.

Optionally, the transmitter is specifically configured to initiate the access to the network device to establish an RRC connection to the network device;
the receiver is further configured to receive a second message from the network device, where the second message is used to configure a key, and the second message includes the security configuration.

Optionally, the first message further includes indication information used to indicate whether there is downlink data.

Optionally, the sending module is further configured to indicate, to the network device when initiating the access to the network device, that an access cause is that the key is to be updated.

Optionally, the first message is an RRC connection release message.

An eighth aspect of this application provides a network device, including:.

Optionally, the receiver is specifically configured to: receive information that is of the UE and that is used for the access, and establish an RRC connection to the UE;
the transmitter sends a second message to the UE, where the second message includes the security configuration.

Optionally, the receiver is further configured to receive an access cause of the access, where the access cause is that the key is to be updated.

A ninth aspect of this application provides user equipment, including:.

Optionally, the security configuration includes a next hop chaining count NCC value and a security algorithm.

Optionally, the processor is specifically configured to:.

Optionally, the processor is further configured to:
generate, based on the eNB key KeNB* and/or the security algorithm, an RRC encryption key and a data encryption key that are related to an encryption algorithm.

Optionally, the user equipment further includes:
a transmitter, configured to send a connection message to the network device based on the new key.

Optionally, the transmitter is further configured to indicate, to the network device in a connection process, that a connection cause is that a key is to be updated.

A tenth aspect of this application provides a network device, including:.

Optionally, the security configuration includes a next hop chaining count NCC value and/or a security algorithm.

Optionally, the receiver is further configured to receive an indication that the UE indicates, to the network device in a connection process, that an access cause is that a key is to be updated.

An eleventh aspect of this application provides user equipment, including:.

Optionally, the first message is an RRC connection reconfiguration message, and the second message is an RRC connection reconfiguration complete message.

A twelfth aspect of this application provides a network device, including:.

A thirteenth aspect of this application provides user equipment, including:.

Optionally, the sending module is specifically configured to initiate the access to the network device to establish an RRC connection to the network device;
the receiving module is further configured to receive a second message from the network device, where the second message includes the security configuration.

A fourteenth aspect of this application provides a network device, including:.

Optionally, the receiving module is specifically configured to: receive information that is of the UE and that is used for the access, and establish an RRC connection to the UE;
the sending module is further configured to send a second message to the UE, where the second message includes the security configuration.

Optionally, the receiving module is further configured to receive an access cause of the access, where the access cause is that the key is to be updated.

A fifteenth aspect of this application provides user equipment, including:.

Optionally, the processing module is specifically configured to:.

Optionally, the processing module is further configured to:
generate, based on the eNB key KeNB* and/or the security algorithm, an RRC encryption key and a data encryption key that are related to an encryption algorithm.

Optionally, the user equipment further includes:
a sending module, configured to send a connection message to the network device based on the new key.

Optionally, the sending module is further configured to indicate, to the network device in a connection process, that a connection cause is that a key is to be updated.

A sixteenth aspect of this application provides a network device, including:.

Optionally, the receiving module is further configured to receive an indication that the UE indicates, to the network device in a connection process, that an access cause is that a key is to be updated.

A seventeenth aspect of this application provides user equipment, including:.

An eighteenth aspect of this application provides a network device, including:.

A nineteenth aspect of this application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, and the computer instruction enables user equipment to perform the key update method provided in any one of the implementations in the first aspect, the third aspect, or the fifth aspect.

A twentieth aspect of this application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, and the computer instruction enables a network device to perform the key update method provided in any one of the implementations in the second aspect, the fourth aspect, or the sixth aspect.

A twenty-first aspect of this application provides a computer program product, where the computer program product includes computer program code, and when the computer program code is run by user equipment, the user equipment is enabled to perform the key update method provided in any one of the implementations in the first aspect, the third aspect, or the fifth aspect.

A twenty-second aspect of this application provides a computer program product, where the computer program product includes computer program code, and when the computer program code is run by a network device, the network device is enabled to perform the key update method provided in any one of the implementations in the second aspect, the fourth aspect, or the sixth aspect.

The embodiments of this application provide the key update method, the device, and the storage medium. After determining that the key needs to be updated, the network device sends, to the user equipment, the first message used for releasing the RRC connection, where the message carries an indication used to indicate that the key is to be updated. After receiving the first message, the user equipment releases the RRC connection, and may determine that a release cause is that the key needs to be updated. In this case, the user equipment actively initiates an access process, obtains the new security configuration to complete updating the key, and does not need to wait for data to be uploaded or paging of the network device to perform access, thereby effectively shortening a disconnection time of the user equipment. In addition, the network device does not need to page the user equipment, thereby saving the radio resources on the network side.

<FIG> is a schematic diagram of an application scenario of a key update method according to an embodiment of this application. As shown in <FIG>, the key update method provided in this application is specifically applied to a narrowband internet of things (NarrowBand Internet of Things, NB-IoT) or a similar internet of things system that does not support handover. In the NB-IoT communications system in this application, main network elements include a core network (for example, a packet core network (Evolved Packet Core, EPC)), a network device (for example, an eNB base station), and user equipment (user equipment, UE). The UE accesses the network device via the base station or a routing node, and the network device is connected to the core network to complete data backhaul and forward transmission.

The technical solutions of embodiments of this application may be further applied to a <NUM> or a future communications system, and may also be applied to various other communications systems, such as a global system for mobile communications (Global System of Mobile communication, GSM) system, a code division multiple access (CDMA, Code Division Multiple Access) system, a wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA) system, a general packet radio service (General Packet Radio Service, GPRS), a long term evolution (Long Term Evolution, LTE) system, an LTE frequency division duplex (Frequency Division Duplex, FDD) system, an LTE time division duplex (Time Division Duplex, TDD), and a universal mobile telecommunications system (Universal Mobile Telecommunication System, UMTS).

It should be understood that the network device in this solution may be a base station (Base Transceiver Station, BTS for short) in the global system for mobile communications (Global System of Mobile communication, GSM for short) or the code division multiple access (Code Division Multiple Access, CDMA for short), or may be a base station (NodeB, NB for short) in the wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA for short), or may be an evolved NodeB (Evolutional Node B, eNB or eNodeB for short) in LTE, a relay station or an access point, a base station in a <NUM> network, or the like. This is not limited herein.

The user equipment may be a wireless terminal or a wired terminal. The wireless terminal may refer to a device that provides a user with voice and/or other service data connectivity, a handheld device with a wireless connection function, or another processing device connected to a wireless modem. The wireless terminal may communicate with one or more core networks through a radio access network (Radio Access Network, RAN for short). The wireless terminal may be a mobile terminal such as a mobile phone (also referred to as a "cellular" phone) or a computer with a mobile terminal, for example, may be a portable, pocket-sized, handheld, computer built-in, or vehicle-mounted mobile apparatus, which exchanges voice and/or data with the radio access network. For example, it may be a device such as a personal communication service (Personal Communication Service, PCS for short) phone, a cordless telephone set, a Session Initiation Protocol (Session Initiation Protocol, SIP for short) phone, a wireless local loop (Wireless Local Loop, WLL for short) station, or a personal digital assistant (Personal Digital Assistant, PDA for short). The wireless terminal may alternatively be referred to as a system, a subscriber unit (Subscriber Unit), a subscriber station (Subscriber Station), a mobile station (Mobile Station), a mobile station (Mobile), a remote station (Remote Station), a remote terminal (Remote Terminal), an access terminal (Access Terminal), a user terminal (User Terminal), a user agent (User Agent), or a user device (User Device or User Equipment). This is not limited herein.

<FIG> is a schematic diagram of NB-IoT UP air interface security protection according to an embodiment of this application. <FIG> is a schematic diagram of NB-IoT key hierarchy according to an embodiment of this application. As shown in <FIG>, in an NB-IoT security mechanism, the following security protection for the air interface in a UP mode is provided: Encryption and integrity protection are performed on an NAS; encryption and integrity protection are performed on a control plane of an AS, and encryption is performed on a user plane of the AS. The encryption and the integrity protection on the AS are implemented in PDCP through RRC negotiation and key generation.

Generally, a key is generated based on a KDF algorithm. The KDF algorithm is short for an HmacSha256 algorithm, is a hash-based message authentication algorithm, and can be considered as a combination of an HMAC algorithm and an SHA256 algorithm. An input of the KDF algorithm is two strings that each have fewer than <NUM>^<NUM> bits, and an output is a string of <NUM> bits. <FIG> specifically shows the key hierarchy below.

K: A K is stored in a universal subscriber identity module (Universal Subscriber Identity Module, USIM) card of UE, and is also stored in an authentication center AuC.

CK and IK: A CK and an IK are generated by the UE and the AuC in a key agreement AKA process.

KASME: A KASME is generated by the CK and the IK in the AKA process.

KNASenc and KNASint: A KNASenc and a KNASint are keys used for encryption and integrity check on an NAS, and are generated by the K-ASME.

KeNB or NH: A KeNB or an NH can be used to generate three keys for final encryption and integrity check.

KUPenc: A KUPenc is used for encryption on a user plane of an AS.

KRRCint: A KRRCint is used for integrity check on a control plane of the AS.

KRRCenc: A KRRCenc is used for encryption on the control plane of the AS.

In a current key update solution, the UE releases a connection, and waits until the UE is paged or there is data to be uploaded, to negotiate a new key in a random access process. In a key update process, the UE is disconnected for a relatively long time, and because a key needs to be updated, problems such as a waste of a large quantity of radio resources on a network side for paging the UE may be caused. This application provides a new key update method, to shorten a disconnection time of the UE, and save network resources.

The following uses an example in which a network device is an eNB to describe the key update method by using some specific embodiments.

<FIG> is an interaction flowchart of Embodiment <NUM> of a key update method according to an embodiment of this application. As shown in <FIG>, the key update method includes the following steps.

S101: An eNB sends an RRC connection release message (carrying an indication used to indicate that a key is to be updated) to UE.

In this step, after the eNB determines that the key needs to be updated, the UE needs to disconnect an RRC connection to perform security reconfiguration to update the key. Therefore, the eNB may send, to the UE, a message indicating connection release, where the message may be an RRC connection release message, or may be another message. In addition to indicating the UE to release the RRC connection, the RRC connection release message further carries an indication used to indicate that a cause for releasing the RRC connection is that the key is to be updated.

In a specific implementation, the message may carry a release cause information element, and a value of the release cause information element indicates that the release cause is that the key is to be updated. For example, an enumerated value keyChange is newly added to a release cause (release cause) in the RRC connection release (namely, RRCConnectionRelease) message.

Optionally, the RRC connection release message may further indicate whether there is downlink data in the eNB; to be specific, may further include indication information used to indicate whether there is the downlink data. This is not limited in this solution.

S102: The UE releases the RRC connection based on the RRC connection release message, and initiates random access after the release is completed.

In this step, after receiving the message, the UE releases the RRC connection based on the RRC connection release message. In addition, the UE determines, based on the indication carried in the RRC connection release message, that the cause of the current release is to update the key. Therefore, the UE may directly initiate the random access without needing to wait for paging of the eNB or wait until there is uplink data that needs to be transmitted.

That is, in a specific implementation of the solution, when receiving a release cause indication key Change that is in the RRCConnectionRelease message, the user equipment needs to perform an operation when leaving RRC_CONNECTED, and the release cause is "key change". After releasing the connection, the user equipment re-initiates an RRC connection, accesses a network, and re-negotiates a new AS key with the network. A specific negotiation process is described in the following steps.

The UE sends a random access preamble.

S104: The eNB returns a random access response (Random Access Response, RAR) to the UE.

S105: The UE sends an RRC connection request to the eNB.

S106: The eNB returns an RRC connection setup message to the UE.

S107: The UE sends an RRC connection setup complete message to the eNB.

In the foregoing steps, the UE sends the random access preamble to initiate the random access. After detecting that there is a sent preamble, the eNB sends the random access response RAR in a downlink, where the RAR may carry timing information, a resource configuration, and the like. After receiving the random access response, the UE sends an uplink message, in other words, sends the RRC connection request, on an allocated uplink resource based on an indication of the random access response. The eNB receives the RRC connection request of the UE, and returns a conflict resolution message, in other words, returns the RRC connection setup complete message, to UE that successfully accesses the eNB.

Optionally, in a specific implementation of this solution, when initiating an access process, the UE may further simultaneously indicate, to the eNB, that a cause for the access is that the key is to be updated.

S108: The eNB sends an RRC security configuration message to the UE.

In this step, the base station eNB sends a new security configuration (including information such as a derivation parameter of the key) to the UE, that is, delivers, to the UE, a second message used to configure the key, where the second message may be the RRC security configuration message. In a specific implementation of this solution, the second message includes the new security configuration.

The derivation parameter of the key in this solution is a parameter used to calculate a new key, for example, a parameter such as a next hop chaining count.

S109: The UE sends an RRC security configuration complete message to the eNB.

In this step, the UE may obtain an RRC encryption key and a data encryption key based on the new security configuration in the received security configuration, may further obtain an RRC integrity protection key, and may send, to the eNB, a message indicating that RRC security configuration is completed.

S110: The eNB sends an RRC connection reconfiguration message to the UE.

S111: The UE sends an RRC connection reconfiguration complete message to the eNB.

In the foregoing steps, connection reconfiguration between the base station and the UE is completed in the foregoing process, and a key update process is also completed.

In a specific implementation of this solution, it should be understood that, in the foregoing embodiment, the new key is negotiated after connection setup is completed; in other words, security configuration is performed after the connection setup is completed. Considering a case of early data transmission, in this solution, a security configuration process performed in the access process is also supported. In other words, the UE releases the RRC connection based on the RRC connection release message, initiates the access to the network device after completing the release, and obtains the new key through negotiation in the access process or after establishing the connection to the eNB. This is not limited in this solution.

This embodiment provides the key update method. After determining that the key needs to be updated, the eNB sends the RRC connection release message to the user equipment, where the message carries the indication used to indicate that the key is to be updated. After receiving the message, the user equipment releases the RRC connection, and may determine that the release cause is that the key needs to be updated. In this case, the user equipment actively initiates the access process, obtains the new security configuration to complete updating the key, and does not need to wait for data to be uploaded or paging of the eNB to perform access, thereby effectively shortening a disconnection time of the user equipment. In addition, the network device does not need to page the user equipment, thereby saving radio resources on a network side.

Based on the embodiment shown in <FIG>, in addition to a case in which the RRC connection release message sent by the eNB to the UE carries a first indication indicating that the key is to be updated, in another implementation, the RRC connection release message sent by the eNB to the UE does not carry the first indication indicating that the key is to be updated, and instead directly carries a security configuration, where the security configuration includes some parameters, such as an NCC value and a security algorithm, for calculating a new key. The security algorithm may include an integrity protection algorithm and an encryption algorithm. After receiving the RRC connection release message, the UE releases an RRC connection based on the message, and then obtains the new key based on the security configuration. After obtaining the key, the UE may directly initiate access, or may initiate an access process when there is data to be uploaded, where the random access process is similar to that in the prior art, or the eNB pages the UE when the eNB has downlink data to be transmitted, to establish a connection to the UE. After the connection establishment is completed, the UE performs integrity protection and/or encryption based on the new key, and then performs data transmission.

Similarly, the RRC connection release message may also include indication information used to indicate whether there is the downlink data. In a process in which the UE obtains the new key and establishes the connection to the eNB, the UE may indicate, to the eNB, that a connection cause is that the key is to be updated.

In this solution, security protection is also performed, based on the new key, on a connection message sent by the UE.

When an RRCConnectionReconfiguration message received by the UE includes an IE Security config, the UE needs to perform the following operations to obtain the new key based on the security configuration in a specific implementation.

Media access control (Media Access Control, MAC) is reset.

The packet data convergence protocol (Packet Data Convergence Protocol, PDCP) is reestablished for all resource blocks (resource block, RB).

The radio link control (Radio Link Control, RLC) protocol for all RBs is reestablished.

For example, a KeNB key is updated based on a KASME key associated with a current KeNB based on a nextHopChainingCount value indicated in an RRCConnectionReestablishment message specified in the latest version of TS <NUM>.

The nextHopChainingCount value is stored.

For example, a KRRCint key, namely, an RRC integrity protection key, related to a previously configured integrity algorithm is derived according to specifications in the latest version of TS <NUM>.

For example, a KRRCenc key and a KUPenc key, namely, an RRC encryption key and a data encryption key, related to a previously configured encryption algorithm are derived according to specifications in the latest version of TS <NUM>.

In this solution, a key hierarchy and a key calculation manner are implemented according to the solution shown in <FIG>, and reference may be made to the description corresponding to <FIG>.

In the foregoing solution, an example in which the eNB is the network device is used. In an actual application process, another network device may be the network device. The key update method provided in this application is described. With reference to the technical solutions in the foregoing two embodiments, it may be learned that there are at least two cases in which the UE obtains the new key based on the message indicating to release the RRC connection.

In the first case, the UE performs the following solution to obtain the new key:
receiving a first message from the network device, where the first message is used for releasing the RRC connection, the first message includes the first indication, and the first indication is used to indicate that the key is to be updated; releasing the RRC connection; and initiating the access to the network device in response to the first indication to obtain the new security configuration, where the security configuration is used for obtaining the new key.

In another specific implementation, the initiating the random access to the network device to obtain the new security configuration includes:.

Optionally, the first message further includes the indication information used to indicate whether there is the downlink data.

Further, the UE may further indicate, to the network device when initiating the access to the network device, that an access cause is that the key is to be updated.

Optionally, the first message is the RRC connection release message.

Corresponding to the foregoing execution process of the UE, the network device in this case performs the following solution:
sending a first message to the UE, where the first message is used for releasing the radio resource control RRC connection, the first message includes the first indication, and the first indication is used to indicate that the key is to be updated; and accepting the access initiated by the UE in response to the first indication, to send the security configuration to the UE, where the security configuration is used for obtaining the new key.

In a specific implementation, the accepting the access initiated by the UE in response to the first indication, to send the security configuration to the UE includes:.

Further, the network device may further receive an access cause of the access, where the access cause is that the key is to be updated.

In the second case, the UE performs the following solution to obtain the new key:
receiving, by the UE, a first message from the network device, where the first message is used for releasing the RRC connection, and the first message includes the security configuration; releasing the RRC connection; and obtaining the new key based on the security configuration.

In a specific implementation of this solution, the security configuration includes the NCC value and the security algorithm.

Optionally, the obtaining the new key based on the security configuration includes:.

Further, the UE may further generate, based on the eNB key KeNB* and/or the security algorithm, the RRC encryption key and the data encryption key that are related to the encryption algorithm.

Optionally, the UE further sends a connection message to the network device based on the new key.

Further, the UE may further indicate, to the network device in a connection process, that the connection cause is that the key is to be updated.

Corresponding to the foregoing execution process of the UE, the network device in this case performs the following solution:.

In a specific implementation, the security configuration includes the next hop chaining count NCC value and/or the security algorithm.

Further, the network device may further receive an indication that the UE indicates, to the network device in a connection process, that an access cause is that the key is to be updated.

<FIG> is an interaction flowchart of Embodiment <NUM> of a key update method according to an embodiment of this application. As shown in <FIG>, in another implementation, UE can obtain a new key without needing to release an RRC connection. Similarly, using an eNB as an example, the key update method includes the following steps.

S201: An eNB sends an RRC connection reconfiguration message (including a security configuration) to the UE.

In this process, the UE and the eNB are in a connected state. When determining that a key needs to be updated, the eNB may update the key in a connection reconfiguration process. To be specific, the eNB sends the RRC connection reconfiguration message to the UE, where the RRC connection reconfiguration message carries the security configuration, to indicate the UE to update the key. That is, an IE Security config is newly added to an RRCConnectionReconfiguration message sent by the eNB to the UE.

In a specific implementation of the solution, a specific definition of the IE Security config is as follows:
<IMG>.

In a specific implementation of the foregoing solution, the security configuration includes at least a next hop chaining count (nextHopChainingCount, NCC) value and a security algorithm, so that the UE can obtain the new key through calculation based on the parameters.

S202: The UE re-obtains the new key based on the security configuration.

In this step, after receiving the RRC connection reconfiguration message including the security configuration, the UE needs to calculate an RRC integrity protection key and an encryption key based on the parameter and the security algorithm in the security configuration.

In a specific implementation, when the RRCConnectionReconfiguration message received by the UE includes the IE Security config, the UE needs to perform the following operations to obtain the new key based on the security configuration in a specific implementation.

A KeNB key is updated based on a KASME key associated with a current KeNB based on a nextHopChainingCount value indicated in an RRCConnectionReestablishment message specified in TS <NUM>.

A KRRCint key, namely, the RRC integrity protection key, related to a previously configured integrity algorithm is derived according to specifications in TS <NUM>.

A KRRCenc key and a KUPenc key, namely, an RRC encryption key and a data encryption key, related to a previously configured encryption algorithm are derived according to specifications in TS <NUM>.

S203: The UE returns an RRC connection reconfiguration complete message to the eNB.

In this step, after obtaining the new key based on the security configuration, the UE returns the RRC connection reconfiguration complete message to the eNB, to notify the eNB that the new key has been obtained, and that security configuration is completed.

In a specific implementation of this solution, after the UE completes the foregoing process, when there is uplink data that needs to be transmitted, the UE may perform integrity protection and encryption based on the new key, to perform data transmission.

According to the key update method provided in this embodiment, the eNB sends, to the UE, the RRC connection reconfiguration message carrying the new security configuration. The UE does not need to release the RRC connection, and directly obtains the new key based on the new security configuration to complete a key update process. The base station does not need to release the UE, so that the UE does not need to perform access again, and the base station does not need to page the UE when there is data to be delivered, thereby effectively shortening a key update time and saving network resources.

In the foregoing solution, an example in which the eNB is the network device is used. In an actual application process, another network device may be the network device. The key update method provided in this application is described. With reference to the technical solution in the foregoing embodiment, it may be learned that in a manner in which the UE is enabled to obtain the new key based on a message indicating the security configuration, the UE needs to perform the following solution:
receiving, by the UE, a first message that is sent by the network device and that is used in a non-handover condition, where the first message is used for RRC connection reconfiguration, and the first message includes the security configuration; obtaining the new key based on the security configuration; and sending a second message to the network device based on the new key, where the second message is used to indicate that the connection reconfiguration is completed.

In a specific implementation of this solution, the security configuration includes the NCC value and/or the security algorithm.

In another specific implementation of the solution, the obtaining the new key based on the security configuration includes:.

During implementation of the foregoing solution, if the first message is the RRC connection reconfiguration message, the second message is the RRC connection reconfiguration complete message.

Corresponding to the foregoing execution process of the UE, the network device in this case performs the following solution:
sending, by the network device, a first message used in a non-handover condition to the UE, where the first message is used for RRC connection reconfiguration, the first message includes the security configuration, and the security configuration is used for obtaining the new key; and receiving a second message returned by the UE based on the new key, where the second message is used to indicate that the connection reconfiguration is completed.

Optionally, the security configuration includes the NCC value and the security algorithm.

Optionally, the first message is the RRC connection reconfiguration message, and the second message is the RRC connection reconfiguration complete message.

Compared with the foregoing embodiments, in the prior art, when a key of a base station is updated, a current system can only release UE first. When downlink data arrives, the UE is paged for access, or when uplink data arrives, the UE actively initiates access. The key is updated by configuring a new key in an access process. There is a problem that the UE is disconnected for a relatively long time, or if there is downlink data to be sent, because the key needs to be updated, a large quantity of radio resources on a network side may be wasted for paging the UE. In the key update solution provided in this application, after releasing the UE, the network device indicates a release cause in an RRC connection release message, so that the UE initiates the access in a timely manner after releasing the connection. Alternatively, the network device enables an RRC connection release message to directly carry the security configuration, so that the UE can directly obtain the new key through calculation. Alternatively, the network device enables the RRC connection reconfiguration message to directly carry the security configuration, so that the UE can directly obtain the new key through calculation. Therefore, a key update time and a time of the UE in a disconnected state are effectively shortened. In addition, the network device does not need to page the UE, thereby saving the network resources.

<FIG> is a schematic structural diagram of Embodiment <NUM> of user equipment according to an embodiment of this application. As shown in <FIG>, user equipment <NUM> provided in this embodiment includes:.

In a specific implementation of the user equipment, the user equipment may further include a memory <NUM>, configured to store a computer program or other data. This is not limited in this solution.

The user equipment provided in this embodiment is configured to perform the technical solution on a user equipment side according to any one of the foregoing method embodiments, and implementation principles and technical effects of the embodiments are similar.

Optionally, the transmitter <NUM> is specifically configured to initiate the access to the network device to establish an RRC connection to the network device;
the receiver <NUM> is further configured to receive a second message from the network device, where the second message is used to configure a key, and the second message includes the new security configuration and/or a security algorithm parameter.

Optionally, the transmitter <NUM> is further configured to indicate, to the network device when initiating the access to the network device, that an access cause is that the key is to be updated.

The user equipment provided in any one of the foregoing implementations is configured to perform the technical solution on the user equipment side according to any one of the foregoing method embodiments, and implementation principles and technical effects of the embodiments are similar.

In another implementation of the user equipment <NUM> shown in <FIG>, the user equipment <NUM> includes:.

The user equipment <NUM> may further include a memory <NUM> configured to store a computer program.

Optionally, the processor <NUM> is further configured to:
generate, based on the eNB key KeNB* and/or the security algorithm, an RRC encryption key and a data encryption key that are related to an encryption algorithm.

Optionally, the user equipment further includes:
a transmitter <NUM>, configured to send a connection message to the network device based on the new key.

The user equipment provided in any one of the foregoing implementations is configured to perform the technical solution on a user equipment side according to any one of the foregoing method embodiments, and implementation principles and technical effects of the embodiments are similar.

It should be understood that the user equipment in this solution may be a mobile phone, a tablet computer, a smart car, a sensing device, an IoT device, CPE, a relay base station, or the like, for example, <NUM> UE (UE supporting a next-generation mobile communications standard), or another <NUM> terminal device. In addition to the foregoing structure, the user equipment may further include one or more transceivers to implement functions of the foregoing receiver and transmitter, one or more antennas, one or more processors, and one or more memories. The memories may be integrated into the processors. This is not limited in this solution.

<FIG> is a schematic structural diagram of a network device. As shown in <FIG>, a network device <NUM> includes:.

In a specific implementation of the network device <NUM>, the network device <NUM> may further include a processor <NUM> and a memory <NUM> that stores a computer program and data. This is not limited in this disclosure.

Optionally, the receiver <NUM> is specifically configured to: receive information that is of the UE and that is used for the access, and establish an RRC connection to the UE;
the transmitter <NUM> sends a second message to the UE, where the second message includes the security configuration.

Optionally, the receiver <NUM> is further configured to receive an access cause of the access, where the access cause is that the key is to be updated.

The network device provided in any one of the foregoing implementations is configured to perform the technical solution on a network device side according to any one of the foregoing method embodiments, and implementation principles and technical effects of the embodiments are similar.

In a specific implementation of the network device <NUM> shown in <FIG>, the network device <NUM> includes:.

Optionally, the receiver <NUM> is further configured to receive an indication that the UE indicates, to the network device in a connection process, that an access cause is that the key is to be updated.

Optionally, in a specific implementation of the network device <NUM> shown in <FIG>, the network device <NUM> includes:.

Similarly, in addition to some network devices described above, the network device in this solution may alternatively be a <NUM> gNB (a base station in a next-generation mobile communications network), a transmission reception point (TRP), or another network device (such as a micro base station) in a <NUM> access network. The network device further includes one or more transceivers implementing functions of the receiver and the transmitter, one or more antennas, one or more processors, and one or more memories. The memories may be integrated into the processors for implementation. Further, the network device may further include one or more other interfaces (such as an optical fiber link interface, an Ethernet interface, and/or a copper wire interface). This is not limited in this solution.

Optionally, the sending module <NUM> is specifically configured to initiate the access to the network device to establish an RRC connection to the network device;
the receiving module <NUM> is further configured to receive a second message from the network device, where the second message includes the security configuration.

Optionally, the sending module <NUM> is further configured to indicate, to the network device when initiating access to the network device, that an access cause is that the key is to be updated.

In another specific implementation of the user equipment <NUM>,.

Optionally, the processing module <NUM> is specifically configured to:.

Optionally, the processing module <NUM> is further configured to:
generate, based on the eNB key KeNB* and/or the security algorithm, an RRC encryption key and a data encryption key that are related to an encryption algorithm.

Optionally, the user equipment further includes:
a sending module <NUM>, configured to send a connection message to the network device based on the new key.

Optionally, the sending module <NUM> is further configured to indicate, to the network device in a connection process, that a connection cause is that a key is to be updated.

<FIG> is a schematic structural diagram of a network device. As shown in <FIG>, the network device <NUM> includes:.

Optionally, the receiving module <NUM> specifically configured to: receive information that is of the UE and that is used for the access, and establish an RRC connection to the UE;
the sending module <NUM> is further configured to send a second message to the UE, where the second message includes the security configuration.

Optionally, the receiving module <NUM> is further configured to receive an access cause of the access, where the access cause is that the key is to be updated. Optionally, the first message is an RRC connection release message.

In another specific implementation of the network device <NUM>,.

Optionally, the receiving module <NUM> is further configured to receive an indication that the UE indicates, to the network device in a connection process, that an access cause is that a key is to be updated.

This application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, and the computer instruction enables user equipment to perform the key update method provided in any one of the foregoing implementations.

This application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer instruction, and the computer instruction enables a network device to perform the key update method provided in any one of the foregoing implementations.

This application further provides a computer program product, where the computer program product includes computer program code, and when the computer program code is run by user equipment, the user equipment is enabled to perform the key update method provided in any one of the foregoing implementations.

This application further provides a computer program product, where the computer program product includes computer program code, and when the computer program code is run by a network device, the network device is enabled to perform the key update method provided in any one of the foregoing implementations.

In a specific implementation of the user equipment or the network device, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, CPU for short), or may be another general purpose processor, a digital signal processor (English: Digital Signal Processor, DSP for short), an application-specific integrated circuit (English: Application Specific Integrated Circuit, ASIC for short), or the like. The general purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the method disclosed with reference to the embodiments of this application may be directly performed and completed by a hardware processor, or may be performed and completed by a combination of hardware and software modules in the processor.

Claim 1:
A key update method, carried out by a user equipment, UE, wherein the method comprises
receiving (S101) a first message from a network device, wherein the first message is used, by the UE, for releasing a radio resource control RRC connection, the first message comprises a first indication, and the first indication indicates that a key is to be updated;
releasing (S102) the RRC connection; and
in response to the first indication, initiating (S103) access to the network device, to obtain, by the UE, a security configuration, wherein the security configuration is used for obtaining, by the UE, a new key through calculation based on security configuration.