Communication method, apparatus, and system
Embodiments of the present disclosure provide a communication method and an apparatus to resolve a PC5 unicast establishment failure due to inconsistency between security parameters of terminal devices in a V2X scenario with security negotiation introduced into a PC5 unicast establishment procedure. The communication method includes: A first direct communication discovery name management function network element obtains a security parameter of a first terminal device. The security parameter of the first terminal device is required for establishing a PC5 connection between the first terminal device and a second terminal device. The first direct communication discovery name management function network element receives a security parameter of the second terminal device from a second direct communication discovery name management function network element and determines, based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication.
1 . A communication method, comprising:
obtaining, by a first direct communication discovery name management function network element, a security parameter of a first terminal device;
receiving, by the first direct communication discovery name management function network element, a security parameter of a second terminal device from a second direct communication discovery name management function network element;
and
determining, by the first direct communication discovery name management function network element based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication,
wherein the security parameter of the first terminal device is required for establishing a PC5 connection between the first terminal device and the second terminal device, and the security parameter of the second terminal device comprises one or more protection algorithms supported by the second terminal device in the PC5 connection.
2 . The method according to claim 1 , wherein the determining, by the first direct communication discovery name management function network element based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication comprises:
when the security parameter of the first terminal device does not match the security parameter of the second terminal device, determining, by the first direct communication discovery name management function network element, that the first terminal device and the second terminal device do not support mutual communication.
3 . The method according to claim 2 , further comprising:
sending, by the first direct communication discovery name management function network element, indication information indicating that the first terminal device and the second terminal device do not support mutual communication.
4 . The method according to claim 1 , wherein the determining, by the first direct communication discovery name management function network element based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication comprises:
when the security parameter of the first terminal device matches the security parameter of the second terminal device, determining, by the first direct communication discovery name management function network element, that the first terminal device and the second terminal device support mutual communication.
5 . The method according to claim 4 , further comprising:
sending, by the first direct communication discovery name management function network element, indication information indicating that the first terminal device and the second terminal device support mutual communication.
6 . The method according to claim 4 , further comprising:
sending, by the first direct communication discovery name management function network element, a discovery response to the first terminal device, wherein the discovery response comprises a discovery parameter for service discovery.
7 . The method according to claim 1 , further comprising:
sending, by the first direct communication discovery name management function network element, the security parameter of the first terminal device to the first terminal device.
8 . The method according to claim 1 , wherein the security parameter of the first terminal device includes a protection algorithm for establishing the PC5 connection, and the method further comprises:
determining whether the security parameter of the first terminal device matches the security parameter of the second terminal device by determining whether the one or more protection algorithms supported by the second terminal device include the protection algorithm for establishing the PC5 connection.
9 . A first direct communication discovery name management function network element, comprising a processor coupled to a memory storing instructions and configured to execute the instructions to cause the first direct communication discovery name management function network element to:
obtain a security parameter of a first terminal device;
receive a security parameter of a second terminal device from a second direct communication discovery name management function network element;
and
determine, based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication,
wherein the security parameter of the first terminal device is required for establishing a PC5 connection between the first terminal device and the second terminal device, and the security parameter of the second terminal device comprises one or more protection algorithms supported by the second terminal device in the PC5 connection.
10 . The first direct communication discovery name management function network element according to claim 9 , wherein the instructions cause the first direct communication discovery name management function network element to determine whether the first terminal device and the second terminal device support mutual communication by:
determining, by the first direct communication discovery name management function network element when the security parameter of the first terminal device does not match the security parameter of the second terminal device, that the first terminal device and the second terminal device do not support mutual communication.
11 . The first direct communication discovery name management function network element according to claim 10 , wherein the instructions further cause the first direct communication discovery name management function network element to send indication information indicating that the first terminal device and the second terminal device do not support mutual communication.
12 . The first direct communication discovery name management function network element according to claim 9 , wherein the instructions cause the first direct communication discovery name management function network element to determine whether the first terminal device and the second terminal device support mutual communication by:
determining, by the first direct communication discovery name management function network element when the security parameter of the first terminal device matches the security parameter of the second terminal device, that the first terminal device and the second terminal device support mutual communication.
13 . The first direct communication discovery name management function network element according to claim 12 , wherein the instructions further cause the first direct communication discovery name management function network element to send indication information indicating that the first terminal device and the second terminal device support mutual communication.
14 . The first direct communication discovery name management function network element according to claim 12 , wherein the instructions further cause the first direct communication discovery name management function network element to send a discovery response to the first terminal device, wherein the discovery response comprises a discovery parameter for service discovery.
15 . The first direct communication discovery name management function network element according to claim 9 , wherein the instructions further cause the first direct communication discovery name management function network element to send the security parameter of the first terminal device to the first terminal device.
16 . The first direct communication discovery name management function network element according to claim 9 , wherein the security parameter of the first terminal device includes a protection algorithm for establishing the PC5 connection, and the instructions further cause the first direct communication discovery name management function network element to determine whether the security parameter of the first terminal device matches the security parameter of the second terminal device by determining whether the one or more protection algorithms supported by the second terminal device includes the protection algorithm for establishing the PC5 connection.
17 . A non-transitory computer-readable storage medium storing instructions that, when run on an apparatus, cause the apparatus to:
obtain a security parameter of a first terminal device;
receive a security parameter of a second terminal device from a second direct communication discovery name management function network element; and
determine, based on whether the security parameter of the first terminal device matches the security parameter of the second terminal device, whether the first terminal device and the second terminal device support mutual communication,
wherein the security parameter of the first terminal device is required for establishing a PC5 connection between the first terminal device and the second terminal device, and the security parameter of the second terminal device comprises one or more protection algorithms supported by the second terminal device in the PC5 connection.
18 . The non-transitory computer-readable storage medium according to claim 17 , wherein the determining whether the first terminal device and the second terminal device support mutual communication comprises:
determining that the first terminal device and the second terminal device support mutual communication when the security parameter of the first terminal device matches the security parameter of the second terminal device.
19 . The non-transitory computer-readable storage medium according to claim 18 , wherein the instructions, when run on an apparatus, further cause the apparatus to send a discovery response to the first terminal device, wherein the discovery response comprises a discovery parameter for service discovery.
20 . The non-transitory computer-readable storage medium according to claim 18 , wherein the security parameter of the first terminal device includes a protection algorithm for establishing the PC5 connection, and the instructions, when run on an apparatus, further cause the apparatus to determine whether the security parameter of the first terminal device matches the security parameter of the second terminal device by determining whether the one or more protection algorithms supported by the second terminal device includes the protection algorithm for establishing the PC5 connection.